]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliFluka/TFluka.cxx
added fFailed data member that tells is file is opened and galise found
[u/mrichter/AliRoot.git] / AliFluka / TFluka.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // $Id$
17 //
18 // Author: I. Hrivnacova
19 //
20 // Class TFluka
21 // ------------------------
22 // See the class description in the header file.
23
24 #include "TFluka.h"
25
26 #include "TG4Globals.h"
27 #include "TG4GeometryManager.h" 
28
29 #include "AliDecayer.h"
30
31 TFluka::TFluka(const char* name, const char* title)
32   : AliMC(name, title)
33 {
34   // create geometry manager
35   fGeometryManager = new TG4GeometryManager();
36   // add verbose level
37   //G4cout << "TG4GeometryManager has been created." << endl;
38 }
39     
40 TFluka::TFluka() {
41 //
42 }
43
44 TFluka::TFluka(const TFluka& right) {
45 // 
46   TG4Globals::Exception("TFluka is protected from copying.");
47 }
48
49 TFluka::~TFluka() {
50 //
51   delete fGeometryManager;
52 }
53
54 // operators
55
56 TFluka& TFluka::operator=(const TFluka& right)
57 {
58   // check assignement to self
59   if (this == &right) return *this;
60
61   TG4Globals::Exception("TFluka is protected from assigning.");
62     
63   return *this;  
64 }    
65           
66
67 // methods for building/management of geometry
68 // ------------------------------------------------
69
70 void TFluka::FinishGeometry() {
71 //
72   fGeometryManager->Ggclos();
73
74
75 void TFluka::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,  
76                          Float_t &dens, Float_t &radl, Float_t &absl,
77                          Float_t* ubuf, Int_t& nbuf) {
78 //
79   fGeometryManager
80     ->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
81
82
83 void TFluka::Material(Int_t& kmat, const char* name, Float_t a, 
84                      Float_t z, Float_t dens, Float_t radl, Float_t absl,
85                      Float_t* buf, Int_t nwbuf) {
86 //
87   fGeometryManager
88     ->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf); 
89
90
91 void TFluka::Mixture(Int_t& kmat, const char *name, Float_t *a, 
92                      Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat) {
93 //
94    fGeometryManager
95      ->Mixture(kmat, name, a, z, dens, nlmat, wmat); 
96
97
98 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat, 
99                      Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, 
100                      Float_t stemax, Float_t deemax, Float_t epsil, 
101                      Float_t stmin, Float_t* ubuf, Int_t nbuf) { 
102 //
103   fGeometryManager
104     ->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, 
105         epsil, stmin, ubuf, nbuf);
106
107
108 void TFluka::Matrix(Int_t& krot, Float_t thetaX, Float_t phiX, 
109                      Float_t thetaY, Float_t phiY, Float_t thetaZ, 
110                      Float_t phiZ) {
111 //                   
112   fGeometryManager
113     ->Matrix(krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ); 
114
115
116 void TFluka::Gstpar(Int_t itmed, const char *param, Float_t parval) {
117 //
118   fGeometryManager->Gstpar(itmed, param, parval); 
119 }    
120
121 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,  
122                          Float_t *upar, Int_t np)  {
123 //
124   return fGeometryManager->Gsvolu(name, shape, nmed, upar, np); 
125 }
126  
127 void TFluka::Gsdvn(const char *name, const char *mother, Int_t ndiv, 
128                         Int_t iaxis) {
129 //
130   fGeometryManager->Gsdvn(name, mother, ndiv, iaxis); 
131
132
133 void TFluka::Gsdvn2(const char *name, const char *mother, Int_t ndiv, 
134                          Int_t iaxis, Float_t c0i, Int_t numed) {
135 //
136   fGeometryManager->Gsdvn2(name, mother, ndiv, iaxis, c0i, numed); 
137
138
139 void TFluka::Gsdvt(const char *name, const char *mother, Float_t step, 
140                         Int_t iaxis, Int_t numed, Int_t ndvmx) {
141 //                      
142   fGeometryManager->Gsdvt(name, mother, step, iaxis, numed, ndvmx); 
143
144
145 void TFluka::Gsdvt2(const char *name, const char *mother, Float_t step, 
146                          Int_t iaxis, Float_t c0, Int_t numed, Int_t ndvmx) { 
147 //
148   fGeometryManager->Gsdvt2(name, mother, step, iaxis, c0, numed, ndvmx); 
149
150
151 void TFluka::Gsord(const char *name, Int_t iax) {
152 //
153   fGeometryManager->Gsord(name, iax); 
154
155
156 void TFluka::Gspos(const char *name, Int_t nr, const char *mother,  
157                         Float_t x, Float_t y, Float_t z, Int_t irot, 
158                         const char *konly) {
159 //
160   fGeometryManager->Gspos(name, nr, mother, x, y, z, irot, konly); 
161
162
163 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,  
164                          Float_t x, Float_t y, Float_t z, Int_t irot,
165                          const char *konly, Float_t *upar, Int_t np)  {
166 //
167   fGeometryManager->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np); 
168
169
170 void TFluka::SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
171                   Float_t *absco, Float_t *effic, Float_t *rindex) {
172 //
173   fGeometryManager->SetCerenkov(itmed, npckov, ppckov, absco, effic, rindex);
174 }  
175     
176 void TFluka::WriteEuclid(const char* fileName, const char* topVol, 
177                           Int_t number, Int_t nlevel) {
178 //
179   fGeometryManager->WriteEuclid(fileName, topVol, number, nlevel); 
180
181                                
182 //======================================================================
183 //
184 // NOT IMPLEMENTED METHODS
185 //
186 //======================================================================
187
188 Int_t TFluka::VolId2Mate(Int_t id) const {
189 //
190   TG4Globals:: Warning("TFluka::VolId2Mate(..) is not implemented."); 
191   return 0; 
192
193
194 Int_t TFluka::VolId(const Text_t* volName) const {
195 //
196   TG4Globals:: Warning("TFluka::VolId(..) is not implemented."); 
197   return 0; 
198
199
200 const char* TFluka::VolName(Int_t id) const {
201 //
202   TG4Globals:: Warning("TFluka::VolName(..) is not implemented."); 
203   return 0; 
204 }
205  
206 Int_t TFluka::NofVolumes() const {
207 //
208   TG4Globals:: Warning("TFluka::NofVolumes(..) is not implemented."); 
209   return 0; 
210
211
212
213 // methods for physics management
214 // ------------------------------------------------
215  
216 void TFluka::BuildPhysics() {
217 //
218   TG4Globals:: Warning("TFluka::BuildPhysics(..) is not implemented."); 
219 }  
220
221 void TFluka::SetCut(const char* cutName, Float_t cutValue) { 
222 //
223   TG4Globals:: Warning("TFluka::SetCut(..) is not implemented."); 
224 }  
225
226 void TFluka::SetProcess(const char* flagName, Int_t flagValue) {
227 //
228   TG4Globals:: Warning("TFluka::SetProcess(..) is not implemented."); 
229 }  
230  
231 Float_t TFluka::Xsec(char* reac, Float_t energy, Int_t part, Int_t mate) {
232 //
233   TG4Globals:: Warning("TFluka::Xsec(..) is not implemented."); 
234   return 0;
235 }  
236
237 void TFluka::SetExternalDecayer(AliDecayer* decayer) {
238 //
239   TG4Globals:: Warning("TFluka::SetExternalDecayer(..) is not implemented."); 
240 }
241
242 AliDecayer* TFluka::Decayer() const {
243 //
244   TG4Globals:: Warning("TFluka::Decayer(..) is not implemented."); 
245   return 0; 
246 }
247   
248
249 Int_t TFluka::IdFromPDG(Int_t pdgID) const { 
250 //
251   TG4Globals:: Warning("TFluka::IdFromPDG(..) is not implemented."); 
252   return 0;
253 }  
254
255 Int_t TFluka::PDGFromId(Int_t mcID) const {
256 //
257   TG4Globals:: Warning("TFluka::PDGFromId(..) is not implemented."); 
258   return 0;
259 }  
260
261 void TFluka::DefineParticles() { 
262 //
263   TG4Globals:: Warning("TFluka::DefineParticles(..) is not implemented."); 
264 }  
265
266 // methods for step management
267 // ------------------------------------------------
268
269 void TFluka::StopTrack()
270
271   TG4Globals:: Warning("TFluka::StopTrack(..) is not implemented."); 
272
273
274 void TFluka::StopEvent()   
275
276   TG4Globals:: Warning("TFluka::StopEvent(..) is not implemented."); 
277
278
279 void TFluka::SetMaxStep(Float_t step)
280
281   TG4Globals:: Warning("TFluka::SetMaxStep(..) is not implemented."); 
282
283
284 void TFluka::SetMaxNStep(Int_t number)
285
286   TG4Globals:: Warning("TFluka::SetMaxNStep(..) is not implemented."); 
287
288
289 void TFluka::SetUserDecay(Int_t number)
290
291   TG4Globals:: Warning("TFluka::SetUserDecay(..) is not implemented."); 
292
293
294 Int_t TFluka::CurrentVolID(Int_t& copyNo) const
295
296   TG4Globals:: Warning("TFluka::CurrentVolID(..) is not implemented."); 
297   return 0;
298
299
300 Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
301
302   TG4Globals:: Warning("TFluka::CurrentVolOffID(..) is not implemented."); 
303   return 0;
304
305
306 const char* TFluka::CurrentVolName() const
307
308   TG4Globals:: Warning("TFluka::CurrentVolName(..) is not implemented."); 
309   return 0;
310
311
312 const char* TFluka::CurrentVolOffName(Int_t off) const
313
314   TG4Globals:: Warning("TFluka::CurrentVolOffName(..) is not implemented."); 
315   return 0;
316
317
318 Int_t TFluka::CurrentMaterial(Float_t &a, Float_t &z, 
319                     Float_t &dens, Float_t &radl, Float_t &absl) const  
320
321   TG4Globals:: Warning("TFluka::CurrentMaterial(..) is not implemented."); 
322   return 0;
323
324
325 void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
326
327   TG4Globals:: Warning("TFluka::Gmtod(..) is not implemented."); 
328
329
330 void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
331
332   TG4Globals:: Warning("TFluka::Gdtom(..) is not implemented."); 
333
334     
335 Float_t TFluka::MaxStep() const
336
337   TG4Globals:: Warning("TFluka::MaxStep(..) is not implemented."); 
338   return 0;
339
340
341 Int_t TFluka::GetMaxNStep() const
342
343   TG4Globals:: Warning("TFluka::GetMaxNStep(..) is not implemented."); 
344   return 0;
345
346
347 Int_t TFluka::GetMedium() const
348
349   TG4Globals:: Warning("TFluka::GetMedium(..) is not implemented."); 
350   return 0;
351
352
353 void TFluka::TrackPosition(TLorentzVector& position) const
354
355   TG4Globals:: Warning("TFluka::TrackPosition(..) is not implemented."); 
356
357
358 void TFluka::TrackMomentum(TLorentzVector& momentum) const
359
360   TG4Globals:: Warning("TFluka::TrackMomentum(..) is not implemented."); 
361
362
363 void TFluka::TrackVertexPosition(TLorentzVector& position) const
364
365   TG4Globals:: Warning("TFluka::TrackVertexPosition(..) is not implemented."); 
366
367
368 void TFluka::TrackVertexMomentum(TLorentzVector& momentum) const
369
370   TG4Globals:: Warning("TFluka::TrackVertexMomentum(..) is not implemented."); 
371
372
373 Float_t TFluka::TrackStep() const
374
375   TG4Globals:: Warning("TFluka::TrackStep(..) is not implemented."); 
376   return 0;
377
378
379 Float_t TFluka::TrackLength() const 
380
381   TG4Globals:: Warning("TFluka::TrackLength(..) is not implemented."); 
382   return 0; 
383
384
385 Float_t TFluka::TrackTime() const
386
387   TG4Globals:: Warning("TFluka::TrackTime(..) is not implemented."); 
388   return 0; 
389
390
391 Float_t TFluka::Edep() const
392
393   TG4Globals:: Warning("TFluka::Edep(..) is not implemented."); 
394   return 0; 
395
396
397 Int_t TFluka::TrackPid() const
398
399   TG4Globals:: Warning("TFluka::TrackPid(..) is not implemented."); 
400   return 0; 
401
402
403 Float_t TFluka::TrackCharge() const
404
405   TG4Globals:: Warning("TFluka::TrackCharge(..) is not implemented."); 
406   return 0; 
407
408
409 Float_t TFluka::TrackMass() const
410
411   TG4Globals:: Warning("TFluka::TrackMass(..) is not implemented."); 
412   return 0; 
413
414
415 Float_t TFluka::Etot() const
416
417   TG4Globals:: Warning("TFluka::Etot(..) is not implemented."); 
418   return 0; 
419
420
421 Bool_t  TFluka::IsTrackInside() const
422 {   
423   TG4Globals:: Warning("TFluka::IsTrackInside(..) is not implemented."); 
424   return false; 
425
426
427 Bool_t  TFluka::IsTrackEntering() const
428 {   
429   TG4Globals:: Warning("TFluka::IsTrackEntering(..) is not implemented."); 
430   return false; 
431
432
433 Bool_t  TFluka::IsTrackExiting() const
434 {   
435   TG4Globals:: Warning("TFluka::IsTrackExiting(..) is not implemented."); 
436   return false; 
437
438
439 Bool_t  TFluka::IsTrackOut() const
440 {   
441   TG4Globals:: Warning("TFluka::IsTrackOut(..) is not implemented."); 
442   return false; 
443
444
445 Bool_t  TFluka::IsTrackDisappeared() const
446 {   
447   TG4Globals:: Warning("TFluka::IsTrackDisappeared(..) is not implemented."); 
448   return false; 
449
450
451 Bool_t  TFluka::IsTrackStop() const
452 {  
453   TG4Globals:: Warning("TFluka::IsTrackStop(..) is not implemented."); 
454   return false; 
455
456
457 Bool_t  TFluka::IsTrackAlive() const
458 {   
459   TG4Globals:: Warning("TFluka::IsTrackAlive(..) is not implemented."); 
460   return false; 
461
462
463 Bool_t TFluka::IsNewTrack() const
464 {
465   TG4Globals:: Warning("TFluka::IsNewTrack(..) is not implemented."); 
466   return false;
467 }  
468
469 Int_t TFluka::NSecondaries() const
470
471   TG4Globals:: Warning("TFluka::NSecondaries(..) is not implemented."); 
472   return 0; 
473
474
475 void  TFluka::GetSecondary(Int_t isec, Int_t& particleId, 
476                          TLorentzVector& position, TLorentzVector& momentum)
477
478   TG4Globals:: Warning("TFluka::GetSecondary(..) is not implemented."); 
479
480
481 AliMCProcess TFluka::ProdProcess(Int_t isec) const 
482
483   TG4Globals:: Warning("TFluka::ProdProcess(..) is not implemented."); 
484   return kPNoProcess; 
485
486
487 Int_t TFluka::StepProcesses(TArrayI &proc) const
488
489   TG4Globals:: Warning("TFluka::StepProcesses(..) is not implemented."); 
490   return 0; 
491
492
493 // methods for visualization
494 // ------------------------------------------------
495
496 void TFluka::DrawOneSpec(const char* name) {
497 //
498   TG4Globals:: Warning("TFluka::DrawOneSpec(): no visualization available."); 
499
500
501 void TFluka::Gsatt(const char* name, const char* att, Int_t val) {
502 //
503   TG4Globals:: Warning("TFluka::Gsatt(): no visualization available."); 
504
505
506 void TFluka::Gdraw(const char* p1, Float_t theta, Float_t phi,
507                         Float_t psi, Float_t u0, Float_t v0,
508                         Float_t ul, Float_t vl) {
509 //
510   TG4Globals:: Warning("TFluka::Gdraw(): no visualization available."); 
511
512
513
514 // methods for run control
515 // ------------------------------------------------
516
517 void TFluka::Init() { 
518 //
519   TG4Globals:: Warning("TFluka::Init(..) is not implemented."); 
520 }  
521   
522 void TFluka::ProcessEvent() { 
523 //
524   TG4Globals:: Warning("TFluka::ProcessEvent(..) is not implemented."); 
525 }  
526
527 void TFluka::ProcessRun(Int_t nofEvents) {
528 //
529   TG4Globals:: Warning("TFluka::ProcessRun(..) is not implemented."); 
530 }  
531
532 Int_t TFluka::CurrentEvent() const {
533 //
534   TG4Globals:: Warning("TFluka::CurrentEvent(..) is not implemented."); 
535   return 0;
536
537
538 // Geant3 specific methods
539 // !!! need to be transformed to common interface
540 // ------------------------------------------------
541     
542 void TFluka::Gdopt(const char* name, const char* value) {
543 //
544   TG4Globals:: Warning("TFluka::Gdopt(..) is not implemented."); 
545 }
546
547 void TFluka::SetClipBox(const char *name, Float_t xmin, Float_t xmax,
548                      Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax) { 
549 //
550   TG4Globals:: Warning("TFluka::SetClipBox(..) is not implemented."); 
551 }
552
553 void TFluka::DefaultRange() { 
554 //
555   TG4Globals:: Warning("TFluka::DefaultRange() is not implemented."); 
556 }
557
558 void TFluka::Gdhead(Int_t isel, const char* name, Float_t chrsiz) { 
559 //
560   TG4Globals:: Warning("TFluka::Gdhead(..) is not implemented."); 
561 }
562
563 void TFluka::Gdman(Float_t u, Float_t v, const char* type) { 
564 //
565   TG4Globals:: Warning("TFluka::Gdman(..) is not implemented."); 
566 }
567
568 void TFluka::SetColors() { 
569 //
570   TG4Globals:: Warning("TFluka::SetColours() is not implemented."); 
571 }
572
573 void TFluka::Gtreve() { 
574 //
575   TG4Globals:: Warning("TFluka::Gtreve() is not implemented."); 
576 }
577
578 void TFluka::GtreveRoot() { 
579 //
580   TG4Globals:: Warning("TFluka::GtreveRoot() is not implemented."); 
581 }
582
583 void TFluka::Gckmat(Int_t itmed, char* natmed) { 
584 //
585   TG4Globals:: Warning("TFluka::Gckmat(..) is not implemented."); 
586 }
587
588 void TFluka::InitLego() { 
589 //
590   TG4Globals:: Warning("TFluka::InitLego() is not implemented."); 
591 }
592
593 void TFluka::Gfpart(Int_t ipart, char *name, Int_t& itrtyp,  
594                      Float_t& amass, Float_t& charge, Float_t& tlife) { 
595 //
596   TG4Globals:: Warning("TFluka::Gfpart(..) is not implemented."); 
597 }
598
599 void TFluka::Gspart(Int_t ipart, const char *name, Int_t itrtyp,  
600                      Float_t amass, Float_t charge, Float_t tlife) {  
601 //
602   TG4Globals:: Warning("TFluka::Gspart(..) is not implemented."); 
603 }