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_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 6 of file CustomPDGParser.h.

Member Function Documentation

◆ s_charge()

double CustomPDGParser::s_charge ( int  pdg)
static

Definition at line 64 of file CustomPDGParser.cc.

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

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

Referenced by CustomParticleFactory::addCustomParticle().

◆ s_containedQuarks()

std::vector< int > CustomPDGParser::s_containedQuarks ( int  pdg)
static

Definition at line 150 of file CustomPDGParser.cc.

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

References mps_fire::i, and s_containedQuarksCode().

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

◆ s_containedQuarksCode()

int CustomPDGParser::s_containedQuarksCode ( int  pdg)
static

Definition at line 158 of file CustomPDGParser.cc.

158  {
159  int pdgAbs = abs(pdg);
160  if (s_isRBaryon(pdg))
161  return pdgAbs / 10 % 1000;
162 
163  if (s_isRMeson(pdg))
164  return pdgAbs / 10 % 100;
165 
166  if (s_isMesonino(pdg))
167  return pdgAbs / 10 % 1000 % 10;
168 
169  if (s_isSbaryon(pdg))
170  return pdgAbs / 10 % 1000 % 100;
171 
172  return 0;
173 }

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

Referenced by s_charge(), and s_containedQuarks().

◆ s_isChargino()

bool CustomPDGParser::s_isChargino ( int  pdg)
static

Definition at line 54 of file CustomPDGParser.cc.

54  {
55  int pdgAbs = abs(pdg);
56  return (pdgAbs == 1000024);
57 }

References funct::abs().

Referenced by s_charge().

◆ s_isDphoton()

bool CustomPDGParser::s_isDphoton ( int  pdg)
static

Definition at line 34 of file CustomPDGParser.cc.

34  {
35  int pdgAbs = abs(pdg);
36  return (pdgAbs == 1072000) || (pdgAbs == 1023);
37 }

References funct::abs().

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

◆ s_isMesonino()

bool CustomPDGParser::s_isMesonino ( int  pdg)
static

Definition at line 44 of file CustomPDGParser.cc.

44  {
45  int pdgAbs = abs(pdg);
46  return ((pdgAbs % 10000 / 100 == 6) || (pdgAbs % 10000 / 100 == 5));
47 }

References funct::abs().

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

◆ s_isRBaryon()

bool CustomPDGParser::s_isRBaryon ( int  pdg)
static

Definition at line 24 of file CustomPDGParser.cc.

24  {
25  int pdgAbs = abs(pdg);
26  return (pdgAbs % 100000 / 10000 == 9);
27 }

References funct::abs().

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

◆ s_isRGlueball()

bool CustomPDGParser::s_isRGlueball ( int  pdg)
static

Definition at line 29 of file CustomPDGParser.cc.

29  {
30  int pdgAbs = abs(pdg);
31  return (pdgAbs % 100000 / 10 == 99);
32 }

References funct::abs().

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

◆ s_isRHadron()

bool CustomPDGParser::s_isRHadron ( int  pdg)
static

Definition at line 4 of file CustomPDGParser.cc.

4  {
5  int pdgAbs = abs(pdg);
6  return ((pdgAbs % 100000 / 10000 == 9) || (pdgAbs % 10000 / 1000 == 9) || s_isRGlueball(pdg));
7 }

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

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

◆ s_isRMeson()

bool CustomPDGParser::s_isRMeson ( int  pdg)
static

Definition at line 39 of file CustomPDGParser.cc.

39  {
40  int pdgAbs = abs(pdg);
41  return (pdgAbs % 10000 / 1000 == 9);
42 }

References funct::abs().

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

◆ s_isSbaryon()

bool CustomPDGParser::s_isSbaryon ( int  pdg)
static

Definition at line 49 of file CustomPDGParser.cc.

49  {
50  int pdgAbs = abs(pdg);
51  return ((pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 10000 / 1000 == 5));
52 }

References funct::abs().

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

◆ s_issbottomHadron()

bool CustomPDGParser::s_issbottomHadron ( int  pdg)
static

Definition at line 14 of file CustomPDGParser.cc.

14  {
15  int pdgAbs = abs(pdg);
16  return ((pdgAbs % 10000 / 1000 == 5) || (pdgAbs % 10000 / 100 == 5));
17 }

References funct::abs().

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

◆ s_isSIMP()

bool CustomPDGParser::s_isSIMP ( int  pdg)
static

Definition at line 59 of file CustomPDGParser.cc.

59  {
60  int pdgAbs = abs(pdg);
61  return (pdgAbs == 9000006);
62 }

References funct::abs().

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

◆ s_isSLepton()

bool CustomPDGParser::s_isSLepton ( int  pdg)
static

Definition at line 19 of file CustomPDGParser.cc.

19  {
20  int pdgAbs = abs(pdg);
21  return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1);
22 }

References funct::abs().

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

◆ s_isstopHadron()

bool CustomPDGParser::s_isstopHadron ( int  pdg)
static

Definition at line 9 of file CustomPDGParser.cc.

9  {
10  int pdgAbs = abs(pdg);
11  return ((pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 1000 / 100 == 6));
12 }

References funct::abs().

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

◆ s_spin()

double CustomPDGParser::s_spin ( int  pdg)
static

Definition at line 139 of file CustomPDGParser.cc.

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

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle().

CustomPDGParser::s_containedQuarksCode
static int s_containedQuarksCode(int pdg)
Definition: CustomPDGParser.cc:158
mps_fire.i
i
Definition: mps_fire.py:428
CustomPDGParser::s_isRMeson
static bool s_isRMeson(int pdg)
Definition: CustomPDGParser.cc:39
CustomPDGParser::s_isDphoton
static bool s_isDphoton(int pdg)
Definition: CustomPDGParser.cc:34
CustomPDGParser::s_issbottomHadron
static bool s_issbottomHadron(int pdg)
Definition: CustomPDGParser.cc:14
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
CustomPDGParser::s_isRBaryon
static bool s_isRBaryon(int pdg)
Definition: CustomPDGParser.cc:24
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
CustomPDGParser::s_isSIMP
static bool s_isSIMP(int pdg)
Definition: CustomPDGParser.cc:59
CustomPDGParser::s_isChargino
static bool s_isChargino(int pdg)
Definition: CustomPDGParser.cc:54
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CustomPDGParser::s_isRGlueball
static bool s_isRGlueball(int pdg)
Definition: CustomPDGParser.cc:29
CustomPDGParser::s_isMesonino
static bool s_isMesonino(int pdg)
Definition: CustomPDGParser.cc:44
pdg
Definition: pdg_functions.h:28
CustomPDGParser::s_isSbaryon
static bool s_isSbaryon(int pdg)
Definition: CustomPDGParser.cc:49
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CustomPDGParser::s_isSLepton
static bool s_isSLepton(int pdg)
Definition: CustomPDGParser.cc:19
CustomPDGParser::s_containedQuarks
static std::vector< int > s_containedQuarks(int pdg)
Definition: CustomPDGParser.cc:150