Rivet::PID Namespace Reference


Enumerations

enum  location {
  nj = 1, nq3, nq2, nq1,
  nl, nr, n, n8,
  n9, n10
}

Functions

unsigned short digit (location loc, const int &pid)
 return the digit at a named location in the PID
int fundamentalID (const int &pid)
 extract fundamental ID (1-100) if this is a "fundamental" particle
int extraBits (const int &pid)
 if this is a fundamental particle, does it have a valid antiparticle?
int Z (const int &pid)
int A (const int &pid)
int lambda (const int &pid)
PID operations on Rivet::Particle wrapper
int abspid (const int &pid)
 absolute value of particle ID
bool isValid (const int &pid)
 is this a valid ID?
bool isMeson (const int &pid)
 is this a valid meson ID?
bool isBaryon (const int &pid)
 is this a valid baryon ID?
bool isDiQuark (const int &pid)
 is this a valid diquark ID?
bool isHadron (const int &pid)
 is this a valid hadron ID?
bool isLepton (const int &pid)
 is this a valid lepton ID?
bool isNucleus (const int &pid)
 is this a valid ion ID?
bool isPentaquark (const int &pid)
 is this a valid pentaquark ID?
bool isSUSY (const int &pid)
 is this a valid SUSY ID?
bool isRhadron (const int &pid)
 is this a valid R-hadron ID?
bool hasUp (const int &pid)
 does this particle contain an up quark?
bool hasDown (const int &pid)
 does this particle contain a down quark?
bool hasStrange (const int &pid)
 does this particle contain a strange quark?
bool hasCharm (const int &pid)
 does this particle contain a charm quark?
bool hasBottom (const int &pid)
 does this particle contain a bottom quark?
bool hasTop (const int &pid)
 does this particle contain a top quark?
int jSpin (const int &pid)
 jSpin returns 2J+1, where J is the total spin
int sSpin (const int &pid)
 sSpin returns 2S+1, where S is the spin
int lSpin (const int &pid)
 lSpin returns 2L+1, where L is the orbital angular momentum
int threeCharge (const int &pid)
 return 3 times the charge (3 x quark charge is an int)
double charge (const int &pid)
 return the charge
PID operations on Rivet::Particle wrapper
int abspid (const Particle &p)
 absolute value of particle ID
bool isMeson (const Particle &p)
 is this a valid meson ID?
bool isBaryon (const Particle &p)
 is this a valid baryon ID?
bool isDiQuark (const Particle &p)
 is this a valid diquark ID?
bool isHadron (const Particle &p)
 is this a valid hadron ID?
bool isLepton (const Particle &p)
 is this a valid lepton ID?
bool isNucleus (const Particle &p)
 is this a valid ion ID?
bool isPentaquark (const Particle &p)
 is this a valid pentaquark ID?
bool isSUSY (const Particle &p)
 is this a valid SUSY ID?
bool isRhadron (const Particle &p)
 is this a valid R-hadron ID?
bool hasUp (const Particle &p)
 does this particle contain an up quark?
bool hasDown (const Particle &p)
 does this particle contain a down quark?
bool hasStrange (const Particle &p)
 does this particle contain a strange quark?
bool hasCharm (const Particle &p)
 does this particle contain a charm quark?
bool hasBottom (const Particle &p)
 does this particle contain a bottom quark?
bool hasTop (const Particle &p)
 does this particle contain a top quark?
int jSpin (const Particle &p)
 jSpin returns 2J+1, where J is the total spin
int sSpin (const Particle &p)
 sSpin returns 2S+1, where S is the spin
int lSpin (const Particle &p)
 lSpin returns 2L+1, where L is the orbital angular momentum
int threeCharge (const Particle &p)
 return 3 times the charge (3 x quark charge is an int)
double charge (const Particle &p)
 return the charge

Enumeration Type Documentation

enum location

PID digits (base 10) are: n nr nl nq1 nq2 nq3 nj The location enum provides a convenient index into the PID.

Enumerator:
nj 
nq3 
nq2 
nq1 
nl 
nr 
n 
n8 
n9 
n10 

Definition at line 19 of file ParticleIdUtils.cc.

