ATLAS Offline Software
Static Public Member Functions | Static Private Member Functions | List of all members
CustomPDGParser Class Reference

#include <CustomPDGParser.h>

Collaboration diagram for CustomPDGParser:

Static Public Member Functions

static bool s_isRHadron (int pdg)
 
static bool s_isSLepton (int pdg)
 
static bool s_isRBaryon (int pdg)
 
static bool s_isRMeson (int pdg)
 
static bool s_isMesonino (int pdg)
 
static bool s_isSbaryon (int pdg)
 
static bool s_isRGlueball (int pdg)
 
static double s_charge (int pdg)
 
static double s_spin (int pdg)
 
static std::vector< int > s_containedQuarks (int pdg)
 
static int s_containedQuarksCode (int pdg)
 

Static Private Member Functions

static bool s_isstopHadron (int pdg)
 
static bool s_issbottomHadron (int pdg)
 

Detailed Description

Definition at line 11 of file CustomPDGParser.h.

Member Function Documentation

◆ s_charge()

double CustomPDGParser::s_charge ( int  pdg)
static

Definition at line 74 of file CustomPDGParser.cxx.

75 {
76  float charge=0,sign=1;
77  int pdgAbs=abs(pdg);
78  if(pdg < 0 ) sign=-1;
79 
80  if(s_isSLepton(pdg)) //Sleptons
81  {
82  if(pdgAbs %2 == 0)
83  return 0;
84  else
85  return -sign;
86  }
87 
88  if(s_isRMeson(pdg))
89  {
90  std::vector<int> quarks = s_containedQuarks(pdg);
91  if((quarks[1] % 2 == 0 && quarks[0] % 2 == 1)||(quarks[1] % 2 == 1 && quarks[0] % 2 == 0 )) charge=1;
92  charge*=sign;
93  return charge;
94  }
95 
96  if(s_isRBaryon(pdg))
97  {
98  int baryon = s_containedQuarksCode(pdg);
99  for(int q=1; q< 1000; q*=10)
100  {
101  if(baryon / q % 2 == 0) charge+=2; else charge -=1;
102  }
103  charge/=3;
104  charge*=sign;
105  return charge;
106  }
107 
108  if(s_isMesonino(pdg))
109  {
110  int quark = s_containedQuarks(pdg)[0];
111  int squark = abs(pdg/100%10);
112  if (squark % 2 == 0 && quark % 2 == 1) charge = 1;
113  if (squark % 2 == 1 && quark % 2 == 0) charge = 1;
114  charge *= sign;
115  if(s_issbottomHadron(pdg)) charge*=-1;
116  return charge;
117  }
118 
119  if(s_isSbaryon(pdg))
120  {
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) charge+=2; else charge -=1;
124  charge/=3;
125  charge*=sign;
126  if(s_issbottomHadron(pdg)) charge*=-1;
127  return charge;
128  }
129 
130  return 0;
131 }

◆ s_containedQuarks()

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

Definition at line 139 of file CustomPDGParser.cxx.

140 {
141  std::vector<int> quarks;
142  for(int i=s_containedQuarksCode(pdg); i > 0; i /= 10)
143  quarks.push_back(i % 10);
144 
145  return quarks;
146 }

◆ s_containedQuarksCode()

int CustomPDGParser::s_containedQuarksCode ( int  pdg)
static

Definition at line 148 of file CustomPDGParser.cxx.

149 {
150  int pdgAbs=abs(pdg);
151  if(s_isRBaryon(pdg))
152  return pdgAbs / 10 % 1000;
153 
154  if(s_isRMeson(pdg))
155  return pdgAbs / 10 % 100;
156 
157  if(s_isMesonino(pdg))
158  return pdgAbs / 10 % 1000 % 10;
159 
160  if(s_isSbaryon(pdg))
161  return pdgAbs / 10 % 1000 % 100;
162 
163 
164  return 0;
165 }

◆ s_isMesonino()

bool CustomPDGParser::s_isMesonino ( int  pdg)
static

Definition at line 59 of file CustomPDGParser.cxx.

60 {
61  int pdgAbs=abs(pdg);
62  return ((pdgAbs % 10000 / 100 == 6) || (pdgAbs % 10000 / 100 == 5));
63 
64 }

