BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtVubNLO Class Reference

#include <EvtVubNLO.hh>

+ Inheritance diagram for EvtVubNLO:

Public Member Functions

 EvtVubNLO ()
 
virtual ~EvtVubNLO ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void initProbMax ()
 
void init ()
 
void decay (EvtParticle *p)
 
 EvtVubNLO ()
 
virtual ~EvtVubNLO ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void initProbMax ()
 
void init ()
 
void decay (EvtParticle *p)
 
- Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
- Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (EvtParticle *p)=0
 
virtual EvtDecayBaseclone ()=0
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual std::string commandName ()
 
virtual void command (std::string cmd)
 
double getProbMax (double prob)
 
double resetProbMax (double prob)
 
 EvtDecayBase ()
 
virtual ~EvtDecayBase ()
 
virtual bool matchingDecay (const EvtDecayBase &other) const
 
EvtId getParentId ()
 
double getBranchingFraction ()
 
void disableCheckQ ()
 
void checkQ ()
 
int getNDaug ()
 
EvtIdgetDaugs ()
 
EvtId getDaug (int i)
 
int getNArg ()
 
int getPHOTOS ()
 
void setPHOTOS ()
 
void setVerbose ()
 
void setSummary ()
 
double * getArgs ()
 
std::string * getArgsStr ()
 
double getArg (int j)
 
std::string getArgStr (int j)
 
std::string getModelName ()
 
int getDSum ()
 
int summary ()
 
int verbose ()
 
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
 
void printSummary ()
 
void setProbMax (double prbmx)
 
void noProbMax ()
 
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
 
void checkNDaug (int d1, int d2=-1)
 
void checkSpinParent (EvtSpinType::spintype sp)
 
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
 
virtual int nRealDaughters ()
 
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (EvtParticle *p)=0
 
virtual EvtDecayBaseclone ()=0
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual std::string commandName ()
 
virtual void command (std::string cmd)
 
double getProbMax (double prob)
 
double resetProbMax (double prob)
 
 EvtDecayBase ()
 
virtual ~EvtDecayBase ()
 
virtual bool matchingDecay (const EvtDecayBase &other) const
 
EvtId getParentId ()
 
double getBranchingFraction ()
 
void disableCheckQ ()
 
void checkQ ()
 
int getNDaug ()
 
EvtIdgetDaugs ()
 
EvtId getDaug (int i)
 
int getNArg ()
 
int getPHOTOS ()
 
void setPHOTOS ()
 
void setVerbose ()
 
void setSummary ()
 
double * getArgs ()
 
std::string * getArgsStr ()
 
double getArg (int j)
 
std::string getArgStr (int j)
 
std::string getModelName ()
 
int getDSum ()
 
int summary ()
 
int verbose ()
 
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
 
void printSummary ()
 
void setProbMax (double prbmx)
 
void noProbMax ()
 
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
 
void checkNDaug (int d1, int d2=-1)
 
void checkSpinParent (EvtSpinType::spintype sp)
 
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
 
virtual int nRealDaughters ()
 

Additional Inherited Members

- Static Public Member Functions inherited from EvtDecayBase
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 
- Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
 
bool daugsDecayedByParentModel ()
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Detailed Description

Constructor & Destructor Documentation

◆ EvtVubNLO() [1/2]

EvtVubNLO::EvtVubNLO ( )
inline

Definition at line 36 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtVubNLO.hh.

36{}

Referenced by clone().

◆ ~EvtVubNLO() [1/2]

EvtVubNLO::~EvtVubNLO ( )
virtual

Definition at line 39 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtVubNLO.cc.

39 {
40 delete [] _masses;
41 delete [] _weights;
42 cout <<" max pdf : "<<_gmax<<endl;
43 cout <<" efficiency : "<<(float)_ngood/(float)_ntot<<endl;
44
45}

◆ EvtVubNLO() [2/2]

EvtVubNLO::EvtVubNLO ( )
inline

◆ ~EvtVubNLO() [2/2]

virtual EvtVubNLO::~EvtVubNLO ( )
virtual

Member Function Documentation

◆ clone() [1/2]