00019 { nj=1, nq3, nq2, nq1, nl, nr, n, n8, n9, n10 };


Function Documentation

int Rivet::PID::A ( const int &  pid  ) 

Definition at line 79 of file ParticleIdUtils.cc.

References abspid(), and isNucleus().

Referenced by Rivet::diagonalize().

00080     {
00081         // a proton can also be a Hydrogen nucleus
00082         if( abspid(pid) == 2212 ) { return 1; }
00083         if( isNucleus(pid) ) return (abspid(pid)/10)%1000;
00084         return 0;
00085     }

int Rivet::PID::abspid ( const Particle &  p  )  [inline]

absolute value of particle ID

if this is a nucleus (ion), get A Ion numbers are +/- 10LZZZAAAI. if this is a nucleus (ion), get Z Ion numbers are +/- 10LZZZAAAI. if this is a nucleus (ion), get nLambda Ion numbers are +/- 10LZZZAAAI.

Definition at line 116 of file ParticleIdUtils.hh.

References abspid(), and Particle::pdgId().

00116 { return abspid(p.pdgId()); }

int abspid ( const int &  pid  ) 

absolute value of particle ID

Definition at line 35 of file ParticleIdUtils.cc.

Referenced by A(), abspid(), digit(), extraBits(), fundamentalID(), isBaryon(), isDiQuark(), isMeson(), isNucleus(), jSpin(), lambda(), threeCharge(), and Z().

00036     {
00037       return (pid < 0) ? -pid : pid;
00038     }

double Rivet::PID::charge ( const Particle &  p  )  [inline]

return the charge

Definition at line 160 of file ParticleIdUtils.hh.

References threeCharge().

00160 { return threeCharge(p)/3.0; }

double Rivet::PID::charge ( const int &  pid  )  [inline]

return the charge

Definition at line 91 of file ParticleIdUtils.hh.

References threeCharge().

Referenced by threeCharge().

00091 { return threeCharge(pid)/3.0; }

unsigned short digit ( location  loc,
const int &  pid 
)

return the digit at a named location in the PID

Definition at line 47 of file ParticleIdUtils.cc.

References abspid().

Referenced by fundamentalID(), hasBottom(), hasCharm(), hasDown(), hasStrange(), hasTop(), hasUp(), isBaryon(), isDiQuark(), isMeson(), isNucleus(), isPentaquark(), isRhadron(), isSUSY(), lambda(), lSpin(), sSpin(), and threeCharge().

00048     {
00049         //  PID digits (base 10) are: n nr nl nq1 nq2 nq3 nj
00050         //  the location enum provides a convenient index into the PID
00051         int numerator = (int) std::pow(10.0,(loc-1));
00052         return (abspid(pid)/numerator)%10;
00053     }

int extraBits ( const int &  pid  ) 

if this is a fundamental particle, does it have a valid antiparticle?

returns everything beyond the 7th digit (e.g. outside the standard numbering scheme)

Definition at line 41 of file ParticleIdUtils.cc.

References abspid().

Referenced by fundamentalID(), hasBottom(), hasCharm(), hasDown(), hasStrange(), hasTop(), hasUp(), isBaryon(), isDiQuark(), isHadron(), isLepton(), isMeson(), isPentaquark(), isRhadron(), isSUSY(), isValid(), jSpin(), and threeCharge().

00042     {
00043         return abspid(pid)/10000000;
00044     }

int fundamentalID ( const int &  pid  ) 

extract fundamental ID (1-100) if this is a "fundamental" particle

Definition at line 57 of file ParticleIdUtils.cc.

References abspid(), digit(), extraBits(), nq1, and nq2.

Referenced by hasBottom(), hasCharm(), hasDown(), hasStrange(), hasTop(), hasUp(), isBaryon(), isDiQuark(), isLepton(), isMeson(), isSUSY(), isValid(), jSpin(), and threeCharge().

00058     {
00059         if( extraBits(pid) > 0 ) return 0;
00060         if( digit(nq2,pid) == 0 && digit(nq1,pid) == 0) {
00061             return abspid(pid)%10000;
00062         } else if( abspid(pid) <= 100 ) {
00063             return abspid(pid);
00064         } else {
00065             return 0;
00066         }
00067     }

