#include <CustomPDGParser.h>
Static Public Member Functions | |
static double | s_charge (int pdg) |
static std::vector< int > | s_containedQuarks (int pdg) |
static int | s_containedQuarksCode (int pdg) |
static bool | s_isMesonino (int pdg) |
static bool | s_isRBaryon (int pdg) |
static bool | s_isRGlueball (int pdg) |
static bool | s_isRHadron (int pdg) |
static bool | s_isRMeson (int pdg) |
static bool | s_isSbaryon (int pdg) |
static bool | s_issbottomHadron (int pdg) |
static bool | s_isSLepton (int pdg) |
static bool | s_isstopHadron (int pdg) |
static double | s_spin (int pdg) |
Definition at line 7 of file CustomPDGParser.h.
double CustomPDGParser::s_charge | ( | int | pdg | ) | [static] |
Definition at line 71 of file CustomPDGParser.cc.
References abs, DeDxDiscriminatorTools::charge(), lumiQueryAPI::q, s_containedQuarks(), s_containedQuarksCode(), s_isMesonino(), s_isRBaryon(), s_isRMeson(), s_isSbaryon(), s_issbottomHadron(), and s_isSLepton().
Referenced by CustomParticleFactory::addCustomParticle().
{ float charge=0,sign=1; int pdgAbs=abs(pdg); if(pdg < 0 ) sign=-1; if(s_isSLepton(pdg)) //Sleptons { if(pdgAbs %2 == 0) return 0; else return -sign; } if(s_isRMeson(pdg)) { std::vector<int> quarks = s_containedQuarks(pdg); if((quarks[1] % 2 == 0 && quarks[0] % 2 == 1)||(quarks[1] % 2 == 1 && quarks[0] % 2 == 0 )) charge=1; charge*=sign; return charge; } if(s_isRBaryon(pdg)) { int baryon = s_containedQuarksCode(pdg); for(int q=1; q< 1000; q*=10) { if(baryon / q % 2 == 0) charge+=2; else charge -=1; } charge/=3; charge*=sign; return charge; } if(s_isMesonino(pdg)) { int quark = s_containedQuarks(pdg)[0]; int squark = abs(pdg/100%10); if (squark % 2 == 0 && quark % 2 == 1) charge = 1; if (squark % 2 == 1 && quark % 2 == 0) charge = 1; charge *= sign; if(s_issbottomHadron(pdg)) charge*=-1; return charge; } if(s_isSbaryon(pdg)) { int baryon = s_containedQuarksCode(pdg)+100*(abs(pdg/1000%10));//Adding the squark back on for(int q=1; q< 1000; q*=10) { if(baryon / q % 2 == 0) charge+=2; else charge -=1; } charge/=3; charge*=sign; if(s_issbottomHadron(pdg)) charge*=-1; return charge; } return 0; }
std::vector< int > CustomPDGParser::s_containedQuarks | ( | int | pdg | ) | [static] |
Definition at line 138 of file CustomPDGParser.cc.
References i, and s_containedQuarksCode().
Referenced by s_charge().
{ std::vector<int> quarks; for(int i=s_containedQuarksCode(pdg); i > 0; i /= 10) { quarks.push_back(i % 10); } return quarks; }
int CustomPDGParser::s_containedQuarksCode | ( | int | pdg | ) | [static] |
Definition at line 148 of file CustomPDGParser.cc.
References abs, s_isMesonino(), s_isRBaryon(), s_isRMeson(), and s_isSbaryon().
Referenced by s_charge(), and s_containedQuarks().
{ int pdgAbs=abs(pdg); if(s_isRBaryon(pdg)) return pdgAbs / 10 % 1000; if(s_isRMeson(pdg)) return pdgAbs / 10 % 100; if(s_isMesonino(pdg)) return pdgAbs / 10 % 1000 % 10; if(s_isSbaryon(pdg)) return pdgAbs / 10 % 1000 % 100; return 0; }
bool CustomPDGParser::s_isMesonino | ( | int | pdg | ) | [static] |
Definition at line 55 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle(), s_charge(), and s_containedQuarksCode().
{ int pdgAbs=abs(pdg); return ((pdgAbs % 10000 / 100 == 6 ) || (pdgAbs % 10000 / 100 == 5)); }
bool CustomPDGParser::s_isRBaryon | ( | int | pdg | ) | [static] |
Definition at line 34 of file CustomPDGParser.cc.
References abs.
Referenced by s_charge(), and s_containedQuarksCode().
{ int pdgAbs=abs(pdg); return (pdgAbs % 100000 / 10000 == 9); }
bool CustomPDGParser::s_isRGlueball | ( | int | pdg | ) | [static] |
Definition at line 41 of file CustomPDGParser.cc.
References abs.
Referenced by s_isRHadron().
{ int pdgAbs=abs(pdg); return (pdgAbs % 100000 / 10 == 99); }
bool CustomPDGParser::s_isRHadron | ( | int | pdg | ) | [static] |
Definition at line 10 of file CustomPDGParser.cc.
References abs, and s_isRGlueball().
Referenced by CustomParticleFactory::addCustomParticle(), and CustomParticleFactory::getMassTable().
{ int pdgAbs=abs(pdg); return ( (pdgAbs % 100000 / 10000 == 9) || (pdgAbs % 10000 / 1000 == 9) || s_isRGlueball(pdg) ); }
bool CustomPDGParser::s_isRMeson | ( | int | pdg | ) | [static] |
Definition at line 48 of file CustomPDGParser.cc.
References abs.
Referenced by s_charge(), and s_containedQuarksCode().
{ int pdgAbs=abs(pdg); return (pdgAbs % 10000 / 1000 == 9); }
bool CustomPDGParser::s_isSbaryon | ( | int | pdg | ) | [static] |
Definition at line 63 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle(), s_charge(), and s_containedQuarksCode().
{ int pdgAbs=abs(pdg); return ((pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 10000 / 1000 == 5)); }
bool CustomPDGParser::s_issbottomHadron | ( | int | pdg | ) | [static] |
Definition at line 22 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle(), and s_charge().
{ int pdgAbs=abs(pdg); return ( (pdgAbs % 10000 / 1000 == 5) || (pdgAbs % 10000 / 100 == 5) ); }
bool CustomPDGParser::s_isSLepton | ( | int | pdg | ) | [static] |
Definition at line 28 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle(), and s_charge().
{ int pdgAbs=abs(pdg); return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1); }
bool CustomPDGParser::s_isstopHadron | ( | int | pdg | ) | [static] |
Definition at line 16 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle(), and CustomParticleFactory::getMassTable().
{ int pdgAbs=abs(pdg); return ( (pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 1000 / 100 == 6) ); }
double CustomPDGParser::s_spin | ( | int | pdg | ) | [static] |
Definition at line 132 of file CustomPDGParser.cc.
References abs.
Referenced by CustomParticleFactory::addCustomParticle().
{ int pdgAbs=abs(pdg); return pdgAbs % 10; }