◆ s_isRBaryon()

bool CustomPDGParser::s_isRBaryon ( int  pdg)
static

Definition at line 38 of file CustomPDGParser.cxx.

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

◆ s_isRGlueball()

bool CustomPDGParser::s_isRGlueball ( int  pdg)
static

Definition at line 45 of file CustomPDGParser.cxx.

46 {
47  int pdgAbs=abs(pdg);
48  return (pdgAbs % 100000 / 10 == 99);
49 
50 }

◆ s_isRHadron()

bool CustomPDGParser::s_isRHadron ( int  pdg)
static

Definition at line 13 of file CustomPDGParser.cxx.

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

◆ s_isRMeson()

bool CustomPDGParser::s_isRMeson ( int  pdg)
static

Definition at line 52 of file CustomPDGParser.cxx.

53 {
54  int pdgAbs=abs(pdg);
55  return (pdgAbs % 10000 / 1000 == 9);
56 
57 }

◆ s_isSbaryon()

bool CustomPDGParser::s_isSbaryon ( int  pdg)
static

Definition at line 66 of file CustomPDGParser.cxx.

67 {
68  int pdgAbs=abs(pdg);
69  return ((pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 10000 / 1000 == 5));
70 
71 }

◆ s_issbottomHadron()

bool CustomPDGParser::s_issbottomHadron ( int  pdg)
staticprivate

Definition at line 25 of file CustomPDGParser.cxx.

26 {
27  int pdgAbs=abs(pdg);
28  return ( (pdgAbs % 10000 / 1000 == 5) || (pdgAbs % 10000 / 100 == 5) );
29 }

◆ s_isSLepton()

bool CustomPDGParser::s_isSLepton ( int  pdg)
static

Definition at line 32 of file CustomPDGParser.cxx.

33 {
34  int pdgAbs=abs(pdg);
35  return (pdgAbs / 100 % 10000 == 0 && pdgAbs / 10 % 10 == 1);
36 }

◆ s_isstopHadron()

bool CustomPDGParser::s_isstopHadron ( int  pdg)
staticprivate

Definition at line 19 of file CustomPDGParser.cxx.

20 {
21  int pdgAbs=abs(pdg);
22  return ( (pdgAbs % 10000 / 1000 == 6) || (pdgAbs % 10000 / 100 == 6) );
23 }

◆ s_spin()

double CustomPDGParser::s_spin ( int  pdg)
static

Definition at line 133 of file CustomPDGParser.cxx.

134 {
135  int pdgAbs=abs(pdg);
136  return pdgAbs % 10;
137 }

The documentation for this class was generated from the following files:
CustomPDGParser::s_containedQuarksCode
static int s_containedQuarksCode(int pdg)
Definition: CustomPDGParser.cxx:148
CustomPDGParser::s_isRMeson
static bool s_isRMeson(int pdg)
Definition: CustomPDGParser.cxx:52
CustomPDGParser::s_issbottomHadron
static bool s_issbottomHadron(int pdg)
Definition: CustomPDGParser.cxx:25
CustomPDGParser::s_isRBaryon
static bool s_isRBaryon(int pdg)
Definition: CustomPDGParser.cxx:38
lumiFormat.i
int i
Definition: lumiFormat.py:85
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
charge
double charge(const T &p)
Definition: AtlasPID.h:756
CustomPDGParser::s_isRGlueball
static bool s_isRGlueball(int pdg)
Definition: CustomPDGParser.cxx:45
CustomPDGParser::s_isMesonino
static bool s_isMesonino(int pdg)
Definition: CustomPDGParser.cxx:59
extractSporadic.q
list q
Definition: extractSporadic.py:98
CustomPDGParser::s_isSbaryon
static bool s_isSbaryon(int pdg)
Definition: CustomPDGParser.cxx:66
DerivationFramework::squark
@ squark
Definition: utilityFunctions.h:11
CustomPDGParser::s_isSLepton
static bool s_isSLepton(int pdg)
Definition: CustomPDGParser.cxx:32
CustomPDGParser::s_containedQuarks
static std::vector< int > s_containedQuarks(int pdg)
Definition: CustomPDGParser.cxx:139