]>
Commit | Line | Data |
---|---|---|
b9d0a01d | 1 | #ifndef TFLUKA |
2 | #define TFLUKA | |
03ca248b | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | // // | |
10 | // // | |
27b2f7fe | 11 | // FLUKA implementation of the AliMC Interface // |
03ca248b | 12 | // // |
13 | // // | |
14 | /////////////////////////////////////////////////////////////////////////////// | |
15 | ||
16 | ||
b9d0a01d | 17 | #include "TVirtualMC.h" |
18 | #include "TMCProcess.h" | |
03ca248b | 19 | |
27b2f7fe | 20 | #include <map> |
21 | #include <vector> | |
22 | ||
bf3aa28e | 23 | //Forward declaration |
24 | class TG4GeometryManager; | |
25 | class TG4DetConstruction; | |
b9d0a01d | 26 | |
27 | class TFluka : public TVirtualMC { | |
28 | ||
03ca248b | 29 | public: |
b9d0a01d | 30 | TFluka(const char *title, Int_t verbosity = 0); |
31 | TFluka(); | |
bf3aa28e | 32 | virtual ~TFluka(); |
03ca248b | 33 | |
b9d0a01d | 34 | // |
35 | // methods for building/management of geometry | |
36 | // ------------------------------------------------ | |
37 | // | |
38 | ||
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, | |
bf3aa28e | 42 | Float_t* ubuf, Int_t& nbuf); |
b9d0a01d | 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, | |
bf3aa28e | 45 | Double_t* ubuf, Int_t& nbuf); |
b9d0a01d | 46 | |
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, | |
bf3aa28e | 50 | Float_t* buf, Int_t nwbuf); |
b9d0a01d | 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, | |
bf3aa28e | 53 | Double_t* buf, Int_t nwbuf); |
b9d0a01d | 54 | virtual void Mixture(Int_t& kmat, const char *name, Float_t *a, |
bf3aa28e | 55 | Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat); |
b9d0a01d | 56 | virtual void Mixture(Int_t& kmat, const char *name, Double_t *a, |
bf3aa28e | 57 | Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat); |
b9d0a01d | 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, | |
bf3aa28e | 61 | Double_t stmin, Float_t* ubuf, Int_t nbuf); |
b9d0a01d | 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, | |
bf3aa28e | 65 | Double_t stmin, Double_t* ubuf, Int_t nbuf); |
b9d0a01d | 66 | virtual void Matrix(Int_t& krot, Double_t thetaX, Double_t phiX, |
67 | Double_t thetaY, Double_t phiY, Double_t thetaZ, | |
bf3aa28e | 68 | Double_t phiZ); |
69 | virtual void Gstpar(Int_t itmed, const char *param, Double_t parval); | |
b9d0a01d | 70 | |
71 | // functions from GGEOM | |
72 | virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, | |
bf3aa28e | 73 | Float_t *upar, Int_t np); |
b9d0a01d | 74 | virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, |
bf3aa28e | 75 | Double_t *upar, Int_t np); |
b9d0a01d | 76 | virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, |
bf3aa28e | 77 | Int_t iaxis); |
b9d0a01d | 78 | virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, |
bf3aa28e | 79 | Int_t iaxis, Double_t c0i, Int_t numed); |
b9d0a01d | 80 | virtual void Gsdvt(const char *name, const char *mother, Double_t step, |
bf3aa28e | 81 | Int_t iaxis, Int_t numed, Int_t ndvmx); |
b9d0a01d | 82 | virtual void Gsdvt2(const char *name, const char *mother, Double_t step, |
bf3aa28e | 83 | Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx); |
84 | virtual void Gsord(const char *name, Int_t iax); | |
b9d0a01d | 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, | |
bf3aa28e | 87 | const char *konly="ONLY"); |
b9d0a01d | 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, | |
bf3aa28e | 90 | const char *konly, Float_t *upar, Int_t np); |
b9d0a01d | 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, | |
bf3aa28e | 93 | const char *konly, Double_t *upar, Int_t np); |
94 | virtual void Gsbool(const char* onlyVolName, const char* manyVolName); | |
b9d0a01d | 95 | |
96 | virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, | |
bf3aa28e | 97 | Float_t *absco, Float_t *effic, Float_t *rindex); |
b9d0a01d | 98 | virtual void SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov, |
bf3aa28e | 99 | Double_t *absco, Double_t *effic, Double_t *rindex); |
b9d0a01d | 100 | |
101 | ||
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");} | |
111 | ||
112 | // Euclid | |
bf3aa28e | 113 | virtual void WriteEuclid(const char*, const char*, Int_t, Int_t); |
b9d0a01d | 114 | |
115 | // get methods | |
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;} | |
124 | ||
125 | // | |
126 | // methods for physics management | |
127 | // ------------------------------------------------ | |
128 | // | |
129 | ||
130 | // set methods | |
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.;} | |
137 | ||
138 | // particle table usage | |
139 | virtual Int_t IdFromPDG(Int_t id) const; | |
b9d0a01d | 140 | virtual Int_t PDGFromId(Int_t pdg) const; |
f9cb2fec | 141 | virtual void DefineParticles() |
142 | {printf("WARNING: DefineParticles not yet implemented !\n");} | |
b9d0a01d | 143 | |
144 | // | |
145 | // methods for step management | |
146 | // ------------------------------------------------ | |
147 | // | |
148 | ||
149 | // action methods | |
150 | virtual void StopTrack() | |
151 | {printf("WARNING: StopTrack not yet implemented !\n");} | |
152 | virtual void StopEvent() | |
153 | {printf("WARNING: StopEvent not yet implemented !\n");} | |
154 | ||
155 | // set methods | |
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");} | |
162 | ||
163 | // get methods | |
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;} | |
27b2f7fe | 190 | virtual Int_t GetMedium() const; |
b9d0a01d | 191 | |
192 | // tracking particle | |
193 | // dynamic properties | |
fa3d1cc7 | 194 | virtual void TrackPosition(TLorentzVector& position) const; |
195 | virtual void TrackMomentum(TLorentzVector& momentum) const; | |
196 | virtual Double_t TrackStep() const; | |
197 | virtual Double_t TrackLength() const; | |
198 | virtual Double_t TrackTime() const; | |
199 | virtual Double_t Edep() const; | |
b9d0a01d | 200 | // static properties |
fa3d1cc7 | 201 | virtual Int_t TrackPid() const; |
202 | virtual Double_t TrackCharge() const; | |
203 | virtual Double_t TrackMass() const; | |
204 | virtual Double_t Etot() const; | |
b9d0a01d | 205 | // track status |
fa3d1cc7 | 206 | virtual Bool_t IsNewTrack() const; |
207 | virtual Bool_t IsTrackInside() const; | |
208 | virtual Bool_t IsTrackEntering() const; | |
209 | virtual Bool_t IsTrackExiting() const; | |
210 | virtual Bool_t IsTrackOut() const; | |
211 | virtual Bool_t IsTrackDisappeared() const; | |
212 | virtual Bool_t IsTrackStop() const; | |
213 | virtual Bool_t IsTrackAlive() const; | |
03ca248b | 214 | |
b9d0a01d | 215 | // secondaries |
fa3d1cc7 | 216 | virtual Int_t NSecondaries() const ; |
b9d0a01d | 217 | virtual void GetSecondary(Int_t isec, Int_t& particleId, |
fa3d1cc7 | 218 | TLorentzVector& position, TLorentzVector& momentum); |
b9d0a01d | 219 | virtual TMCProcess ProdProcess(Int_t isec) const |
220 | {printf("WARNING: StepProcesses not yet implemented !\n"); return kPNoProcess;} | |
221 | virtual Int_t StepProcesses(TArrayI &proc) const | |
222 | {printf("WARNING: StepProcesses not yet implemented !\n"); return -1;} | |
223 | ||
224 | ||
225 | // | |
226 | // Geant3 specific methods | |
227 | // !!! need to be transformed to common interface | |
228 | // | |
229 | virtual void Gdopt(const char*,const char*) | |
230 | {printf("WARNING: Gdopt not yet implemented !\n");} | |
231 | virtual void SetClipBox(const char*,Double_t=-9999,Double_t=0, Double_t=-9999, | |
232 | Double_t=0,Double_t=-9999,Double_t=0) | |
233 | {printf("WARNING: SetClipBox not yet implemented !\n");} | |
234 | virtual void DefaultRange() | |
235 | {printf("WARNING: DefaultRange not yet implemented !\n");} | |
236 | virtual void Gdhead(Int_t, const char*, Double_t=0) | |
237 | {printf("WARNING: Gdhead not yet implemented !\n");} | |
238 | virtual void Gdman(Double_t, Double_t, const char*) | |
239 | {printf("WARNING: Gdman not yet implemented !\n");} | |
240 | virtual void SetColors() | |
241 | {printf("WARNING: SetColors not yet implemented !\n");} | |
242 | virtual void Gtreve() | |
243 | {printf("WARNING: Gtreve not yet implemented !\n");} | |
244 | virtual void GtreveRoot() | |
245 | {printf("WARNING: GtreveRoot not yet implemented !\n");} | |
246 | virtual void Gckmat(Int_t, char*) | |
247 | {printf("WARNING: Gckmat not yet implemented !\n");} | |
248 | virtual void InitLego() | |
249 | {printf("WARNING: InitLego not yet implemented !\n");} | |
250 | virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) | |
251 | {printf("WARNING: Gfpart not yet implemented !\n");} | |
252 | virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t) | |
253 | {printf("WARNING: Gspart not yet implemented !\n");} | |
254 | ||
255 | // | |
256 | // control methods | |
257 | // ------------------------------------------------ | |
258 | // | |
259 | ||
260 | virtual void Init(); | |
bf3aa28e | 261 | virtual void FinishGeometry(); |
262 | virtual void BuildPhysics(); | |
b9d0a01d | 263 | virtual void ProcessEvent(); |
b9d0a01d | 264 | virtual void ProcessRun(Int_t nevent); |
03ca248b | 265 | |
03ca248b | 266 | |
b9d0a01d | 267 | // |
268 | //New Getter and Setters | |
269 | // ------------------------------------------------ | |
270 | // | |
271 | // - Input file name | |
272 | TString GetInputFileName() const {return fInputFileName;} | |
273 | void SetInputFileName(const char* n) {fInputFileName = n;} | |
274 | // - Verbosity level | |
275 | Int_t GetVerbosityLevel() const {return fVerbosityLevel;} | |
276 | void SetVerbosityLevel(Int_t l) {fVerbosityLevel = l;} | |
fa3d1cc7 | 277 | |
278 | // - Fluka Draw procedures formal parameters | |
279 | Int_t GetIcode() const {return fIcode;} | |
280 | void SetIcode(Int_t l) {fIcode = l;} | |
281 | ||
282 | Int_t GetMreg() const {return fCurrentFlukaRegion;} | |
283 | void SetMreg(Int_t l) {fCurrentFlukaRegion = l;} | |
284 | ||
285 | Int_t GetNewreg() const {return fNewreg;} | |
286 | void SetNewreg(Int_t l) {fNewreg = l;} | |
287 | ||
288 | Double_t GetRull() const {return fRull;} | |
289 | void SetRull(Double_t r) {fRull = r;} | |
290 | ||
291 | Double_t GetXsco() const {return fXsco;} | |
292 | void SetXsco(Double_t x) {fXsco = x;} | |
293 | ||
294 | Double_t GetYsco() const {return fYsco;} | |
295 | void SetYsco(Double_t y) {fYsco = y;} | |
296 | ||
297 | Double_t GetZsco() const {return fZsco;} | |
298 | void SetZsco(Double_t z) {fZsco = z;} | |
299 | ||
27b2f7fe | 300 | void SetCurrentFlukaRegion(Int_t reg) {fCurrentFlukaRegion=reg;} |
301 | Int_t GetCurrentFlukaRegion() const {return fCurrentFlukaRegion;} | |
03ca248b | 302 | |
fa3d1cc7 | 303 | // |
304 | // test | |
305 | // ------------------------------------------------ | |
306 | // | |
307 | virtual void FutoTest() ; | |
308 | ||
b9d0a01d | 309 | private: |
310 | TFluka(const TFluka &mc){} | |
311 | TFluka & operator=(const TFluka &) {return (*this);} | |
03ca248b | 312 | |
b9d0a01d | 313 | protected: |
314 | Int_t fVerbosityLevel; //Verbosity level (0 lowest - 3 highest) | |
fa3d1cc7 | 315 | |
316 | TString fInputFileName; //Name of the input file (f.e. mu.inp) | |
317 | ||
318 | Int_t fIcode; //Fluka Draw procedures formal parameter | |
319 | // Int_t fMreg; //Fluka Draw procedures formal parameter | |
320 | Int_t fNewreg; //Fluka Draw procedures formal parameter | |
321 | Double_t fRull; //Fluka Draw procedures formal parameter | |
322 | Double_t fXsco; //Fluka Draw procedures formal parameter | |
323 | Double_t fYsco; //Fluka Draw procedures formal parameter | |
324 | Double_t fZsco; //Fluka Draw procedures formal parameter | |
325 | ||
03ca248b | 326 | |
03ca248b | 327 | |
bf3aa28e | 328 | //Geometry through Geant4 for the time being!!! |
329 | TG4GeometryManager* fGeometryManager; //geometry manager | |
330 | TG4DetConstruction* fDetector; //Detector | |
03ca248b | 331 | |
fa3d1cc7 | 332 | |
333 | ||
334 | ||
335 | ||
27b2f7fe | 336 | //Index of fluka region at each step |
337 | Int_t fCurrentFlukaRegion; | |
338 | //Map between volume name and media indices | |
0e22711e | 339 | std::map<TString, Int_t, std::less<TString> > fVolumeMediaMap; |
27b2f7fe | 340 | //Map between region and media indices |
0e22711e | 341 | std::vector<Int_t> fMediaByRegion; |
27b2f7fe | 342 | |
03ca248b | 343 | |
fa3d1cc7 | 344 | |
b9d0a01d | 345 | ClassDef(TFluka,1) //C++ interface to Fluka montecarlo |
fa3d1cc7 | 346 | |
347 | ||
03ca248b | 348 | }; |
349 | ||
b9d0a01d | 350 | #endif //TFLUKA |
03ca248b | 351 |