3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ///////////////////////////////////////////////////////////////////////////////
11 // FLUKA implementation of the AliMC Interface //
14 ///////////////////////////////////////////////////////////////////////////////
17 #include "TVirtualMC.h"
18 #include "TMCProcess.h"
24 class TG4GeometryManager;
25 class TG4DetConstruction;
27 class TFluka : public TVirtualMC {
30 TFluka(const char *title, Int_t verbosity = 0);
35 // methods for building/management of geometry
36 // ------------------------------------------------
39 // functions from GCONS
40 virtual void Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
41 Float_t &dens, Float_t &radl, Float_t &absl,
42 Float_t* ubuf, Int_t& nbuf);
43 virtual void Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
44 Double_t &dens, Double_t &radl, Double_t &absl,
45 Double_t* ubuf, Int_t& nbuf);
47 // detector composition
48 virtual void Material(Int_t& kmat, const char* name, Double_t a,
49 Double_t z, Double_t dens, Double_t radl, Double_t absl,
50 Float_t* buf, Int_t nwbuf);
51 virtual void Material(Int_t& kmat, const char* name, Double_t a,
52 Double_t z, Double_t dens, Double_t radl, Double_t absl,
53 Double_t* buf, Int_t nwbuf);
54 virtual void Mixture(Int_t& kmat, const char *name, Float_t *a,
55 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat);
56 virtual void Mixture(Int_t& kmat, const char *name, Double_t *a,
57 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat);
58 virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
59 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
60 Double_t stemax, Double_t deemax, Double_t epsil,
61 Double_t stmin, Float_t* ubuf, Int_t nbuf);
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, Double_t* ubuf, Int_t nbuf);
66 virtual void Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
67 Double_t thetaY, Double_t phiY, Double_t thetaZ,
69 virtual void Gstpar(Int_t itmed, const char *param, Double_t parval);
71 // functions from GGEOM
72 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
73 Float_t *upar, Int_t np);
74 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
75 Double_t *upar, Int_t np);
76 virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv,
78 virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv,
79 Int_t iaxis, Double_t c0i, Int_t numed);
80 virtual void Gsdvt(const char *name, const char *mother, Double_t step,
81 Int_t iaxis, Int_t numed, Int_t ndvmx);
82 virtual void Gsdvt2(const char *name, const char *mother, Double_t step,
83 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx);
84 virtual void Gsord(const char *name, Int_t iax);
85 virtual void Gspos(const char *name, Int_t nr, const char *mother,
86 Double_t x, Double_t y, Double_t z, Int_t irot,
87 const char *konly="ONLY");
88 virtual void Gsposp(const char *name, Int_t nr, const char *mother,
89 Double_t x, Double_t y, Double_t z, Int_t irot,
90 const char *konly, Float_t *upar, Int_t np);
91 virtual void Gsposp(const char *name, Int_t nr, const char *mother,
92 Double_t x, Double_t y, Double_t z, Int_t irot,
93 const char *konly, Double_t *upar, Int_t np);
94 virtual void Gsbool(const char* onlyVolName, const char* manyVolName);
96 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
97 Float_t *absco, Float_t *effic, Float_t *rindex);
98 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov,
99 Double_t *absco, Double_t *effic, Double_t *rindex);
102 // functions for drawing
103 virtual void DrawOneSpec(const char* name)
104 {printf("WARNING: DrawOneSpec not yet implemented !\n");}
105 virtual void Gsatt(const char* name, const char* att, Int_t val)
106 {printf("WARNING: Gsatt not yet implemented !\n");}
107 virtual void Gdraw(const char*,Double_t theta = 30, Double_t phi = 30,
108 Double_t psi = 0, Double_t u0 = 10, Double_t v0 = 10,
109 Double_t ul = 0.01, Double_t vl = 0.01)
110 {printf("WARNING: Gdraw not yet implemented !\n");}
113 virtual void WriteEuclid(const char*, const char*, Int_t, Int_t);
116 virtual Int_t VolId(const Text_t* volName) const
117 {printf("WARNING: VolId not yet implemented !\n"); return -1;}
118 virtual const char* VolName(Int_t id) const
119 {printf("WARNING: VolName not yet implemented !\n"); return "void";}
120 virtual Int_t NofVolumes() const
121 {printf("WARNING: NofVolumes not yet implemented !\n"); return -1;}
122 virtual Int_t VolId2Mate(Int_t id) const
123 {printf("WARNING: VolId2Mate not yet implemented !\n"); return -1;}
126 // methods for physics management
127 // ------------------------------------------------
131 virtual void SetCut(const char* cutName, Double_t cutValue)
132 {printf("WARNING: SetCut not yet implemented !\n");}
133 virtual void SetProcess(const char* flagName, Int_t flagValue)
134 {printf("WARNING: SetProcess not yet implemented !\n");}
135 virtual Double_t Xsec(char*, Double_t, Int_t, Int_t)
136 {printf("WARNING: Xsec not yet implemented !\n"); return -1.;}
138 // particle table usage
139 virtual Int_t IdFromPDG(Int_t id) const;
140 virtual Int_t PDGFromId(Int_t pdg) const;
141 virtual void DefineParticles()
142 {printf("WARNING: DefineParticles not yet implemented !\n");}
145 // methods for step management
146 // ------------------------------------------------
150 virtual void StopTrack()
151 {printf("WARNING: StopTrack not yet implemented !\n");}
152 virtual void StopEvent()
153 {printf("WARNING: StopEvent not yet implemented !\n");}
156 virtual void SetMaxStep(Double_t)
157 {printf("WARNING: SetMaxStep not yet implemented !\n");}
158 virtual void SetMaxNStep(Int_t)
159 {printf("WARNING: SetMaxNStep not yet implemented !\n");}
160 virtual void SetUserDecay(Int_t)
161 {printf("WARNING: SetUserDecay not yet implemented !\n");}
164 // tracking volume(s)
165 virtual Int_t CurrentVolID(Int_t& copyNo) const
166 {printf("WARNING: CurrentVolID not yet implemented !\n"); return -1;}
167 virtual Int_t CurrentVolOffID(Int_t off, Int_t& copyNo) const
168 {printf("WARNING: CurrentVolOffID not yet implemented !\n"); return -1;}
169 virtual const char* CurrentVolName() const
170 {printf("WARNING: CurrentVolName not yet implemented !\n"); return "void";}
171 virtual const char* CurrentVolOffName(Int_t off) const
172 {printf("WARNING: CurrentVolOffName not yet implemented !\n"); return "void";}
173 virtual Int_t CurrentMaterial(Float_t &a, Float_t &z,
174 Float_t &dens, Float_t &radl, Float_t &absl) const
175 {printf("WARNING: CurrentMaterial not yet implemented !\n"); return -1;}
176 virtual Int_t CurrentEvent() const
177 {printf("WARNING: CurrentEvent not yet implemented !\n"); return -1;}
178 virtual void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
179 {printf("WARNING: Gmtod not yet implemented !\n");}
180 virtual void Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
181 {printf("WARNING: Gmtod not yet implemented !\n");}
182 virtual void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
183 {printf("WARNING: Gdtom not yet implemented !\n");}
184 virtual void Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
185 {printf("WARNING: Gdtom not yet implemented !\n");}
186 virtual Double_t MaxStep() const
187 {printf("WARNING: MaxStep not yet implemented !\n"); return -1.;}
188 virtual Int_t GetMaxNStep() const
189 {printf("WARNING: GetMaxNStep not yet implemented !\n"); return -1;}
190 virtual Int_t GetMedium() const;
193 // dynamic properties
194 virtual void TrackPosition(TLorentzVector& position) const
195 {printf("WARNING: TrackPosition not yet implemented !\n");}
196 virtual void TrackMomentum(TLorentzVector& momentum) const
197 {printf("WARNING: TrackMomentum not yet implemented !\n");}
198 virtual Double_t TrackStep() const
199 {printf("WARNING: TrackStep not yet implemented !\n"); return -1.;}
200 virtual Double_t TrackLength() const
201 {printf("WARNING: TrackLength not yet implemented !\n"); return -1.;}
202 virtual Double_t TrackTime() const
203 {printf("WARNING: TrackTime not yet implemented !\n"); return -1.;}
204 virtual Double_t Edep() const
205 {printf("WARNING: Edep not yet implemented !\n"); return -1.;}
207 virtual Int_t TrackPid() const
208 {printf("WARNING: TrackPid not yet implemented !\n"); return -1;}
209 virtual Double_t TrackCharge() const
210 {printf("WARNING: TrackCharge not yet implemented !\n"); return -1.;}
211 virtual Double_t TrackMass() const
212 {printf("WARNING: TrackMass not yet implemented !\n"); return -1.;}
213 virtual Double_t Etot() const
214 {printf("WARNING: Etot not yet implemented !\n"); return -1.;}
217 virtual Bool_t IsNewTrack() const
218 {printf("WARNING: IsNewTrack not yet implemented !\n"); return 0;}
219 virtual Bool_t IsTrackInside() const
220 {printf("WARNING: IsTrackInside not yet implemented !\n"); return 0;}
221 virtual Bool_t IsTrackEntering() const
222 {printf("WARNING: IsTrackEntering not yet implemented !\n"); return 0;}
223 virtual Bool_t IsTrackExiting() const
224 {printf("WARNING: IsTrackExiting not yet implemented !\n"); return 0;}
225 virtual Bool_t IsTrackOut() const
226 {printf("WARNING: IsTrackOut not yet implemented !\n"); return 0;}
227 virtual Bool_t IsTrackDisappeared() const
228 {printf("WARNING: IsTrackDisappeared not yet implemented !\n"); return 0;}
229 virtual Bool_t IsTrackStop() const
230 {printf("WARNING: IsTrackStop not yet implemented !\n"); return 0;}
231 virtual Bool_t IsTrackAlive() const
232 {printf("WARNING: IsTrackAlive not yet implemented !\n"); return 0;}
235 virtual Int_t NSecondaries() const
236 {printf("WARNING: NSecondaries not yet implemented !\n"); return -1;}
237 virtual void GetSecondary(Int_t isec, Int_t& particleId,
238 TLorentzVector& position, TLorentzVector& momentum)
239 {printf("WARNING: GetSecondary not yet implemented !\n");}
240 virtual TMCProcess ProdProcess(Int_t isec) const
241 {printf("WARNING: StepProcesses not yet implemented !\n"); return kPNoProcess;}
242 virtual Int_t StepProcesses(TArrayI &proc) const
243 {printf("WARNING: StepProcesses not yet implemented !\n"); return -1;}
247 // Geant3 specific methods
248 // !!! need to be transformed to common interface
250 virtual void Gdopt(const char*,const char*)
251 {printf("WARNING: Gdopt not yet implemented !\n");}
252 virtual void SetClipBox(const char*,Double_t=-9999,Double_t=0, Double_t=-9999,
253 Double_t=0,Double_t=-9999,Double_t=0)
254 {printf("WARNING: SetClipBox not yet implemented !\n");}
255 virtual void DefaultRange()
256 {printf("WARNING: DefaultRange not yet implemented !\n");}
257 virtual void Gdhead(Int_t, const char*, Double_t=0)
258 {printf("WARNING: Gdhead not yet implemented !\n");}
259 virtual void Gdman(Double_t, Double_t, const char*)
260 {printf("WARNING: Gdman not yet implemented !\n");}
261 virtual void SetColors()
262 {printf("WARNING: SetColors not yet implemented !\n");}
263 virtual void Gtreve()
264 {printf("WARNING: Gtreve not yet implemented !\n");}
265 virtual void GtreveRoot()
266 {printf("WARNING: GtreveRoot not yet implemented !\n");}
267 virtual void Gckmat(Int_t, char*)
268 {printf("WARNING: Gckmat not yet implemented !\n");}
269 virtual void InitLego()
270 {printf("WARNING: InitLego not yet implemented !\n");}
271 virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&)
272 {printf("WARNING: Gfpart not yet implemented !\n");}
273 virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t)
274 {printf("WARNING: Gspart not yet implemented !\n");}
278 // ------------------------------------------------
282 virtual void FinishGeometry();
283 virtual void BuildPhysics();
284 virtual void ProcessEvent();
285 virtual void ProcessRun(Int_t nevent);
289 //New Getter and Setters
290 // ------------------------------------------------
293 TString GetInputFileName() const {return fInputFileName;}
294 void SetInputFileName(const char* n) {fInputFileName = n;}
296 Int_t GetVerbosityLevel() const {return fVerbosityLevel;}
297 void SetVerbosityLevel(Int_t l) {fVerbosityLevel = l;}
298 void SetCurrentFlukaRegion(Int_t reg) {fCurrentFlukaRegion=reg;}
299 Int_t GetCurrentFlukaRegion() const {return fCurrentFlukaRegion;}
302 TFluka(const TFluka &mc){}
303 TFluka & operator=(const TFluka &) {return (*this);}
306 Int_t fVerbosityLevel; //Verbosity level (0 lowest - 3 highest)
307 TString fInputFileName; //Name of the input file (f.e. alice.inp)
311 //Geometry through Geant4 for the time being!!!
312 TG4GeometryManager* fGeometryManager; //geometry manager
313 TG4DetConstruction* fDetector; //Detector
315 //Index of fluka region at each step
316 Int_t fCurrentFlukaRegion;
317 //Map between volume name and media indices
318 map<TString, Int_t, less<TString> > fVolumeMediaMap;
319 //Map between region and media indices
320 vector<Int_t> fMediaByRegion;
323 ClassDef(TFluka,1) //C++ interface to Fluka montecarlo