Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
JAANET::JPDB Struct Reference

Collection of particles. More...

#include <JPDB.hh>

Inheritance diagram for JAANET::JPDB:
std::vector< JParticle >

Public Member Functions

 JPDB ()
 Default constructor. More...
 
bool hasGEANT (const int geant) const
 Check if PDB has particle corresponding to given GEANT code. More...
 
const JParticlegetGEANT (const int geant) const
 Get particle corresponding to given GEANT code. More...
 
bool hasPDG (const int pdg) const
 Check if PDB has particle corresponding to given PDG code. More...
 
const JParticlegetPDG (const int pdg) const
 Get particle corresponding to given PDG code. More...
 

Static Public Member Functions

static const JPDBgetInstance ()
 Get particle data book. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const JPDB &pdb)
 Print particle data book. More...
 

Detailed Description

Collection of particles.

Definition at line 104 of file JPDB.hh.

Constructor & Destructor Documentation

JAANET::JPDB::JPDB ( )
inline

Default constructor.

Definition at line 110 of file JPDB.hh.

111  {}

Member Function Documentation

static const JPDB& JAANET::JPDB::getInstance ( )
inlinestatic

Get particle data book.

This particle data book contains all known GEANT particle codes.

Returns
particle data book

Definition at line 120 of file JPDB.hh.

121  {
122  using namespace JPP;
123 
124  static JPDB pdb;
125 
126  if (pdb.empty()) {
127 
164 
171  // anti-photon does not exist
199 
200  }
201 
202  return pdb;
203  }
static const double MASS_NEUTRAL_OMEGA_C
Omega_c_0 mass [GeV].
static const double MASS_CHARGED_KAON
K^+/- mass [GeV].
static const double MASS_CHARGED_OMEGA_B
Omega_b^+/- mass [GeV].
static const double MASS_NEUTRAL_LAMBDA_B
Lambda_b^0 mass [GeV].
static const double MASS_CHARGED_B
B^+/- mass [GeV].
static const double MASS_ELECTRON_NEUTRINO
electron neutrino mass [GeV]
static const double MASS_TAU_NEUTRINO
tau neutrino mass [GeV]
static const double MASS_NEUTRAL_KAON
K_0 mass [GeV].
static const double MASS_CHARGED_XI
Xi^+/- mass [GeV].
static const double MASS_MUON
muon mass [GeV]
Collection of particles.
Definition: JPDB.hh:104
static const double MASS_NEUTRAL_XI_C
Xi_c_0 mass [GeV].
static const double MASS_NEUTRON
neutron mass [GeV]
static const double MASS_CHARGED_D_S
D_s^+/- mass [GeV].
static const double MASS_CHARGED_SIGMA
Sigma^+/- mass [GeV].
static const double MASS_CHARGED_LAMBDA_C
Lambda_c^+/- mass [GeV].
static const double MASS_NEUTRAL_B_S
B_s^0 mass [GeV].
static const double MASS_TAU
tau mass [GeV]
static const double MASS_LAMBDA
Lambda mass [GeV].
static const double MASS_CHARGED_PION
pi^+/- mass [GeV]
static const double MASS_CHARGED_B_C
B_c^+/- mass [GeV].
static const double MASS_MUON_NEUTRINO
muon neutrino mass [GeV]
static const double MASS_ELECTRON
electron mass [GeV]
static const double MASS_NEUTRAL_D
D_0 mass [GeV].
static const double MASS_NEUTRAL_XI
Xi_0 mass [GeV].
static const double MASS_NEUTRAL_SIGMA
Sigma_0 mass [GeV].
static const double MASS_NEUTRAL_PION
pi_0 mass [GeV]
static const double MASS_CHARGED_XI_C
Xi_c^+/- mass [GeV].
static const double MASS_CHARGED_OMEGA
Omega^+/- mass [GeV].
static const double MASS_NEUTRAL_XI_B
Xi_b^0 mass [GeV].
static const double MASS_CHARGED_XI_B
Xi_b^+/- mass [GeV].
static const double MASS_PROTON
proton mass [GeV]
static const double MASS_PHOTON
Particle masses.
static const double MASS_NEUTRAL_B
B_0 mass [GeV].
#define MAKE_PARTICLE(PDG, GEANT, MASS)
Auxiliary macro for particle creation.
Definition: JPDB.hh:98
static const double MASS_CHARGED_D
D^+/- mass [GeV].
bool JAANET::JPDB::hasGEANT ( const int  geant) const
inline

Check if PDB has particle corresponding to given GEANT code.

Parameters
geantGEANT code
Returns
true if available; else false

Definition at line 212 of file JPDB.hh.

213  {
214  return (find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::geant, geant)) != this->end());
215  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
int geant
GEANT code of particle.
Definition: JPDB.hh:86
const JParticle& JAANET::JPDB::getGEANT ( const int  geant) const
inline

Get particle corresponding to given GEANT code.


This method throws an error if the particle cannot be found.

Parameters
geantGEANT code
Returns
particle

Definition at line 225 of file JPDB.hh.

226  {
227  const_iterator p = find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::geant, geant));
228 
229  if (p != this->end())
230  return *p;
231  else
232  THROW(JException, "Invalid GEANT particle code " << geant);
233  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
int geant
GEANT code of particle.
Definition: JPDB.hh:86
bool JAANET::JPDB::hasPDG ( const int  pdg) const
inline

Check if PDB has particle corresponding to given PDG code.

Parameters
pdgPDG code
Returns
true if available; else false

Definition at line 242 of file JPDB.hh.

243  {
244  return (find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::pdg, pdg)) != this->end());
245  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
int pdg
PDG code of particle.
Definition: JPDB.hh:85
const JParticle& JAANET::JPDB::getPDG ( const int  pdg) const
inline

Get particle corresponding to given PDG code.


This method throws an error if the particle cannot be found.

Parameters
pdgPDG code
Returns
particle

Definition at line 255 of file JPDB.hh.

256  {
257  const_iterator p = find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::pdg, pdg));
258 
259  if (p != this->end())
260  return *p;
261  else
262  THROW(JException, "Invalid PDG particle code " << pdg);
263  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
int pdg
PDG code of particle.
Definition: JPDB.hh:85

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JPDB pdb 
)
friend

Print particle data book.

Parameters
outoutput stream
pdbparticle data book
Returns
output stream

Definition at line 273 of file JPDB.hh.

274  {
275  using namespace std;
276 
277  out << setw(32) << left << "particle" << " "
278  << setw( 6) << right << "PDG" << " "
279  << setw( 6) << right << "GEANT" << " "
280  << setw(12) << right << "Mass [GeV]" << endl;
281 
282  for (JPDB::const_iterator i = pdb.begin(); i != pdb.end(); ++i) {
283  out << *i << endl;
284  }
285 
286  return out;
287  }

The documentation for this struct was generated from the following file: