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.
EvtParticle.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/EvtCPUtil.hh"
26 #include "EvtGenBase/EvtGenKine.hh"
27 #include "EvtGenBase/EvtId.hh"
28 #include "EvtGenBase/EvtIdSet.hh"
30 #include "EvtGenBase/EvtPDL.hh"
32 #include "EvtGenBase/EvtPatches.hh"
34 #include "EvtGenBase/EvtRadCorr.hh"
35 #include "EvtGenBase/EvtRandom.hh"
37 #include "EvtGenBase/EvtReport.hh"
40 #include "EvtGenBase/EvtStatus.hh"
41 #include "EvtGenBase/EvtStdHep.hh"
45 
46 #include <sys/stat.h>
47 
48 #include <iostream>
49 #include <math.h>
50 #include <stdio.h>
51 #include <stdlib.h>
52 
53 using std::endl;
54 
56 {
57  delete _decayProb;
58 }
59 
61 {
62  _ndaug = 0;
63  _parent = 0;
64  _channel = -10;
65  _t = 0.0;
66  _genlifetime = 1;
67  _first = 1;
68  _isInit = false;
69  _validP4 = false;
70  _isDecayed = false;
71  _decayProb = 0;
72  _intAttributes.clear();
73  _dblAttributes.clear();
74  // _mix=false;
75 }
76 
78 {
79  _first = 0;
80 }
82 {
83  _first = 1;
84 }
85 
87 {
88  _channel = i;
89 }
90 
92 {
93  return _daug[i];
94 }
95 
97 {
98  return _parent;
99 }
100 
101 void EvtParticle::setLifetime( double tau )
102 {
103  _t = tau;
104 }
105 
107 {
108  if ( _genlifetime ) {
109  _t = -log( EvtRandom::Flat() ) * EvtPDL::getctau( getId() );
110  }
111 }
112 
114 {
115  return _t;
116 }
117 
119 {
120  node->_daug[node->_ndaug++] = this;
121  _ndaug = 0;
122  _parent = node;
123 }
124 
126 {
127  return _first;
128 }
129 
131 {
132  return _id;
133 }
134 
136 {
137  return EvtPDL::getStdHep( _id );
138 }
139 
141 {
142  return EvtPDL::getSpinType( _id );
143 }
144 
146 {
148 }
149 
151 {
152  return _p;
153 }
154 
156 {
157  return _channel;
158 }
159 
160 size_t EvtParticle::getNDaug() const
161 {
162  return _ndaug;
163 }
164 
165 double EvtParticle::mass() const
166 {
167  return _p.mass();
168 }
169 
171 {
173 }
174 
176 {
177  if ( getSpinStates() != 3 ) {
178  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
179  << "Error in EvtParticle::setVectorSpinDensity" << endl;
180  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
181  << "spin_states:" << getSpinStates() << endl;
182  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
183  << "particle:" << EvtPDL::name( _id ).c_str() << endl;
184  ::abort();
185  }
186 
187  EvtSpinDensity rho;
188 
189  //Set helicity +1 and -1 to 1.
190  rho.setDiag( getSpinStates() );
191  rho.set( 1, 1, EvtComplex( 0.0, 0.0 ) );
192 
194 }
195 
197 {
199 
200  assert( R.getDim() == rho.getDim() );
201 
202  int n = rho.getDim();
203 
204  _rhoForward.setDim( n );
205 
206  int i, j, k, l;
207 
208  for ( i = 0; i < n; i++ ) {
209  for ( j = 0; j < n; j++ ) {
210  EvtComplex tmp = 0.0;
211  for ( k = 0; k < n; k++ ) {
212  for ( l = 0; l < n; l++ ) {
213  tmp += R.get( l, i ) * rho.get( l, k ) *
214  conj( R.get( k, j ) );
215  }
216  }
217  _rhoForward.set( i, j, tmp );
218  }
219  }
220 }
221 
223  double alpha, double beta,
224  double gamma )
225 {
226  EvtSpinDensity R = rotateToHelicityBasis( alpha, beta, gamma );
227 
228  assert( R.getDim() == rho.getDim() );
229 
230  int n = rho.getDim();
231 
232  _rhoForward.setDim( n );
233 
234  int i, j, k, l;
235 
236  for ( i = 0; i < n; i++ ) {
237  for ( j = 0; j < n; j++ ) {
238  EvtComplex tmp = 0.0;
239  for ( k = 0; k < n; k++ ) {
240  for ( l = 0; l < n; l++ ) {
241  tmp += R.get( l, i ) * rho.get( l, k ) *
242  conj( R.get( k, j ) );
243  }
244  }
245  _rhoForward.set( i, j, tmp );
246  }
247  }
248 }
249 
250 void EvtParticle::initDecay( bool useMinMass )
251 {
252  EvtParticle* p = this;
253  // carefull - the parent mass might be fixed in stone..
254  EvtParticle* par = p->getParent();
255  double parMass = -1.;
256  if ( par != 0 ) {
257  if ( par->hasValidP4() )
258  parMass = par->mass();
259  for ( size_t i = 0; i < par->getNDaug(); i++ ) {
260  EvtParticle* tDaug = par->getDaug( i );
261  if ( p != tDaug )
262  parMass -= EvtPDL::getMinMass( tDaug->getId() );
263  }
264  }
265 
266  if ( _isInit ) {
267  //we have already been here - just reroll the masses!
268  if ( _ndaug > 0 ) {
269  for ( size_t ii = 0; ii < _ndaug; ii++ ) {
270  if ( _ndaug == 1 ||
271  EvtPDL::getWidth( p->getDaug( ii )->getId() ) > 0.0000001 )
272  p->getDaug( ii )->initDecay( useMinMass );
273  else
274  p->getDaug( ii )->setMass(
275  EvtPDL::getMeanMass( p->getDaug( ii )->getId() ) );
276  }
277  }
278 
279  EvtId* dauId = 0;
280  double* dauMasses = 0;
281  if ( _ndaug > 0 ) {
282  dauId = new EvtId[_ndaug];
283  dauMasses = new double[_ndaug];
284  for ( size_t j = 0; j < _ndaug; j++ ) {
285  dauId[j] = p->getDaug( j )->getId();
286  dauMasses[j] = p->getDaug( j )->mass();
287  }
288  }
289  EvtId* parId = 0;
290  EvtId* othDauId = 0;
291  EvtParticle* tempPar = p->getParent();
292  if ( tempPar ) {
293  parId = new EvtId( tempPar->getId() );
294  if ( tempPar->getNDaug() == 2 ) {
295  if ( tempPar->getDaug( 0 ) == this )
296  othDauId = new EvtId( tempPar->getDaug( 1 )->getId() );
297  else
298  othDauId = new EvtId( tempPar->getDaug( 0 )->getId() );
299  }
300  }
301  if ( p->getParent() && _validP4 == false ) {
302  if ( !useMinMass ) {
303  p->setMass( EvtPDL::getRandMass( p->getId(), parId, _ndaug, dauId,
304  othDauId, parMass, dauMasses ) );
305  } else
306  p->setMass( EvtPDL::getMinMass( p->getId() ) );
307  }
308  if ( parId )
309  delete parId;
310  if ( othDauId )
311  delete othDauId;
312  if ( dauId )
313  delete[] dauId;
314  if ( dauMasses )
315  delete[] dauMasses;
316  return;
317  }
318 
319  //Will include effects of mixing here
320  //added by Lange Jan4,2000
321  static EvtId BS0 = EvtPDL::getId( "B_s0" );
322  static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
323  static EvtId BD0 = EvtPDL::getId( "B0" );
324  static EvtId BDB = EvtPDL::getId( "anti-B0" );
325  static EvtId D0 = EvtPDL::getId( "D0" );
326  static EvtId D0B = EvtPDL::getId( "anti-D0" );
327  static EvtId U4S = EvtPDL::getId( "Upsilon(4S)" );
328  static EvtIdSet borUps( BS0, BSB, BD0, BDB, U4S );
329 
330  //only makes sense if there is no parent particle which is a B or an Upsilon
331  bool hasBorUps = false;
332  if ( getParent() && borUps.contains( getParent()->getId() ) )
333  hasBorUps = true;
334  // if ( (getNDaug()==0)&&(getParent()==0) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){
335  EvtId thisId = getId();
336  // remove D0 mixing for now.
337  // if ( (getNDaug()==0 && !hasBorUps) && (thisId==BS0||thisId==BSB||thisId==BD0||thisId==BDB||thisId==D0||thisId==D0B)){
338  if ( ( getNDaug() == 0 && !hasBorUps ) &&
339  ( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
340  double t;
341  int mix;
343  setLifetime( t );
344 
345  if ( mix ) {
346  EvtScalarParticle* scalar_part;
347 
348  scalar_part = new EvtScalarParticle;
349  if ( getId() == BS0 ) {
350  EvtVector4R p_init( EvtPDL::getMass( BSB ), 0.0, 0.0, 0.0 );
351  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
352  } else if ( getId() == BSB ) {
353  EvtVector4R p_init( EvtPDL::getMass( BS0 ), 0.0, 0.0, 0.0 );
354  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
355  } else if ( getId() == BD0 ) {
356  EvtVector4R p_init( EvtPDL::getMass( BDB ), 0.0, 0.0, 0.0 );
357  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
358  } else if ( getId() == BDB ) {
359  EvtVector4R p_init( EvtPDL::getMass( BD0 ), 0.0, 0.0, 0.0 );
360  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
361  } else if ( getId() == D0 ) {
362  EvtVector4R p_init( EvtPDL::getMass( D0B ), 0.0, 0.0, 0.0 );
363  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
364  } else if ( getId() == D0B ) {
365  EvtVector4R p_init( EvtPDL::getMass( D0 ), 0.0, 0.0, 0.0 );
366  scalar_part->init( EvtPDL::chargeConj( getId() ), p_init );
367  }
368 
369  scalar_part->setLifetime( 0 );
370  scalar_part->setDiagonalSpinDensity();
371 
372  insertDaugPtr( 0, scalar_part );
373 
374  _ndaug = 1;
375  _isInit = true;
376  p = scalar_part;
377  p->initDecay( useMinMass );
378  return;
379  }
380  }
381 
382  EvtDecayBase* decayer;
383  decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
384 
385  if ( decayer ) {
386  p->makeDaughters( decayer->nRealDaughters(), decayer->getDaugs() );
387  //then loop over the daughters and init their decay
388  for ( size_t i = 0; i < p->getNDaug(); i++ ) {
389  // std::cout << EvtPDL::name(p->getDaug(i)->getId()) << " " << i << " " << p->getDaug(i)->getSpinType() << " " << EvtPDL::name(p->getId()) << std::endl;
390  if ( EvtPDL::getWidth( p->getDaug( i )->getId() ) > 0.0000001 )
391  p->getDaug( i )->initDecay( useMinMass );
392  else
393  p->getDaug( i )->setMass(
394  EvtPDL::getMeanMass( p->getDaug( i )->getId() ) );
395  }
396  }
397 
398  int j;
399  EvtId* dauId = 0;
400  double* dauMasses = 0;
401  int nDaugT = p->getNDaug();
402  if ( nDaugT > 0 ) {
403  dauId = new EvtId[nDaugT];
404  dauMasses = new double[nDaugT];
405  for ( j = 0; j < nDaugT; j++ ) {
406  dauId[j] = p->getDaug( j )->getId();
407  dauMasses[j] = p->getDaug( j )->mass();
408  }
409  }
410 
411  EvtId* parId = 0;
412  EvtId* othDauId = 0;
413  EvtParticle* tempPar = p->getParent();
414  if ( tempPar ) {
415  parId = new EvtId( tempPar->getId() );
416  if ( tempPar->getNDaug() == 2 ) {
417  if ( tempPar->getDaug( 0 ) == this )
418  othDauId = new EvtId( tempPar->getDaug( 1 )->getId() );
419  else
420  othDauId = new EvtId( tempPar->getDaug( 0 )->getId() );
421  }
422  }
423  if ( p->getParent() && p->hasValidP4() == false ) {
424  if ( !useMinMass ) {
425  p->setMass( EvtPDL::getRandMass( p->getId(), parId, p->getNDaug(),
426  dauId, othDauId, parMass,
427  dauMasses ) );
428  } else {
429  p->setMass( EvtPDL::getMinMass( p->getId() ) );
430  }
431  }
432  if ( parId )
433  delete parId;
434  if ( othDauId )
435  delete othDauId;
436  if ( dauId )
437  delete[] dauId;
438  if ( dauMasses )
439  delete[] dauMasses;
440  _isInit = true;
441 }
442 
444 {
445  //P is particle to decay, typically 'this' but sometime
446  //modified by mixing
447  EvtParticle* p = this;
448  //Did it mix?
449  //if ( p->getMixed() ) {
450  //should take C(p) - this should only
451  //happen the first time we call decay for this
452  //particle
453  //p->takeCConj();
454  // p->setUnMixed();
455  //}
456 
457  EvtDecayBase* decayer;
458  decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
459  // if ( decayer ) {
460  // EvtGenReport(EVTGEN_INFO,"EvtGen") << "calling decay for " << EvtPDL::name(p->getId()) << " " << p->mass() << " " << p->getP4() << " " << p->getNDaug() << " " << p << endl;
461  // EvtGenReport(EVTGEN_INFO,"EvtGen") << "NDaug= " << decayer->getNDaug() << endl;
462  // int ti;
463  // for ( ti=0; ti<decayer->getNDaug(); ti++)
464  // EvtGenReport(EVTGEN_INFO,"EvtGen") << "Daug " << ti << " " << EvtPDL::name(decayer->getDaug(ti)) << endl;
465  // }
466  //if (p->_ndaug>0) {
467  // EvtGenReport(EVTGEN_INFO,"EvtGen") <<"Is decaying particle with daughters!!!!!"<<endl;
468  // ::abort();
469  //return;
470  //call initdecay first - April 29,2002 - Lange
471  //}
472 
473  //if there are already daughters, then this step is already done!
474  // figure out the masses
475  bool massTreeOK( true );
476  if ( _ndaug == 0 ) {
477  massTreeOK = generateMassTree();
478  }
479 
480  if ( massTreeOK == false ) {
481  EvtGenReport( EVTGEN_INFO, "EvtGen" )
482  << "Could not decay " << EvtPDL::name( p->getId() ) << " with mass "
483  << p->mass() << " to decay channel number " << _channel << endl;
484  _isDecayed = false;
485  return;
486  }
487 
488  static EvtId BS0 = EvtPDL::getId( "B_s0" );
489  static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
490  static EvtId BD0 = EvtPDL::getId( "B0" );
491  static EvtId BDB = EvtPDL::getId( "anti-B0" );
492  // static EvtId D0=EvtPDL::getId("D0");
493  // static EvtId D0B=EvtPDL::getId("anti-D0");
494 
495  EvtId thisId = getId();
496  // remove D0 mixing for now..
497  // if ( _ndaug==1 && (thisId==BS0||thisId==BSB||thisId==BD0||thisId==BDB||thisId==D0||thisId==D0B) ) {
498  if ( _ndaug == 1 &&
499  ( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
500  p = p->getDaug( 0 );
501  decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
502  }
503  //now we have accepted a set of masses - time
504  if ( decayer != 0 ) {
505  decayer->makeDecay( p );
506  } else {
508  }
509 
510  _isDecayed = true;
511  return;
512 }
513 
515 {
516  bool isOK( true );
517 
518  double massProb = 1.;
519  double ranNum = 2.;
520  int counter = 0;
521  EvtParticle* p = this;
522  while ( massProb < ranNum ) {
523  //check it out the first time.
524  p->initDecay();
525  massProb = p->compMassProb();
526  ranNum = EvtRandom::Flat();
527  counter++;
528 
529  if ( counter > 10000 ) {
530  if ( counter == 10001 ) {
531  EvtGenReport( EVTGEN_INFO, "EvtGen" )
532  << "Too many iterations to determine the mass tree. Parent mass= "
533  << p->mass() << " " << massProb << endl;
534  p->printTree();
535  EvtGenReport( EVTGEN_INFO, "EvtGen" )
536  << "will take next combo with non-zero likelihood\n";
537  }
538  if ( massProb > 0. )
539  massProb = 2.0;
540  if ( counter > 20000 ) {
541  // one last try - take the minimum masses
542  p->initDecay( true );
543  p->printTree();
544  massProb = p->compMassProb();
545  if ( massProb > 0. ) {
546  massProb = 2.0;
547  EvtGenReport( EVTGEN_INFO, "EvtGen" )
548  << "Taking the minimum mass of all particles in the chain\n";
549  } else {
550  EvtGenReport( EVTGEN_INFO, "EvtGen" )
551  << "Sorry, no luck finding a valid set of masses. This may be a pathological combo\n";
552  isOK = false;
553  break;
554  }
555  }
556  }
557  }
558 
559  return isOK;
560 }
561 
563 {
564  EvtParticle* p = this;
565  double mass = p->mass();
566  double parMass = 0.;
567  if ( p->getParent() ) {
568  parMass = p->getParent()->mass();
569  }
570 
571  int nDaug = p->getNDaug();
572  double* dMasses = 0;
573 
574  int i;
575  if ( nDaug > 0 ) {
576  dMasses = new double[nDaug];
577  for ( i = 0; i < nDaug; i++ )
578  dMasses[i] = p->getDaug( i )->mass();
579  }
580 
581  double temp = 1.0;
582  temp = EvtPDL::getMassProb( p->getId(), mass, parMass, nDaug, dMasses );
583 
584  //If the particle already has a mass, we dont need to include
585  //it in the probability calculation
586  if ( ( !p->getParent() || _validP4 ) && temp > 0.0 )
587  temp = 1.;
588 
589  delete[] dMasses;
590  for ( i = 0; i < nDaug; i++ ) {
591  temp *= p->getDaug( i )->compMassProb();
592  }
593  return temp;
594 }
595 
596 void EvtParticle::deleteDaughters( bool keepChannel )
597 {
598  for ( size_t i = 0; i < _ndaug; i++ ) {
599  _daug[i]->deleteTree();
600  }
601 
602  _ndaug = 0;
603  if ( !keepChannel )
604  _channel = -10;
605  _first = 1;
606  _isInit = false;
607 }
608 
610 {
611  this->deleteDaughters();
612 
613  delete this;
614 }
615 
617 {
618  EvtVector4C temp;
619  printParticle();
620  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
621  << "and you have asked for the:" << i << "th polarization vector."
622  << " I.e. you thought it was a"
623  << " vector particle!" << endl;
624  ::abort();
625  return temp;
626 }
627 
629 {
630  EvtVector4C temp;
631  printParticle();
632  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
633  << "and you have asked for the:" << i << "th polarization vector."
634  << " I.e. you thought it was a"
635  << " vector particle!" << endl;
636  ::abort();
637  return temp;
638 }
639 
641 {
642  EvtVector4C temp;
643  printParticle();
644  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the:" << i
645  << "th polarization vector of photon."
646  << " I.e. you thought it was a"
647  << " photon particle!" << endl;
648  ::abort();
649  return temp;
650 }
651 
653 {
654  EvtVector4C temp;
655  printParticle();
656  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
657  << "and you have asked for the:" << i
658  << "th polarization vector of a photon."
659  << " I.e. you thought it was a"
660  << " photon particle!" << endl;
661  ::abort();
662  return temp;
663 }
664 
666 {
667  EvtDiracSpinor tempD;
668  printParticle();
669  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
670  << "and you have asked for the:" << i << "th dirac spinor."
671  << " I.e. you thought it was a"
672  << " Dirac particle!" << endl;
673  ::abort();
674  return tempD;
675 }
676 
678 {
679  EvtDiracSpinor tempD;
680  printParticle();
681  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
682  << "and you have asked for the:" << i << "th dirac spinor."
683  << " I.e. you thought it was a"
684  << " Dirac particle!" << endl;
685  ::abort();
686  return tempD;
687 }
688 
690 {
691  EvtDiracSpinor tempD;
692  printParticle();
693  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the "
694  << "dirac spinor."
695  << " I.e. you thought it was a"
696  << " neutrino particle!" << endl;
697  ::abort();
698  return tempD;
699 }
700 
702 {
703  EvtDiracSpinor tempD;
704  printParticle();
705  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "and you have asked for the "
706  << "dirac spinor."
707  << " I.e. you thought it was a"
708  << " neutrino particle!" << endl;
709  ::abort();
710  return tempD;
711 }
712 
714 {
715  EvtTensor4C tempC;
716  printParticle();
717  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
718  << "and you have asked for the:" << i << "th tensor."
719  << " I.e. you thought it was a"
720  << " Tensor particle!" << endl;
721  ::abort();
722  return tempC;
723 }
724 
726 {
727  EvtTensor4C tempC;
728  printParticle();
729  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
730  << "and you have asked for the:" << i << "th tensor."
731  << " I.e. you thought it was a"
732  << " Tensor particle!" << endl;
733  ::abort();
734  return tempC;
735 }
736 
738 {
739  EvtRaritaSchwinger tempD;
740  printParticle();
741  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
742  << "and you have asked for the:" << i << "th Rarita-Schwinger spinor."
743  << " I.e. you thought it was a"
744  << " RaritaSchwinger particle!" << std::endl;
745  ::abort();
746  return tempD;
747 }
748 
750 {
751  EvtRaritaSchwinger tempD;
752  printParticle();
753  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
754  << "and you have asked for the:" << i << "th Rarita-Schwinger spinor."
755  << " I.e. you thought it was a"
756  << " RaritaSchwinger particle!" << std::endl;
757  ::abort();
758  return tempD;
759 }
760 
762 {
763  EvtVector4R temp, mom;
764  const EvtParticle* ptemp;
765 
766  temp = this->getP4();
767  ptemp = this;
768 
769  while ( ptemp->getParent() != 0 ) {
770  ptemp = ptemp->getParent();
771  mom = ptemp->getP4();
772  temp = boostTo( temp, mom );
773  }
774  return temp;
775 }
776 
778 {
779  EvtVector4R temp, mom;
780  EvtParticle* ptemp;
781 
782  temp = this->_pBeforeFSR;
783  ptemp = this;
784 
785  while ( ptemp->getParent() != 0 ) {
786  ptemp = ptemp->getParent();
787  mom = ptemp->getP4();
788  temp = boostTo( temp, mom );
789  }
790  return temp;
791 }
792 
794 {
795  return EvtVector4R( mass(), 0.0, 0.0, 0.0 );
796 }
797 
799 {
800  EvtVector4R temp, mom;
801  EvtParticle* ptemp;
802 
803  temp.set( 0.0, 0.0, 0.0, 0.0 );
804  ptemp = getParent();
805 
806  if ( ptemp == 0 )
807  return temp;
808 
809  temp = ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() );
810 
811  while ( ptemp->getParent() != 0 ) {
812  ptemp = ptemp->getParent();
813  mom = ptemp->getP4();
814  temp = boostTo( temp, mom );
815  temp = temp + ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() );
816  }
817 
818  return temp;
819 }
820 
822 {
823  EvtParticle* bpart;
824  EvtParticle* current;
825 
826  current = this;
827  size_t i;
828 
829  if ( _ndaug != 0 )
830  return _daug[0];
831 
832  do {
833  bpart = current->_parent;
834  if ( bpart == 0 )
835  return 0;
836  i = 0;
837  while ( bpart->_daug[i] != current ) {
838  i++;
839  }
840 
841  if ( bpart == rootOfTree ) {
842  if ( i + 1 == bpart->_ndaug )
843  return 0;
844  }
845 
846  i++;
847  current = bpart;
848 
849  } while ( i >= bpart->_ndaug );
850 
851  return bpart->_daug[i];
852 }
853 
855  EvtId* list_of_stable )
856 {
857  //first add particle to the stdhep list;
858  stdhep.createParticle( getP4Lab(), get4Pos(), -1, -1,
859  EvtPDL::getStdHep( getId() ) );
860 
861  int ii = 0;
862 
863  //lets see if this is a longlived particle and terminate the
864  //list building!
865 
866  while ( list_of_stable[ii] != EvtId( -1, -1 ) ) {
867  if ( getId() == list_of_stable[ii] ) {
868  secondary.createSecondary( 0, this );
869  return;
870  }
871  ii++;
872  }
873 
874  for ( size_t i = 0; i < _ndaug; i++ ) {
875  stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(), 0, 0,
876  EvtPDL::getStdHep( _daug[i]->getId() ) );
877  }
878 
879  for ( size_t i = 0; i < _ndaug; i++ ) {
880  _daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep, secondary, list_of_stable );
881  }
882  return;
883 }
884 
886 {
887  //first add particle to the stdhep list;
888  stdhep.createParticle( getP4Lab(), get4Pos(), -1, -1,
889  EvtPDL::getStdHep( getId() ) );
890 
891  for ( size_t i = 0; i < _ndaug; i++ ) {
892  stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(), 0, 0,
893  EvtPDL::getStdHep( _daug[i]->getId() ) );
894  }
895 
896  for ( size_t i = 0; i < _ndaug; i++ ) {
897  _daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep );
898  }
899  return;
900 }
901 
902 void EvtParticle::makeStdHepRec( int firstparent, int lastparent,
903  EvtStdHep& stdhep, EvtSecondary& secondary,
904  EvtId* list_of_stable )
905 {
906  int ii = 0;
907 
908  //lets see if this is a longlived particle and terminate the
909  //list building!
910 
911  while ( list_of_stable[ii] != EvtId( -1, -1 ) ) {
912  if ( getId() == list_of_stable[ii] ) {
913  secondary.createSecondary( firstparent, this );
914  return;
915  }
916  ii++;
917  }
918 
919  int parent_num = stdhep.getNPart();
920  for ( size_t i = 0; i < _ndaug; i++ ) {
921  stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(),
922  firstparent, lastparent,
923  EvtPDL::getStdHep( _daug[i]->getId() ) );
924  }
925 
926  for ( size_t i = 0; i < _ndaug; i++ ) {
927  _daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep,
928  secondary, list_of_stable );
929  }
930  return;
931 }
932 
933 void EvtParticle::makeStdHepRec( int firstparent, int lastparent,
934  EvtStdHep& stdhep )
935 {
936  int parent_num = stdhep.getNPart();
937  for ( size_t i = 0; i < _ndaug; i++ ) {
938  stdhep.createParticle( _daug[i]->getP4Lab(), _daug[i]->get4Pos(),
939  firstparent, lastparent,
940  EvtPDL::getStdHep( _daug[i]->getId() ) );
941  }
942 
943  for ( size_t i = 0; i < _ndaug; i++ ) {
944  _daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep );
945  }
946  return;
947 }
948 
949 void EvtParticle::printTreeRec( unsigned int level ) const
950 {
951  size_t newlevel, i;
952  newlevel = level + 1;
953 
954  if ( _ndaug != 0 ) {
955  if ( level > 0 ) {
956  for ( i = 0; i < ( 5 * level ); i++ ) {
957  EvtGenReport( EVTGEN_INFO, "" ) << " ";
958  }
959  }
960  EvtGenReport( EVTGEN_INFO, "" ) << EvtPDL::name( _id ).c_str();
961  EvtGenReport( EVTGEN_INFO, "" ) << " -> ";
962  for ( i = 0; i < _ndaug; i++ ) {
964  << EvtPDL::name( _daug[i]->getId() ).c_str() << " ";
965  }
966  for ( i = 0; i < _ndaug; i++ ) {
968  << _daug[i]->mass() << " " << _daug[i]->getP4() << " "
969  << _daug[i]->getSpinStates() << "; ";
970  }
971  EvtGenReport( EVTGEN_INFO, "" ) << endl;
972  for ( i = 0; i < _ndaug; i++ ) {
973  _daug[i]->printTreeRec( newlevel );
974  }
975  }
976 }
977 
979 {
980  EvtGenReport( EVTGEN_INFO, "EvtGen" )
981  << "This is the current decay chain" << endl;
983  << "This top particle is " << EvtPDL::name( _id ).c_str() << " "
984  << this->mass() << " " << this->getP4() << endl;
985 
986  this->printTreeRec( 0 );
987  EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "End of decay chain." << endl;
988 }
989 
990 std::string EvtParticle::treeStrRec( unsigned int level ) const
991 {
992  size_t newlevel, i;
993  newlevel = level + 1;
994 
995  std::string retval = "";
996 
997  for ( i = 0; i < _ndaug; i++ ) {
998  retval += EvtPDL::name( _daug[i]->getId() );
999  if ( _daug[i]->getNDaug() > 0 ) {
1000  retval += " (";
1001  retval += _daug[i]->treeStrRec( newlevel );
1002  retval += ") ";
1003  } else {
1004  if ( i + 1 != _ndaug )
1005  retval += " ";
1006  }
1007  }
1008 
1009  return retval;
1010 }
1011 
1012 std::string EvtParticle::treeStr() const
1013 {
1014  std::string retval = EvtPDL::name( _id );
1015  retval += " -> ";
1016 
1017  retval += treeStrRec( 0 );
1018 
1019  return retval;
1020 }
1021 
1023 {
1024  switch ( EvtPDL::getSpinType( _id ) ) {
1025  case EvtSpinType::SCALAR:
1026  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1027  << "This is a scalar particle:" << EvtPDL::name( _id ).c_str()
1028  << "\n";
1029  break;
1030  case EvtSpinType::VECTOR:
1031  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1032  << "This is a vector particle:" << EvtPDL::name( _id ).c_str()
1033  << "\n";
1034  break;
1035  case EvtSpinType::TENSOR:
1036  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1037  << "This is a tensor particle:" << EvtPDL::name( _id ).c_str()
1038  << "\n";
1039  break;
1040  case EvtSpinType::DIRAC:
1041  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1042  << "This is a dirac particle:" << EvtPDL::name( _id ).c_str()
1043  << "\n";
1044  break;
1045  case EvtSpinType::PHOTON:
1046  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1047  << "This is a photon:" << EvtPDL::name( _id ).c_str() << "\n";
1048  break;
1049  case EvtSpinType::NEUTRINO:
1050  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1051  << "This is a neutrino:" << EvtPDL::name( _id ).c_str() << "\n";
1052  break;
1053  case EvtSpinType::STRING:
1054  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1055  << "This is a string:" << EvtPDL::name( _id ).c_str() << "\n";
1056  break;
1057  default:
1058  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1059  << "Unknown particle type in EvtParticle::printParticle()"
1060  << endl;
1061  break;
1062  }
1063  EvtGenReport( EVTGEN_INFO, "EvtGen" )
1064  << "Number of daughters:" << _ndaug << "\n";
1065 }
1066 
1067 void init_vector( EvtParticle** part )
1068 {
1069  *part = new EvtVectorParticle;
1070 }
1071 
1072 void init_scalar( EvtParticle** part )
1073 {
1074  *part = new EvtScalarParticle;
1075 }
1076 
1077 void init_tensor( EvtParticle** part )
1078 {
1079  *part = new EvtTensorParticle;
1080 }
1081 
1082 void init_dirac( EvtParticle** part )
1083 {
1084  *part = new EvtDiracParticle;
1085 }
1086 
1087 void init_photon( EvtParticle** part )
1088 {
1089  *part = new EvtPhotonParticle;
1090 }
1091 
1093 {
1094  *part = new EvtNeutrinoParticle;
1095 }
1096 
1097 void init_string( EvtParticle** part )
1098 {
1099  *part = new EvtStringParticle;
1100 }
1101 
1102 double EvtParticle::initializePhaseSpace( unsigned int numdaughter,
1103  EvtId* daughters,
1104  bool forceDaugMassReset,
1105  double poleSize, int whichTwo1,
1106  int whichTwo2 )
1107 {
1108  double m_b;
1109  unsigned int i;
1110  //lange
1111  // this->makeDaughters(numdaughter,daughters);
1112 
1113  static EvtVector4R p4[100];
1114  static double mass[100];
1115 
1116  m_b = this->mass();
1117 
1118  //lange - Jan2,2002 - Need to check to see if the daughters of the parent
1119  // have changed. If so, delete them and start over.
1120  //EvtGenReport(EVTGEN_INFO,"EvtGen") << "the parent is\n";
1121  //if ( this->getParent() ) {
1122  // if ( this->getParent()->getParent() ) this->getParent()->getParent()->printTree();
1123  // this->getParent()->printTree();
1124  //}
1125  //EvtGenReport(EVTGEN_INFO,"EvtGen") << "and this is\n";
1126  //if ( this) this->printTree();
1127  bool resetDaughters = false;
1128 
1129  if ( numdaughter != this->getNDaug() && this->getNDaug() > 0 )
1130  resetDaughters = true;
1131  if ( numdaughter == this->getNDaug() )
1132  for ( i = 0; i < numdaughter; i++ ) {
1133  if ( this->getDaug( i )->getId() != daughters[i] )
1134  resetDaughters = true;
1135  //EvtGenReport(EVTGEN_INFO,"EvtGen") << EvtPDL::name(this->getDaug(i)->getId())
1136  // << " " << EvtPDL::name(daughters[i]) << endl;
1137  }
1138 
1139  if ( resetDaughters || forceDaugMassReset ) {
1140  bool t1 = true;
1141  //but keep the decay channel of the parent.
1142  this->deleteDaughters( t1 );
1143  this->makeDaughters( numdaughter, daughters );
1144  bool massTreeOK = this->generateMassTree();
1145  if ( massTreeOK == false ) {
1146  return 0.0;
1147  }
1148  }
1149 
1150  double weight = 0.;
1151  for ( i = 0; i < numdaughter; i++ ) {
1152  mass[i] = this->getDaug( i )->mass();
1153  }
1154 
1155  if ( poleSize < -0.1 ) {
1156  //special case to enforce 4-momentum conservation in 1->1 decays
1157  if ( numdaughter == 1 ) {
1158  this->getDaug( 0 )->init( daughters[0],
1159  EvtVector4R( m_b, 0.0, 0.0, 0.0 ) );
1160  } else {
1161  EvtGenKine::PhaseSpace( numdaughter, mass, p4, m_b );
1162  for ( i = 0; i < numdaughter; i++ ) {
1163  this->getDaug( i )->init( daughters[i], p4[i] );
1164  }
1165  }
1166  } else {
1167  if ( numdaughter != 3 ) {
1168  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1169  << "Only can generate pole phase space "
1170  << "distributions for 3 body final states" << endl
1171  << "Will terminate." << endl;
1172  ::abort();
1173  }
1174  bool ok = false;
1175  if ( ( whichTwo1 == 1 && whichTwo2 == 0 ) ||
1176  ( whichTwo1 == 0 && whichTwo2 == 1 ) ) {
1177  weight = EvtGenKine::PhaseSpacePole( m_b, mass[0], mass[1], mass[2],
1178  poleSize, p4 );
1179  this->getDaug( 0 )->init( daughters[0], p4[0] );
1180  this->getDaug( 1 )->init( daughters[1], p4[1] );
1181  this->getDaug( 2 )->init( daughters[2], p4[2] );
1182  ok = true;
1183  }
1184  if ( ( whichTwo1 == 1 && whichTwo2 == 2 ) ||
1185  ( whichTwo1 == 2 && whichTwo2 == 1 ) ) {
1186  weight = EvtGenKine::PhaseSpacePole( m_b, mass[2], mass[1], mass[0],
1187  poleSize, p4 );
1188  this->getDaug( 0 )->init( daughters[0], p4[2] );
1189  this->getDaug( 1 )->init( daughters[1], p4[1] );
1190  this->getDaug( 2 )->init( daughters[2], p4[0] );
1191  ok = true;
1192  }
1193  if ( ( whichTwo1 == 0 && whichTwo2 == 2 ) ||
1194  ( whichTwo1 == 2 && whichTwo2 == 0 ) ) {
1195  weight = EvtGenKine::PhaseSpacePole( m_b, mass[1], mass[0], mass[2],
1196  poleSize, p4 );
1197  this->getDaug( 0 )->init( daughters[0], p4[1] );
1198  this->getDaug( 1 )->init( daughters[1], p4[0] );
1199  this->getDaug( 2 )->init( daughters[2], p4[2] );
1200  ok = true;
1201  }
1202  if ( !ok ) {
1203  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1204  << "Invalid pair of particle to generate a pole dist "
1205  << whichTwo1 << " " << whichTwo2 << endl
1206  << "Will terminate." << endl;
1207  ::abort();
1208  }
1209  }
1210 
1211  return weight;
1212 }
1213 
1214 void EvtParticle::makeDaughters( unsigned int ndaugstore,
1215  std::vector<EvtId> idVector )
1216 {
1217  // Convert the STL vector method to use the array method for now, since the
1218  // array method pervades most of the EvtGen code...
1219 
1220  unsigned int nVector = idVector.size();
1221  if ( nVector < ndaugstore ) {
1222  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1223  << "Asking to make " << ndaugstore << " daughters when there "
1224  << "are only " << nVector << " EvtId values available" << endl;
1225  return;
1226  }
1227 
1228  EvtId* idArray = new EvtId[ndaugstore];
1229  unsigned int i;
1230  for ( i = 0; i < ndaugstore; i++ ) {
1231  idArray[i] = idVector[i];
1232  }
1233 
1234  this->makeDaughters( ndaugstore, idArray );
1235 
1236  delete[] idArray;
1237 }
1238 
1239 void EvtParticle::makeDaughters( unsigned int ndaugstore, EvtId* id )
1240 {
1241  unsigned int i;
1242  if ( _channel < 0 ) {
1243  setChannel( 0 );
1244  }
1245  EvtParticle* pdaug;
1246  if ( _ndaug != 0 ) {
1247  if ( _ndaug != ndaugstore ) {
1248  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1249  << "Asking to make a different number of "
1250  << "daughters than what was previously created." << endl;
1251  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1252  << "Original parent:" << EvtPDL::name( _id ) << endl;
1253  for ( size_t i = 0; i < _ndaug; i++ ) {
1254  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1255  << "Original daugther:"
1256  << EvtPDL::name( getDaug( i )->getId() ) << endl;
1257  }
1258  for ( size_t i = 0; i < ndaugstore; i++ ) {
1259  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
1260  << "New Daug:" << EvtPDL::name( id[i] ) << endl;
1261  }
1262  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Will terminate." << endl;
1263  ::abort();
1264  }
1265  } else {
1266  for ( i = 0; i < ndaugstore; i++ ) {
1268  EvtPDL::getSpinType( id[i] ) );
1269  pdaug->setId( id[i] );
1270  pdaug->addDaug( this );
1271  }
1272 
1273  } //else
1274 } //makeDaughters
1275 
1276 void EvtParticle::setDecayProb( double prob )
1277 {
1278  if ( _decayProb == 0 )
1279  _decayProb = new double;
1280  *_decayProb = prob;
1281 }
1282 
1284 {
1285  std::string theName = _id.getName();
1286  return theName;
1287 }
1288 
1289 int EvtParticle::getAttribute( std::string attName )
1290 {
1291  // Retrieve the attribute integer if the name exists.
1292  // Otherwise, simply return 0
1293 
1294  int attValue = 0;
1295 
1296  EvtAttIntMap::iterator mapIter;
1297 
1298  if ( ( mapIter = _intAttributes.find( attName ) ) != _intAttributes.end() ) {
1299  attValue = mapIter->second;
1300  }
1301 
1302  return attValue;
1303 }
1304 
1305 double EvtParticle::getAttributeDouble( std::string attName )
1306 {
1307  // Retrieve the attribute double if the name exists.
1308  // Otherwise, simply return 0.0
1309 
1310  double attValue = 0.0;
1311 
1312  EvtAttDblMap::iterator mapIter;
1313 
1314  if ( ( mapIter = _dblAttributes.find( attName ) ) != _dblAttributes.end() ) {
1315  attValue = mapIter->second;
1316  }
1317 
1318  return attValue;
1319 }
virtual EvtTensor4C epsTensorParent(int i) const
virtual EvtVector4C epsPhoton(int i)
void setMass(double m)
Definition: EvtParticle.hh:392
double compMassProb()
void setChannel(int i)
Definition: EvtParticle.cpp:86
void createSecondary(int stdhepindex, EvtParticle *prnt)
EvtSpinDensity _rhoForward
Definition: EvtParticle.hh:480
size_t _ndaug
Definition: EvtParticle.hh:467
static std::string name(EvtId i)
Definition: EvtPDL.cpp:382
void printTreeRec(unsigned int level) const
void resetFirstOrNot()
Definition: EvtParticle.cpp:81
virtual EvtRaritaSchwinger spRSParent(int) const
void printParticle() const
virtual int nRealDaughters()
void setDecayProb(double p)
virtual EvtVector4C eps(int i) const
static double PhaseSpacePole(double M, double m1, double m2, double m3, double a, EvtVector4R p4[10])
Definition: EvtGenKine.cpp:263
static EvtDecayTable * getInstance()
std::string treeStr() const
void setDiag(int n)
virtual EvtDiracSpinor sp(int) const
EvtParticle * getParent() const
Definition: EvtParticle.cpp:96
std::string getName()
void init_photon(EvtParticle **part)
std::string getName() const
Definition: EvtId.cpp:41
void init_tensor(EvtParticle **part)
EvtSpinType::spintype getSpinType() const
void createParticle(EvtVector4R p4, EvtVector4R x, int prntfirst, int prntlast, int id)
Definition: EvtStdHep.cpp:40
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
void makeStdHepRec(int firstparent, int lastparent, EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
void init_vector(EvtParticle **part)
EvtVector4R getP4Lab() const
std::string treeStrRec(unsigned int level) const
virtual EvtRaritaSchwinger spRS(int) const
int getNPart()
Definition: EvtStdHep.cpp:35
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtAttIntMap _intAttributes
Definition: EvtParticle.hh:459
static double getMassProb(EvtId i, double mass, double massPar, int nDaug, double *massDau)
Definition: EvtPDL.cpp:331
void initDecay(bool useMinMass=false)
Evt3Rank3C conj(const Evt3Rank3C &t2)
Definition: Evt3Rank3C.cpp:172
const EvtComplex & get(int i, int j) const
void insertDaugPtr(int idaug, EvtParticle *partptr)
Definition: EvtParticle.hh:220
double mass() const
Definition: EvtVector4R.cpp:49
static double getctau(EvtId i)
Definition: EvtPDL.cpp:357
EvtAttDblMap _dblAttributes
Definition: EvtParticle.hh:463
double * _decayProb
Definition: EvtParticle.hh:495
static double getMeanMass(EvtId i)
Definition: EvtPDL.cpp:314
int getSpinStates() const
virtual EvtVector4C epsParentPhoton(int i)
EvtId getId() const
static int getSpinStates(spintype stype)
Definition: EvtSpinType.cpp:57
void makeDaughters(unsigned int ndaug, EvtId *id)
EvtVector4R get4Pos() const
void set(int i, double d)
Definition: EvtVector4R.hh:167
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
virtual EvtDiracSpinor spParent(int) const
void setLifetime(double tau)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
bool hasValidP4()
Definition: EvtParticle.hh:403
EvtParticle * _parent
Definition: EvtParticle.hh:468
Definition: EvtId.hh:27
size_t getNDaug() const
EvtVector4R _p
Definition: EvtParticle.hh:472
EvtDecayBase * getDecayFunc(EvtParticle *p)
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
EvtVector4R getP4LabBeforeFSR()
bool generateMassTree()
void printTree() const
void incoherentMix(const EvtId id, double &t, int &mix)
Definition: EvtCPUtil.cpp:461
int getAttribute(std::string attName)
virtual void makeDecay(EvtParticle *p, bool recursive=true)=0
void setId(EvtId id)
Definition: EvtParticle.hh:385
EvtVector4R _pBeforeFSR
Definition: EvtParticle.hh:473
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void deleteTree()
virtual EvtVector4C epsParent(int i) const
virtual EvtSpinDensity rotateToHelicityBasis() const =0
void deleteDaughters(bool keepChannel=false)
void init_dirac(EvtParticle **part)
EvtParticle * nextIter(EvtParticle *rootOfTree=0)
static double getMinMass(EvtId i)
Definition: EvtPDL.cpp:342
void setLifetime()
static double Flat()
Definition: EvtRandom.cpp:72
void addDaug(EvtParticle *node)
void init_string(EvtParticle **part)
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void init(EvtId part_n, double e, double px, double py, double pz)
int getDim() const
int getChannel() const
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
Definition: EvtGenKine.cpp:46
double mass() const
virtual EvtTensor4C epsTensor(int i) const
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
static double getWidth(EvtId i)
Definition: EvtPDL.cpp:352
virtual EvtDiracSpinor spParentNeutrino() const
int firstornot() const
virtual EvtDiracSpinor spNeutrino() const
int getPDGId() const
void init_scalar(EvtParticle **part)
EvtSpinDensity _rhoBackward
Definition: EvtParticle.hh:481
static EvtCPUtil * getInstance()
Definition: EvtCPUtil.cpp:43
double getLifetime()
double getAttributeDouble(std::string attName)
void setDiagonalSpinDensity()
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
void set(int i, int j, const EvtComplex &rhoij)
int contains(const EvtId id)
Definition: EvtIdSet.cpp:422
static double getMass(EvtId i)
Definition: EvtPDL.cpp:319
void makeStdHep(EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
EvtParticle * _daug[MAX_DAUG]
Definition: EvtParticle.hh:466
void setDim(int n)
EvtVector4R getP4Restframe() const
static EvtId chargeConj(EvtId id)
Definition: EvtPDL.cpp:207
static int getStdHep(EvtId id)
Definition: EvtPDL.cpp:362
void setFirstOrNot()
Definition: EvtParticle.cpp:77
static double getRandMass(EvtId i, EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
Definition: EvtPDL.cpp:324
void setVectorSpinDensity()
virtual ~EvtParticle()
Definition: EvtParticle.cpp:55
void init_neutrino(EvtParticle **part)