CMS 3D CMS Logo

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_isgluinoHadron (int pdg)
 
static bool s_isMesonino (int pdg)
 
static bool s_isRBaryon (int pdg)
 
static bool s_isRGlueball (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)
 

Detailed Description

Definition at line 6 of file CustomPDGParser.h.

Member Function Documentation

double CustomPDGParser::s_charge ( int  pdg)
static

Definition at line 66 of file CustomPDGParser.cc.

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

Referenced by CustomParticleFactory::addCustomParticle().

66  {
67  float charge = 0, sign = 1;
68  int pdgAbs = abs(pdg);
69  if (pdg < 0)
70  sign = -1;
71 
72  if (s_isSLepton(pdg)) //Sleptons
73  {
74  if (pdgAbs % 2 == 0)
75  return 0;
76  else
77  return -sign;
78  }
79 
80  if (s_isDphoton(pdg)) {
81  return charge;
82  }
83  if (s_isChargino(pdg)) {
84  return sign;
85  }
86  if (s_isRMeson(pdg)) {
87  std::vector<int> quarks = s_containedQuarks(pdg);
88  if ((quarks[1] % 2 == 0 && quarks[0] % 2 == 1) || (quarks[1] % 2 == 1 && quarks[0] % 2 == 0))
89  charge = 1;
90  charge *= sign;
91  return charge;
92  }
93 
94  if (s_isRBaryon(pdg)) {
95  int baryon = s_containedQuarksCode(pdg);
96  for (int q = 1; q < 1000; q *= 10) {
97  if (baryon / q % 2 == 0)
98  charge += 2;
99  else
100  charge -= 1;
101  }
102  charge /= 3;
103  charge *= sign;
104  return charge;
105  }
106 
107  if (s_isMesonino(pdg)) {
108  int quark = s_containedQuarks(pdg)[0];
109  int squark = abs(pdg / 100 % 10);
110  if (squark % 2 == 0 && quark % 2 == 1)
111  charge = 1;
112  if (squark % 2 == 1 && quark % 2 == 0)
113  charge = 1;
114  charge *= sign;
115  if (s_issbottomHadron(pdg))
116  charge *= -1;
117  return charge;
118  }
119 
120  if (s_isSbaryon(pdg)) {
121  int baryon = s_containedQuarksCode(pdg) + 100 * (abs(pdg / 1000 % 10)); //Adding the squark back on
122  for (int q = 1; q < 1000; q *= 10) {
123  if (baryon / q % 2 == 0)
124  charge += 2;
125  else
126  charge -= 1;
127  }
128  charge /= 3;
129  charge *= sign;
130  if (s_issbottomHadron(pdg))
131  charge *= -1;
132  return charge;
133  }
134 
135  return 0;
136 }
static int s_containedQuarksCode(int pdg)
static bool s_isDphoton(int pdg)
static bool s_isSbaryon(int pdg)
static bool s_isRMeson(int pdg)
static bool s_isMesonino(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 149 of file CustomPDGParser.cc.

References mps_fire::i, and s_containedQuarksCode().

Referenced by G4ProcessHelper::GetInclusiveCrossSection(), HadronicProcessHelper::inclusiveCrossSection(), and s_charge().

149  {
150  std::vector<int> quarks;
151  for (int i = s_containedQuarksCode(pdg); i > 0; i /= 10) {
152  quarks.push_back(i % 10);
153  }
154  return quarks;
155 }
static int s_containedQuarksCode(int pdg)
int CustomPDGParser::s_containedQuarksCode ( int  pdg)
static

Definition at line 157 of file CustomPDGParser.cc.

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

Referenced by s_charge(), and s_containedQuarks().

157  {
158  int pdgAbs = abs(pdg);
159  if (s_isRBaryon(pdg))
160  return pdgAbs / 10 % 1000;
161 
162  if (s_isRMeson(pdg))
163  return pdgAbs / 10 % 100;
164 
165  if (s_isMesonino(pdg))
166  return pdgAbs / 10 % 1000 % 10;
167 
168  if (s_isSbaryon(pdg))
169  return pdgAbs / 10 % 1000 % 100;
170 
171  return 0;
172 }
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 61 of file CustomPDGParser.cc.

References funct::abs().

Referenced by s_charge().

61  {
62  int pdgAbs = abs(pdg);
63  return (pdgAbs == 1000024);
64 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isDphoton ( int  pdg)
static

Definition at line 41 of file CustomPDGParser.cc.

References funct::abs().

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

41  {
42  int pdgAbs = abs(pdg);
43  return (pdgAbs == 1072000) || (pdgAbs == 1023);
44 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isgluinoHadron ( int  pdg)
static

Definition at line 11 of file CustomPDGParser.cc.

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

Referenced by CustomParticleFactory::addCustomParticle(), CustomPhysicsListSS::ConstructProcess(), CustomPhysicsList::ConstructProcess(), 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_isMesonino ( int  pdg)
static

Definition at line 51 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), G4ProcessHelper::GetFinalState(), G4ProcessHelper::GetInclusiveCrossSection(), FullModelHadronicProcess::PostStepDoIt(), s_charge(), and s_containedQuarksCode().

51  {
52  int pdgAbs = abs(pdg);
53  return ((pdgAbs % 10000 / 100 == 6) || (pdgAbs % 10000 / 100 == 5));
54 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRBaryon ( int  pdg)
static

Definition at line 31 of file CustomPDGParser.cc.

References funct::abs().

Referenced by G4ProcessHelper::GetFinalState(), G4ProcessHelper::GetInclusiveCrossSection(), G4ProcessHelper::ReactionGivesBaryon(), s_charge(), and s_containedQuarksCode().

31  {
32  int pdgAbs = abs(pdg);
33  return (pdgAbs % 100000 / 10000 == 9);
34 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isRGlueball ( int  pdg)
static

Definition at line 36 of file CustomPDGParser.cc.

References funct::abs().

Referenced by G4ProcessHelper::GetInclusiveCrossSection(), HadronicProcessHelper::inclusiveCrossSection(), and s_isgluinoHadron().

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

Definition at line 46 of file CustomPDGParser.cc.

References funct::abs().

Referenced by G4ProcessHelper::GetFinalState(), G4ProcessHelper::GetInclusiveCrossSection(), FullModelHadronicProcess::PostStepDoIt(), s_charge(), and s_containedQuarksCode().

46  {
47  int pdgAbs = abs(pdg);
48  return (pdgAbs % 10000 / 1000 == 9);
49 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool CustomPDGParser::s_isSbaryon ( int  pdg)
static

Definition at line 56 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), G4ProcessHelper::GetFinalState(), G4ProcessHelper::GetInclusiveCrossSection(), G4ProcessHelper::ReactionGivesBaryon(), s_charge(), and s_containedQuarksCode().

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

Definition at line 21 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle(), CustomPhysicsListSS::ConstructProcess(), CustomPhysicsList::ConstructProcess(), and s_charge().

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

Definition at line 26 of file CustomPDGParser.cc.

References funct::abs().

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

26  {
27  int pdgAbs = abs(pdg);
28  return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1);
29 }
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(), CustomPhysicsListSS::ConstructProcess(), CustomPhysicsList::ConstructProcess(), and CustomParticleFactory::getMassTable().

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

Definition at line 138 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle().

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