evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtVVPIPI_WEIGHTED.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtGenKine.hh"
24 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtReport.hh"
30 
31 #include <stdlib.h>
32 #include <string>
33 using std::endl;
34 
36 {
37  return "VVPIPI_WEIGHTED";
38 }
39 
41 {
42  return new EvtVVPIPI_WEIGHTED;
43 }
44 
46 {
47  static EvtId PIP = EvtPDL::getId( "pi+" );
48  static EvtId PIM = EvtPDL::getId( "pi-" );
49  static EvtId PI0 = EvtPDL::getId( "pi0" );
50 
51  // check that there are 0 arguments
52  checkNArg( 0 );
53  checkNDaug( 3 );
54 
57 
58  if ( ( !( getDaug( 1 ) == PIP && getDaug( 2 ) == PIM ) ) &&
59  ( !( getDaug( 1 ) == PI0 && getDaug( 2 ) == PI0 ) ) ) {
60  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
61  << "EvtVVPIPI_WEIGHTED generator expected "
62  << " pi+ and pi- (or pi0 and pi0) "
63  << "as 2nd and 3rd daughter. " << endl;
64  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
65  << "Will terminate execution!" << endl;
66  ::abort();
67  }
68 }
69 
71 {
72  //Hard coded... should not be hard to calculate...
73  setProbMax( 0.08 * 1.13 );
74 }
75 
76 double reweight_event( double pipi_mass )
77 {
78  pipi_mass *= 1000.0;
79  return sqrt( -3.6911336508223251 + 0.019119831948029617 * pipi_mass +
80  -1.8962883732377376e-05 * pipi_mass * pipi_mass );
81 }
82 
84 {
85  psi_prime->initializePhaseSpace( getNDaug(), getDaugs() );
86 
87  EvtParticle *jpsi, *pi1, *pi2;
88 
89  jpsi = psi_prime->getDaug( 0 );
90  pi1 = psi_prime->getDaug( 1 );
91  pi2 = psi_prime->getDaug( 2 );
92 
93  // Put phase space results into the daughters.
94 
95  EvtVector4C ep0, ep1, ep2;
96 
97  ep0 = psi_prime->eps( 0 );
98  ep1 = psi_prime->eps( 1 );
99  ep2 = psi_prime->eps( 2 );
100 
101  EvtVector4C e0, e1, e2;
102 
103  e0 = jpsi->epsParent( 0 );
104  e1 = jpsi->epsParent( 1 );
105  e2 = jpsi->epsParent( 2 );
106 
107  double mass2 = ( pi1->getP4() + pi2->getP4() ).mass2();
108 
109  double fac = mass2 - 4 * pi1->mass() * pi2->mass();
110 
111  fac *= reweight_event( sqrt( mass2 ) );
112 
113  vertex( 0, 0, fac * ( ep0 * e0.conj() ) );
114  vertex( 0, 1, fac * ( ep0 * e1.conj() ) );
115  vertex( 0, 2, fac * ( ep0 * e2.conj() ) );
116 
117  vertex( 1, 0, fac * ( ep1 * e0.conj() ) );
118  vertex( 1, 1, fac * ( ep1 * e1.conj() ) );
119  vertex( 1, 2, fac * ( ep1 * e2.conj() ) );
120 
121  vertex( 2, 0, fac * ( ep2 * e0.conj() ) );
122  vertex( 2, 1, fac * ( ep2 * e1.conj() ) );
123  vertex( 2, 2, fac * ( ep2 * e2.conj() ) );
124 
125  return;
126 }
virtual EvtVector4C eps(int i) const
double reweight_event(double pipi_mass)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
void setProbMax(double prbmx)
Definition: EvtId.hh:27
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
virtual EvtVector4C epsParent(int i) const
void decay(EvtParticle *p) override
void checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void initProbMax() override
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double mass() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtVector4C conj() const
Definition: EvtVector4C.hh:202
EvtDecayBase * clone() override
std::string getName() override
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67