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_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 65 of file CustomPDGParser.cc.

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_isSIMP(pdg)) {
86  return 0;
87  }
88  if (s_isRMeson(pdg)) {
89  std::vector<int> quarks = s_containedQuarks(pdg);
90  if ((quarks[1] % 2 == 0 && quarks[0] % 2 == 1) || (quarks[1] % 2 == 1 && quarks[0] % 2 == 0))
91  charge = 1;
92  charge *= sign;
93  return charge;
94  }
95 
96  if (s_isRBaryon(pdg)) {
97  int baryon = s_containedQuarksCode(pdg);
98  for (int q = 1; q < 1000; q *= 10) {
99  if (baryon / q % 2 == 0)
100  charge += 2;
101  else
102  charge -= 1;
103  }
104  charge /= 3;
105  charge *= sign;
106  return charge;
107  }
108 
109  if (s_isMesonino(pdg)) {
110  int quark = s_containedQuarks(pdg)[0];
111  int squark = abs(pdg / 100 % 10);
112  if (squark % 2 == 0 && quark % 2 == 1)
113  charge = 1;
114  if (squark % 2 == 1 && quark % 2 == 0)
115  charge = 1;
116  charge *= sign;
117  if (s_issbottomHadron(pdg))
118  charge *= -1;
119  return charge;
120  }
121 
122  if (s_isSbaryon(pdg)) {
123  int baryon = s_containedQuarksCode(pdg) + 100 * (abs(pdg / 1000 % 10)); //Adding the squark back on
124  for (int q = 1; q < 1000; q *= 10) {
125  if (baryon / q % 2 == 0)
126  charge += 2;
127  else
128  charge -= 1;
129  }
130  charge /= 3;
131  charge *= sign;
132  if (s_issbottomHadron(pdg))
133  charge *= -1;
134  return charge;
135  }
136 
137  return 0;
138 }

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 151 of file CustomPDGParser.cc.

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

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 159 of file CustomPDGParser.cc.

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

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 55 of file CustomPDGParser.cc.

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

References funct::abs().

Referenced by s_charge().

◆ s_isDphoton()

bool CustomPDGParser::s_isDphoton ( int  pdg)
static

Definition at line 35 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_isgluinoHadron()

bool CustomPDGParser::s_isgluinoHadron ( int  pdg)
static

Definition at line 5 of file CustomPDGParser.cc.

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

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

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

◆ s_isMesonino()

bool CustomPDGParser::s_isMesonino ( int  pdg)
static

Definition at line 45 of file CustomPDGParser.cc.

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

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 25 of file CustomPDGParser.cc.

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

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 30 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_isRMeson()

bool CustomPDGParser::s_isRMeson ( int  pdg)
static

Definition at line 40 of file CustomPDGParser.cc.

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

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 50 of file CustomPDGParser.cc.

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

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 15 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_isSIMP()

bool CustomPDGParser::s_isSIMP ( int  pdg)
static

Definition at line 60 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_isSLepton()

bool CustomPDGParser::s_isSLepton ( int  pdg)
static

Definition at line 20 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_isstopHadron()

bool CustomPDGParser::s_isstopHadron ( int  pdg)
static

Definition at line 10 of file CustomPDGParser.cc.

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

References funct::abs().

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

◆ s_spin()

double CustomPDGParser::s_spin ( int  pdg)
static

Definition at line 140 of file CustomPDGParser.cc.

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

References funct::abs().

Referenced by CustomParticleFactory::addCustomParticle().

CustomPDGParser::s_containedQuarksCode
static int s_containedQuarksCode(int pdg)
Definition: CustomPDGParser.cc:159
mps_fire.i
i
Definition: mps_fire.py:428
CustomPDGParser::s_isRMeson
static bool s_isRMeson(int pdg)
Definition: CustomPDGParser.cc:40
CustomPDGParser::s_isDphoton
static bool s_isDphoton(int pdg)
Definition: CustomPDGParser.cc:35
CustomPDGParser::s_issbottomHadron
static bool s_issbottomHadron(int pdg)
Definition: CustomPDGParser.cc:15
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
CustomPDGParser::s_isRBaryon
static bool s_isRBaryon(int pdg)
Definition: CustomPDGParser.cc:25
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
CustomPDGParser::s_isSIMP
static bool s_isSIMP(int pdg)
Definition: CustomPDGParser.cc:60
CustomPDGParser::s_isChargino
static bool s_isChargino(int pdg)
Definition: CustomPDGParser.cc:55
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CustomPDGParser::s_isRGlueball
static bool s_isRGlueball(int pdg)
Definition: CustomPDGParser.cc:30
CustomPDGParser::s_isMesonino
static bool s_isMesonino(int pdg)
Definition: CustomPDGParser.cc:45
pdg
Definition: pdg_functions.h:28
CustomPDGParser::s_isSbaryon
static bool s_isSbaryon(int pdg)
Definition: CustomPDGParser.cc:50
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:20
CustomPDGParser::s_containedQuarks
static std::vector< int > s_containedQuarks(int pdg)
Definition: CustomPDGParser.cc:151