]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4StepManager.h
added enum TG4StepStatus type, attribute fStepStatus and argument to SetStep of this...
[u/mrichter/AliRoot.git] / TGeant4 / TG4StepManager.h
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
13 #include <G4ThreeVector.hh>
14 #include <globals.hh>
15
16 #include <Rtypes.h>
17
18 class G4Step;
19 class G4SteppingManager;
20
21 class TLorentzVector;
22
23 enum TG4StepStatus { kPreStepPoint, kPostStepPoint};
24
25 class TG4StepManager
26 {
27   public:
28     TG4StepManager();
29     // --> protected
30     // TG4StepManager(const TG4StepManager& right);
31     virtual ~TG4StepManager();
32
33     // static access method
34     static TG4StepManager* Instance();
35         
36     // methods
37     void StopTrack(); //new
38     void StopEvent(); //new
39     void Rndm(Float_t* array, const Int_t size) const;
40     
41     // set methods
42     void SetStep(G4Step* step, TG4StepStatus status);    // G4 specific
43     void SetSteppingManager(G4SteppingManager* manager); // G4 specific
44     void SetMaxStep(Float_t step);
45     void SetMaxNStep(Int_t maxNofSteps);  //??
46     void SetUserDecay(Int_t pdg);  //NEW
47     
48     // get methods
49     G4Step* GetStep() const;                              // G4 specific
50     TG4StepStatus GetStepStatus() const;                  // G4 specific
51     
52         // tracking volume(s) 
53     Int_t CurrentVolID(Int_t& copyNo) const;
54     Int_t CurrentVolOffID(Int_t off, Int_t& copyNo) const;
55     const char* CurrentVolName() const;
56     const char* CurrentVolOffName(Int_t off) const;
57     Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, 
58                     Float_t &radl, Float_t &absl) const;
59     void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag);  //new
60     void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag); //new
61     Float_t MaxStep() const;
62     Int_t GetMaxNStep() const;  //??                       
63     Int_t GetMedium() const;  //??
64
65         // tracking particle 
66         // dynamic properties
67     void TrackPosition(TLorentzVector& position) const;
68     void TrackMomentum(TLorentzVector& momentum) const;
69     void TrackVertexPosition(TLorentzVector& position) const;
70     void TrackVertexMomentum(TLorentzVector& momentum) const;
71     Float_t TrackStep() const;  
72     Float_t TrackLength() const;   
73     Float_t TrackTime() const;  
74     Float_t Edep() const;
75         // static properties
76     Int_t TrackPid() const;
77     Float_t TrackCharge() const;
78     Float_t TrackMass() const;
79     Float_t Etot() const;
80
81         // track status
82     Bool_t IsTrackInside() const;
83     Bool_t IsTrackEntering() const;
84     Bool_t IsTrackExiting() const;
85     Bool_t IsTrackOut() const;
86     Bool_t IsTrackDisappeared() const;
87     Bool_t IsTrackStop() const;
88     Bool_t IsTrackAlive() const;
89     Bool_t IsNewTrack() const;
90
91         // secondaries
92     Int_t NSecondaries() const;
93     void GetSecondary(Int_t isec, Int_t& particleId,
94                       TLorentzVector& position, TLorentzVector& momentum);      
95     const char* ProdProcess() const; 
96
97   protected:
98     TG4StepManager(const TG4StepManager& right);
99
100     // operators
101     TG4StepManager& operator=(const TG4StepManager& right);
102
103   private:
104     // methods
105     void SetTLorentzVector(G4ThreeVector xyz, G4double t, 
106                            TLorentzVector& lv) const;
107     
108     // static data members
109     static TG4StepManager*  fgInstance;   //this instance
110     
111     // data members
112     G4Step*             fStep;            //current step
113     TG4StepStatus       fStepStatus;      //step status that decides whether
114                                           //track properties will be returned
115                                           //from PreStepPoint or PostStepPoint
116     G4SteppingManager*  fSteppingManager; //G4SteppingManager
117 };
118
119 // inline methods
120
121 inline TG4StepManager* TG4StepManager::Instance() 
122 { return fgInstance; }
123
124 inline void TG4StepManager::SetStep(G4Step* step, TG4StepStatus status)
125 { fStep = step; fStepStatus = status; }
126
127 inline void TG4StepManager::SetSteppingManager(G4SteppingManager* manager)
128 { fSteppingManager = manager; }
129
130 inline G4Step* TG4StepManager::GetStep() const
131 { return fStep; }
132
133 inline TG4StepStatus TG4StepManager::GetStepStatus() const
134 { return fStepStatus; }
135
136 #endif //TG4_STEP_MANAGER_H
137