StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StarParticleData.h
1 #ifndef __StarParticleData_h__
2 #define __StarParticleData_h__
3 
4 #include "TParticlePDG.h"
5 #include "TObjectSet.h"
6 
7 #include <map>
8 
23 {
24  public:
25 
26  StarParticleData( const Char_t *name="PDG_Database", TDataSet *parent = 0 );
28 
30  TParticlePDG *GetParticle( const Char_t *name ) ;
32  TParticlePDG *GetParticle( const Int_t id );
34  TParticlePDG *GetParticleG3( const Int_t id );
35 
37  void AddParticle( const Char_t *name, TParticlePDG *particle );
39  void AddAlias ( const Char_t *alias, const Char_t *realname );
40 
60  TParticlePDG *AddParticle( const Char_t *name, const Char_t *title, Double_t mass, Bool_t Stable, Double_t Width, Double_t Charge3, const char* ParticleClass, Int_t PdgCode, Int_t Anti, Int_t geantCode );
61 
65  TParticlePDG *AddParticleToG3( const char* name, const double mass, const double lifetime, const double charge, const int tracktype, const int pdgcode, const int g3code, const double* bratio=0, const int* mode=0 );
66  TParticlePDG *AddParticleToG3( TParticlePDG *part, const int g3code );
67 
69  TParticlePDG *SetTrackingCode( const int pdgid, const int g3id );
70 
71 
80  static StarParticleData &instance();
82 
83  TParticlePDG *operator()( const Char_t *name );
84  TParticlePDG *operator()( const Int_t id );
85 
87  const TObjArray &GetParticles() const { return mParticleList; }
88 
89  private:
90  protected:
91 
92  // Singleton instance of this class
93  static StarParticleData *sInstance;
94 
95  TObjArray mParticleList; // my particles
96  std::map< TString, TParticlePDG* > mParticleNameMap; // particle aliases
97  std::map< Int_t, TParticlePDG* > mParticleIdMap; // map by PDG id
98  std::map< Int_t, TParticlePDG* > mParticleG3IdMap; // map by G3 id
99 
100  ClassDef( StarParticleData, 1 );
101 
102 };
103 
104 #endif
105 
106 
TParticlePDG * GetParticleG3(const Int_t id)
Get a particle by G3 ID.
void AddAlias(const Char_t *alias, const Char_t *realname)
Add an alias to a particle in the database.
static StarParticleData & instance()
Returns a reference to the single instance of this class.
TParticlePDG * GetParticle(const Char_t *name)
Get a particle by name.
Interface to PDG information.
const TObjArray & GetParticles() const
Returns a reference to the list of particles.
void AddParticle(const Char_t *name, TParticlePDG *particle)
Add a particle to the database.
TParticlePDG * SetTrackingCode(const int pdgid, const int g3id)
Maps the particle with the given PDG id to G3 tracking ID and returns pointer to the particle data...
TParticlePDG * AddParticleToG3(const char *name, const double mass, const double lifetime, const double charge, const int tracktype, const int pdgcode, const int g3code, const double *bratio=0, const int *mode=0)