BOSS 8.0.0
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)
Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
virtual ~EvtDecayIncoherent ()
void setDaughterSpinDensity (int daughter)
int isDaughterSpinDensitySet (int daughter)
Public Member Functions inherited from EvtDecayBase
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)
Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel

Detailed Description

Definition at line 32 of file EvtVubNLO.hh.

Constructor & Destructor Documentation

◆ EvtVubNLO()

EvtVubNLO::EvtVubNLO ( )
inline

Definition at line 35 of file EvtVubNLO.hh.

35{}

Referenced by clone().

◆ ~EvtVubNLO()

EvtVubNLO::~EvtVubNLO ( )
virtual

Definition at line 40 of file EvtVubNLO.cc.

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

Member Function Documentation

◆ clone()

EvtDecayBase * EvtVubNLO::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 53 of file EvtVubNLO.cc.

53{ return new EvtVubNLO; }

◆ decay()

void EvtVubNLO::decay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 159 of file EvtVubNLO.cc.

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

◆ getName()

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

Implements EvtDecayBase.

Definition at line 51 of file EvtVubNLO.cc.

51{ model_name = "VUB_NLO"; }

◆ init()

void EvtVubNLO::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 55 of file EvtVubNLO.cc.

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

◆ initProbMax()

void EvtVubNLO::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 157 of file EvtVubNLO.cc.

157{ noProbMax(); }

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