bool Rivet::PID::hasBottom ( const Particle &  p  )  [inline]

does this particle contain a bottom quark?

Definition at line 146 of file ParticleIdUtils.hh.

References hasBottom(), and Particle::pdgId().

00146 { return hasBottom(p.pdgId()); }

bool hasBottom ( const int &  pid  ) 

does this particle contain a bottom quark?

Definition at line 318 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasBottom().

00319     {
00320         if( extraBits(pid) > 0 ) { return false; }
00321         if( fundamentalID(pid) > 0 ) { return false; }
00322         if( digit(nq3,pid) == 5 || digit(nq2,pid) == 5 || digit(nq1,pid) == 5 ) { return true; }
00323         return false;
00324     }

bool Rivet::PID::hasCharm ( const Particle &  p  )  [inline]

does this particle contain a charm quark?

Definition at line 144 of file ParticleIdUtils.hh.

References hasCharm(), and Particle::pdgId().

00144 { return hasCharm(p.pdgId()); }

bool hasCharm ( const int &  pid  ) 

does this particle contain a charm quark?

Definition at line 310 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasCharm().

00311     {
00312         if( extraBits(pid) > 0 ) { return false; }
00313         if( fundamentalID(pid) > 0 ) { return false; }
00314         if( digit(nq3,pid) == 4 || digit(nq2,pid) == 4 || digit(nq1,pid) == 4 ) { return true; }
00315         return false;
00316     }

bool Rivet::PID::hasDown ( const Particle &  p  )  [inline]

does this particle contain a down quark?

Definition at line 140 of file ParticleIdUtils.hh.

References hasDown(), and Particle::pdgId().

00140 { return hasDown(p.pdgId()); }

bool hasDown ( const int &  pid  ) 

does this particle contain a down quark?

Definition at line 294 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasDown().

00295     {
00296         if( extraBits(pid) > 0 ) { return false; }
00297         if( fundamentalID(pid) > 0 ) { return false; }
00298         if( digit(nq3,pid) == 1 || digit(nq2,pid) == 1 || digit(nq1,pid) == 1 ) { return true; }
00299         return false;
00300     }

bool Rivet::PID::hasStrange ( const Particle &  p  )  [inline]

does this particle contain a strange quark?

Definition at line 142 of file ParticleIdUtils.hh.

References hasStrange(), and Particle::pdgId().

00142 { return hasStrange(p.pdgId()); }

bool hasStrange ( const int &  pid  ) 

does this particle contain a strange quark?

Definition at line 302 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasStrange().

00303     {
00304         if( extraBits(pid) > 0 ) { return false; }
00305         if( fundamentalID(pid) > 0 ) { return false; }
00306         if( digit(nq3,pid) == 3 || digit(nq2,pid) == 3 || digit(nq1,pid) == 3 ) { return true; }
00307         return false;
00308     }

bool Rivet::PID::hasTop ( const Particle &  p  )  [inline]

does this particle contain a top quark?

Definition at line 148 of file ParticleIdUtils.hh.

References hasTop(), and Particle::pdgId().

00148 { return hasTop(p.pdgId()); }

bool hasTop ( const int &  pid  ) 

does this particle contain a top quark?

Definition at line 326 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasTop().

00327     {
00328         if( extraBits(pid) > 0 ) { return false; }
00329         if( fundamentalID(pid) > 0 ) { return false; }
00330         if( digit(nq3,pid) == 6 || digit(nq2,pid) == 6 || digit(nq1,pid) == 6 ) { return true; }
00331         return false;
00332     }

bool Rivet::PID::hasUp ( const Particle &  p  )  [inline]

does this particle contain an up quark?

Definition at line 138 of file ParticleIdUtils.hh.

References hasUp(), and Particle::pdgId().

00138 { return hasUp(p.pdgId()); }

bool hasUp ( const int &  pid  ) 

does this particle contain an up quark?

Definition at line 286 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), nq1, nq2, and nq3.

Referenced by hasUp().

00287     {
00288         if( extraBits(pid) > 0 ) { return false; }
00289         if( fundamentalID(pid) > 0 ) { return false; }
00290         if( digit(nq3,pid) == 2 || digit(nq2,pid) == 2 || digit(nq1,pid) == 2 ) { return true; }
00291         return false;
00292     }

