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