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