Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Pdt Class Reference

#include <Pdt.h>

List of all members.

Static Public Member Functions

void addDecay (PdtLund::LundType id, float bf, PdtLund::LundType child1, PdtLund::LundType child2=PdtLund::null, PdtLund::LundType child3=PdtLund::null, PdtLund::LundType child4=PdtLund::null, PdtLund::LundType child5=PdtLund::null)
void addDecay (const char *pname, float bf, const char *child1, const char *child2=0, const char *child3=0, const char *child4=0, const char *child5=0)
void addDecay (PdtLund::LundType id, float bf, PdtLund::LundType child1, PdtLund::LundType child2=PdtLund::null, PdtLund::LundType child3=PdtLund::null, PdtLund::LundType child4=PdtLund::null, PdtLund::LundType child5=PdtLund::null)
void addDecay (const char *pname, float bf, const char *child1, const char *child2=0, const char *child3=0, const char *child4=0, const char *child5=0)
void addParticle (const char *pname, PdtGeant::GeantType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
void addParticle (const char *pname, PdtLund::LundType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
void addParticle (const char *pname, PdtGeant::GeantType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
void addParticle (const char *pname, PdtLund::LundType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
PdtLund::LundType antiCode (PdtLund::LundType)
PdtLund::LundType antiCode (PdtLund::LundType)
float charge (const char *name)
float charge (PdtGeant::GeantType id)
float charge (PdtLund::LundType id)
float charge (const char *name)
float charge (PdtGeant::GeantType id)
float charge (PdtLund::LundType id)
const PdtEntryconjugate (const PdtEntry *)
const PdtEntryconjugate (const PdtEntry *)
void deleteAll ()
void deleteAll ()
PdtGeant::GeantType geantId (const int id)
PdtGeant::GeantType geantId (const PdtPdg::PdgType pdg)
PdtGeant::GeantType geantId (const PdtPid::PidNeutralType, int charge=0)
PdtGeant::GeantType geantId (const PdtPid::PidType, int charge=-1)
PdtGeant::GeantType geantId (const PdtLund::LundType)
PdtGeant::GeantType geantId (const int id)
PdtGeant::GeantType geantId (const PdtPdg::PdgType pdg)
PdtGeant::GeantType geantId (const PdtPid::PidNeutralType, int charge=0)
PdtGeant::GeantType geantId (const PdtPid::PidType, int charge=-1)
PdtGeant::GeantType geantId (const PdtLund::LundType)
float lifetime (const char *name)
float lifetime (PdtPid::PidNeutralType id)
float lifetime (PdtPid::PidType id)
float lifetime (PdtGeant::GeantType id)
float lifetime (PdtLund::LundType id)
float lifetime (const char *name)
float lifetime (PdtPid::PidNeutralType id)
float lifetime (PdtPid::PidType id)
float lifetime (PdtGeant::GeantType id)
float lifetime (PdtLund::LundType id)
PdtEntrylookup (PdtPid::PidNeutralType id, int charge=0)
PdtEntrylookup (PdtPid::PidType id, int charge=-1)
PdtEntrylookup (PdtPdg::PdgType id)
PdtEntrylookup (PdtGeant::GeantType id)
PdtEntrylookup (PdtLund::LundType id)
PdtEntrylookup (const std::string &name)
PdtEntrylookup (PdtPid::PidNeutralType id, int charge=0)
PdtEntrylookup (PdtPid::PidType id, int charge=-1)
PdtEntrylookup (PdtPdg::PdgType id)
PdtEntrylookup (PdtGeant::GeantType id)
PdtEntrylookup (PdtLund::LundType id)
PdtEntrylookup (const std::string &name)
PdtLund::LundType lundId (const int id)
PdtLund::LundType lundId (const PdtPid::PidNeutralType, int charge=0)
PdtLund::LundType lundId (const PdtPid::PidType, int charge=-1)
PdtLund::LundType lundId (const PdtPdg::PdgType)
PdtLund::LundType lundId (const PdtGeant::GeantType)
PdtLund::LundType lundId (const int id)
PdtLund::LundType lundId (const PdtPid::PidNeutralType, int charge=0)
PdtLund::LundType lundId (const PdtPid::PidType, int charge=-1)
PdtLund::LundType lundId (const PdtPdg::PdgType)
PdtLund::LundType lundId (const PdtGeant::GeantType)
float mass (const char *name)
float mass (PdtPid::PidNeutralType id)
float mass (PdtPid::PidType id)
float mass (PdtGeant::GeantType id)
float mass (PdtLund::LundType id)
float mass (const char *name)
float mass (PdtPid::PidNeutralType id)
float mass (PdtPid::PidType id)
float mass (PdtGeant::GeantType id)
float mass (PdtLund::LundType id)
PdtPdg::PdgType pdgId (const int id)
PdtPdg::PdgType pdgId (const PdtPid::PidNeutralType pid, int charge=0)
PdtPdg::PdgType pdgId (const PdtPid::PidType pid, int charge=-1)
PdtPdg::PdgType pdgId (const PdtLund::LundType)
PdtPdg::PdgType pdgId (const int id)
PdtPdg::PdgType pdgId (const PdtPid::PidNeutralType pid, int charge=0)
PdtPdg::PdgType pdgId (const PdtPid::PidType pid, int charge=-1)
PdtPdg::PdgType pdgId (const PdtLund::LundType)
PdtPdg::PdgType pdgPid (const PdtGeant::GeantType geant)
PdtPdg::PdgType pdgPid (const PdtGeant::GeantType geant)
PdtPid::PidType pidId (const int id)
PdtPid::PidType pidId (const PdtPdg::PdgType pdg)
PdtPid::PidType pidId (const PdtGeant::GeantType)
PdtPid::PidType pidId (const PdtLund::LundType)
PdtPid::PidType pidId (const int id)
PdtPid::PidType pidId (const PdtPdg::PdgType pdg)
PdtPid::PidType pidId (const PdtGeant::GeantType)
PdtPid::PidType pidId (const PdtLund::LundType)
PdtPid::PidNeutralType pidNeutId (const int id)
PdtPid::PidNeutralType pidNeutId (const PdtPdg::PdgType pdg)
PdtPid::PidNeutralType pidNeutId (const PdtGeant::GeantType)
PdtPid::PidNeutralType pidNeutId (const PdtLund::LundType)
PdtPid::PidNeutralType pidNeutId (const int id)
PdtPid::PidNeutralType pidNeutId (const PdtPdg::PdgType pdg)
PdtPid::PidNeutralType pidNeutId (const PdtGeant::GeantType)
PdtPid::PidNeutralType pidNeutId (const PdtLund::LundType)
void printOn (std::ostream &)
void printOn (std::ostream &)
void readMCppTable (std::string filenm)
void readMCppTable (std::string filenm)
bool sameOrConj (PdtEntry *id1, PdtEntry *id2)
bool sameOrConj (PdtPdg::PdgType id1, PdtPdg::PdgType id2)
bool sameOrConj (PdtLund::LundType id1, PdtLund::LundType id2)
bool sameOrConj (PdtEntry *id1, PdtEntry *id2)
bool sameOrConj (PdtPdg::PdgType id1, PdtPdg::PdgType id2)
bool sameOrConj (PdtLund::LundType id1, PdtLund::LundType id2)
float spin (const char *name)
float spin (PdtPid::PidNeutralType id)
float spin (PdtPid::PidType id)
float spin (PdtGeant::GeantType id)
float spin (PdtLund::LundType id)
float spin (const char *name)
float spin (PdtPid::PidNeutralType id)
float spin (PdtPid::PidType id)
float spin (PdtGeant::GeantType id)
float spin (PdtLund::LundType id)
float width (const char *name)
float width (PdtPid::PidNeutralType id)
float width (PdtPid::PidType id)
float width (PdtGeant::GeantType id)
float width (PdtLund::LundType id)
float width (const char *name)
float width (PdtPid::PidNeutralType id)
float width (PdtPid::PidType id)
float width (PdtGeant::GeantType id)
float width (PdtLund::LundType id)

Static Private Member Functions

unsigned PdtNameHash (const std::string &c)
unsigned PdtNameHash (const std::string &c)
unsigned PdtNumHash (const int &num)
unsigned PdtNumHash (const int &num)

Static Private Attributes

std::map< int, PdtEntry * > * _entries
std::map< int, PdtEntry * > * _entries = new map<int PdtEntry*>
std::map< int, PdtEntry * > * _entriesg
std::map< int, PdtEntry * > * _entriesg = new map<int PdtEntry*>
std::map< int, PdtEntry * > * _entriesl
std::map< int, PdtEntry * > * _entriesl = new map<int PdtEntry*>
AstStringMap< PdtEntry > * _entriesn
AstStringMap< PdtEntry > * _entriesn = new AstStringMap< PdtEntry >
PdtEntry_negativeEntries [5]
PdtEntry_negativeEntries [5] = {0,0,0,0,0}
PdtEntry_neutralEntries [5]
PdtEntry_neutralEntries [5] = {0,0,0,0,0}
PdtEntry_positiveEntries [5]
PdtEntry_positiveEntries [5] = {0,0,0,0,0}


Member Function Documentation

void Pdt::addDecay PdtLund::LundType  id,
float  bf,
PdtLund::LundType  child1,
PdtLund::LundType  child2 = PdtLund::null,
PdtLund::LundType  child3 = PdtLund::null,
PdtLund::LundType  child4 = PdtLund::null,
PdtLund::LundType  child5 = PdtLund::null
[static]
 

void Pdt::addDecay const char *  pname,
float  bf,
const char *  child1,
const char *  child2 = 0,
const char *  child3 = 0,
const char *  child4 = 0,
const char *  child5 = 0
[static]
 

void Pdt::addDecay PdtLund::LundType  id,
float  bf,
PdtLund::LundType  child1,
PdtLund::LundType  child2 = PdtLund::null,
PdtLund::LundType  child3 = PdtLund::null,
PdtLund::LundType  child4 = PdtLund::null,
PdtLund::LundType  child5 = PdtLund::null
[static]
 

00187                                           {
00188  
00189   PdtEntry *primary = lookup(id);
00190   if (primary == 0) return;
00191 
00192   PdtLund::LundType children[5] = {child1, child2, child3, child4, child5};
00193   vector<PdtEntry*> *kids = new vector<PdtEntry*>;
00194   
00195   int nkids;
00196   for(nkids=0; nkids<5 && children[nkids]!=0; nkids++ )
00197   {  
00198     PdtEntry* secondary = lookup(children[nkids]);
00199     if( secondary ==0 ) break;
00200     kids->push_back(secondary);
00201   }
00202   
00203   primary->addDecay(bf, kids );
00204 
00205 }

void Pdt::addDecay const char *  pname,
float  bf,
const char *  child1,
const char *  child2 = 0,
const char *  child3 = 0,
const char *  child4 = 0,
const char *  child5 = 0
[static]
 

00162                                                           {
00163  
00164   PdtEntry *primary = lookup(pname);
00165   if (primary == 0) return;
00166   const char *children[5] = {child1, child2, child3, child4, child5};
00167 
00168   vector<PdtEntry*> *kids = new vector<PdtEntry*>;
00169   
00170   int nkids;
00171   for(nkids=0; nkids<5 && children[nkids]!=0; nkids++ )
00172   {  
00173     PdtEntry* secondary = lookup(children[nkids]);
00174     if( secondary ==0 ) break;
00175     kids->push_back(secondary);
00176   }
00177   
00178   primary->addDecay(bf, kids );
00179 
00180 }

void Pdt::addParticle const char *  pname,
PdtGeant::GeantType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0
[static]
 

void Pdt::addParticle const char *  pname,
PdtLund::LundType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0
[static]
 

void Pdt::addParticle const char *  pname,
PdtGeant::GeantType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0
[static]
 

00127                                              {
00128 
00129   PdtEntry* nentry = new PdtEntry(pname, id, spin, charge, mass, width, cut);
00130 
00131   (*_entries)[pdgId(id)]=nentry;
00132   if ( (*_entriesn)[pname] != 0 ) {
00133     //cout << "Pdt::addParticle:adding existing particle:"<<pname<<endl;
00134   }
00135 
00136   _entriesn->insert( pname )=nentry;
00137   if(PdtGeant::null!=nentry->geantId()){
00138     (*_entriesg)[id]=nentry;
00139   }
00140 
00141   (*_entriesl)[lundId(id)]=nentry;
00142 
00143   if(PdtPid::null!=nentry->pidId()) {
00144     if(nentry->charge()>0) {
00145       _positiveEntries[nentry->pidId()]=nentry;
00146     }else{
00147       _negativeEntries[nentry->pidId()]=nentry;
00148     }
00149 
00150   }
00151 
00152   if(PdtPid::none!=nentry->pidNeutId()){
00153     if(nentry->charge()==0) {
00154       _neutralEntries[nentry->pidNeutId()]=nentry;
00155     }
00156   }
00157 
00158 }

void Pdt::addParticle const char *  pname,
PdtLund::LundType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0
[static]
 

00093                                              {
00094 
00095   PdtEntry* nentry = new PdtEntry(pname, id, spin, charge, mass, width, cut);
00096   (*_entries)[pdgId(id)]=nentry;
00097 
00098   if ( (*_entriesn)[pname] != 0 ) {
00099     //cout << "Pdt::addParticle:adding existing particle:"<<pname<<endl;
00100   }
00101 
00102   _entriesn->insert( pname )=nentry;
00103   if(PdtGeant::null!=nentry->geantId()){
00104     (*_entriesg)[nentry->geantId()]=nentry;
00105   }
00106 
00107   (*_entriesl)[id]=nentry;
00108 
00109   if(PdtPid::null!=nentry->pidId()) {
00110     if(nentry->charge()>0) {
00111       _positiveEntries[nentry->pidId()]=nentry;
00112     }else{
00113       _negativeEntries[nentry->pidId()]=nentry;
00114     }
00115   }
00116 
00117   if(PdtPid::none!=nentry->pidNeutId()){
00118     if(nentry->charge()==0){
00119       _neutralEntries[nentry->pidNeutId()]=nentry;
00120     }
00121   }
00122 
00123 }

PdtLund::LundType Pdt::antiCode PdtLund::LundType   )  [static]
 

PdtLund::LundType Pdt::antiCode PdtLund::LundType   )  [static]
 

00073                                                   {
00074 
00075   int kf = (int) kf_id;
00076   
00077   int i2 = (kf/10) % 10;
00078   int i3 = (kf/100) % 10;
00079   int i4 = (kf/1000) % 10;
00080   
00081   if (i2 == i3 && i4 == 0 && kf > 100)
00082     return lundId(kf);
00083   else if (kf >= 21 && kf <= 23) return lundId(kf);
00084   
00085   else if (kf == 310) return lundId(130);
00086   else if (kf == 130) return lundId(310);
00087   
00088   else return lundId(-kf);
00089 }

float Pdt::charge const char *  name  )  [inline, static]
 

00105 { return lookup(name)->charge(); }

float Pdt::charge PdtGeant::GeantType  id  )  [inline, static]
 

00104 { return lookup(id)->charge(); }

float Pdt::charge PdtLund::LundType  id  )  [inline, static]
 

00103 { return lookup(id)->charge(); }

float Pdt::charge const char *  name  )  [inline, static]
 

00105 { return lookup(name)->charge(); }

float Pdt::charge PdtGeant::GeantType  id  )  [inline, static]
 

00104 { return lookup(id)->charge(); }

float Pdt::charge PdtLund::LundType  id  )  [inline, static]
 

00103 { return lookup(id)->charge(); }

const PdtEntry* Pdt::conjugate const PdtEntry  )  [static]
 

const PdtEntry * Pdt::conjugate const PdtEntry  )  [static]
 

00682 {
00683   if( pdt==0 ) return 0;
00684   PdtEntry* conjPdt = (PdtEntry*) pdt;
00685 
00686   // get the key
00687   int key = (int) pdt->pdgId();
00688 
00689   // switch the key
00690   key *= -1;
00691   
00692   // look for an entry in the dictionary
00693 
00694   map<int, PdtEntry*>::iterator iter=_entries->find(key);
00695   
00696   if ( iter!=_entries->end()  ) {
00697     //found a match.
00698     conjPdt=iter->second;
00699   }
00700   //otherwise its self conjugate - we should just return..
00701 
00702   // return the conjugate
00703   return conjPdt;
00704 }