bool Rivet::PID::isBaryon ( const Particle &  p  )  [inline]

is this a valid baryon ID?

Definition at line 121 of file ParticleIdUtils.hh.

References isBaryon(), and Particle::pdgId().

00121 { return isBaryon(p.pdgId()); }

bool isBaryon ( const int &  pid  ) 

is this a valid baryon ID?

Definition at line 169 of file ParticleIdUtils.cc.

References abspid(), digit(), extraBits(), fundamentalID(), nj, nq1, nq2, and nq3.

Referenced by isBaryon(), isHadron(), isValid(), and threeCharge().

00170     {
00171         if( extraBits(pid) > 0 ) { return false; }
00172         if( abspid(pid) <= 100 ) { return false; }
00173         if( fundamentalID(pid) <= 100 && fundamentalID(pid) > 0 ) { return false; }
00174         if( abspid(pid) == 2110 || abspid(pid) == 2210 ) { return true; }
00175         if(    digit(nj,pid) > 0  && digit(nq3,pid) > 0
00176             && digit(nq2,pid) > 0 && digit(nq1,pid) > 0 ) { return true; }
00177         return false;
00178     }

bool Rivet::PID::isDiQuark ( const Particle &  p  )  [inline]

is this a valid diquark ID?

Definition at line 123 of file ParticleIdUtils.hh.

References isDiQuark(), and Particle::pdgId().

00123 { return isDiQuark(p.pdgId()); }

bool isDiQuark ( const int &  pid  ) 

is this a valid diquark ID?

Definition at line 181 of file ParticleIdUtils.cc.

References abspid(), digit(), extraBits(), fundamentalID(), nj, nq1, nq2, and nq3.

Referenced by isDiQuark(), isValid(), and threeCharge().

00182     {
00183         if( extraBits(pid) > 0 ) { return false; }
00184         if( abspid(pid) <= 100 ) { return false; }
00185         if( fundamentalID(pid) <= 100 && fundamentalID(pid) > 0 ) { return false; }
00186         if(    digit(nj,pid) > 0  && digit(nq3,pid) == 0
00187             && digit(nq2,pid) > 0 && digit(nq1,pid) > 0 ) {  // diquark signature
00188            // EvtGen uses the diquarks for quark pairs, so, for instance,
00189            //   5501 is a valid "diquark" for EvtGen
00190            //if( digit(nj) == 1 && digit(nq2) == digit(nq1) ) {     // illegal
00191            //   return false;
00192            //} else {
00193               return true;
00194            //}
00195         }
00196         return false;
00197     }

bool Rivet::PID::isHadron ( const Particle &  p  )  [inline]

is this a valid hadron ID?

Definition at line 125 of file ParticleIdUtils.hh.

References isHadron(), and Particle::pdgId().

Referenced by Rivet::hadronFilter(), and DISKinematics::project().

00125 { return isHadron(p.pdgId()); }

bool isHadron ( const int &  pid  ) 

is this a valid hadron ID?

Definition at line 200 of file ParticleIdUtils.cc.

References extraBits(), isBaryon(), isMeson(), and isPentaquark().

Referenced by isHadron(), and Multiplicity::project().

00201     {
00202         if( extraBits(pid) > 0 ) { return false; }
00203         if( isMeson(pid) )   { return true; }
00204         if( isBaryon(pid) )  { return true; }
00205         if( isPentaquark(pid) ) { return true; }
00206         return false;
00207     }

bool Rivet::PID::isLepton ( const Particle &  p  )  [inline]

is this a valid lepton ID?

Definition at line 127 of file ParticleIdUtils.hh.

References isLepton(), and Particle::pdgId().

Referenced by DISLepton::project().

00127 { return isLepton(p.pdgId()); }

bool isLepton ( const int &  pid  ) 

is this a valid lepton ID?

Definition at line 209 of file ParticleIdUtils.cc.

References extraBits(), and fundamentalID().

Referenced by isLepton(), and ChargedLeptons::project().

