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.
EvtBtoXsll.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/EvtConst.hh"
24 #include "EvtGenBase/EvtGenKine.hh"
25 #include "EvtGenBase/EvtId.hh"
26 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtRandom.hh"
30 #include "EvtGenBase/EvtReport.hh"
31 
34 
35 #include <stdlib.h>
36 using std::endl;
37 
38 std::string EvtBtoXsll::getName()
39 {
40  return "BTOXSLL";
41 }
42 
44 {
45  return new EvtBtoXsll;
46 }
47 
49 {
50  // check that there are no arguments
51 
52  checkNArg( 0, 4, 5 );
53 
54  checkNDaug( 3 );
55 
56  // Check that the two leptons are the same type
57 
58  EvtId lepton1type = getDaug( 1 );
59  EvtId lepton2type = getDaug( 2 );
60 
61  int etyp = 0;
62  int mutyp = 0;
63  int tautyp = 0;
64  if ( lepton1type == EvtPDL::getId( "e+" ) ||
65  lepton1type == EvtPDL::getId( "e-" ) ) {
66  etyp++;
67  }
68  if ( lepton2type == EvtPDL::getId( "e+" ) ||
69  lepton2type == EvtPDL::getId( "e-" ) ) {
70  etyp++;
71  }
72  if ( lepton1type == EvtPDL::getId( "mu+" ) ||
73  lepton1type == EvtPDL::getId( "mu-" ) ) {
74  mutyp++;
75  }
76  if ( lepton2type == EvtPDL::getId( "mu+" ) ||
77  lepton2type == EvtPDL::getId( "mu-" ) ) {
78  mutyp++;
79  }
80  if ( lepton1type == EvtPDL::getId( "tau+" ) ||
81  lepton1type == EvtPDL::getId( "tau-" ) ) {
82  tautyp++;
83  }
84  if ( lepton2type == EvtPDL::getId( "tau+" ) ||
85  lepton2type == EvtPDL::getId( "tau-" ) ) {
86  tautyp++;
87  }
88 
89  if ( etyp != 2 && mutyp != 2 && tautyp != 2 ) {
90  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
91  << "Expect two leptons of the same type in EvtBtoXsll.cc\n";
92  ::abort();
93  }
94 
95  // Check that the second and third entries are leptons with positive
96  // and negative charge, respectively
97 
98  int lpos = 0;
99  int lneg = 0;
100  if ( lepton1type == EvtPDL::getId( "e+" ) ||
101  lepton1type == EvtPDL::getId( "mu+" ) ||
102  lepton1type == EvtPDL::getId( "tau+" ) ) {
103  lpos++;
104  }
105  if ( lepton2type == EvtPDL::getId( "e-" ) ||
106  lepton2type == EvtPDL::getId( "mu-" ) ||
107  lepton2type == EvtPDL::getId( "tau-" ) ) {
108  lneg++;
109  }
110 
111  if ( lpos != 1 || lneg != 1 ) {
112  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
113  << "Expect 2nd and 3rd particles to be positive and negative leptons in EvtBtoXsll.cc\n";
114  ::abort();
115  }
116 
117  _mb = 4.8;
118  _ms = 0.2;
119  _mq = 0.;
120  _pf = 0.41;
121  _mxmin = 1.1;
122  if ( getNArg() == 4 ) {
123  // b-quark mass
124  _mb = getArg( 0 );
125  // s-quark mass
126  _ms = getArg( 1 );
127  // spectator quark mass
128  _mq = getArg( 2 );
129  // Fermi motion parameter
130  _pf = getArg( 3 );
131  }
132  if ( getNArg() == 5 ) {
133  _mxmin = getArg( 4 );
134  }
135 
136  _calcprob = std::make_unique<EvtBtoXsllUtil>();
137 
138  double ml = EvtPDL::getMeanMass( getDaug( 1 ) );
139 
140  // determine the maximum probability density from dGdsProb
141 
142  int i, j;
143  int nsteps = 100;
144  double s = 0.0;
145  double smin = 4.0 * ml * ml;
146  double smax = ( _mb - _ms ) * ( _mb - _ms );
147  double probMax = -10000.0;
148  double sProbMax = -10.0;
149  double uProbMax = -10.0;
150 
151  for ( i = 0; i < nsteps; i++ ) {
152  s = smin + ( i + 0.002 ) * ( smax - smin ) / (double)nsteps;
153  double prob = _calcprob->dGdsProb( _mb, _ms, ml, s );
154  if ( prob > probMax ) {
155  sProbMax = s;
156  probMax = prob;
157  }
158  }
159 
160  _dGdsProbMax = probMax;
161 
162  if ( verbose() ) {
163  EvtGenReport( EVTGEN_INFO, "EvtGen" )
164  << "dGdsProbMax = " << probMax << " for s = " << sProbMax << endl;
165  }
166 
167  // determine the maximum probability density from dGdsdupProb
168 
169  probMax = -10000.0;
170  sProbMax = -10.0;
171 
172  for ( i = 0; i < nsteps; i++ ) {
173  s = smin + ( i + 0.002 ) * ( smax - smin ) / (double)nsteps;
174  double umax = sqrt( ( s - ( _mb + _ms ) * ( _mb + _ms ) ) *
175  ( s - ( _mb - _ms ) * ( _mb - _ms ) ) );
176  for ( j = 0; j < nsteps; j++ ) {
177  double u = -umax + ( j + 0.002 ) * ( 2.0 * umax ) / (double)nsteps;
178  double prob = _calcprob->dGdsdupProb( _mb, _ms, ml, s, u );
179  if ( prob > probMax ) {
180  sProbMax = s;
181  uProbMax = u;
182  probMax = prob;
183  }
184  }
185  }
186 
187  _dGdsdupProbMax = 2.0 * probMax;
188 
189  if ( verbose() ) {
190  EvtGenReport( EVTGEN_INFO, "EvtGen" )
191  << "dGdsdupProbMax = " << probMax << " for s = " << sProbMax
192  << " and u = " << uProbMax << endl;
193  }
194 }
195 
197 {
198  noProbMax();
199 }
200 
202 {
203  p->makeDaughters( getNDaug(), getDaugs() );
204 
205  EvtParticle* xhadron = p->getDaug( 0 );
206  EvtParticle* leptonp = p->getDaug( 1 );
207  EvtParticle* leptonn = p->getDaug( 2 );
208 
209  double mass[3];
210 
211  findMasses( p, getNDaug(), getDaugs(), mass );
212 
213  double mB = p->mass();
214  double ml = mass[1];
215  double pb( 0. );
216 
217  int im = 0;
218  static int nmsg = 0;
219  double xhadronMass = -999.0;
220 
221  EvtVector4R p4xhadron;
222  EvtVector4R p4leptonp;
223  EvtVector4R p4leptonn;
224 
225  // require the hadronic system has mass greater than that of a Kaon pion pair
226 
227  // while (xhadronMass < 0.6333)
228  // the above minimum value of K+pi mass appears to be too close
229  // to threshold as far as JETSET is concerned
230  // (JETSET gets caught in an infinite loop)
231  // so we choose a lightly larger value for the threshold
232  while ( xhadronMass < _mxmin ) {
233  im++;
234 
235  // Apply Fermi motion and determine effective b-quark mass
236 
237  // Old BaBar MC parameters
238  // double pf = 0.25;
239  // double ms = 0.2;
240  // double mq = 0.3;
241 
242  double mb = 0.0;
243 
244  double xbox, ybox;
245 
246  while ( mb <= 0.0 ) {
247  pb = _calcprob->FermiMomentum( _pf );
248 
249  // effective b-quark mass
250  mb = mB * mB + _mq * _mq - 2.0 * mB * sqrt( pb * pb + _mq * _mq );
251  if ( mb > 0. && sqrt( mb ) - _ms < 2.0 * ml )
252  mb = -10.;
253  }
254  mb = sqrt( mb );
255 
256  // cout << "b-quark momentum = " << pb << " mass = " << mb << endl;
257 
258  // generate a dilepton invariant mass
259 
260  double s = 0.0;
261  double smin = 4.0 * ml * ml;
262  double smax = ( mb - _ms ) * ( mb - _ms );
263 
264  while ( s == 0.0 ) {
265  xbox = EvtRandom::Flat( smin, smax );
266  ybox = EvtRandom::Flat( _dGdsProbMax );
267  double prob = _calcprob->dGdsProb( mb, _ms, ml, xbox );
268  if ( !( prob >= 0.0 ) && !( prob <= 0.0 ) ) {
269  // EvtGenReport(EVTGEN_INFO,"EvtGen") << "nan from dGdsProb " << prob << " " << mb << " " << _ms << " " << ml << " " << xbox << std::endl;
270  }
271  if ( ybox < prob )
272  s = xbox;
273  }
274 
275  // cout << "dGdsProb(s) = " << _calcprob->dGdsProb(mb, _ms, ml, s)
276  // << " for s = " << s << endl;
277 
278  // two-body decay of b quark at rest into s quark and dilepton pair:
279  // b -> s (ll)
280 
281  EvtVector4R p4sdilep[2];
282 
283  double msdilep[2];
284  msdilep[0] = _ms;
285  msdilep[1] = sqrt( s );
286 
287  EvtGenKine::PhaseSpace( 2, msdilep, p4sdilep, mb );
288 
289  // generate dilepton decay with the expected asymmetry: (ll) -> l+ l-
290 
291  EvtVector4R p4ll[2];
292 
293  double mll[2];
294  mll[0] = ml;
295  mll[1] = ml;
296 
297  double tmp = 0.0;
298 
299  while ( tmp == 0.0 ) {
300  // (ll) -> l+ l- decay in dilepton rest frame
301 
302  EvtGenKine::PhaseSpace( 2, mll, p4ll, msdilep[1] );
303 
304  // boost to b-quark rest frame
305 
306  p4ll[0] = boostTo( p4ll[0], p4sdilep[1] );
307  p4ll[1] = boostTo( p4ll[1], p4sdilep[1] );
308 
309  // compute kinematical variable u
310 
311  EvtVector4R p4slp = p4sdilep[0] + p4ll[0];
312  EvtVector4R p4sln = p4sdilep[0] + p4ll[1];
313 
314  double u = p4slp.mass2() - p4sln.mass2();
315 
317 
318  double prob = _calcprob->dGdsdupProb( mb, _ms, ml, s, u );
319  if ( !( prob >= 0.0 ) && !( prob <= 0.0 ) ) {
320  EvtGenReport( EVTGEN_INFO, "EvtGen" )
321  << "nan from dGdsProb " << prob << " " << mb << " " << _ms
322  << " " << ml << " " << s << " " << u << std::endl;
323  }
324  if ( prob > _dGdsdupProbMax && nmsg < 20 ) {
325  EvtGenReport( EVTGEN_INFO, "EvtGen" )
326  << "d2gdsdup GT d2gdsdup_max:" << prob << " "
327  << _dGdsdupProbMax << " for s = " << s << " u = " << u
328  << " mb = " << mb << endl;
329  nmsg++;
330  }
331  if ( ybox < prob ) {
332  tmp = 1.0;
333  // cout << "dGdsdupProb(s) = " << prob
334  // << " for u = " << u << endl;
335  }
336  }
337 
338  // assign 4-momenta to valence quarks inside B meson in B rest frame
339 
340  double phi = EvtRandom::Flat( EvtConst::twoPi );
341  double costh = EvtRandom::Flat( -1.0, 1.0 );
342  double sinth = sqrt( 1.0 - costh * costh );
343 
344  // b-quark four-momentum in B meson rest frame
345 
346  EvtVector4R p4b( sqrt( mb * mb + pb * pb ), pb * sinth * sin( phi ),
347  pb * sinth * cos( phi ), pb * costh );
348 
349  // B meson in its rest frame
350  //
351  // EvtVector4R p4B(mB, 0.0, 0.0, 0.0);
352  //
353  // boost B meson to b-quark rest frame
354  //
355  // p4B = boostTo(p4B, p4b);
356  //
357  // cout << " B meson mass in b-quark rest frame = " << p4B.mass() << endl;
358 
359  // boost s, l+ and l- to B meson rest frame
360 
361  // EvtVector4R p4s = boostTo(p4sdilep[0], p4B);
362  // p4leptonp = boostTo(p4ll[0], p4B);
363  // p4leptonn = boostTo(p4ll[1], p4B);
364 
365  EvtVector4R p4s = boostTo( p4sdilep[0], p4b );
366  p4leptonp = boostTo( p4ll[0], p4b );
367  p4leptonn = boostTo( p4ll[1], p4b );
368 
369  // spectator quark in B meson rest frame
370 
371  EvtVector4R p4q( sqrt( pb * pb + _mq * _mq ), -p4b.get( 1 ),
372  -p4b.get( 2 ), -p4b.get( 3 ) );
373 
374  // hadron system in B meson rest frame
375 
376  p4xhadron = p4s + p4q;
377  xhadronMass = p4xhadron.mass();
378 
379  // cout << "Xs mass = " << xhadronMass << " trial " << im << endl;
380  }
381 
382  // initialize the decay products
383 
384  xhadron->init( getDaug( 0 ), p4xhadron );
385 
386  // For B-bar mesons (i.e. containing a b quark) we have the normal
387  // order of leptons
388  if ( p->getId() == EvtPDL::getId( "anti-B0" ) ||
389  p->getId() == EvtPDL::getId( "B-" ) ) {
390  leptonp->init( getDaug( 1 ), p4leptonp );
391  leptonn->init( getDaug( 2 ), p4leptonn );
392  }
393  // For B mesons (i.e. containing a b-bar quark) we need to flip the
394  // role of the positive and negative leptons in order to produce the
395  // correct forward-backward asymmetry between the two leptons
396  else {
397  leptonp->init( getDaug( 1 ), p4leptonn );
398  leptonn->init( getDaug( 2 ), p4leptonp );
399  }
400 
401  return;
402 }
double _mq
Definition: EvtBtoXsll.hh:58
double _pf
Definition: EvtBtoXsll.hh:59
double _mb
Definition: EvtBtoXsll.hh:56
double getArg(unsigned int j)
EvtDecayBase * clone() override
Definition: EvtBtoXsll.cpp:43
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double mass() const
Definition: EvtVector4R.cpp:49
double _ms
Definition: EvtBtoXsll.hh:57
static const double twoPi
Definition: EvtConst.hh:27
static double getMeanMass(EvtId i)
Definition: EvtPDL.cpp:314
EvtId getId() const
void makeDaughters(unsigned int ndaug, EvtId *id)
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
Definition: EvtId.hh:27
double mass2() const
Definition: EvtVector4R.hh:100
double get(int i) const
Definition: EvtVector4R.hh:162
double _mxmin
Definition: EvtBtoXsll.hh:60
void checkNDaug(int d1, int d2=-1)
static double Flat()
Definition: EvtRandom.cpp:72
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
Definition: EvtGenKine.cpp:46
double mass() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
void init() override
Definition: EvtBtoXsll.cpp:48
std::unique_ptr< EvtBtoXsllUtil > _calcprob
Definition: EvtBtoXsll.hh:53
int verbose() const
Definition: EvtDecayBase.hh:82
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
std::string getName() override
Definition: EvtBtoXsll.cpp:38
void decay(EvtParticle *p) override
Definition: EvtBtoXsll.cpp:201
double _dGdsProbMax
Definition: EvtBtoXsll.hh:54
static void findMasses(EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
double _dGdsdupProbMax
Definition: EvtBtoXsll.hh:55
void initProbMax() override
Definition: EvtBtoXsll.cpp:196
int getNArg() const
Definition: EvtDecayBase.hh:68
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67