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

References abs, DeDxDiscriminatorTools::charge(), lumiQueryAPI::q, s_containedQuarks(), s_containedQuarksCode(), s_isMesonino(), s_isRBaryon(), s_isRMeson(), s_isSbaryon(), and s_isSLepton().

Referenced by CustomParticleFactory::addCustomParticle().

66 {
67  float charge=0,sign=1;
68  int pdgAbs=abs(pdg);
69  if(pdg < 0 ) 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_isRMeson(pdg))
80  {
81  std::vector<int> quarks = s_containedQuarks(pdg);
82  if((quarks[1] % 2 == 0 && quarks[0] % 2 == 1)||(quarks[1] % 2 == 1 && quarks[0] % 2 == 0 )) charge=1;
83  charge*=sign;
84  return charge;
85  }
86 
87  if(s_isRBaryon(pdg))
88  {
89  int baryon = s_containedQuarksCode(pdg);
90  for(int q=1; q< 1000; q*=10)
91  {
92  if(baryon / q % 2 == 0) charge+=2; else charge -=1;
93  }
94  charge/=3;
95  charge*=sign;
96  return charge;
97  }
98 
99  if(s_isMesonino(pdg))
100  {
101  int quark = s_containedQuarks(pdg)[0];
102  int squark = abs(pdg/100%10);
103  if (squark % 2 == 0 && quark % 2 == 1) charge = 1;
104  if (squark % 2 == 1 && quark % 2 == 0) charge = 1;
105  charge *= sign;
106  return charge;
107  }
108 
109  if(s_isSbaryon(pdg))
110  {
111  int baryon = s_containedQuarksCode(pdg)+100*(abs(pdg/1000%10));//Adding the squark back on
112  for(int q=1; q< 1000; q*=10)
113  {
114  if(baryon / q % 2 == 0) charge+=2; else charge -=1;
115  }
116  charge/=3;
117  charge*=sign;
118  return charge;
119  }
120 
121 return 0;
122 }
static int s_containedQuarksCode(int pdg)
static bool s_isSbaryon(int pdg)
#define abs(x)
Definition: mlp_lapack.h:159
static bool s_isRMeson(int pdg)
double charge(const std::vector< uint8_t > &Ampls)
static bool s_isMesonino(int pdg)
static bool s_isSLepton(int pdg)
static bool s_isRBaryon(int pdg)
static std::vector< int > s_containedQuarks(int pdg)
std::vector< int > CustomPDGParser::s_containedQuarks ( int  pdg)
static

Definition at line 130 of file CustomPDGParser.cc.

References i, and s_containedQuarksCode().

Referenced by s_charge().

131 {
132  std::vector<int> quarks;
133  for(int i=s_containedQuarksCode(pdg); i > 0; i /= 10)
134  {
135  quarks.push_back(i % 10);
136  }
137  return quarks;
138 }
static int s_containedQuarksCode(int pdg)
int i
Definition: DBlmapReader.cc:9
int CustomPDGParser::s_containedQuarksCode ( int  pdg)
static

Definition at line 140 of file CustomPDGParser.cc.

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

Referenced by s_charge(), and s_containedQuarks().

141 {
142  int pdgAbs=abs(pdg);
143  if(s_isRBaryon(pdg))
144  return pdgAbs / 10 % 1000;
145 
146  if(s_isRMeson(pdg))
147  return pdgAbs / 10 % 100;
148 
149  if(s_isMesonino(pdg))
150  return pdgAbs / 10 % 1000 % 10;
151 
152  if(s_isSbaryon(pdg))
153  return pdgAbs / 10 % 1000 % 100;
154 
155 
156 return 0;
157 }
static bool s_isSbaryon(int pdg)
#define abs(x)
Definition: mlp_lapack.h:159
static bool s_isRMeson(int pdg)
static bool s_isMesonino(int pdg)
static bool s_isRBaryon(int pdg)
bool CustomPDGParser::s_isMesonino ( int  pdg)
static

Definition at line 50 of file CustomPDGParser.cc.

References abs.

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

51 {
52  int pdgAbs=abs(pdg);
53  return (pdgAbs % 10000 / 100 == 6);
54 
55 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isRBaryon ( int  pdg)
static

Definition at line 29 of file CustomPDGParser.cc.

References abs.

Referenced by s_charge(), and s_containedQuarksCode().

30 {
31  int pdgAbs=abs(pdg);
32  return (pdgAbs % 100000 / 10000 == 9);
33 
34 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isRGlueball ( int  pdg)
static

Definition at line 36 of file CustomPDGParser.cc.

References abs.

Referenced by s_isRHadron().

37 {
38  int pdgAbs=abs(pdg);
39  return (pdgAbs % 100000 / 10 == 99);
40 
41 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isRHadron ( int  pdg)
static

Definition at line 10 of file CustomPDGParser.cc.

References 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)
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isRMeson ( int  pdg)
static

Definition at line 43 of file CustomPDGParser.cc.

References abs.

Referenced by s_charge(), and s_containedQuarksCode().

44 {
45  int pdgAbs=abs(pdg);
46  return (pdgAbs % 10000 / 1000 == 9);
47 
48 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isSbaryon ( int  pdg)
static

Definition at line 57 of file CustomPDGParser.cc.

References abs.

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

58 {
59  int pdgAbs=abs(pdg);
60  return (pdgAbs % 10000 / 1000 == 6);
61 
62 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isSLepton ( int  pdg)
static

Definition at line 23 of file CustomPDGParser.cc.

References abs.

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

24 {
25  int pdgAbs=abs(pdg);
26  return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1);
27 }
#define abs(x)
Definition: mlp_lapack.h:159
bool CustomPDGParser::s_isstopHadron ( int  pdg)
static

Definition at line 16 of file CustomPDGParser.cc.

References abs.

Referenced by CustomParticleFactory::getMassTable().

17 {
18  int pdgAbs=abs(pdg);
19  return ( (pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 1000 / 100 == 6) );
20 }
#define abs(x)
Definition: mlp_lapack.h:159
double CustomPDGParser::s_spin ( int  pdg)
static

Definition at line 124 of file CustomPDGParser.cc.

References abs.

Referenced by CustomParticleFactory::addCustomParticle().

125 {
126  int pdgAbs=abs(pdg);
127  return pdgAbs % 10;
128 }
#define abs(x)
Definition: mlp_lapack.h:159