00210     {
00211         if( extraBits(pid) > 0 ) { return false; }
00212         if( fundamentalID(pid) >= 11 && fundamentalID(pid) <= 18 ) { return true; }
00213         return false;
00214     }

bool Rivet::PID::isMeson ( const Particle &  p  )  [inline]

is this a valid meson ID?

Definition at line 119 of file ParticleIdUtils.hh.

References isMeson(), and Particle::pdgId().

00119 { return isMeson(p.pdgId()); }

bool isMeson ( const int &  pid  ) 

is this a valid meson ID?

Definition at line 145 of file ParticleIdUtils.cc.

References abspid(), digit(), extraBits(), fundamentalID(), nj, nq1, nq2, and nq3.

Referenced by isHadron(), isMeson(), isValid(), lSpin(), sSpin(), and threeCharge().

00146     {
00147         if( extraBits(pid) > 0 ) { return false; }
00148         if( abspid(pid) <= 100 ) { return false; }
00149         if( fundamentalID(pid) <= 100 && fundamentalID(pid) > 0 ) { return false; }
00150         int aid = abspid(pid);
00151         if( aid == 130 || aid == 310 || aid == 210 ) { return true; }
00152         // EvtGen uses some odd numbers
00153         if( aid == 150 || aid == 350 || aid == 510 || aid == 530 ) { return true; }
00154         // pomeron, etc.
00155         if( pid == 110 || pid == 990 || pid == 9990 ) { return true; }
00156         if(    digit(nj,pid) > 0 && digit(nq3,pid) > 0
00157             && digit(nq2,pid) > 0 && digit(nq1,pid) == 0 ) {
00158             // check for illegal antiparticles
00159             if( digit(nq3,pid) == digit(nq2,pid) && pid < 0 ) {
00160                 return false;
00161             } else {
00162                 return true;
00163             }
00164         }
00165         return false;
00166     }

bool Rivet::PID::isNucleus ( const Particle &  p  )  [inline]

is this a valid ion ID?

Definition at line 129 of file ParticleIdUtils.hh.

References isNucleus(), and Particle::pdgId().

00129 { return isNucleus(p.pdgId()); }

bool isNucleus ( const int &  pid  ) 

is this a valid ion ID?

Definition at line 223 of file ParticleIdUtils.cc.

References abspid(), digit(), n10, and n9.

Referenced by A(), isNucleus(), isValid(), lambda(), and Z().

00224     {
00225          // a proton can also be a Hydrogen nucleus
00226          if( abspid(pid) == 2212 ) { return true; }
00227          // new standard: +/- 10LZZZAAAI
00228          if( ( digit(n10,pid) == 1 ) && ( digit(n9,pid) == 0 ) ) {
00229             // charge should always be less than or equal to baryon number
00230         // the following line is A >= Z
00231             if( (abspid(pid)/10)%1000 >= (abspid(pid)/10000)%1000 ) { return true; }
00232          }
00233          return false;
00234     }

bool Rivet::PID::isPentaquark ( const Particle &  p  )  [inline]

is this a valid pentaquark ID?

Definition at line 131 of file ParticleIdUtils.hh.

References isPentaquark(), and Particle::pdgId().

00131 { return isPentaquark(p.pdgId()); }

bool isPentaquark ( const int &  pid  ) 

is this a valid pentaquark ID?

Definition at line 237 of file ParticleIdUtils.cc.

References digit(), extraBits(), n, nj, nl, nq1, nq2, nq3, and nr.

Referenced by isHadron(), isPentaquark(), and isValid().

00238     {
00239         // a pentaquark is of the form 9abcdej,
00240         // where j is the spin and a, b, c, d, and e are quarks
00241         if( extraBits(pid) > 0 ) { return false; }
00242         if( digit(n,pid) != 9 )  { return false; }
00243         if( digit(nr,pid) == 9 || digit(nr,pid) == 0 )  { return false; }
00244         if( digit(nj,pid) == 9 || digit(nl,pid) == 0 )  { return false; }
00245         if( digit(nq1,pid) == 0 )  { return false; }
00246         if( digit(nq2,pid) == 0 )  { return false; }
00247         if( digit(nq3,pid) == 0 )  { return false; }
00248         if( digit(nj,pid) == 0 )  { return false; }
00249         // check ordering
00250         if( digit(nq2,pid) > digit(nq1,pid) )  { return false; }
00251         if( digit(nq1,pid) > digit(nl,pid) )  { return false; }
00252         if( digit(nl,pid) > digit(nr,pid) )  { return false; }
00253         return true;
00254     }

