Jpp
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 105 of file JPDB.hh.

Constructor & Destructor Documentation

◆ JPDB()

JAANET::JPDB::JPDB ( )
inline

Default constructor.

Definition at line 111 of file JPDB.hh.

112  {}

Member Function Documentation

◆ getInstance()

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 121 of file JPDB.hh.

122  {
123  using namespace JAANET;
124  using namespace JTOOLS;
125 
126  static JPDB pdb;
127 
128  if (pdb.empty()) {
129 
151 
158  // anti-photon does not exist
172  }
173 
174  return pdb;
175  }

◆ hasGEANT()

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 184 of file JPDB.hh.

185  {
186  return (find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::geant, geant)) != this->end());
187  }

◆ getGEANT()

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 197 of file JPDB.hh.

198  {
199  const_iterator p = find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::geant, geant));
200 
201  if (p != this->end())
202  return *p;
203  else
204  THROW(JException, "Invalid GEANT particle code " << geant);
205  }

◆ hasPDG()

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 214 of file JPDB.hh.

215  {
216  return (find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::pdg, pdg)) != this->end());
217  }

◆ getPDG()

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 227 of file JPDB.hh.

228  {
229  const_iterator p = find_if(this->begin(), this->end(), JLANG::make_predicate(&JParticle::pdg, pdg));
230 
231  if (p != this->end())
232  return *p;
233  else
234  THROW(JException, "Invalid PDG particle code " << pdg);
235  }

Friends And Related Function Documentation

◆ operator<<

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 245 of file JPDB.hh.

246  {
247  using namespace std;
248 
249  out << setw(32) << left << "particle" << " "
250  << setw( 6) << right << "PDG" << " "
251  << setw( 6) << right << "GEANT" << " "
252  << setw(12) << right << "Mass [GeV]" << endl;
253 
254  for (JPDB::const_iterator i = pdb.begin(); i != pdb.end(); ++i) {
255  out << *i << endl;
256  }
257 
258  return out;
259  }

