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