bool Rivet::PID::isRhadron ( const Particle &  p  )  [inline]

is this a valid R-hadron ID?

Definition at line 135 of file ParticleIdUtils.hh.

References isRhadron(), and Particle::pdgId().

00135 { return isRhadron(p.pdgId()); }

bool isRhadron ( const int &  pid  ) 

is this a valid R-hadron ID?

Definition at line 269 of file ParticleIdUtils.cc.

References digit(), extraBits(), isSUSY(), n, nj, nq2, nq3, and nr.

Referenced by isRhadron(), and isValid().

00270     {
00271         // an R-hadron is of the form 10abcdj,
00272         // where j is the spin and a, b, c, and d are quarks or gluons
00273         if( extraBits(pid) > 0 ) { return false; }
00274         if( digit(n,pid) != 1 )  { return false; }
00275         if( digit(nr,pid) != 0 )  { return false; }
00276         // make sure this isn't a SUSY particle
00277         if( isSUSY(pid) ) { return false; }
00278         // All R-hadrons have at least 3 core digits
00279         if( digit(nq2,pid) == 0 )  { return false; }
00280         if( digit(nq3,pid) == 0 )  { return false; }
00281         if( digit(nj,pid) == 0 )  { return false; }
00282         return true;
00283     }

bool Rivet::PID::isSUSY ( const Particle &  p  )  [inline]

is this a valid SUSY ID?

Definition at line 133 of file ParticleIdUtils.hh.

References isSUSY(), and Particle::pdgId().

00133 { return isSUSY(p.pdgId()); }

bool isSUSY ( const int &  pid  ) 

is this a valid SUSY ID?

Definition at line 257 of file ParticleIdUtils.cc.

References digit(), extraBits(), fundamentalID(), n, and nr.

Referenced by isRhadron(), isSUSY(), and isValid().

00258     {
00259         // fundamental SUSY particles have n = 1 or 2
00260         if( extraBits(pid) > 0 ) { return false; }
00261         if( digit(n,pid) != 1 && digit(n,pid) != 2 )  { return false; }
00262         if( digit(nr,pid) != 0 )  { return false; }
00263         // check fundamental part
00264         if( fundamentalID(pid) == 0 )  { return false; }
00265         return true;
00266     }

bool isValid ( const int &  pid  ) 

is this a valid ID?

Definition at line 102 of file ParticleIdUtils.cc.

References extraBits(), fundamentalID(), isBaryon(), isDiQuark(), isMeson(), isNucleus(), isPentaquark(), isRhadron(), and isSUSY().

00103     {
00104         if( extraBits(pid) > 0 ) {
00105             if( isNucleus(pid) )   { return true; }
00106             return false;
00107         }
00108         if( isSUSY(pid) ) { return true; }
00109         if( isRhadron(pid) ) { return true; }
00110         // Meson signature
00111         if( isMeson(pid) )   { return true; }
00112         // Baryon signature
00113         if( isBaryon(pid) )  { return true; }
00114         // DiQuark signature
00115         if( isDiQuark(pid) ) { return true; }
00116         // fundamental particle
00117         if( fundamentalID(pid) > 0 ) {
00118           if(pid > 0 ) {
00119             return true;
00120           } else {
00121             // AB - disabled this to remove need for PID -> name lookup.
00122             //if( hasFundamentalAnti(pid) ) { return true; }
00123             return false;
00124           }
00125         }
00126         // pentaquark
00127         if( isPentaquark(pid) ) { return true; }
00128         // don't recognize this number
00129         return false;
00130     }

int Rivet::PID::jSpin ( const Particle &  p  )  [inline]

jSpin returns 2J+1, where J is the total spin

Definition at line 151 of file ParticleIdUtils.hh.

References jSpin(), and Particle::pdgId().

00151 { return jSpin(p.pdgId()); }

