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.
EvtSVP.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 
21 #include "EvtGenModels/EvtSVP.hh"
22 
24 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtPatches.hh"
30 
31 #include <cmath>
32 
33 std::string EvtSVP::getName()
34 {
35  return "SVP";
36 }
37 
39 {
40  return new EvtSVP;
41 }
42 
44 {
46  // Photon is the first particle and psi is the second
47  // to ensure decay file backwards compatibility
48  EvtParticle* photon = root->getDaug( 0 );
49  EvtParticle* psi = root->getDaug( 1 );
50 
51  EvtVector4R p = psi->getP4(), // psi momentum
52  k = photon->getP4(); // Photon momentum
53 
54  bool validAmp( true );
55 
56  double kp = k * p;
57  if ( fabs( kp ) < 1e-10 ) {
58  validAmp = false;
59  }
60 
61  for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
62  EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
63  for ( int iGamma = 0; iGamma < 2; iGamma++ ) {
64  EvtVector4C epsGamma = photon->epsParentPhoton( iGamma ).conj();
65  EvtComplex amp( 0.0, 0.0 );
66  if ( validAmp ) {
67  amp = ( epsPsi * epsGamma ) -
68  ( epsPsi * k ) * ( epsGamma * p ) / kp;
69  }
70  vertex( iGamma, iPsi, amp );
71  }
72  }
73 }
74 
76 {
78  EvtParticle* psi = root->getDaug( 0 );
79  EvtParticle* mup = root->getDaug( 1 );
80  EvtParticle* mum = root->getDaug( 2 );
81 
82  EvtVector4R p = psi->getP4(), // psi momentum
83  k1 = mup->getP4(), // mu+ momentum
84  k2 = mum->getP4(), // mu- momentum
85  k = k1 + k2; // photon momentum
86 
87  double kSq = k * k;
88 
89  // The decay amplitude needs four-vector products. Make sure we have
90  // valid values for these, otherwise set the amplitude to zero.
91  // We need to set _amp2 (EvtDecayAmp) via the vertex() function call
92  // even when the amplitude is zero, otherwise the amplitude from the
93  // previous accepted event will be used, potentially leading to biases
94 
95  // Selection on k^2 to avoid inefficient generation for the electron modes
96  bool validAmp( true );
97  if ( kSq < 1e-3 ) {
98  validAmp = false;
99  }
100 
101  // Extra checks to make sure we are not dividing by zero
102  double kp = k * p;
103  if ( fabs( kp ) < 1e-10 ) {
104  validAmp = false;
105  }
106 
107  double dSq = delta * delta;
108  double dSqDenom = dSq - kSq;
109  if ( fabs( dSqDenom ) < 1e-10 ) {
110  validAmp = false;
111  }
112 
113  double factor( 1.0 );
114  if ( validAmp ) {
115  factor = dSq / ( dSqDenom * kSq );
116  }
117 
118  // Calculate the amplitude terms, looping over the psi and lepton states
119  for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
120  EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
121 
122  for ( int iMplus = 0; iMplus < 2; iMplus++ ) {
123  EvtDiracSpinor spMplus = mup->spParent( iMplus );
124 
125  for ( int iMminus = 0; iMminus < 2; iMminus++ ) {
126  EvtDiracSpinor spMminus = mum->spParent( iMminus );
127  EvtVector4C epsGamma = EvtLeptonVCurrent( spMplus, spMminus );
128  EvtComplex amp( 0.0, 0.0 );
129  if ( validAmp ) {
130  amp = ( epsPsi * epsGamma ) -
131  ( epsPsi * k ) * ( epsGamma * p ) / kp;
132  }
133  amp *= factor;
134 
135  // Set the amplitude matrix element using the vertex function
136  vertex( iPsi, iMplus, iMminus, amp );
137  }
138  }
139  }
140 }
141 
143 {
144  if ( getNDaug() == 2 ) {
145  decay_2body( root );
146  } else if ( getNDaug() == 3 ) {
147  decay_3body( root );
148  }
149 }
150 
152 {
154 
155  if ( getNDaug() == 2 ) { // chi -> gamma psi radiative mode
156  checkNArg( 0 );
157  checkNDaug( 2 );
160 
161  } else if ( getNDaug() == 3 ) { // chi -> psi lepton lepton
166  checkNArg( 1 );
167  delta = getArg( 0 );
168  }
169 }
170 
172 {
173  if ( getNDaug() == 2 ) {
174  setProbMax( 2.2 );
175 
176  } else if ( getNDaug() == 3 ) {
177  const EvtId daugId = getDaug( 1 );
178 
179  if ( daugId == EvtPDL::getId( "mu+" ) ||
180  daugId == EvtPDL::getId( "mu-" ) ) {
181  setProbMax( 130.0 );
182  } else if ( daugId == EvtPDL::getId( "e+" ) ||
183  daugId == EvtPDL::getId( "e-" ) ) {
184  setProbMax( 4100.0 );
185  }
186  }
187 }
void initProbMax() override
Definition: EvtSVP.cpp:171
EvtDecayBase * clone() override
Definition: EvtSVP.cpp:38
double getArg(unsigned int j)
void decay_2body(EvtParticle *p)
Definition: EvtSVP.cpp:43
virtual EvtVector4C epsParentPhoton(int i)
virtual EvtDiracSpinor spParent(int) const
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
Definition: EvtSVP.hh:35
void setProbMax(double prbmx)
double delta
Definition: EvtSVP.hh:48
Definition: EvtId.hh:27
void decay_3body(EvtParticle *p)
Definition: EvtSVP.cpp:75
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 checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void init() override
Definition: EvtSVP.cpp:151
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
int getNDaug() const
Definition: EvtDecayBase.hh:65
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtVector4C EvtLeptonVCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtVector4C conj() const
Definition: EvtVector4C.hh:202
void decay(EvtParticle *p) override
Definition: EvtSVP.cpp:142
std::string getName() override
Definition: EvtSVP.cpp:33
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67