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