void Pdt::deleteAll  )  [static]
 

void Pdt::deleteAll  )  [static]
 

00393                    {
00394 
00395   PdtEntry *p;
00396 
00397   map<int, PdtEntry*>::iterator iter=_entries->begin();
00398 
00399   while ( iter != _entries->end()) {
00400     p = iter->second;
00401     assert(0!=p);
00402     delete p;
00403     ++iter;
00404   }
00405 
00406   _entries->clear();
00407   _entriesn->clear();
00408   _entriesg->clear();
00409   _entriesl->clear();
00410 }

PdtGeant::GeantType Pdt::geantId const int  id  )  [inline, static]
 

00181 { return (PdtGeant::GeantType) id; }; 

PdtGeant::GeantType Pdt::geantId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00161     { return geantId(lundId(pdg)); }

PdtGeant::GeantType Pdt::geantId const PdtPid::PidNeutralType  ,
int  charge = 0
[static]
 

PdtGeant::GeantType Pdt::geantId const PdtPid::PidType  ,
int  charge = -1
[static]
 

PdtGeant::GeantType Pdt::geantId const PdtLund::LundType   )  [static]
 

PdtGeant::GeantType Pdt::geantId const int  id  )  [inline, static]
 

00181 { return (PdtGeant::GeantType) id; }; 

