]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: event | |
3 | // | |
4 | // Geant4 implementation of the MonteCarlo interface methods | |
5 | // for access to Geant4 at step level | |
6 | // | |
7 | // The public methods that do not implement AliMC methods | |
8 | // are commented as G4 specific | |
9 | ||
10 | #ifndef TG4_STEP_MANAGER_H | |
11 | #define TG4_STEP_MANAGER_H | |
12 | ||
f2510df1 | 13 | #include "TG4StepStatus.h" |
14 | ||
15 | #include <G4Step.hh> | |
2817d3e2 | 16 | #include <G4ThreeVector.hh> |
17 | #include <globals.hh> | |
18 | ||
19 | #include <Rtypes.h> | |
20 | ||
f2510df1 | 21 | class G4Track; |
2817d3e2 | 22 | class G4SteppingManager; |
f2510df1 | 23 | class G4VPhysicalVolume; |
2817d3e2 | 24 | |
25 | class TLorentzVector; | |
26 | ||
27 | class TG4StepManager | |
28 | { | |
29 | public: | |
30 | TG4StepManager(); | |
31 | // --> protected | |
32 | // TG4StepManager(const TG4StepManager& right); | |
33 | virtual ~TG4StepManager(); | |
34 | ||
35 | // static access method | |
36 | static TG4StepManager* Instance(); | |
37 | ||
38 | // methods | |
39 | void StopTrack(); //new | |
40 | void StopEvent(); //new | |
41 | void Rndm(Float_t* array, const Int_t size) const; | |
42 | ||
43 | // set methods | |
016b38e0 | 44 | void SetStep(G4Step* step, TG4StepStatus status); // G4 specific |
f2510df1 | 45 | void SetStep(G4Track* track, TG4StepStatus status); // G4 specific |
2817d3e2 | 46 | void SetSteppingManager(G4SteppingManager* manager); // G4 specific |
47 | void SetMaxStep(Float_t step); | |
48 | void SetMaxNStep(Int_t maxNofSteps); //?? | |
57f88f6f | 49 | void SetUserDecay(Int_t pdg); //NEW |
2817d3e2 | 50 | |
51 | // get methods | |
f2510df1 | 52 | G4Track* GetTrack() const; // G4 specific |
53 | G4Step* GetStep() const; // G4 specific | |
016b38e0 | 54 | TG4StepStatus GetStepStatus() const; // G4 specific |
f2510df1 | 55 | |
2817d3e2 | 56 | // tracking volume(s) |
f2510df1 | 57 | G4VPhysicalVolume* GetCurrentPhysicalVolume() const; // G4 specific |
2817d3e2 | 58 | Int_t CurrentVolID(Int_t& copyNo) const; |
59 | Int_t CurrentVolOffID(Int_t off, Int_t& copyNo) const; | |
60 | const char* CurrentVolName() const; | |
61 | const char* CurrentVolOffName(Int_t off) const; | |
62 | Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, | |
63 | Float_t &radl, Float_t &absl) const; | |
64 | void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag); //new | |
65 | void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag); //new | |
66 | Float_t MaxStep() const; | |
67 | Int_t GetMaxNStep() const; //?? | |
68 | Int_t GetMedium() const; //?? | |
69 | ||
70 | // tracking particle | |
71 | // dynamic properties | |
72 | void TrackPosition(TLorentzVector& position) const; | |
73 | void TrackMomentum(TLorentzVector& momentum) const; | |
74 | void TrackVertexPosition(TLorentzVector& position) const; | |
75 | void TrackVertexMomentum(TLorentzVector& momentum) const; | |
76 | Float_t TrackStep() const; | |
77 | Float_t TrackLength() const; | |
78 | Float_t TrackTime() const; | |
79 | Float_t Edep() const; | |
80 | // static properties | |
81 | Int_t TrackPid() const; | |
82 | Float_t TrackCharge() const; | |
83 | Float_t TrackMass() const; | |
84 | Float_t Etot() const; | |
85 | ||
86 | // track status | |
87 | Bool_t IsTrackInside() const; | |
88 | Bool_t IsTrackEntering() const; | |
89 | Bool_t IsTrackExiting() const; | |
90 | Bool_t IsTrackOut() const; | |
91 | Bool_t IsTrackDisappeared() const; | |
92 | Bool_t IsTrackStop() const; | |
93 | Bool_t IsTrackAlive() const; | |
94 | Bool_t IsNewTrack() const; | |
95 | ||
96 | // secondaries | |
97 | Int_t NSecondaries() const; | |
98 | void GetSecondary(Int_t isec, Int_t& particleId, | |
99 | TLorentzVector& position, TLorentzVector& momentum); | |
100 | const char* ProdProcess() const; | |
101 | ||
102 | protected: | |
103 | TG4StepManager(const TG4StepManager& right); | |
104 | ||
105 | // operators | |
106 | TG4StepManager& operator=(const TG4StepManager& right); | |
107 | ||
108 | private: | |
109 | // methods | |
f2510df1 | 110 | void CheckTrack() const; |
111 | void CheckStep() const; | |
112 | void CheckSteppingManager() const; | |
57f88f6f | 113 | void SetTLorentzVector(G4ThreeVector xyz, G4double t, |
f2510df1 | 114 | TLorentzVector& lv) const; |
115 | G4VPhysicalVolume* GetCurrentOffPhysicalVolume(G4int off) const; | |
116 | G4int GetVolumeID(G4VPhysicalVolume* volume) const; | |
117 | ||
2817d3e2 | 118 | // static data members |
119 | static TG4StepManager* fgInstance; //this instance | |
120 | ||
121 | // data members | |
f2510df1 | 122 | G4Track* fTrack; //current track |
2817d3e2 | 123 | G4Step* fStep; //current step |
016b38e0 | 124 | TG4StepStatus fStepStatus; //step status that decides whether |
125 | //track properties will be returned | |
126 | //from PreStepPoint or PostStepPoint | |
2817d3e2 | 127 | G4SteppingManager* fSteppingManager; //G4SteppingManager |
128 | }; | |
129 | ||
130 | // inline methods | |
131 | ||
132 | inline TG4StepManager* TG4StepManager::Instance() | |
133 | { return fgInstance; } | |
134 | ||
016b38e0 | 135 | inline void TG4StepManager::SetStep(G4Step* step, TG4StepStatus status) |
f2510df1 | 136 | { fTrack = step->GetTrack(); fStep = step; fStepStatus = status; } |
137 | ||
138 | inline void TG4StepManager::SetStep(G4Track* track, TG4StepStatus status) | |
139 | { fTrack = track; fStep = 0; fStepStatus = status; } | |
2817d3e2 | 140 | |
141 | inline void TG4StepManager::SetSteppingManager(G4SteppingManager* manager) | |
142 | { fSteppingManager = manager; } | |
143 | ||
f2510df1 | 144 | inline G4Track* TG4StepManager::GetTrack() const |
145 | { return fTrack; } | |
146 | ||
2817d3e2 | 147 | inline G4Step* TG4StepManager::GetStep() const |
148 | { return fStep; } | |
149 | ||
016b38e0 | 150 | inline TG4StepStatus TG4StepManager::GetStepStatus() const |
151 | { return fStepStatus; } | |
152 | ||
2817d3e2 | 153 | #endif //TG4_STEP_MANAGER_H |
154 |