int jSpin ( const int &  pid  ) 

jSpin returns 2J+1, where J is the total spin

Definition at line 337 of file ParticleIdUtils.cc.

References abspid(), extraBits(), and fundamentalID().

Referenced by jSpin().

00338     {
00339         if( fundamentalID(pid) > 0 ) {
00340         // some of these are known
00341         int fund = fundamentalID(pid);
00342         if( fund > 0 && fund < 7 ) return 2;
00343         if( fund == 9 ) return 3;
00344         if( fund > 10 && fund < 17 ) return 2;
00345         if( fund > 20 && fund < 25 ) return 3;
00346             return 0;
00347         } else if( extraBits(pid) > 0 ) {
00348             return 0;
00349         }
00350         return abspid(pid)%10;
00351     }

int Rivet::PID::lambda ( const int &  pid  ) 

Definition at line 89 of file ParticleIdUtils.cc.

References abspid(), digit(), isNucleus(), and n8.

00090     {
00091         // a proton can also be a Hydrogen nucleus
00092         if( abspid(pid) == 2212 ) { return 0; }
00093         if( isNucleus(pid) ) return digit(n8,pid);
00094         return 0;
00095     }

int Rivet::PID::lSpin ( const Particle &  p  )  [inline]

lSpin returns 2L+1, where L is the orbital angular momentum

Definition at line 155 of file ParticleIdUtils.hh.

References lSpin(), and Particle::pdgId().

00155 { return lSpin(p.pdgId()); }

int lSpin ( const int &  pid  ) 

lSpin returns 2L+1, where L is the orbital angular momentum

Definition at line 378 of file ParticleIdUtils.cc.

References digit(), isMeson(), n, nj, and nl.

Referenced by lSpin().

00379     {
00380         if( !isMeson(pid) ) { return 0; }
00381         int inl = digit(nl,pid);
00382         //int tent = digit(n,pid);
00383         int js = digit(nj,pid);
00384         if( digit(n,pid) == 9 ) { return 0; }   // tentative ID
00385         if( inl == 0 && js == 3 ) {
00386             return 0;
00387         } else if( inl == 0 && js == 5 ) {
00388             return 1;
00389         } else if( inl == 0 && js == 7 ) {
00390             return 2;
00391         } else if( inl == 0 && js == 9 ) {
00392             return 3;
00393         } else if( inl == 0  && js == 1 ) {
00394             return 0;
00395         } else if( inl == 1  && js == 3 ) {
00396             return 1;
00397         } else if( inl == 1  && js == 5 ) {
00398             return 2;
00399         } else if( inl == 1  && js == 7 ) {
00400             return 3;
00401         } else if( inl == 1  && js == 9 ) {
00402             return 4;
00403         } else if( inl == 2  && js == 3 ) {
00404             return 1;
00405         } else if( inl == 2  && js == 5 ) {
00406             return 2;
00407         } else if( inl == 2  && js == 7 ) {
00408             return 3;
00409         } else if( inl == 2  && js == 9 ) {
00410             return 4;
00411         } else if( inl == 1  && js == 1 ) {
00412             return 1;
00413         } else if( inl == 3  && js == 3 ) {
00414             return 2;
00415         } else if( inl == 3  && js == 5 ) {
00416             return 3;
00417         } else if( inl == 3  && js == 7 ) {
00418             return 4;
00419         } else if( inl == 3  && js == 9 ) {
00420             return 5;
00421         }
00422         // default to zero
00423         return 0;
00424     }

int Rivet::PID::sSpin ( const Particle &  p  )  [inline]

sSpin returns 2S+1, where S is the spin

Definition at line 153 of file ParticleIdUtils.hh.

References Particle::pdgId(), and sSpin().

00153 { return sSpin(p.pdgId()); }

int sSpin ( const int &  pid  ) 

sSpin returns 2S+1, where S is the spin

Definition at line 353 of file ParticleIdUtils.cc.

References digit(), isMeson(), n, nj, and nl.

Referenced by sSpin().

