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
EvtSemiLeptonicAmp.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/EvtAmp.hh"
26#include "EvtGenBase/EvtId.hh"
27#include "EvtGenBase/EvtPDL.hh"
35
36double EvtSemiLeptonicAmp::CalcMaxProb( EvtId parent, EvtId meson, EvtId lepton,
37 EvtId nudaug,
38 EvtSemiLeptonicFF* FormFactors,
39 int nQ2Bins )
40{
41 //This routine takes the arguements parent, meson, and lepton
42 //number, and a form factor model, and returns a maximum
43 //probability for this semileptonic form factor model. A
44 //brute force method is used. The 2D cos theta lepton and
45 //q2 phase space is probed.
46
47 //Start by declaring a particle at rest.
48
49 //It only makes sense to have a scalar parent. For now.
50 //This should be generalized later.
51
52 EvtScalarParticle* scalar_part;
53 EvtParticle* root_part;
54
55 scalar_part = new EvtScalarParticle;
56
57 //cludge to avoid generating random numbers!
58 scalar_part->noLifeTime();
59
60 EvtVector4R p_init;
61
62 p_init.set( EvtPDL::getMass( parent ), 0.0, 0.0, 0.0 );
63 scalar_part->init( parent, p_init );
64 root_part = (EvtParticle*)scalar_part;
65 root_part->setDiagonalSpinDensity();
66
67 EvtParticle *daughter, *lep, *trino;
68
69 EvtAmp amp;
70
71 EvtId listdaug[3];
72 listdaug[0] = meson;
73 listdaug[1] = lepton;
74 listdaug[2] = nudaug;
75
76 amp.init( parent, 3, listdaug );
77
78 root_part->makeDaughters( 3, listdaug );
79 daughter = root_part->getDaug( 0 );
80 lep = root_part->getDaug( 1 );
81 trino = root_part->getDaug( 2 );
82
83 //cludge to avoid generating random numbers!
84 daughter->noLifeTime();
85 lep->noLifeTime();
86 trino->noLifeTime();
87
88 //Initial particle is unpolarized, well it is a scalar so it is
89 //trivial
91 rho.setDiag( root_part->getSpinStates() );
92
93 double mass[3];
94
95 double m = root_part->mass();
96
97 EvtVector4R p4meson, p4lepton, p4nu, p4w;
98 double q2min;
99 double q2max;
100
101 double q2, elepton, plepton;
102 int i, j;
103 double erho, prho, costl;
104
105 double maxfoundprob = 0.0;
106 double prob = -10.0;
107 int massiter;
108
109 for ( massiter = 0; massiter < 3; massiter++ ) {
110 mass[0] = EvtPDL::getMeanMass( meson );
111 mass[1] = EvtPDL::getMeanMass( lepton );
112 mass[2] = EvtPDL::getMeanMass( nudaug );
113 if ( massiter == 1 ) {
114 mass[0] = EvtPDL::getMinMass( meson );
115 }
116 if ( massiter == 2 ) {
117 mass[0] = EvtPDL::getMaxMass( meson );
118 if ( ( mass[0] + mass[1] + mass[2] ) > m )
119 mass[0] = m - mass[1] - mass[2] - 0.00001;
120 }
121
122 q2min = mass[1] * mass[1];
123 q2max = ( m - mass[0] ) * ( m - mass[0] );
124
125 //loop over q2 (default = 25 bins)
126
127 for ( i = 0; i < nQ2Bins; i++ ) {
128 q2 = q2min + ( ( i + 0.5 ) * ( q2max - q2min ) ) / nQ2Bins;
129
130 erho = ( m * m + mass[0] * mass[0] - q2 ) / ( 2.0 * m );
131
132 prho = sqrt( erho * erho - mass[0] * mass[0] );
133
134 p4meson.set( erho, 0.0, 0.0, -1.0 * prho );
135 p4w.set( m - erho, 0.0, 0.0, prho );
136
137 //This is in the W rest frame
138 elepton = ( q2 + mass[1] * mass[1] ) / ( 2.0 * sqrt( q2 ) );
139 plepton = sqrt( elepton * elepton - mass[1] * mass[1] );
140
141 double probctl[3];
142
143 for ( j = 0; j < 3; j++ ) {
144 costl = 0.99 * ( j - 1.0 );
145
146 //These are in the W rest frame. Need to boost out into
147 //the B frame.
148 p4lepton.set( elepton, 0.0, plepton * sqrt( 1.0 - costl * costl ),
149 plepton * costl );
150 p4nu.set( plepton, 0.0,
151 -1.0 * plepton * sqrt( 1.0 - costl * costl ),
152 -1.0 * plepton * costl );
153
154 EvtVector4R boost( ( m - erho ), 0.0, 0.0, 1.0 * prho );
155 p4lepton = boostTo( p4lepton, boost );
156 p4nu = boostTo( p4nu, boost );
157
158 //Now initialize the daughters...
159
160 daughter->init( meson, p4meson );
161 lep->init( lepton, p4lepton );
162 trino->init( nudaug, p4nu );
163
164 CalcAmp( root_part, amp, FormFactors );
165
166 //Now find the probability at this q2 and cos theta lepton point
167 //and compare to maxfoundprob.
168
169 //Do a little magic to get the probability!!
170 prob = rho.normalizedProb( amp.getSpinDensity() );
171
172 probctl[j] = prob;
173 }
174
175 //probclt contains prob at ctl=-1,0,1.
176 //prob=a+b*ctl+c*ctl^2
177
178 double a = probctl[1];
179 double b = 0.5 * ( probctl[2] - probctl[0] );
180 double c = 0.5 * ( probctl[2] + probctl[0] ) - probctl[1];
181
182 prob = probctl[0];
183 if ( probctl[1] > prob )
184 prob = probctl[1];
185 if ( probctl[2] > prob )
186 prob = probctl[2];
187
188 if ( fabs( c ) > 1e-20 ) {
189 double ctlx = -0.5 * b / c;
190 if ( fabs( ctlx ) < 1.0 ) {
191 double probtmp = a + b * ctlx + c * ctlx * ctlx;
192 if ( probtmp > prob )
193 prob = probtmp;
194 }
195 }
196
197 if ( prob > maxfoundprob ) {
198 maxfoundprob = prob;
199 }
200 }
201 if ( EvtPDL::getWidth( meson ) <= 0.0 ) {
202 //if the particle is narrow dont bother with changing the mass.
203 massiter = 4;
204 }
205 }
206 root_part->deleteTree();
207
208 maxfoundprob *= 1.1;
209 return maxfoundprob;
210}
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
EvtSpinDensity getSpinDensity() const
Definition EvtAmp.cpp:141
void init(EvtId p, int ndaug, const EvtId *daug)
Definition EvtAmp.cpp:67
Definition EvtId.hh:27
static double getWidth(EvtId i)
Definition EvtPDL.cpp:346
static double getMaxMass(EvtId i)
Definition EvtPDL.cpp:331
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
static double getMeanMass(EvtId i)
Definition EvtPDL.cpp:306
static double getMinMass(EvtId i)
Definition EvtPDL.cpp:336
void noLifeTime()
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
int getSpinStates() const
void setDiagonalSpinDensity()
EvtParticle * getDaug(const int i)
double mass() const
void makeDaughters(size_t ndaug, const EvtId *id)
void deleteTree()
void init(EvtId part_n, double e, double px, double py, double pz)
virtual void CalcAmp(EvtParticle *parent, EvtAmp &amp, EvtSemiLeptonicFF *FormFactors)=0
double CalcMaxProb(EvtId parent, EvtId meson, EvtId lepton, EvtId nudaug, EvtSemiLeptonicFF *FormFactors, int nQ2Bins=25)
double normalizedProb(const EvtSpinDensity &d)
void setDiag(int n)
void set(int i, double d)