]>
Commit | Line | Data |
---|---|---|
17929791 | 1 | // $Id$ |
2 | // Category: physics | |
3 | // | |
499b353a | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class TG4ParticlesManager | |
7 | // ------------------------- | |
17929791 | 8 | // This class provides mapping between TDatabasePDG |
9 | // and Geant4 particles. | |
10 | ||
11 | #ifndef TG4_PARTICLES_MANAGER_H | |
12 | #define TG4_PARTICLES_MANAGER_H | |
13 | ||
5b6ecd36 | 14 | #include "TG4Verbose.h" |
17929791 | 15 | #include "TG4Globals.h" |
16 | #include "TG4NameMap.h" | |
17 | #include "TG4IntMap.h" | |
18 | ||
19 | #include <globals.hh> | |
20 | #include <G4ThreeVector.hh> | |
21 | ||
22 | #include <Rtypes.h> | |
23 | ||
24 | class G4DynamicParticle; | |
25 | class G4ParticleDefinition; | |
26 | ||
27 | class TParticle; | |
28 | class TClonesArray; | |
29 | ||
5b6ecd36 | 30 | class TG4ParticlesManager : public TG4Verbose |
17929791 | 31 | { |
32 | public: | |
33 | TG4ParticlesManager(); | |
34 | // --> protected | |
35 | // TG4ParticlesManager(const TG4ParticlesManager& right); | |
36 | virtual ~TG4ParticlesManager(); | |
37 | ||
38 | // static access method | |
39 | static TG4ParticlesManager* Instance(); | |
40 | ||
41 | // methods | |
42 | void MapParticles(); | |
43 | ||
44 | // get methods | |
45 | // for G4 particle types | |
46 | G4int GetPDGEncodingFast(G4ParticleDefinition* particle); | |
47 | ||
48 | // for Root particle types; | |
49 | TParticle* GetParticle(const TClonesArray* particles, G4int index) const; | |
50 | G4ParticleDefinition* GetParticleDefinition( | |
51 | const TParticle* particle) const; | |
52 | G4DynamicParticle* CreateDynamicParticle( | |
53 | const TParticle* particle) const; | |
54 | G4ThreeVector GetParticlePosition( | |
55 | const TParticle* particle) const; | |
56 | G4ThreeVector GetParticleMomentum( | |
57 | const TParticle* particle) const; | |
58 | ||
59 | protected: | |
60 | TG4ParticlesManager(const TG4ParticlesManager& right); | |
61 | ||
62 | // operators | |
63 | TG4ParticlesManager& operator=(const TG4ParticlesManager& right); | |
64 | ||
65 | private: | |
66 | // methods | |
67 | G4int GetPDGEncoding(G4ParticleDefinition* particle); | |
68 | G4int GetPDGEncoding(G4String particleName); | |
69 | ||
70 | // static data members | |
71 | static TG4ParticlesManager* fgInstance; //this instance | |
72 | ||
73 | // data members | |
74 | TG4NameMap fParticleNameMap; //the mapping between G4 particle names | |
75 | //and TDatabasePDG names | |
76 | TG4IntMap fParticlePDGMap; //the mapping between G4 particle names | |
77 | //and TDatabasePDG codes | |
78 | }; | |
79 | ||
80 | // inline methods | |
81 | ||
82 | inline TG4ParticlesManager* TG4ParticlesManager::Instance() | |
83 | { return fgInstance; } | |
84 | ||
85 | #endif //TG4_PARTICLES_MANAGER_H | |
86 |