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