00354     {
00355         if( !isMeson(pid) ) { return 0; }
00356         int inl = digit(nl,pid);
00357         //int tent = digit(n,pid);
00358         int js = digit(nj,pid);
00359         if( digit(n,pid) == 9 ) { return 0; }   // tentative ID
00360         //if( tent == 9 ) { return 0; } // tentative assignment
00361         if( inl == 0 && js >= 3 ) {
00362             return 1;
00363         } else if( inl == 0  && js == 1 ) {
00364             return 0;
00365         } else if( inl == 1  && js >= 3 ) {
00366             return 0;
00367         } else if( inl == 2  && js >= 3 ) {
00368             return 1;
00369         } else if( inl == 1  && js == 1 ) {
00370             return 1;
00371         } else if( inl == 3  && js >= 3 ) {
00372             return 1;
00373         }
00374         // default to zero
00375         return 0;
00376     }

int Rivet::PID::threeCharge ( const Particle &  p  )  [inline]

int threeCharge ( const int &  pid  ) 

return 3 times the charge (3 x quark charge is an int)

Definition at line 427 of file ParticleIdUtils.cc.

References abspid(), charge(), digit(), extraBits(), fundamentalID(), isBaryon(), isDiQuark(), isMeson(), nj, nq1, nq2, and nq3.

Referenced by MC_ZZJETS::analyze(), MC_WWJETS::analyze(), MC_WJETS::analyze(), MC_SUSY::analyze(), H1_1994_S2919893::analyze(), CDF_1993_S2742446::analyze(), charge(), ZFinder::project(), WFinder::project(), NeutralFinalState::project(), ClusteredPhotons::project(), and threeCharge().

00428     {
00429         int charge=0;
00430         int ida, sid;
00431         unsigned short q1, q2, q3;
00432         static int ch100[100] = { -1, 2,-1, 2,-1, 2,-1, 2, 0, 0,
00433                            -3, 0,-3, 0,-3, 0,-3, 0, 0, 0,
00434                             0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
00435                             0, 0, 0, 3, 0, 0, 3, 0, 0, 0,
00436                             0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
00437                             0, 6, 3, 6, 0, 0, 0, 0, 0, 0,
00438                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00439                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00440                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00441                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
00442         q1 = digit(nq1,pid);
00443         q2 = digit(nq2,pid);
00444         q3 = digit(nq3,pid);
00445         ida = abspid(pid);
00446         sid = fundamentalID(pid);
00447         if( ida == 0 || extraBits(pid) > 0 ) {      // ion or illegal
00448             return 0;
00449         } else if( sid > 0 && sid <= 100 ) {    // use table
00450             charge = ch100[sid-1];
00451             if(ida==1000017 || ida==1000018) { charge = 0; }
00452             if(ida==1000034 || ida==1000052) { charge = 0; }
00453             if(ida==1000053 || ida==1000054) { charge = 0; }
00454             if(ida==5100061 || ida==5100062) { charge = 6; }
00455         } else if( digit(nj,pid) == 0 ) {       // KL, Ks, or undefined
00456             return 0;
00457         } else if( isMeson(pid) ) {         // mesons
00458                 if( q2 == 3 || q2 == 5 ) {
00459                     charge = ch100[q3-1] - ch100[q2-1];
00460                 } else {
00461                     charge = ch100[q2-1] - ch100[q3-1];
00462                 }
00463         } else if( isDiQuark(pid) ) {           // diquarks
00464             charge = ch100[q2-1] + ch100[q1-1];
00465         } else if( isBaryon(pid) ) {            // baryons
00466             charge = ch100[q3-1] + ch100[q2-1] + ch100[q1-1];
00467         } else {        // unknown
00468             return 0;
00469         }
00470         if( charge == 0 ) {
00471             return 0;
00472         } else if( pid < 0 ) {
00473             charge = -charge;
00474         }
00475         return charge;
00476     }

int Rivet::PID::Z ( const int &  pid  ) 

Definition at line 70 of file ParticleIdUtils.cc.

References abspid(), and isNucleus().

Referenced by ZFinder::project().

00071     {
00072         // a proton can also be a Hydrogen nucleus
00073         if( abspid(pid) == 2212 ) { return 1; }
00074         if( isNucleus(pid) ) return (abspid(pid)/10000)%1000;
00075         return 0;
00076     }