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_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)
 

Detailed Description

Definition at line 6 of file CustomPDGParser.h.

Member Function Documentation

double CustomPDGParser::s_charge ( int  pdg)
static

Definition at line 65 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().

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

References mps_fire::i, and s_containedQuarksCode().

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

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

Definition at line 156 of file CustomPDGParser.cc.

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

Referenced by s_charge(), and s_containedQuarks().

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

References funct::abs().

Referenced by s_charge().

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

Definition at line 40 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 50 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 30 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 35 of file CustomPDGParser.cc.

References funct::abs().

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

35  {
36  int pdgAbs = abs(pdg);
37  return (pdgAbs % 100000 / 10 == 99);
38 }
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(), CustomPhysicsListSS::ConstructProcess(), CustomPhysicsList::ConstructProcess(), and CustomParticleFactory::getMassTable().

10  {
11  int pdgAbs = abs(pdg);
12  return ((pdgAbs % 100000 / 10000 == 9) || (pdgAbs % 10000 / 1000 == 9) || s_isRGlueball(pdg));
13 }
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 45 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 55 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 20 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 25 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 15 of file CustomPDGParser.cc.

References funct::abs().

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

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

Definition at line 137 of file CustomPDGParser.cc.

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle().

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