EvtDecayBase * EvtVubNLO::clone ( )
virtual

◆ clone() [2/2]

EvtDecayBase * EvtVubNLO::clone ( )
virtual

Implements EvtDecayBase.

◆ decay() [1/2]

void EvtVubNLO::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 173 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtVubNLO.cc.

173 {
174
175 int j;
176 // B+ -> u-bar specflav l+ nu
177
178 EvtParticle *xuhad, *lepton, *neutrino;
179 EvtVector4R p4;
180
181 double pp,pm,pl,ml,El(0.0),Eh(0.0),sh(0.0);
182
183
184
186
187 xuhad=p->getDaug(0);
188 lepton=p->getDaug(1);
189 neutrino=p->getDaug(2);
190
191 _mB = p->mass();
192 ml = lepton->mass();
193
194 bool tryit = true;
195
196 while (tryit) {
197 // pm=(E_H+P_H)
198 pm= EvtRandom::Flat(0.,1);
199 pm= pow(pm,1./3.)*_mB;
200 // pl=mB-2*El
201 pl = EvtRandom::Flat(0.,1);
202 pl=sqrt(pl)*pm;
203 // pp=(E_H-P_H)
204 pp = EvtRandom::Flat(0.,pl);
205
206 _ntot++;
207
208 El = (_mB-pl)/2.;
209 Eh = (pp+pm)/2;
210 sh = pp*pm;
211
212 double pdf(0.);
213 if (pp<pl && El>ml&& sh > _masses[0]*_masses[0]&& _mB*_mB + sh - 2*_mB*Eh > ml*ml) {
214 double xran = EvtRandom::Flat(0,_dGMax);
215 pdf = tripleDiff(pp,pl,pm); // triple differential distribution
216 // cout <<" P+,P-,Pl,Pdf= "<<pp <<" "<<pm<<" "<<pl<<" "<<pdf<<endl;
217 if(pdf>_dGMax){
218 report(ERROR,"EvtGen") << "EvtVubNLO pdf above maximum: " <<pdf
219 <<" P+,P-,Pl,Pdf= "<<pp <<" "<<pm<<" "<<pl<<" "<<pdf<<endl;
220 //::abort();
221
222 }
223 if ( pdf >= xran ) tryit = false;
224
225 if(pdf>_gmax)_gmax=pdf;
226 } else {
227 // cout <<" EvtVubNLO incorrect kinematics sh= "<<sh<<"EH "<<Eh<<endl;
228 }
229
230
231 // reweight the Mx distribution
232 if(!tryit && _nbins>0){
233 _ngood++;
234 double xran1 = EvtRandom::Flat();
235 double m = sqrt(sh);j=0;
236 while ( j < _nbins && m > _masses[j] ) j++;
237 double w = _weights[j-1];
238 if ( w < xran1 ) tryit = true;// through away this candidate
239 }
240 }
241
242 // cout <<" max prob "<<gmax<<" " << pp<<" "<<y<<" "<<x<<endl;
243
244 // o.k. we have the three kineamtic variables
245 // now calculate a flat cos Theta_H [-1,1] distribution of the
246 // hadron flight direction w.r.t the B flight direction
247 // because the B is a scalar and should decay isotropic.
248 // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
249 // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
250 // W flight direction.
251
252 double ctH = EvtRandom::Flat(-1,1);
253 double phH = EvtRandom::Flat(0,2*M_PI);
254 double phL = EvtRandom::Flat(0,2*M_PI);
255
256 // now compute the four vectors in the B Meson restframe
257
258 double ptmp,sttmp;
259 // calculate the hadron 4 vector in the B Meson restframe
260
261 sttmp = sqrt(1-ctH*ctH);
262 ptmp = sqrt(Eh*Eh-sh);
263 double pHB[4] = {Eh,ptmp*sttmp*cos(phH),ptmp*sttmp*sin(phH),ptmp*ctH};
264 p4.set(pHB[0],pHB[1],pHB[2],pHB[3]);
265 xuhad->init( getDaug(0), p4);
266
267
268 // calculate the W 4 vector in the B Meson restrframe
269
270 double apWB = ptmp;
271 double pWB[4] = {_mB-Eh,-pHB[1],-pHB[2],-pHB[3]};
272
273 // first go in the W restframe and calculate the lepton and
274 // the neutrino in the W frame
275
276 double mW2 = _mB*_mB + sh - 2*_mB*Eh;
277 // if(mW2<0.1){
278 // cout <<" low Q2! "<<pp<<" "<<epp<<" "<<x<<" "<<y<<endl;
279 //}
280 double beta = ptmp/pWB[0];
281 double gamma = pWB[0]/sqrt(mW2);
282
283 double pLW[4];
284
285 ptmp = (mW2-ml*ml)/2/sqrt(mW2);
286 pLW[0] = sqrt(ml*ml + ptmp*ptmp);
287
288 double ctL = (El - gamma*pLW[0])/beta/gamma/ptmp;
289 if ( ctL < -1 ) ctL = -1;
290 if ( ctL > 1 ) ctL = 1;
291 sttmp = sqrt(1-ctL*ctL);
292
293 // eX' = eZ x eW
294 double xW[3] = {-pWB[2],pWB[1],0};
295 // eZ' = eW
296 double zW[3] = {pWB[1]/apWB,pWB[2]/apWB,pWB[3]/apWB};
297
298 double lx = sqrt(xW[0]*xW[0]+xW[1]*xW[1]);
299 for (j=0;j<2;j++)
300 xW[j] /= lx;
301
302 // eY' = eZ' x eX'
303 double yW[3] = {-pWB[1]*pWB[3],-pWB[2]*pWB[3],pWB[1]*pWB[1]+pWB[2]*pWB[2]};
304 double ly = sqrt(yW[0]*yW[0]+yW[1]*yW[1]+yW[2]*yW[2]);
305 for (j=0;j<3;j++)
306 yW[j] /= ly;
307
308 // p_lep = |p_lep| * ( sin(Theta) * cos(Phi) * eX'
309 // + sin(Theta) * sin(Phi) * eY'
310 // + cos(Theta) * eZ')
311 for (j=0;j<3;j++)
312 pLW[j+1] = sttmp*cos(phL)*ptmp*xW[j]
313 + sttmp*sin(phL)*ptmp*yW[j]
314 + ctL *ptmp*zW[j];
315
316 double apLW = ptmp;
317
318 // boost them back in the B Meson restframe
319
320 double appLB = beta*gamma*pLW[0] + gamma*ctL*apLW;
321
322 ptmp = sqrt(El*El-ml*ml);
323 double ctLL = appLB/ptmp;
324
325 if ( ctLL > 1 ) ctLL = 1;
326 if ( ctLL < -1 ) ctLL = -1;
327
328 double pLB[4] = {El,0,0,0};
329 double pNB[8] = {pWB[0]-El,0,0,0};
330
331 for (j=1;j<4;j++) {
332 pLB[j] = pLW[j] + (ctLL*ptmp - ctL*apLW)/apWB*pWB[j];
333 pNB[j] = pWB[j] - pLB[j];
334 }
335
336 p4.set(pLB[0],pLB[1],pLB[2],pLB[3]);
337 lepton->init( getDaug(1), p4);
338
339 p4.set(pNB[0],pNB[1],pNB[2],pNB[3]);
340 neutrino->init( getDaug(2), p4);
341
342 return ;
343}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
#define M_PI
Definition: TConstant.h:4
ostream & report(Severity severity, const char *facility)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)

