Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:18

0001 // -*- C++ -*-
0002 //
0003 // Package:     FastSimulation/Particle
0004 // Class  :     pdg_functions
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Mon, 04 Mar 2019 19:53:06 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FastSimulation/Particle/interface/pdg_functions.h"
0017 
0018 double pdg::mass(int pdgID, HepPDT::ParticleDataTable const* theTable) {
0019   auto info = theTable->particle(HepPDT::ParticleID(pdgID));
0020   if (info) {
0021     return info->mass().value();
0022   }
0023   return kInvalidMass;
0024 }
0025 
0026 double pdg::cTau(int pdgID, HepPDT::ParticleDataTable const* theTable) {
0027   auto info = theTable->particle(HepPDT::ParticleID(pdgID));
0028   double ct = kInvalidCtau;
0029   if (info) {
0030     // The lifetime is 0. in the Pythia Particle Data Table !
0031     //    ct=tab->theTable()->particle(ParticleID(myId))->lifetime().value();
0032 
0033     // Get it from the width (apparently Gamma/c!)
0034     double w = info->totalWidth().value();
0035     if (w != 0. && pdgID != 1000022) {
0036       ct = 6.582119e-25 / w / 10.;  // ctau in cm
0037     } else {
0038       // Temporary fix of a bug in the particle data table
0039       unsigned amyId = abs(pdgID);
0040       if (amyId != 22 &&       // photon
0041           amyId != 11 &&       // e+/-
0042           amyId != 10 &&       // nu_e
0043           amyId != 12 &&       // nu_mu
0044           amyId != 14 &&       // nu_tau
0045           amyId != 1000022 &&  // Neutralino
0046           amyId != 1000039 &&  // Gravitino
0047           amyId != 2112 &&     // neutron/anti-neutron
0048           amyId != 2212 &&     // proton/anti-proton
0049           amyId != 101 &&      // Deutreron etc..
0050           amyId != 102 &&      // Deutreron etc..
0051           amyId != 103 &&      // Deutreron etc..
0052           amyId != 104) {      // Deutreron etc..
0053         ct = 0.;
0054         /* */
0055       }
0056     }
0057   }
0058 
0059   /*
0060   std::cout << setw(20) << setprecision(18) 
0061        << "myId/ctau/width = " << myId << " " 
0062        << ct << " " << w << endl;  
0063   */
0064   return ct;
0065 }