PdtGeant::GeantType Pdt::geantId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00161     { return geantId(lundId(pdg)); }

PdtGeant::GeantType Pdt::geantId const PdtPid::PidNeutralType  ,
int  charge = 0
[static]
 

00504                                                                         {
00505   return geantId(lundId(pId, charge)); 
00506 }

PdtGeant::GeantType Pdt::geantId const PdtPid::PidType  ,
int  charge = -1
[static]
 

00500                                                                  {
00501   return geantId(lundId(pId, charge)); 
00502 }

PdtGeant::GeantType Pdt::geantId const PdtLund::LundType   )  [static]
 

00427                                                        {
00428 
00429   //
00430   // special case:
00431   // GEANT has only one neutrino
00432   //
00433   if (lId == PdtLund::nu_e ||
00434       lId == PdtLund::anti_nu_e ||
00435       lId == PdtLund::nu_mu ||
00436       lId == PdtLund::anti_nu_mu ||
00437       lId == PdtLund::nu_tau ||
00438       lId == PdtLund::anti_nu_tau )
00439   { return PdtGeant::nu_e; }
00440   else
00441   {
00442     int i;
00443     for(i = 0; i< PdtGeant::_nGeantId; i++)
00444     { if (PdtGeant::_lundId[i] == lId) return geantId(i); }
00445     return PdtGeant::null;
00446   }
00447 }

float Pdt::lifetime const char *  name  )  [inline, static]
 

00093 { return lookup(name)->lifetime(); }

float Pdt::lifetime PdtPid::PidNeutralType  id  )  [inline, static]
 

00092 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtPid::PidType  id  )  [inline, static]
 

00091 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtGeant::GeantType  id  )  [inline, static]
 

00090 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtLund::LundType  id  )  [inline, static]
 

00089 { return lookup(id)->lifetime(); }

float Pdt::lifetime const char *  name  )  [inline, static]
 

00093 { return lookup(name)->lifetime(); }

float Pdt::lifetime PdtPid::PidNeutralType  id  )  [inline, static]
 

00092 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtPid::PidType  id  )  [inline, static]
 

00091 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtGeant::GeantType  id  )  [inline, static]
 

00090 { return lookup(id)->lifetime(); }

float Pdt::lifetime PdtLund::LundType  id  )  [inline, static]
 

00089 { return lookup(id)->lifetime(); }

PdtEntry* Pdt::lookup PdtPid::PidNeutralType  id,
int  charge = 0
[static]
 

PdtEntry* Pdt::lookup PdtPid::PidType  id,
int  charge = -1
[static]
 

PdtEntry* Pdt::lookup PdtPdg::PdgType  id  )  [static]
 

PdtEntry* Pdt::lookup PdtGeant::GeantType  id  )  [static]
 

PdtEntry* Pdt::lookup PdtLund::LundType  id  )  [static]
 

PdtEntry* Pdt::lookup const std::string &  name  )  [static]
 

PdtEntry * Pdt::lookup PdtPid::PidNeutralType  id,
int  charge = 0
[static]
 

00235                                                             {
00236 
00237   // look for the particle by PID code id and charge
00238 
00239   if(id==PdtPid::none) return lookup(PdtLund::null);
00240   return _neutralEntries[id];
00241 
00242 }

PdtEntry * Pdt::lookup PdtPid::PidType  id,
int  charge = -1
[static]
 

00226                                                  {
00227 
00228   // look for the particle by PID code id and charge
00229   if(id==PdtPid::null) return lookup(PdtLund::null);
00230   if(charge>0) return _positiveEntries[id];
00231   return _negativeEntries[id];
00232 
00233 }

PdtEntry * Pdt::lookup PdtPdg::PdgType  id  )  [static]
 

00221                                      {
00222   // look for the particle by PDG id
00223   return (*_entries)[id];
00224 }

PdtEntry * Pdt::lookup PdtGeant::GeantType  id  )  [static]
 

00216                                          {
00217   // look for the particle by GEANT id
00218   return (*_entriesg)[id];
00219 }

PdtEntry * Pdt::lookup PdtLund::LundType  id  )  [static]
 

00211                                        {
00212   // look for the particle by Particle Data Group id
00213   return (*_entriesl)[id];
00214 }

PdtEntry * Pdt::lookup const std::string &  name  )  [static]
 

00207                                             {
00208   return (*_entriesn)[name];
00209 }

PdtLund::LundType Pdt::lundId const int  id  )  [inline, static]
 

00180 { return (PdtLund::LundType) id; }; 

