Update of tracking code for tilted pads
[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 */
5
6/* $Id$ */
7
0a29d0f1 8///////////////////////////////////////////////////////////////////////////////
9// //
10// Simple TRD Monte Carlo class //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
16bf9884 14#include "AliMC.h"
15#include "AliMCProcess.h"
b9d0a01d 16#include "AliDecayer.h"
16bf9884 17
18class AliTRDv1;
5443e65e 19class AliTRDparameter;
16bf9884 20
21class AliTRDsimpleMC : public AliMC {
22
23 public:
24
25 enum {
26 kPdgElectron = 11
27 , kPdgPion = 211
28 };
29
30 AliTRDsimpleMC();
31 AliTRDsimpleMC(const char *name, const char *title);
32 AliTRDsimpleMC(const AliTRDsimpleMC &m);
33
34 virtual ~AliTRDsimpleMC();
35 AliTRDsimpleMC &operator=(const AliTRDsimpleMC &m);
36
37 virtual void Copy(TObject &m);
38
39 //
40 // Methods for building / management of geometry
41 //
42
43 // Functions from GCONS
b9d0a01d 44 virtual void Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
45 Float_t &dens, Float_t &radl, Float_t &absl,
46 Float_t* ubuf, Int_t& nbuf) {}
47 virtual void Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
48 Double_t &dens, Double_t &radl, Double_t &absl,
49 Double_t* ubuf, Int_t& nbuf) {}
16bf9884 50
51 // Detector composition
b9d0a01d 52 virtual void Material(Int_t& kmat, const char* name, Double_t a,
53 Double_t z, Double_t dens, Double_t radl, Double_t absl,
54 Float_t* buf, Int_t nwbuf) {}
55 virtual void Material(Int_t& kmat, const char* name, Double_t a,
56 Double_t z, Double_t dens, Double_t radl, Double_t absl,
57 Double_t* buf, Int_t nwbuf) {}
58 virtual void Mixture(Int_t& kmat, const char *name, Float_t *a,
59 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat) {}
60 virtual void Mixture(Int_t& kmat, const char *name, Double_t *a,
61 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat) {}
62 virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
63 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
64 Double_t stemax, Double_t deemax, Double_t epsil,
65 Double_t stmin, Float_t* ubuf, Int_t nbuf) {}
66 virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
67 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
68 Double_t stemax, Double_t deemax, Double_t epsil,
69 Double_t stmin, Double_t* ubuf, Int_t nbuf) {}
70 virtual void Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
71 Double_t thetaY, Double_t phiY, Double_t thetaZ,
72 Double_t phiZ) {}
73 virtual void Gstpar(Int_t itmed, const char *param, Double_t parval) {}
16bf9884 74
75 // Functions from GGEOM
b9d0a01d 76 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
77 Float_t *upar, Int_t np) { return 0; }
78 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
79 Double_t *upar, Int_t np) { return 0; }
80 virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv,
81 Int_t iaxis) {}
82 virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv,
83 Int_t iaxis, Double_t c0i, Int_t numed) {}
84 virtual void Gsdvt(const char *name, const char *mother, Double_t step,
85 Int_t iaxis, Int_t numed, Int_t ndvmx) {}
86 virtual void Gsdvt2(const char *name, const char *mother, Double_t step,
87 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx) {}
88 virtual void Gsord(const char *name, Int_t iax) {}
89 virtual void Gspos(const char *name, Int_t nr, const char *mother,
90 Double_t x, Double_t y, Double_t z, Int_t irot,
91 const char *konly="ONLY") {}
92 virtual void Gsposp(const char *name, Int_t nr, const char *mother,
93 Double_t x, Double_t y, Double_t z, Int_t irot,
94 const char *konly, Float_t *upar, Int_t np) {}
95 virtual void Gsposp(const char *name, Int_t nr, const char *mother,
96 Double_t x, Double_t y, Double_t z, Int_t irot,
97 const char *konly, Double_t *upar, Int_t np) {}
98 virtual void Gsbool(const char* onlyVolName, const char* manyVolName) {}
99
100 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
101 Float_t *absco, Float_t *effic, Float_t *rindex) {}
102 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov,
103 Double_t *absco, Double_t *effic, Double_t *rindex) {}
104
16bf9884 105 // Functions for drawing
b9d0a01d 106 virtual void DrawOneSpec(const char* name) {}
107 virtual void Gsatt(const char* name, const char* att, Int_t val) {}
108 virtual void Gdraw(const char*,Double_t theta = 30, Double_t phi = 30,
109 Double_t psi = 0, Double_t u0 = 10, Double_t v0 = 10,
110 Double_t ul = 0.01, Double_t vl = 0.01) {}
16bf9884 111
112 // Euclid
b9d0a01d 113 virtual void WriteEuclid(const char *a, const char *b, Int_t c, Int_t d) {}
16bf9884 114
115 // Get methods
b9d0a01d 116 virtual Int_t VolId(const Text_t* volName) const;
117 virtual const char* VolName(Int_t id) const { return ""; }
118 virtual Int_t NofVolumes() const { return 0; }
119 virtual Int_t VolId2Mate(Int_t id) const { return 0; }
16bf9884 120
121 //
122 // Methods for physics management
123 //
124
125 // Set methods
b9d0a01d 126 virtual void SetCut(const char* cutName, Double_t cutValue) {}
127 virtual void SetProcess(const char* flagName, Int_t flagValue) {}
128 virtual Double_t Xsec(char*, Double_t, Int_t, Int_t) { return 0.; }
16bf9884 129
130 // Particle table usage
b9d0a01d 131 virtual Int_t IdFromPDG(Int_t id) const { return 0; }
132 virtual Int_t PDGFromId(Int_t pdg) const { return 0; }
133 virtual void DefineParticles() {}
16bf9884 134
135 //
136 // Methods for step management
137 //
138
139 // Action methods
140 virtual void StopTrack() { };
141 virtual void StopEvent() { };
142
143 // Set methods
b9d0a01d 144 virtual void SetMaxStep(Double_t step) { fMaxStep = step; };
16bf9884 145 virtual void SetMaxNStep(Int_t n) { };
146 virtual void SetUserDecay(Int_t d) { };
147
148 virtual void NewTrack(Int_t iTrack, Int_t pdg, Double_t px, Double_t py, Double_t pz);
149
150 // Tracking volume(s)
151 virtual Int_t CurrentVolID(Int_t& copyNo) const;
152 virtual Int_t CurrentVolOffID(Int_t off, Int_t& copyNo) const;
153 virtual const char* CurrentVolName() const { return ""; };
154 virtual const char* CurrentVolOffName(Int_t off) const { return ""; };
155 virtual Int_t CurrentMaterial(Float_t &a, Float_t &z,
156 Float_t &dens, Float_t &radl,
157 Float_t &absl) const { return 0; };
158 virtual Int_t CurrentEvent() const { return 0; };
b9d0a01d 159 virtual void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag) {}
160 virtual void Gmtod(Double_t* xm, Double_t* xd, Int_t iflag) {}
161 virtual void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag) {}
162 virtual void Gdtom(Double_t* xd, Double_t* xm, Int_t iflag) {}
163 virtual Double_t MaxStep() const { return fMaxStep; };
16bf9884 164 virtual Int_t GetNStep() const { return fNStep; };
165 virtual Int_t GetMaxNStep() const { return 0; };
166 virtual Int_t GetMedium() const { return 0; };
167
168 // Dynamic properties
169 virtual void TrackPosition(TLorentzVector& position) const;
170 virtual void TrackMomentum(TLorentzVector& momentum) const;
b9d0a01d 171 virtual Double_t TrackStep() const { return fTrackStep; };
172 virtual Double_t TrackLength() const { return 0.0; };
173 virtual Double_t TrackTime() const { return 0.0; };
174 virtual Double_t Edep() const { return 0.0; };
16bf9884 175
176 // Static properties
177 virtual Int_t TrackPid() const { return fTrackPid; };
b9d0a01d 178 virtual Double_t TrackCharge() const { return fTrackCharge; };
179 virtual Double_t TrackMass() const { return fTrackMass; };
180 virtual Double_t Etot() const { return fTrackEtot; };
16bf9884 181
182 // Track status
183 virtual Bool_t IsNewTrack() const { return kFALSE; };
184 virtual Bool_t IsTrackInside() const { return kFALSE; };
185 virtual Bool_t IsTrackEntering() const { return fTrackEntering; };
186 virtual Bool_t IsTrackExiting() const { return kFALSE; };
187 virtual Bool_t IsTrackOut() const { return kFALSE; };
188 virtual Bool_t IsTrackDisappeared() const { return kFALSE; };
189 virtual Bool_t IsTrackStop() const { return kFALSE; };
190 virtual Bool_t IsTrackAlive() const { return kFALSE; };
191
192 // Secondaries
193 virtual Int_t NSecondaries() const { return 0; };
194 virtual void GetSecondary(Int_t isec, Int_t& particleId,
195 TLorentzVector& position,
196 TLorentzVector& momentum) { };
197 virtual AliMCProcess ProdProcess(Int_t isec) const { return kPNoProcess; };
198 virtual Int_t StepProcesses(TArrayI &proc) const { return 0; };
199
200 //
201 // Other (then geometry/step/run management) methods
202 //
203
204 // Geant3 specific methods
b9d0a01d 205 virtual void Gdopt(const char*,const char*) {}
206 virtual void SetClipBox(const char*,Double_t=-9999,Double_t=0, Double_t=-9999,
207 Double_t=0,Double_t=-9999,Double_t=0) {}
208 virtual void DefaultRange() {}
209 virtual void Gdhead(Int_t, const char*, Double_t=0) {}
210 virtual void Gdman(Double_t, Double_t, const char*) {}
211 virtual void SetColors() {}
212 virtual void Gtreve() {}
213 virtual void GtreveRoot() {}
214 virtual void Gckmat(Int_t, char*) {}
215 virtual void InitLego() {}
216 virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) {}
217 virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t) {}
16bf9884 218
219 // Control Methods
220 virtual void Init() { };
221 virtual void FinishGeometry() { };
222 virtual void BuildPhysics() { };
223 virtual void ProcessEvent();
224 virtual void ProcessRun(Int_t nevent) { };
fd621f36 225 //virtual TMCGeomType GetMCGeomType() const { return kGeant3; }
16bf9884 226
227 // External Decayer
228 virtual void SetExternalDecayer(AliDecayer* decayer) { };
229 virtual AliDecayer *Decayer() const { return 0; };
230
231 protected:
232
233 enum {
234 kVolDrRg
235 , kVolAmRg
236 , kVolDrCh
237 };
238
5443e65e 239 Float_t fMaxStep; // Maximum step size
240 Int_t fNStep; // Number of steps
241 Int_t fTrack; // Track number
242 Double_t fTrackPx; // Track px
243 Double_t fTrackPy; // Track py
244 Double_t fTrackPz; // Track pz
245 Double_t fTrackPtot; // Track total momentum
246 Double_t fTrackEtot; // Track total energy
247 Double_t fTrackX; // Track x position
248 Double_t fTrackY; // Track y position
249 Double_t fTrackZ; // Track z position
250 Double_t fX0; // X position of the beginning of the chamber
251 Double_t fTrackStep; // Track step size
252 Int_t fTrackPid; // Track PID
253 Float_t fTrackCharge; // Track charge
254 Float_t fTrackMass; // Track particle mass
255 Bool_t fTrackEntering; // Track entering chamber
256
257 AliTRDv1 *fTRD; //! TRD detector object
258 AliTRDparameter *fPar; //! TRD parameter object
259
260 ClassDef(AliTRDsimpleMC,2) // Simple TRD Monte Carlo class
16bf9884 261
262};
263#endif
b9d0a01d 264