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