PdtLund::LundType Pdt::lundId const PdtPid::PidNeutralType  ,
int  charge = 0
[static]
 

PdtLund::LundType Pdt::lundId const PdtPid::PidType  ,
int  charge = -1
[static]
 

PdtLund::LundType Pdt::lundId const PdtPdg::PdgType   )  [static]
 

PdtLund::LundType Pdt::lundId const PdtGeant::GeantType   )  [static]
 

PdtLund::LundType Pdt::lundId const int  id  )  [inline, static]
 

00180 { return (PdtLund::LundType) id; }; 

PdtLund::LundType Pdt::lundId const PdtPid::PidNeutralType  ,
int  charge = 0
[static]
 

00553                                                                       {
00554   
00555   if (charge == 0)
00556     {
00557      switch(pId)
00558      {
00559        case PdtPid::gamma:
00560          return PdtLund::gamma;
00561        case PdtPid::pi0:
00562          return PdtLund::pi0;
00563        case PdtPid::K0L:
00564          return PdtLund::K_L0;
00565        case PdtPid::neutron:
00566          return PdtLund::n0;
00567        case PdtPid::anti_neutron:
00568          return PdtLund::anti_n0;
00569        default:
00570          return PdtLund::null;
00571      }
00572     }
00573   else
00574     {
00575       cerr << "error: wrong charge; must be +1 or -1" << endl;
00576       return PdtLund::null;
00577     }
00578 }

PdtLund::LundType Pdt::lundId const PdtPid::PidType  ,
int  charge = -1
[static]
 

00508                                                                {
00509  
00510   if(charge == -1)
00511     {
00512      switch(pId)
00513      {
00514        case PdtPid::electron:
00515          return PdtLund::e_minus;
00516        case PdtPid::muon:
00517          return PdtLund::pi_minus;
00518        case PdtPid::pion:
00519          return PdtLund::pi_minus;
00520        case PdtPid::kaon:
00521          return PdtLund::K_minus;
00522        case PdtPid::proton:
00523          return PdtLund::anti_p_minus;
00524        default:
00525          return PdtLund::null;
00526      } 
00527     }
00528   else if (charge == 1)
00529     {
00530      switch(pId)
00531      {
00532        case PdtPid::electron:
00533          return PdtLund::e_plus;
00534        case PdtPid::muon:
00535          return PdtLund::pi_plus;
00536        case PdtPid::pion:
00537          return PdtLund::pi_plus;
00538        case PdtPid::kaon:
00539          return PdtLund::K_plus;
00540        case PdtPid::proton:
00541          return PdtLund::p_plus;
00542        default:
00543          return PdtLund::null;
00544      } 
00545     }
00546   else
00547     {
00548       cerr << "error: wrong charge; must be +1 or -1" << endl;
00549       return PdtLund::null;
00550     }
00551 }

PdtLund::LundType Pdt::lundId const PdtPdg::PdgType   )  [static]
 

00580                                                      {
00581 
00582   int ret;
00583   switch ( (int) pdg ) {
00584   case 551:           // chi_0b
00585     ret = 10551 ;
00586   case 10443:         // chi_1c
00587     ret = 20443 ;
00588   case 20443:         // psi(2S) 
00589     ret = 30443 ;
00590   case 30443:         // psi(3770)
00591     ret = 40443 ;
00592   case 20553:         // Upsilon(2S)
00593     ret = 30553 ;
00594   case 4322:          // Xi_c+
00595     ret = 4232 ;
00596   case -4322:         // Anti Xi_c+
00597     ret = -4232 ;
00598   case 4232:          // Xi'_c+
00599     ret = 4322 ;
00600   case -4232:         // Anti Xi'_c+
00601     ret = -4322 ;
00602   default:            // All the rest is the same (hopefully)
00603     ret = (int) pdg;
00604   } 
00605   return lundId(ret);
00606 }

PdtLund::LundType Pdt::lundId const PdtGeant::GeantType   )  [static]
 

00413                                                       { 
00414 
00415   if (gId == PdtGeant::deuteron ||
00416       gId == PdtGeant::tritium ||
00417       gId == PdtGeant::alpha ||
00418       gId == PdtGeant::geantino ||
00419       gId == PdtGeant::He3 ||
00420       gId == PdtGeant::Cerenkov)
00421   { return PdtLund::null; }
00422   else
00423   { return PdtGeant::_lundId[gId - PdtGeant::_firstGeantId]; }
00424 
00425 }

float Pdt::mass const char *  name  )  [inline, static]
 

00079 { return lookup(name)->mass(); }

float Pdt::mass PdtPid::PidNeutralType  id  )  [inline, static]
 

00078 { return lookup(id)->mass();}

float Pdt::mass PdtPid::PidType  id  )  [inline, static]
 

00077 { return lookup(id)->mass();}

float Pdt::mass PdtGeant::GeantType  id  )  [inline, static]
 

00076 { return lookup(id)->mass(); }

float Pdt::mass PdtLund::LundType  id  )  [inline, static]
 

00075 { return lookup(id)->mass(); }

float Pdt::mass const char *  name  )  [inline, static]
 

00079 { return lookup(name)->mass(); }

float Pdt::mass PdtPid::PidNeutralType  id  )  [inline, static]
 

00078 { return lookup(id)->mass();}

float Pdt::mass PdtPid::PidType  id  )  [inline, static]
 

00077 { return lookup(id)->mass();}

float Pdt::mass PdtGeant::GeantType  id  )  [inline, static]
 

00076 { return lookup(id)->mass(); }

float Pdt::mass PdtLund::LundType  id  )  [inline, static]
 

