CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
pdg Namespace Reference

Functions

double cTau (int pdgID, const HepPDT::ParticleDataTable *pdt)
 
double mass (int pdgID, const HepPDT::ParticleDataTable *pdt)
 

Variables

static constexpr double kInvalidCtau = 1E99
 
static constexpr double kInvalidMass = -99999
 

Function Documentation

double pdg::cTau ( int  pdgID,
const HepPDT::ParticleDataTable pdt 
)

Definition at line 26 of file pdg_functions.cc.

References funct::abs(), info(), kInvalidCtau, and w.

Referenced by lhef::LHEEvent::asHepMCEvent(), ParticlePropagator::initProperDecayTime(), and TrajectoryManager::reconstruct().

26  {
27  auto info = theTable->particle(HepPDT::ParticleID(pdgID));
28  double ct = kInvalidCtau;
29  if (info) {
30  // The lifetime is 0. in the Pythia Particle Data Table !
31  // ct=tab->theTable()->particle(ParticleID(myId))->lifetime().value();
32 
33  // Get it from the width (apparently Gamma/c!)
34  double w = info->totalWidth().value();
35  if (w != 0. && pdgID != 1000022) {
36  ct = 6.582119e-25 / w / 10.; // ctau in cm
37  } else {
38  // Temporary fix of a bug in the particle data table
39  unsigned amyId = abs(pdgID);
40  if (amyId != 22 && // photon
41  amyId != 11 && // e+/-
42  amyId != 10 && // nu_e
43  amyId != 12 && // nu_mu
44  amyId != 14 && // nu_tau
45  amyId != 1000022 && // Neutralino
46  amyId != 1000039 && // Gravitino
47  amyId != 2112 && // neutron/anti-neutron
48  amyId != 2212 && // proton/anti-proton
49  amyId != 101 && // Deutreron etc..
50  amyId != 102 && // Deutreron etc..
51  amyId != 103 && // Deutreron etc..
52  amyId != 104) { // Deutreron etc..
53  ct = 0.;
54  /* */
55  }
56  }
57  }
58 
59  /*
60  std::cout << setw(20) << setprecision(18)
61  << "myId/ctau/width = " << myId << " "
62  << ct << " " << w << endl;
63  */
64  return ct;
65 }
static const TGPicture * info(bool iBackgroundIsBlack)
const double w
Definition: UKUtility.cc:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double kInvalidCtau
Definition: pdg_functions.h:32
double pdg::mass ( int  pdgID,
const HepPDT::ParticleDataTable pdt 
)

Definition at line 18 of file pdg_functions.cc.

References info(), and kInvalidMass.

Referenced by FBaseSimEvent::addSimTrack().

18  {
19  auto info = theTable->particle(HepPDT::ParticleID(pdgID));
20  if (info) {
21  return info->mass().value();
22  }
23  return kInvalidMass;
24 }
static const TGPicture * info(bool iBackgroundIsBlack)
static constexpr double kInvalidMass
Definition: pdg_functions.h:29

Variable Documentation

constexpr double pdg::kInvalidCtau = 1E99
static

Definition at line 32 of file pdg_functions.h.

Referenced by cTau().

constexpr double pdg::kInvalidMass = -99999
static

Definition at line 29 of file pdg_functions.h.

Referenced by mass().