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