00075 { return lookup(id)->mass(); }

PdtPdg::PdgType Pdt::pdgId const int  id  )  [inline, static]
 

00184 { return (PdtPdg::PdgType) id; };

PdtPdg::PdgType Pdt::pdgId const PdtPid::PidNeutralType  pid,
int  charge = 0
[inline, static]
 

00153     { return pdgId(lundId(pid, charge)); }

PdtPdg::PdgType Pdt::pdgId const PdtPid::PidType  pid,
int  charge = -1
[inline, static]
 

00151     { return pdgId(lundId(pid, charge)); }

PdtPdg::PdgType Pdt::pdgId const PdtLund::LundType   )  [static]
 

PdtPdg::PdgType Pdt::pdgId const int  id  )  [inline, static]
 

00184 { return (PdtPdg::PdgType) id; };

PdtPdg::PdgType Pdt::pdgId const PdtPid::PidNeutralType  pid,
int  charge = 0
[inline, static]
 

00153     { return pdgId(lundId(pid, charge)); }

PdtPdg::PdgType Pdt::pdgId const PdtPid::PidType  pid,
int  charge = -1
[inline, static]
 

00151     { return pdgId(lundId(pid, charge)); }

PdtPdg::PdgType Pdt::pdgId const PdtLund::LundType   )  [static]
 

00608                                                      {
00609 
00610   int ret;
00611   switch ( (int) lund ) {
00612   case 551:           // eta_b does not exist in PDG
00613     ret = 0 ;
00614   case 10551:         // chi_0b
00615     ret = 551 ;
00616   case 10443:         // h_1c does not exist in PDG
00617     ret = 0 ;
00618   case 20443:         // chi_1c
00619     ret = 10443 ;
00620   case 30443:         // psi(2S) 
00621     ret = 20443 ;
00622   case 40443:         // psi(3770)
00623     ret = 30443 ;
00624   case 30553:         // Upsilon(2S)
00625     ret = 20553 ;
00626   case 4232:          // Xi_c+
00627     ret = 4322 ;
00628   case -4232:         // Anti Xi_c+
00629     ret = -4322 ;
00630   case 4322:          // Xi'_c+
00631     ret = 4232 ;
00632   case -4322:         // Anti Xi'_c+
00633     ret = -4232 ;
00634   default:            // All the rest is the same (hopefully)
00635     ret = (int) lund ;
00636   }
00637   return pdgId(ret);
00638 }

PdtPdg::PdgType Pdt::pdgPid const PdtGeant::GeantType  geant  )  [inline, static]
 

00155     { return pdgId(lundId(geant)); }

PdtPdg::PdgType Pdt::pdgPid const PdtGeant::GeantType  geant  )  [inline, static]
 

00155     { return pdgId(lundId(geant)); }

unsigned Pdt::PdtNameHash const std::string &  c  )  [static, private]
 

unsigned Pdt::PdtNameHash const std::string &  c  )  [static, private]
 

00650                                         {
00651 
00652   int i;
00653   int hash=0;
00654 
00655   for(i=0;i<(int)c.length();i++){
00656     hash=(153*hash+(int)c[i])%PdtHashSize;
00657   }
00658 
00659   return hash;
00660 
00661 }

unsigned Pdt::PdtNumHash const int &  num  )  [static, private]
 

unsigned Pdt::PdtNumHash const int &  num  )  [static, private]
 

00642                                       {
00643 
00644   //Simple hash function from particle numbers
00645 
00646   if (num>0) return num%PdtHashSize;
00647   return (1-num)%PdtHashSize;
00648 }

PdtPid::PidType Pdt::pidId const int  id  )  [inline, static]
 

00182 { return (PdtPid::PidType) id; }; 

PdtPid::PidType Pdt::pidId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00166     { return pidId(lundId(pdg)); }

PdtPid::PidType Pdt::pidId const PdtGeant::GeantType   )  [static]
 

PdtPid::PidType Pdt::pidId const PdtLund::LundType   )  [static]
 

PdtPid::PidType Pdt::pidId const int  id  )  [inline, static]
 

00182 { return (PdtPid::PidType) id; }; 

PdtPid::PidType Pdt::pidId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00166     { return pidId(lundId(pdg)); }

PdtPid::PidType Pdt::pidId const PdtGeant::GeantType   )  [static]
 

00492                                                    {
00493   return pidId(lundId(gId)); 
00494 }

PdtPid::PidType Pdt::pidId const PdtLund::LundType   )  [static]
 

00449                                                  {
00450 
00451   switch (lId)
00452   {
00453     case PdtLund::e_minus:
00454     case PdtLund::e_plus:
00455       return PdtPid::electron;
00456     case PdtLund::mu_minus:
00457     case PdtLund::mu_plus:
00458       return PdtPid::muon;
00459     case PdtLund::pi_minus:
00460     case PdtLund::pi_plus:
00461       return PdtPid::pion;
00462     case  PdtLund::K_minus:
00463     case PdtLund::K_plus:
00464        return PdtPid::kaon;
00465     case PdtLund::p_plus:
00466     case PdtLund::anti_p_minus:
00467       return PdtPid::proton;
00468     default:
00469        return PdtPid::null;
00470   }
00471 }

PdtPid::PidNeutralType Pdt::pidNeutId const int  id  )  [inline, static]
 

00183 { return (PdtPid::PidNeutralType) id; };

PdtPid::PidNeutralType Pdt::pidNeutId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00170     { return pidNeutId(lundId(pdg)); }

PdtPid::PidNeutralType Pdt::pidNeutId const PdtGeant::GeantType   )  [static]
 

PdtPid::PidNeutralType Pdt::pidNeutId const PdtLund::LundType   )  [static]
 

PdtPid::PidNeutralType Pdt::pidNeutId const int  id  )  [inline, static]
 

00183 { return (PdtPid::PidNeutralType) id; };

PdtPid::PidNeutralType Pdt::pidNeutId const PdtPdg::PdgType  pdg  )  [inline, static]
 

00170     { return pidNeutId(lundId(pdg)); }

PdtPid::PidNeutralType Pdt::pidNeutId const PdtGeant::GeantType   )  [static]
 

00496                                                               { 
00497   return pidNeutId(lundId(gId)); 
00498 }

PdtPid::PidNeutralType Pdt::pidNeutId const PdtLund::LundType   )  [static]
 

00473                                                             {
00474 
00475   switch (lId)
00476     {
00477     case PdtLund::gamma:
00478       return PdtPid::gamma;
00479     case PdtLund::pi0:
00480       return PdtPid::pi0;
00481     case PdtLund::K_L0:
00482       return PdtPid::K0L;
00483     case PdtLund::anti_n0:
00484       return PdtPid::anti_neutron;
00485     case PdtLund::n0:
00486       return PdtPid::neutron;
00487     default:
00488       return PdtPid::none;
00489     }
00490 }

void Pdt::printOn std::ostream  )  [static]
 

void Pdt::printOn std::ostream  )  [static]
 

00244                               {
00245 
00246   //lange move printouts here
00247   cout << "Number of particles in tables: "<<endl
00248        << "By pdt number   :" << _entries->size() <<endl
00249        << "By name         :" << _entriesn->size()<<endl
00250        << "By geant number :" << _entriesg->size()<<endl
00251        << "By lund number  :" <<_entriesl->size()<<endl;
00252 
00253   cout << '\n'; 
00254   int i;
00255   for (i=0;i<72;i++) cout << '-'; 
00256   cout<<'\n';
00257   
00258   cout << "                 Particle Data Table\n\n";
00259   cout << "   id  name       mass    width    spin  charge  lifetime\n";
00260   cout << "                  (GeV)   (GeV)                  (cm)    \n";
00261   for (i=0; i<72; i++) cout << '-';
00262   cout << '\n'; 
00263   
00264   PdtEntry *p;
00265 
00266   map<int, PdtEntry*>::iterator iter=_entries->begin();
00267 
00268   while ( iter != _entries->end()) {
00269     p = iter->second;
00270     assert(0!=p);
00271     p->printOn(cout);
00272     p->printBFOn(cout);
00273     ++iter;
00274   }
00275   cout << '\n'; 
00276   for (i=0; i<72; i++) cout << '-';
00277   cout << '\n';
00278 
00279   map<int, PdtEntry*>::iterator iter1=_entries->begin();
00280 
00281   while ( iter1 != _entries->end()) {
00282     p=iter1->second;
00283     cout << "The conjuate of "<< p->name() << " is ";
00284     cout << conjugate(p)->name() <<endl;
00285     iter1++;
00286   }  
00287 }

void Pdt::readMCppTable std::string  filenm  )  [static]
 

void Pdt::readMCppTable std::string  filenm  )  [static]
 

00291                                     {
00292 
00293   string path = filenm;
00294   char line[512];
00295   FILE *ifl = fopen(path.c_str(),"r");
00296 
00297   if(0 == ifl) cout<<" Pdt::readMCppTable: please copy " <<
00298                      filenm << " in to your run directory!"<<
00299                      std::endl;
00300   assert(0!=ifl);
00301 
00302   while ( fgets(line,512,ifl) )
00303   { 
00304     if (strlen(line) >= 511)
00305       {
00306         cerr << "Pdt.read : input line is too long\n";
00307         assert(0);
00308       }
00309     istrstream linestr(line);
00310     string opcode;
00311     char subcode;
00312     linestr >> opcode >> subcode;
00313     
00314     if( opcode == "end" )
00315       break;
00316     
00317     else if( opcode == "add" )
00318     {
00319       switch (subcode)
00320         {
00321         case 'p':
00322           {
00323             string classname;
00324             linestr >> classname;
00325             // if (classname == "Collision" || classname == "Parton") 
00326             if (classname == "Collision" ) 
00327               continue;
00328             
00329             string name;
00330             int type;
00331             float mass, width, cut, charge, spin, lifetime;
00332             
00333             linestr >> name >> type;
00334             linestr >> mass >> width >> cut >> charge;
00335             linestr >> spin >> lifetime;
00336             
00337             charge /= 3.0;
00338             if (classname != "Meson")
00339               spin /= 2.0;
00340             
00341             // lifetime is c*tau (mm)
00342             if (lifetime > 0.0 && width < 1e-10)
00343               width = HBARC / (lifetime/10.0);
00344             
00345             addParticle(name.c_str(), lundId(type), spin, charge, mass, width, cut);
00346             break;
00347           }
00348           
00349         case 'c':
00350           {
00351             int     ptype, nchild;
00352             float   bf;
00353             string decayer;
00354             
00355             linestr >> ptype >> bf >> decayer >> nchild;
00356             PdtEntry *parent = lookup(lundId(ptype));
00357             if (parent == 0) continue;
00358             
00359             vector<PdtEntry*> *kids = new vector<PdtEntry*>;
00360             
00361             int i;
00362             for(i=0; i<nchild; i++ )
00363             {  
00364               int ctype;
00365               linestr >> ctype;
00366               PdtEntry* secondary = lookup(lundId(ctype));
00367               if( secondary ==0 ) break;
00368               kids->push_back(secondary);
00369             }
00370             
00371             parent->addDecay(bf, kids );
00372             break;
00373           }
00374           
00375         case 'd':
00376           break;
00377           
00378         default:
00379           cerr << "Pdt.readMCppTable : unknown subcode '" << subcode 
00380                << "' for operation add\n";
00381           break;
00382         }
00383     }
00384   }
00385   // adding geantino for GEANT studies
00386   //why why why why - shouldn't you do this in the tables?
00387   //addParticle("geantino", PdtGeant::geantino, 0., 0., 0., 0., 0. );
00388 
00389   fclose(ifl);
00390 
00391 }