The documentation for this struct was generated from the following file:
JAANET::TRACK_TYPE_ANTIOMEGA_MINUS
Definition: JParticleTypes.hh:107
JTOOLS::MASS_CHARGED_PION
static const double MASS_CHARGED_PION
pi^+/- mass [GeV]
Definition: JConstants.hh:63
JTOOLS::MASS_TAU
static const double MASS_TAU
tau mass [GeV]
Definition: JConstants.hh:60
JAANET::TRACK_TYPE_LAMBDA
Definition: JParticleTypes.hh:79
JAANET::GEANT4_TYPE_ANTIELECTRON
Definition: JParticleTypes.hh:19
JAANET::TRACK_TYPE_ANTIPROTON
Definition: JParticleTypes.hh:99
JAANET::GEANT4_TYPE_NEUTRAL_PION
Definition: JParticleTypes.hh:24
JTOOLS::MASS_MUON
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
JTOOLS::MASS_LAMBDA
static const double MASS_LAMBDA
Lambda mass [GeV].
Definition: JConstants.hh:69
JAANET::GEANT4_TYPE_PROTON
Definition: JParticleTypes.hh:31
JAANET::TRACK_TYPE_PROTON
Definition: JParticleTypes.hh:77
JAANET::TRACK_TYPE_ANTISIGMA_MINUS
Definition: JParticleTypes.hh:104
JTOOLS::MASS_PROTON
static const double MASS_PROTON
proton mass [GeV]
Definition: JConstants.hh:67
JAANET::TRACK_TYPE_ANTITAU
Definition: JParticleTypes.hh:91
JAANET::GEANT4_TYPE_ANTITAU
Definition: JParticleTypes.hh:58
JAANET::GEANT4_TYPE_ANTIOMEGA_PLUS
Definition: JParticleTypes.hh:49
JAANET::GEANT4_TYPE_ANTIXI_PLUS
Definition: JParticleTypes.hh:48
JAANET::TRACK_TYPE_PION_MINUS
Definition: JParticleTypes.hh:95
JAANET::TRACK_TYPE_NUMU
Definition: JParticleTypes.hh:67
JAANET::TRACK_TYPE_NEUTRAL_PION
Definition: JParticleTypes.hh:71
JTOOLS::MASS_NEUTRAL_XI
static const double MASS_NEUTRAL_XI
Xi_0 mass [GeV].
Definition: JConstants.hh:72
JAANET::JPDB
Collection of particles.
Definition: JPDB.hh:105
JAANET::GEANT4_TYPE_ANTIPROTON
Definition: JParticleTypes.hh:32
JTOOLS::MASS_CHARGED_SIGMA
static const double MASS_CHARGED_SIGMA
Sigma^+/- mass [GeV].
Definition: JConstants.hh:71
JAANET::TRACK_TYPE_ANTINUE
Definition: JParticleTypes.hh:88
JAANET::TRACK_TYPE_ANTINEUTRAL_SIGMA
Definition: JParticleTypes.hh:103
JAANET::TRACK_TYPE_ANTINEUTRON
Definition: JParticleTypes.hh:100
JAANET::GEANT4_TYPE_PION_PLUS
Definition: JParticleTypes.hh:25
JAANET::TRACK_TYPE_NUTAU
Definition: JParticleTypes.hh:69
JAANET::GEANT4_TYPE_ANTISIGMA_PLUS
Definition: JParticleTypes.hh:46
JAANET::TRACK_TYPE_ELECTRON
Definition: JParticleTypes.hh:64
JAANET::TRACK_TYPE_SIGMA_PLUS
Definition: JParticleTypes.hh:80
JAANET::TRACK_TYPE_XI_MINUS
Definition: JParticleTypes.hh:84
JAANET::GEANT4_TYPE_MUON
Definition: JParticleTypes.hh:23
JAANET::GEANT4_TYPE_ANTILAMBDA
Definition: JParticleTypes.hh:43
JAANET::GEANT4_TYPE_ANTINEUTRON
Definition: JParticleTypes.hh:42
JAANET::TRACK_TYPE_ANTINUMU
Definition: JParticleTypes.hh:90
JAANET::GEANT4_TYPE_NEUTRINO
Definition: JParticleTypes.hh:21
JTOOLS::MASS_CHARGED_KAON
static const double MASS_CHARGED_KAON
K^+/- mass [GeV].
Definition: JConstants.hh:65
JAANET::GEANT4_TYPE_KAON_SHORT
Definition: JParticleTypes.hh:33
JTOOLS::MASS_TAU_NEUTRINO
static const double MASS_TAU_NEUTRINO
tau neutrino mass [GeV]
Definition: JConstants.hh:56
JAANET::TRACK_TYPE_ANTINUTAU
Definition: JParticleTypes.hh:92
JAANET::GEANT4_TYPE_OMEGA_MINUS
Definition: JParticleTypes.hh:41
JAANET::TRACK_TYPE_TAU
Definition: JParticleTypes.hh:68
JTOOLS::MASS_MUON_NEUTRINO
static const double MASS_MUON_NEUTRINO
muon neutrino mass [GeV]
Definition: JConstants.hh:55
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:669
JAANET::GEANT4_TYPE_KAON_PLUS
Definition: JParticleTypes.hh:28
JTOOLS::MASS_NEUTRAL_PION
static const double MASS_NEUTRAL_PION
pi_0 mass [GeV]
Definition: JConstants.hh:62
JTOOLS::MASS_ELECTRON_NEUTRINO
static const double MASS_ELECTRON_NEUTRINO
electron neutrino mass [GeV]
Definition: JConstants.hh:54
JAANET::GEANT4_TYPE_PHOTON
Definition: JParticleTypes.hh:18
JAANET::GEANT4_TYPE_KAON_LONG
Definition: JParticleTypes.hh:27
JAANET::GEANT4_TYPE_KAON_MINUS
Definition: JParticleTypes.hh:29
JAANET::JParticle::geant
int geant
GEANT code of particle.
Definition: JPDB.hh:87
JAANET::GEANT4_TYPE_XI_MINUS
Definition: JParticleTypes.hh:40
JAANET::TRACK_TYPE_ANTILAMBDA
Definition: JParticleTypes.hh:101
JAANET::TRACK_TYPE_NUE
Definition: JParticleTypes.hh:65
JAANET::GEANT4_TYPE_NEUTRON
Definition: JParticleTypes.hh:30
JTOOLS::MASS_PHOTON
static const double MASS_PHOTON
Particle masses.
Definition: JConstants.hh:52
JAANET::GEANT4_TYPE_LAMBDA
Definition: JParticleTypes.hh:35
JAANET
Extensions to AAnet data format.
Definition: JAAnetToolkit.hh:36
JTOOLS::MASS_NEUTRAL_KAON
static const double MASS_NEUTRAL_KAON
K_0 mass [GeV].
Definition: JConstants.hh:64
JAANET::TRACK_TYPE_ANTIK_SHORT
Definition: JParticleTypes.hh:97
MAKE_PARTICLE
#define MAKE_PARTICLE(PDG, GEANT, MASS)
Auxiliary macro for particle creation.
Definition: JPDB.hh:99
JAANET::TRACK_TYPE_ANTIXI_MINUS
Definition: JParticleTypes.hh:106
JTOOLS::MASS_ELECTRON
static const double MASS_ELECTRON
electron mass [GeV]
Definition: JConstants.hh:58
JAANET::TRACK_TYPE_ANTIMUON
Definition: JParticleTypes.hh:89
JAANET::JParticle::pdg
int pdg
PDG code of particle.
Definition: JPDB.hh:86
JTOOLS::MASS_CHARGED_XI
static const double MASS_CHARGED_XI
Xi^+/- mass [GeV].
Definition: JConstants.hh:73
JAANET::GEANT4_TYPE_NEUTRAL_XI
Definition: JParticleTypes.hh:39
std
Definition: jaanetDictionary.h:36
JAANET::GEANT4_TYPE_ANTIMUON
Definition: JParticleTypes.hh:22
JAANET::TRACK_TYPE_OMEGA_MINUS
Definition: JParticleTypes.hh:85
JTOOLS::MASS_CHARGED_OMEGA
static const double MASS_CHARGED_OMEGA
Omega^+/- mass [GeV].
Definition: JConstants.hh:74
JLANG::make_predicate
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
JAANET::TRACK_TYPE_K_MINUS
Definition: JParticleTypes.hh:98
JPHYSICS::geant
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle.
JAANET::TRACK_TYPE_ANTINEUTRAL_XI
Definition: JParticleTypes.hh:105
JAANET::TRACK_TYPE_K_LONG
Definition: JParticleTypes.hh:74
JAANET::GEANT4_TYPE_ELECTRON
Definition: JParticleTypes.hh:20
JAANET::TRACK_TYPE_MUON
Definition: JParticleTypes.hh:66
JAANET::TRACK_TYPE_PHOTON
Definition: JParticleTypes.hh:70
JAANET::GEANT4_TYPE_SIGMA_MINUS
Definition: JParticleTypes.hh:38
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JAANET::TRACK_TYPE_NEUTRAL_SIGMA
Definition: JParticleTypes.hh:81
JAANET::GEANT4_TYPE_TAU
Definition: JParticleTypes.hh:59
JAANET::TRACK_TYPE_K_SHORT
Definition: JParticleTypes.hh:75
JAANET::TRACK_TYPE_NEUTRON
Definition: JParticleTypes.hh:78
JAANET::TRACK_TYPE_ANTIELECTRON
Definition: JParticleTypes.hh:87
JAANET::GEANT4_TYPE_SIGMA_PLUS
Definition: JParticleTypes.hh:36
JTOOLS::MASS_NEUTRON
static const double MASS_NEUTRON
neutron mass [GeV]
Definition: JConstants.hh:68
JAANET::TRACK_TYPE_SIGMA_MINUS
Definition: JParticleTypes.hh:82
JAANET::TRACK_TYPE_PION_PLUS
Definition: JParticleTypes.hh:73
JTOOLS::MASS_NEUTRAL_SIGMA
static const double MASS_NEUTRAL_SIGMA
Sigma_0 mass [GeV].
Definition: JConstants.hh:70
JAANET::TRACK_TYPE_ANTISIGMA_PLUS
Definition: JParticleTypes.hh:102
JAANET::TRACK_TYPE_NEUTRAL_XI
Definition: JParticleTypes.hh:83
JAANET::TRACK_TYPE_K_PLUS
Definition: JParticleTypes.hh:76
JAANET::GEANT4_TYPE_ANTISIGMA_MINUS
Definition: JParticleTypes.hh:44
JAANET::GEANT4_TYPE_NEUTRAL_SIGMA
Definition: JParticleTypes.hh:37
JAANET::TRACK_TYPE_ANTIK_LONG
Definition: JParticleTypes.hh:96
JAANET::GEANT4_TYPE_PION_MINUS
Definition: JParticleTypes.hh:26