1 #ifndef __JAANET__JPDB__
2 #define __JAANET__JPDB__
17 #include "TDatabasePDG.h"
18 #include "TParticlePDG.h"
19 #include "TCollection.h"
20 #include "THashList.h"
28 namespace JPP {
using namespace JAANET; }
86 return out << setw(32) << left << particle.
name <<
" "
87 << setw( 8) << right << particle.
pdg <<
" "
88 << setw( 6) << right << particle.
geant <<
" "
90 << setw( 5) << right << particle.
charge;
109 #define MAKE_PARTICLE(PDG, GEANT, MASS, CHARGE) JParticle(#PDG, PDG, GEANT, MASS, CHARGE)
139 TDatabasePDG::Instance()->ReadPDGTable();
141 TIter next(TDatabasePDG::Instance()->ParticleList());
143 while (TParticlePDG* p = (TParticlePDG*) next()) {
145 const JParticle particle(p->GetName(), p->PdgCode(), convertPDGtoGEANT(p->PdgCode()), p->Mass(), p->Charge());
147 pdb.push_back(particle);
178 if (p != this->end())
216 return TDatabasePDG::Instance()->ConvertPdgToGeant3(pdg);
244 if (p != this->end())
262 out << setw(32) << left <<
"particle" <<
" "
263 << setw( 8) << right <<
"PDG" <<
" "
264 << setw( 6) << right <<
"GEANT" <<
" "
265 << setw(16) << right <<
"Mass [GeV]" <<
" "
266 << setw( 5) << right <<
"Charge [|e|/3]" << endl;
268 for (JPDB::const_iterator
i = pdb.begin();
i != pdb.end(); ++
i) {
std::string name
name of particle
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
static int convertPDGtoGEANT(const int pdg)
Retrieve GEANT code for a given PDG code.
int charge
charge of particle [|e|/3]
const JParticle & getGEANT(const int geant) const
Get particle corresponding to given GEANT code.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
const JParticle & getPDG(const int pdg) const
Get particle corresponding to given PDG code.
JParticle()
Default constructor.
Auxiliary data structure for floating point format specification.
JPDB()
Default constructor.
static const JPDB & getInstance()
Get particle data book.
bool hasGEANT(const int geant) const
Check if PDB has particle corresponding to given GEANT code.
friend std::ostream & operator<<(std::ostream &out, const JPDB &pdb)
Print particle data book.
JParticle(const std::string &name, const int pdg, const int geant, const double mass, const int charge)
Constructor.
Auxiliary class to handle particle name, codes and mass.
bool hasPDG(const int pdg) const
Check if PDB has particle corresponding to given PDG code.
double mass
mass of particle [GeV]
friend std::ostream & operator<<(std::ostream &out, const JParticle &particle)
Print particle.
int geant
GEANT code of particle.
Definition of particle types.
int pdg
PDG code of particle.