bool Pdt::sameOrConj PdtEntry id1,
PdtEntry id2
[static]
 

bool Pdt::sameOrConj PdtPdg::PdgType  id1,
PdtPdg::PdgType  id2
[static]
 

bool Pdt::sameOrConj PdtLund::LundType  id1,
PdtLund::LundType  id2
[static]
 

bool Pdt::sameOrConj PdtEntry id1,
PdtEntry id2
[static]
 

00671                                                     {
00672   if ( (pdt1==0) || (pdt2==0) ) return false;
00673   if ( pdt1->pdgId() == pdt2->pdgId() ) return true;
00674   if ( pdt1->conjugate()->pdgId() == pdt2->pdgId() ) return true;
00675   return false;
00676 }

bool Pdt::sameOrConj PdtPdg::PdgType  id1,
PdtPdg::PdgType  id2
[static]
 

00667                                                           {
00668   return Pdt::sameOrConj(Pdt::lookup(id1),Pdt::lookup(id2));
00669 }

bool Pdt::sameOrConj PdtLund::LundType  id1,
PdtLund::LundType  id2
[static]
 

00663                                                               {
00664   return Pdt::sameOrConj(Pdt::lookup(id1),Pdt::lookup(id2));
00665 }

float Pdt::spin const char *  name  )  [inline, static]
 

00100 { return lookup(name)->spin(); }

float Pdt::spin PdtPid::PidNeutralType  id  )  [inline, static]
 

00099 { return lookup(id)->spin(); }

float Pdt::spin PdtPid::PidType  id  )  [inline, static]
 

00098 { return lookup(id)->spin(); }

float Pdt::spin PdtGeant::GeantType  id  )  [inline, static]
 

00097 { return lookup(id)->spin(); }

float Pdt::spin PdtLund::LundType  id  )  [inline, static]
 

00096 { return lookup(id)->spin(); }

float Pdt::spin const char *  name  )  [inline, static]
 

00100 { return lookup(name)->spin(); }

float Pdt::spin PdtPid::PidNeutralType  id  )  [inline, static]
 

00099 { return lookup(id)->spin(); }

float Pdt::spin PdtPid::PidType  id  )  [inline, static]
 

00098 { return lookup(id)->spin(); }

float Pdt::spin PdtGeant::GeantType  id  )  [inline, static]
 

00097 { return lookup(id)->spin(); }

float Pdt::spin PdtLund::LundType  id  )  [inline, static]
 

00096 { return lookup(id)->spin(); }

float Pdt::width const char *  name  )  [inline, static]
 

00086 { return lookup(name)->width(); }

float Pdt::width PdtPid::PidNeutralType  id  )  [inline, static]
 

00085 { return lookup(id)->width(); }

float Pdt::width PdtPid::PidType  id  )  [inline, static]
 

00084 { return lookup(id)->width(); }

float Pdt::width PdtGeant::GeantType  id  )  [inline, static]
 

00083 { return lookup(id)->width(); }

float Pdt::width PdtLund::LundType  id  )  [inline, static]
 

00082 { return lookup(id)->width(); }

float Pdt::width const char *  name  )  [inline, static]
 

00086 { return lookup(name)->width(); }

float Pdt::width PdtPid::PidNeutralType  id  )  [inline, static]
 

00085 { return lookup(id)->width(); }

float Pdt::width PdtPid::PidType  id  )  [inline, static]
 

00084 { return lookup(id)->width(); }

float Pdt::width PdtGeant::GeantType  id  )  [inline, static]
 

00083 { return lookup(id)->width(); }

float Pdt::width PdtLund::LundType  id  )  [inline, static]
 

00082 { return lookup(id)->width(); }


Member Data Documentation

std::map<int,PdtEntry*>* Pdt::_entries [static, private]
 

map< int, PdtEntry * > * Pdt::_entries = new map<int PdtEntry*> [static, private]
 

std::map<int,PdtEntry*>* Pdt::_entriesg [static, private]
 

map< int, PdtEntry * > * Pdt::_entriesg = new map<int PdtEntry*> [static, private]
 

std::map<int,PdtEntry*>* Pdt::_entriesl [static, private]
 

map< int, PdtEntry * > * Pdt::_entriesl = new map<int PdtEntry*> [static, private]
 

AstStringMap< PdtEntry >* Pdt::_entriesn [static, private]
 

AstStringMap< PdtEntry > * Pdt::_entriesn = new AstStringMap< PdtEntry > [static, private]
 

PdtEntry* Pdt::_negativeEntries[5] [static, private]
 

PdtEntry * Pdt::_negativeEntries = {0,0,0,0,0} [static, private]
 

PdtEntry* Pdt::_neutralEntries[5] [static, private]
 

PdtEntry * Pdt::_neutralEntries = {0,0,0,0,0} [static, private]
 

PdtEntry* Pdt::_positiveEntries[5] [static, private]
 

PdtEntry * Pdt::_positiveEntries = {0,0,0,0,0} [static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:38:45 2011 for BOSS6.5.5 by  doxygen 1.3.9.1