CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
CustomPDGParser Class Reference

#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_isChargino (int pdg)
 
static bool s_isDphoton (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_isSIMP (int pdg)
 
static bool s_isSLepton (int pdg)
 
static bool s_isstopHadron (int pdg)
 
static double s_spin (int pdg)
 

Detailed Description

Definition at line 7 of file CustomPDGParser.h.

Member Function Documentation

double CustomPDGParser::s_charge ( int  pdg)
static

Definition at line 90 of file CustomPDGParser.cc.

References funct::abs(), DeDxDiscriminatorTools::charge(), lumiQueryAPI::q, s_containedQuarks(), s_containedQuarksCode(), s_isChargino(), s_isDphoton(), s_isMesonino(), s_isRBaryon(), s_isRMeson(), s_isSbaryon(), s_issbottomHadron(), s_isSIMP(), and s_isSLepton().

Referenced by CustomParticleFactory::addCustomParticle().

91 {
92  float charge=0,sign=1;
93  int pdgAbs=abs(pdg);
94  if(pdg < 0 ) sign=-1;
95 
96  if(s_isSLepton(pdg)) //Sleptons
97  {
98  if(pdgAbs %2 == 0)
99  return 0;
100  else
101  return -sign;
102  }
103 
104  if(s_isDphoton(pdg)){
105  return charge;
106  }
107  if (s_isChargino(pdg)) {
108  return sign;
109  }
110  if (s_isSIMP(pdg)) {
111  return 0;
112  }
113  if(s_isRMeson(pdg))
114  {
115  std::vector<int> quarks = s_containedQuarks(pdg);
116  if((quarks[1] % 2 == 0 && quarks[0] % 2 == 1)||(quarks[1] % 2 == 1 && quarks[0] % 2 == 0 )) charge=1;
117  charge*=sign;
118  return charge;
119  }
120 
121  if(s_isRBaryon(pdg))
122  {
123  int baryon = s_containedQuarksCode(pdg);
124  for(int q=1; q< 1000; q*=10)
125  {
126  if(baryon / q % 2 == 0) charge+=2; else charge -=1;
127  }
128  charge/=3;
129  charge*=sign;
130  return charge;
131  }
132 
133  if(s_isMesonino(pdg))
134  {
135  int quark = s_containedQuarks(pdg)[0];
136  int squark = abs(pdg/100%10);
137  if (squark % 2 == 0 && quark % 2 == 1) charge = 1;
138  if (squark % 2 == 1 && quark % 2 == 0) charge = 1;
139  charge *= sign;
140  if(s_issbottomHadron(pdg)) charge*=-1;
141  return charge;
142  }
143 
144  if(s_isSbaryon(pdg))
145  {
146  int baryon = s_containedQuarksCode(pdg)+100*(abs(pdg/1000%10));//Adding the squark back on
147  for(int q=1; q< 1000; q*=10)
148  {
149  if(baryon / q % 2 == 0) charge+=2; else charge -=1;
150  }
151  charge/=3;
152  charge*=sign;
153  if(s_issbottomHadron(pdg)) charge*=-1;
154  return charge;
155  }
156 
157 return 0;
158 }
static int s_containedQuarksCode(int pdg)
static bool s_isDphoton(int pdg)
static bool s_isSbaryon(int pdg)
static bool s_isRMeson(int pdg)
double charge(const std::vector< uint8_t > &Ampls)
static bool s_isMesonino(int pdg)
static bool s_isSIMP(int pdg)
static bool s_isSLepton(int pdg)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static bool s_isChargino(int pdg)
static bool s_isRBaryon(int pdg)
static std::vector< int > s_containedQuarks(int pdg)
static bool s_issbottomHadron(int pdg)
std::vector< int > CustomPDGParser::s_containedQuarks ( int  pdg)
static

Definition at line 172 of file CustomPDGParser.cc.

References i, and s_containedQuarksCode().

Referenced by s_charge().

173 {
174  std::vector<int> quarks;
175  for(int i=s_containedQuarksCode(pdg); i > 0; i /= 10)
176  {
177  quarks.push_back(i % 10);
178  }
179  return quarks;
180 }
static int s_containedQuarksCode(int pdg)
int i
Definition: DBlmapReader.cc:9
int CustomPDGParser::s_containedQuarksCode ( int  pdg)
static

Definition at line 182 of file CustomPDGParser.cc.

References funct::abs(), s_isMesonino(), s_isRBaryon(), s_isRMeson(), and s_isSbaryon().

Referenced by s_charge(), and s_containedQuarks().

183 {
184  int pdgAbs=abs(pdg);
185  if(s_isRBaryon(pdg))
186  return pdgAbs / 10 % 1000;
187 
188  if(s_isRMeson(pdg))
189  return pdgAbs / 10 % 100;
190 
191  if(s_isMesonino(pdg))
192  return pdgAbs / 10 % 1000 % 10;
193 
194  if(s_isSbaryon(pdg))
195  return pdgAbs / 10 % 1000 % 100;
196 
197 
198 return 0;
199 }
static bool s_isSbaryon(int pdg)
static bool s_isRMeson(int pdg)
static bool s_isMesonino(int pdg)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static bool s_isRBaryon(int pdg)
bool CustomPDGParser::s_isChargino ( int  pdg)
static

Definition at line 77 of file CustomPDGParser.cc.

References funct::abs().

Referenced by s_charge().

78 {
79  int pdgAbs = abs(pdg);
80  return (pdgAbs == 1000024);
81 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isDphoton ( int  pdg)
static

Definition at line 48 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), and s_charge().

49 {
50  int pdgAbs=abs(pdg);
51  return (pdgAbs == 1072000);
52 
53 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isMesonino ( int  pdg)
static

Definition at line 62 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), s_charge(), and s_containedQuarksCode().

63 {
64  int pdgAbs=abs(pdg);
65  return ((pdgAbs % 10000 / 100 == 6 ) || (pdgAbs % 10000 / 100 == 5));
66 
67 
68 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRBaryon ( int  pdg)
static

Definition at line 34 of file CustomPDGParser.cc.

References funct::abs().

Referenced by s_charge(), and s_containedQuarksCode().

35 {
36  int pdgAbs=abs(pdg);
37  return (pdgAbs % 100000 / 10000 == 9);
38 
39 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRGlueball ( int  pdg)
static

Definition at line 41 of file CustomPDGParser.cc.

References funct::abs().

Referenced by s_isRHadron().

42 {
43  int pdgAbs=abs(pdg);
44  return (pdgAbs % 100000 / 10 == 99);
45 
46 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRHadron ( int  pdg)
static

Definition at line 10 of file CustomPDGParser.cc.

References funct::abs(), and s_isRGlueball().

Referenced by CustomParticleFactory::addCustomParticle(), and CustomParticleFactory::getMassTable().

11 {
12  int pdgAbs=abs(pdg);
13  return ( (pdgAbs % 100000 / 10000 == 9) || (pdgAbs % 10000 / 1000 == 9) || s_isRGlueball(pdg) );
14 }
static bool s_isRGlueball(int pdg)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRMeson ( int  pdg)
static

Definition at line 55 of file CustomPDGParser.cc.

References funct::abs().

Referenced by s_charge(), and s_containedQuarksCode().

56 {
57  int pdgAbs=abs(pdg);
58  return (pdgAbs % 10000 / 1000 == 9);
59 
60 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isSbaryon ( int  pdg)
static

Definition at line 70 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), s_charge(), and s_containedQuarksCode().

71 {
72  int pdgAbs=abs(pdg);
73  return ((pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 10000 / 1000 == 5));
74 
75 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_issbottomHadron ( int  pdg)
static

Definition at line 22 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), and s_charge().

23 {
24  int pdgAbs=abs(pdg);
25  return ( (pdgAbs % 10000 / 1000 == 5) || (pdgAbs % 10000 / 100 == 5) );
26 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isSIMP ( int  pdg)
static

Definition at line 83 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), CustomParticleFactory::getMassTable(), and s_charge().

84 {
85  int pdgAbs = abs(pdg);
86  return (pdgAbs == 9000006);
87 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isSLepton ( int  pdg)
static

Definition at line 28 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), and s_charge().

29 {
30  int pdgAbs=abs(pdg);
31  return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1);
32 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isstopHadron ( int  pdg)
static

Definition at line 16 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), and CustomParticleFactory::getMassTable().

17 {
18  int pdgAbs=abs(pdg);
19  return ( (pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 1000 / 100 == 6) );
20 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double CustomPDGParser::s_spin ( int  pdg)
static

Definition at line 160 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle().

161 {
162  // The PDG numbering is described in the Review of Particle Physics:
163  // "3. In composite quark systems (diquarks, mesons, and baryons) ...
164  // the rightmost digit nJ = 2J + 1 gives the system's spin."
165  // Since this does not apply to SUSY / exotic particles,
166  // if the spin is important for the simulation
167  // it should be hard-coded based on PDG ID in this function.
168  int pdgAbs=abs(pdg);
169  return pdgAbs % 10;
170 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22