Transition to NewIO
[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
88cb7938 14#include <TMCProcess.h>
15#include <TVirtualMC.h>
b9d0a01d 16#include "AliDecayer.h"
16bf9884 17
18class AliTRDv1;
5443e65e 19class AliTRDparameter;
16bf9884 20
4c475d27 21class AliTRDsimpleMC : public TVirtualMC {
16bf9884 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;
ee7e3ede 153 virtual const char* CurrentVolName() const;
16bf9884 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;
059f00b8 170 virtual void TrackPosition(Double_t &x, Double_t &y, Double_t &z) const;
16bf9884 171 virtual void TrackMomentum(TLorentzVector& momentum) const;
059f00b8 172 virtual void TrackMomentum(Double_t &px, Double_t &py, Double_t &pz, Double_t &etot) const;
b9d0a01d 173 virtual Double_t TrackStep() const { return fTrackStep; };
174 virtual Double_t TrackLength() const { return 0.0; };
175 virtual Double_t TrackTime() const { return 0.0; };
176 virtual Double_t Edep() const { return 0.0; };
16bf9884 177
178 // Static properties
179 virtual Int_t TrackPid() const { return fTrackPid; };
b9d0a01d 180 virtual Double_t TrackCharge() const { return fTrackCharge; };
181 virtual Double_t TrackMass() const { return fTrackMass; };
182 virtual Double_t Etot() const { return fTrackEtot; };
16bf9884 183
184 // Track status
185 virtual Bool_t IsNewTrack() const { return kFALSE; };
186 virtual Bool_t IsTrackInside() const { return kFALSE; };
187 virtual Bool_t IsTrackEntering() const { return fTrackEntering; };
188 virtual Bool_t IsTrackExiting() const { return kFALSE; };
189 virtual Bool_t IsTrackOut() const { return kFALSE; };
190 virtual Bool_t IsTrackDisappeared() const { return kFALSE; };
191 virtual Bool_t IsTrackStop() const { return kFALSE; };
192 virtual Bool_t IsTrackAlive() const { return kFALSE; };
193
194 // Secondaries
195 virtual Int_t NSecondaries() const { return 0; };
196 virtual void GetSecondary(Int_t isec, Int_t& particleId,
197 TLorentzVector& position,
198 TLorentzVector& momentum) { };
4c475d27 199 virtual TMCProcess ProdProcess(Int_t isec) const { return kPNoProcess; };
16bf9884 200 virtual Int_t StepProcesses(TArrayI &proc) const { return 0; };
201
202 //
203 // Other (then geometry/step/run management) methods
204 //
205
206 // Geant3 specific methods
b9d0a01d 207 virtual void Gdopt(const char*,const char*) {}
208 virtual void SetClipBox(const char*,Double_t=-9999,Double_t=0, Double_t=-9999,
209 Double_t=0,Double_t=-9999,Double_t=0) {}
210 virtual void DefaultRange() {}
211 virtual void Gdhead(Int_t, const char*, Double_t=0) {}
212 virtual void Gdman(Double_t, Double_t, const char*) {}
213 virtual void SetColors() {}
214 virtual void Gtreve() {}
215 virtual void GtreveRoot() {}
216 virtual void Gckmat(Int_t, char*) {}
217 virtual void InitLego() {}
218 virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) {}
219 virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t) {}
16bf9884 220
221 // Control Methods
222 virtual void Init() { };
223 virtual void FinishGeometry() { };
224 virtual void BuildPhysics() { };
225 virtual void ProcessEvent();
226 virtual void ProcessRun(Int_t nevent) { };
fd621f36 227 //virtual TMCGeomType GetMCGeomType() const { return kGeant3; }
16bf9884 228
229 // External Decayer
230 virtual void SetExternalDecayer(AliDecayer* decayer) { };
231 virtual AliDecayer *Decayer() const { return 0; };
232
233 protected:
234
235 enum {
236 kVolDrRg
237 , kVolAmRg
238 , kVolDrCh
239 };
240
5443e65e 241 Float_t fMaxStep; // Maximum step size
242 Int_t fNStep; // Number of steps
243 Int_t fTrack; // Track number
244 Double_t fTrackPx; // Track px
245 Double_t fTrackPy; // Track py
246 Double_t fTrackPz; // Track pz
247 Double_t fTrackPtot; // Track total momentum
248 Double_t fTrackEtot; // Track total energy
249 Double_t fTrackX; // Track x position
250 Double_t fTrackY; // Track y position
251 Double_t fTrackZ; // Track z position
252 Double_t fX0; // X position of the beginning of the chamber
253 Double_t fTrackStep; // Track step size
254 Int_t fTrackPid; // Track PID
255 Float_t fTrackCharge; // Track charge
256 Float_t fTrackMass; // Track particle mass
257 Bool_t fTrackEntering; // Track entering chamber
258
259 AliTRDv1 *fTRD; //! TRD detector object
260 AliTRDparameter *fPar; //! TRD parameter object
261
262 ClassDef(AliTRDsimpleMC,2) // Simple TRD Monte Carlo class
16bf9884 263
264};
265#endif
b9d0a01d 266