add correct check on ROOT version (now version 4.0.6 has been tagged).
[u/mrichter/AliRoot.git] / TRD / AliTRDsimpleMC.h
CommitLineData
16bf9884 1#ifndef ALITRDSIMPLEMC_H
2#define ALITRDSIMPLEMC_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
dd98d073 5
16bf9884 6/* $Id$ */
dd98d073 7
0a29d0f1 8///////////////////////////////////////////////////////////////////////////////
9// //
10// Simple TRD Monte Carlo class //
11// //
12///////////////////////////////////////////////////////////////////////////////
cafdf622 13
dd98d073 14#include <RVersion.h>
88cb7938 15#include <TMCProcess.h>
16#include <TVirtualMC.h>
b9d0a01d 17#include "AliDecayer.h"
16bf9884 18
19class AliTRDv1;
5443e65e 20class AliTRDparameter;
dd98d073 21
4c475d27 22class AliTRDsimpleMC : public TVirtualMC {
dd98d073 23
24 public:
16bf9884 25
26 enum {
27 kPdgElectron = 11
28 , kPdgPion = 211
29 };
30
31 AliTRDsimpleMC();
32 AliTRDsimpleMC(const char *name, const char *title);
dd98d073 33 AliTRDsimpleMC(const AliTRDsimpleMC &m);
34
16bf9884 35 virtual ~AliTRDsimpleMC();
dd98d073 36 AliTRDsimpleMC &operator=(const AliTRDsimpleMC &m);
16bf9884 37
38 virtual void Copy(TObject &m);
39
40 //
41 // Methods for building / management of geometry
42 //
43
dd98d073 44 // Functions from GCONS
45 virtual void Gfmate(Int_t , char* , Float_t& , Float_t& ,
73ae7b59 46 Float_t& , Float_t& , Float_t& ,
47 Float_t* , Int_t& ) {}
dd98d073 48 virtual void Gfmate(Int_t , char* , Double_t& , Double_t& ,
73ae7b59 49 Double_t& , Double_t& , Double_t& ,
50 Double_t* , Int_t& ) {}
16bf9884 51
52 // Detector composition
dd98d073 53 virtual void Material(Int_t& , const char* , Double_t ,
73ae7b59 54 Double_t , Double_t , Double_t , Double_t ,
55 Float_t* , Int_t ) {}
dd98d073 56 virtual void Material(Int_t& , const char* , Double_t ,
73ae7b59 57 Double_t , Double_t , Double_t , Double_t ,
58 Double_t* , Int_t ) {}
dd98d073 59 virtual void Mixture(Int_t& , const char* , Float_t* ,
73ae7b59 60 Float_t *, Double_t , Int_t , Float_t* ) {}
dd98d073 61 virtual void Mixture(Int_t& , const char* , Double_t *,
73ae7b59 62 Double_t *, Double_t , Int_t , Double_t* ) {}
dd98d073 63 virtual void Medium(Int_t& , const char* , Int_t ,
64 Int_t , Int_t , Double_t , Double_t ,
65 Double_t , Double_t , Double_t ,
73ae7b59 66 Double_t , Float_t* , Int_t ) {}
dd98d073 67 virtual void Medium(Int_t& , const char* , Int_t ,
68 Int_t , Int_t , Double_t , Double_t ,
69 Double_t , Double_t , Double_t ,
73ae7b59 70 Double_t , Double_t* , Int_t ) {}
dd98d073 71 virtual void Matrix(Int_t& , Double_t , Double_t ,
72 Double_t , Double_t , Double_t ,
73ae7b59 73 Double_t ) {}
dd98d073 74 virtual void Gstpar(Int_t , const char* , Double_t ) {}
16bf9884 75
dd98d073 76 // Functions from GGEOM
77 virtual Int_t Gsvolu(const char* , const char* , Int_t ,
73ae7b59 78 Float_t* , Int_t ) { return 0; }
dd98d073 79 virtual Int_t Gsvolu(const char* , const char* , Int_t ,
80 Double_t* , Int_t) { return 0; }
81 virtual void Gsdvn(const char* , const char* , Int_t ,
82 Int_t ) {}
83 virtual void Gsdvn2(const char* , const char* , Int_t ,
84 Int_t , Double_t , Int_t ) {}
85 virtual void Gsdvt(const char* , const char* , Double_t ,
86 Int_t , Int_t , Int_t ) {}
87 virtual void Gsdvt2(const char* , const char* , Double_t ,
88 Int_t , Double_t , Int_t , Int_t ) {}
89 virtual void Gsord(const char* , Int_t ) {}
90 virtual void Gspos(const char* , Int_t , const char* ,
91 Double_t , Double_t , Double_t , Int_t ,
92 const char* ) {}
93 virtual void Gsposp(const char* , Int_t , const char* ,
73ae7b59 94 Double_t, Double_t, Double_t, Int_t ,
95 const char* , Float_t* , Int_t ) {}
dd98d073 96 virtual void Gsposp(const char* , Int_t , const char* ,
73ae7b59 97 Double_t , Double_t , Double_t , Int_t ,
98 const char* , Double_t* , Int_t ) {}
99 virtual void Gsbool(const char* , const char* ) {}
100
101 virtual void SetCerenkov(Int_t , Int_t , Float_t* ,
102 Float_t* , Float_t* , Float_t* ) {}
103 virtual void SetCerenkov(Int_t , Int_t , Double_t* ,
104 Double_t* , Double_t* , Double_t* ) {}
b9d0a01d 105
16bf9884 106 // Functions for drawing
73ae7b59 107 virtual void DrawOneSpec(const char* ) {}
108 virtual void Gsatt(const char* , const char* , Int_t ) {}
109 virtual void Gdraw(const char* , Double_t , Double_t ,
110 Double_t , Double_t , Double_t ,
111 Double_t , Double_t ) {}
16bf9884 112
113 // Euclid
73ae7b59 114 virtual void WriteEuclid(const char* , const char* , Int_t , Int_t ) {}
dd98d073 115
16bf9884 116 // Get methods
b9d0a01d 117 virtual Int_t VolId(const Text_t* volName) const;
73ae7b59 118 virtual const char* VolName(Int_t ) const { return ""; }
b9d0a01d 119 virtual Int_t NofVolumes() const { return 0; }
73ae7b59 120 virtual Int_t VolId2Mate(Int_t ) const { return 0; }
16bf9884 121
122 //
123 // Methods for physics management
124 //
dd98d073 125
16bf9884 126 // Set methods
73ae7b59 127 virtual void SetCut(const char* , Double_t ) {}
128 virtual void SetProcess(const char* , Int_t ) {}
dd98d073 129 virtual Double_t Xsec(char*, Double_t, Int_t, Int_t) { return 0.; }
130
131 // Particle table usage
132 virtual Int_t IdFromPDG(Int_t ) const { return 0; }
133 virtual Int_t PDGFromId(Int_t ) const { return 0; }
134 virtual void DefineParticles() {}
135
16bf9884 136 //
137 // Methods for step management
138 //
139
140 // Action methods
141 virtual void StopTrack() { };
dd98d073 142 virtual void StopEvent() { };
143#if ROOT_VERSION_CODE >= 262150
aac172e5 144 virtual void StopRun() { }
145#endif
16bf9884 146
147 // Set methods
b9d0a01d 148 virtual void SetMaxStep(Double_t step) { fMaxStep = step; };
73ae7b59 149 virtual void SetMaxNStep(Int_t ) { };
dd98d073 150 virtual void SetUserDecay(Int_t ) { };
16bf9884 151
152 virtual void NewTrack(Int_t iTrack, Int_t pdg, Double_t px, Double_t py, Double_t pz);
153
dd98d073 154 // Tracking volume(s)
16bf9884 155 virtual Int_t CurrentVolID(Int_t& copyNo) const;
156 virtual Int_t CurrentVolOffID(Int_t off, Int_t& copyNo) const;
ee7e3ede 157 virtual const char* CurrentVolName() const;
73ae7b59 158 virtual const char* CurrentVolOffName(Int_t ) const { return ""; };
dd98d073 159 virtual Int_t CurrentMaterial(Float_t& , Float_t& ,
160 Float_t& , Float_t& ,
161 Float_t& ) const { return 0; };
162 virtual Int_t CurrentEvent() const { return 0; };
73ae7b59 163 virtual void Gmtod(Float_t* , Float_t* , Int_t ) {}
164 virtual void Gmtod(Double_t* , Double_t* , Int_t ) {}
165 virtual void Gdtom(Float_t* , Float_t* , Int_t ) {}
166 virtual void Gdtom(Double_t* , Double_t* , Int_t ) {}
b9d0a01d 167 virtual Double_t MaxStep() const { return fMaxStep; };
16bf9884 168 virtual Int_t GetNStep() const { return fNStep; };
169 virtual Int_t GetMaxNStep() const { return 0; };
170 virtual Int_t GetMedium() const { return 0; };
171
172 // Dynamic properties
173 virtual void TrackPosition(TLorentzVector& position) const;
059f00b8 174 virtual void TrackPosition(Double_t &x, Double_t &y, Double_t &z) const;
16bf9884 175 virtual void TrackMomentum(TLorentzVector& momentum) const;
059f00b8 176 virtual void TrackMomentum(Double_t &px, Double_t &py, Double_t &pz, Double_t &etot) const;
b9d0a01d 177 virtual Double_t TrackStep() const { return fTrackStep; };
178 virtual Double_t TrackLength() const { return 0.0; };
179 virtual Double_t TrackTime() const { return 0.0; };
180 virtual Double_t Edep() const { return 0.0; };
dd98d073 181
16bf9884 182 // Static properties
183 virtual Int_t TrackPid() const { return fTrackPid; };
b9d0a01d 184 virtual Double_t TrackCharge() const { return fTrackCharge; };
185 virtual Double_t TrackMass() const { return fTrackMass; };
186 virtual Double_t Etot() const { return fTrackEtot; };
16bf9884 187
188 // Track status
189 virtual Bool_t IsNewTrack() const { return kFALSE; };
190 virtual Bool_t IsTrackInside() const { return kFALSE; };
191 virtual Bool_t IsTrackEntering() const { return fTrackEntering; };
192 virtual Bool_t IsTrackExiting() const { return kFALSE; };
193 virtual Bool_t IsTrackOut() const { return kFALSE; };
194 virtual Bool_t IsTrackDisappeared() const { return kFALSE; };
195 virtual Bool_t IsTrackStop() const { return kFALSE; };
196 virtual Bool_t IsTrackAlive() const { return kFALSE; };
197
198 // Secondaries
199 virtual Int_t NSecondaries() const { return 0; };
dd98d073 200 virtual void GetSecondary(Int_t , Int_t& ,
201 TLorentzVector& ,
73ae7b59 202 TLorentzVector& ) { };
dd98d073 203 virtual TMCProcess ProdProcess(Int_t ) const { return kPNoProcess; };
73ae7b59 204 virtual Int_t StepProcesses(TArrayI& ) const { return 0; };
16bf9884 205
206 //
207 // Other (then geometry/step/run management) methods
208 //
dd98d073 209
16bf9884 210 // Geant3 specific methods
b9d0a01d 211 virtual void Gdopt(const char*,const char*) {}
212 virtual void SetClipBox(const char*,Double_t=-9999,Double_t=0, Double_t=-9999,
213 Double_t=0,Double_t=-9999,Double_t=0) {}
214 virtual void DefaultRange() {}
dd98d073 215 virtual void Gdhead(Int_t, const char*, Double_t=0) {}
b9d0a01d 216 virtual void Gdman(Double_t, Double_t, const char*) {}
217 virtual void SetColors() {}
218 virtual void Gtreve() {}
219 virtual void GtreveRoot() {}
220 virtual void Gckmat(Int_t, char*) {}
221 virtual void InitLego() {}
dd98d073 222 virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) {}
223 virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t) {}
224 // Dummy methods
cafdf622 225#if ROOT_VERSION_CODE > 197895
5fa3071f 226 virtual void DefineParticle(int, const char*, TMCParticleType, double, double, double){;}
227 virtual void DefineIon(const char*, int, int, int, double, double){;}
fc8eab84 228 virtual TString ParticleName(int) const {return "";}
229 virtual Double_t ParticleMass(int) const {return 0.;}
230 virtual Double_t ParticleCharge(int) const {return 0.;}
231 virtual Double_t ParticleLifeTime(int) const {return 0.;}
232 virtual TMCParticleType ParticleMCType(int) const {return (TMCParticleType) 0;}
cafdf622 233#endif
5fa3071f 234 //
16bf9884 235 // Control Methods
236 virtual void Init() { };
237 virtual void FinishGeometry() { };
238 virtual void BuildPhysics() { };
239 virtual void ProcessEvent();
dd98d073 240#if ROOT_VERSION_CODE >= 262150
aac172e5 241 virtual Bool_t ProcessRun(Int_t ) { return kTRUE; }
242#else
73ae7b59 243 virtual void ProcessRun(Int_t ) { };
aac172e5 244#endif
fd621f36 245 //virtual TMCGeomType GetMCGeomType() const { return kGeant3; }
16bf9884 246
247 // External Decayer
73ae7b59 248 virtual void SetExternalDecayer(AliDecayer* ) { };
16bf9884 249 virtual AliDecayer *Decayer() const { return 0; };
250
251 protected:
252
253 enum {
254 kVolDrRg
255 , kVolAmRg
256 , kVolDrCh
257 };
258
5443e65e 259 Float_t fMaxStep; // Maximum step size
260 Int_t fNStep; // Number of steps
261 Int_t fTrack; // Track number
262 Double_t fTrackPx; // Track px
263 Double_t fTrackPy; // Track py
264 Double_t fTrackPz; // Track pz
265 Double_t fTrackPtot; // Track total momentum
266 Double_t fTrackEtot; // Track total energy
267 Double_t fTrackX; // Track x position
268 Double_t fTrackY; // Track y position
269 Double_t fTrackZ; // Track z position
270 Double_t fX0; // X position of the beginning of the chamber
271 Double_t fTrackStep; // Track step size
272 Int_t fTrackPid; // Track PID
273 Float_t fTrackCharge; // Track charge
274 Float_t fTrackMass; // Track particle mass
275 Bool_t fTrackEntering; // Track entering chamber
276
277 AliTRDv1 *fTRD; //! TRD detector object
278 AliTRDparameter *fPar; //! TRD parameter object
279
280 ClassDef(AliTRDsimpleMC,2) // Simple TRD Monte Carlo class
dd98d073 281
16bf9884 282};
dd98d073 283#endif
b9d0a01d 284