◆ decay() [2/2]

void EvtVubNLO::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

◆ getName() [1/2]

void EvtVubNLO::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

Definition at line 51 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtVubNLO.cc.

51 {
52
53 model_name="VUB_NLO";
54
55}

◆ getName() [2/2]

void EvtVubNLO::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

◆ init() [1/2]

void EvtVubNLO::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 64 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtVubNLO.cc.

64 {
65
66 // max pdf
67 _gmax=0;
68 _ntot=0;
69 _ngood=0;
70 _lbar=-1000;
71 _mupi2=-1000;
72
73 // check that there are at least 6 arguments
74 int npar = 8;
75 if (getNArg()<npar) {
76
77 report(ERROR,"EvtGen") << "EvtVubNLO generator expected "
78 << " at least npar arguments but found: "
79 <<getNArg()<<endl;
80 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
81 ::abort();
82
83 }
84 // this is the shape function parameter
85 _mb = getArg(0);
86 _b = getArg(1);
87 _lambdaSF = getArg(2);// shape function lambda is different from lambda
88 _mui = 1.5;// GeV (scale)
89 _kpar = getArg(3);// 0
90 _idSF = abs((int)getArg(4));// type of shape function 1: exponential (from Neubert)
91 _nbins = abs((int)getArg(5));
92 _masses = new double[_nbins];
93 _weights = new double[_nbins];
94
95 // Shape function normalization
96 _mB=5.28;// temporary B meson mass for normalization
97
98 std::vector<double> sCoeffs(11);
99 sCoeffs[3] = _b;
100 sCoeffs[4] = _mb;
101 sCoeffs[5] = _mB;
102 sCoeffs[6] = _idSF;
103 sCoeffs[7] = lambda_SF();
104 sCoeffs[8] = mu_h();
105 sCoeffs[9] = mu_i();
106 sCoeffs[10] = 1.;
107 _SFNorm = SFNorm(sCoeffs) ; // SF normalization;
108
109
110 cout << " pdf 0.66, 1.32 , 4.32 "<<tripleDiff(0.66, 1.32 , 4.32)<<endl;
111 cout << " pdf 0.23,0.37,3.76 "<<tripleDiff(0.23,0.37,3.76)<<endl;
112 cout << " pdf 0.97,4.32,4.42 "<<tripleDiff(0.97,4.32,4.42)<<endl;
113 cout << " pdf 0.52,1.02,2.01 "<<tripleDiff(0.52,1.02,2.01)<<endl;
114 cout << " pdf 1.35,1.39,2.73 "<<tripleDiff(1.35,1.39,2.73)<<endl;
115
116
117 if (getNArg()-npar+2 != 2*_nbins) {
118 report(ERROR,"EvtGen") << "EvtVubNLO generator expected "
119 << _nbins << " masses and weights but found: "
120 <<(getNArg()-npar)/2 <<endl;
121 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
122 ::abort();
123 }
124 int i,j = npar-2;
125 double maxw = 0.;
126 for (i=0;i<_nbins;i++) {
127 _masses[i] = getArg(j++);
128 if (i>0 && _masses[i] <= _masses[i-1]) {
129 report(ERROR,"EvtGen") << "EvtVubNLO generator expected "
130 << " mass bins in ascending order!"
131 << "Will terminate execution!"<<endl;
132 ::abort();
133 }
134 _weights[i] = getArg(j++);
135 if (_weights[i] < 0) {
136 report(ERROR,"EvtGen") << "EvtVubNLO generator expected "
137 << " weights >= 0, but found: "
138 <<_weights[i] <<endl;
139 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
140 ::abort();
141 }
142 if ( _weights[i] > maxw ) maxw = _weights[i];
143 }
144 if (maxw == 0) {
145 report(ERROR,"EvtGen") << "EvtVubNLO generator expected at least one "
146 << " weight > 0, but found none! "
147 << "Will terminate execution!"<<endl;
148 ::abort();
149 }
150 for (i=0;i<_nbins;i++) _weights[i]/=maxw;
151
152 // the maximum dGamma*p2 value depends on alpha_s only:
153
154
155 // _dGMax = 0.05;
156 _dGMax = 150.;
157
158 // for the Fermi Motion we need a B-Meso\n mass - but it's not critical
159 // to get an exact value; in order to stay in the phase space for
160 // B+- and B0 use the smaller mass
161
162
163 // check that there are 3 daughters
164 checkNDaug(3);
165}

◆ init() [2/2]

void EvtVubNLO::init ( )
virtual

Reimplemented from EvtDecayBase.

◆ initProbMax() [1/2]

void EvtVubNLO::initProbMax ( )
virtual

◆ initProbMax() [2/2]

void EvtVubNLO::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.


The documentation for this class was generated from the following files: