1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 // Realisation of the TVirtualMC interface for the FLUKA code
20 // (See official web side http://www.fluka.org/).
22 // This implementation makes use of the TGeo geometry modeller.
23 // User configuration is via automatic generation of FLUKA input cards.
32 #include <Riostream.h>
34 //#include "AliModule.h"
36 #include "TClonesArray.h"
37 #include "TFlukaGeo.h"
38 #include "TCallf77.h" //For the fortran calls
39 #include "Fdblprc.h" //(DBLPRC) fluka common
40 #include "Fepisor.h" //(EPISOR) fluka common
41 #include "Ffinuc.h" //(FINUC) fluka common
42 #include "Fiounit.h" //(IOUNIT) fluka common
43 #include "Fpaprop.h" //(PAPROP) fluka common
44 #include "Fpart.h" //(PART) fluka common
45 #include "Ftrackr.h" //(TRACKR) fluka common
46 #include "Fpaprop.h" //(PAPROP) fluka common
47 #include "Ffheavy.h" //(FHEAVY) fluka common
49 #include "TVirtualMC.h"
50 #include "TGeoManager.h"
51 #include "TGeoMaterial.h"
52 #include "TGeoMedium.h"
53 #include "TFlukaMCGeometry.h"
54 #include "TFlukaCerenkov.h"
55 #include "TLorentzVector.h"
57 // Fluka methods that may be needed.
59 # define flukam flukam_
60 # define fluka_openinp fluka_openinp_
61 # define fluka_closeinp fluka_closeinp_
62 # define mcihad mcihad_
63 # define mpdgha mpdgha_
65 # define flukam FLUKAM
66 # define fluka_openinp FLUKA_OPENINP
67 # define fluka_closeinp FLUKA_CLOSEINP
68 # define mcihad MCIHAD
69 # define mpdgha MPDGHA
75 // Prototypes for FLUKA functions
77 void type_of_call flukam(const int&);
78 void type_of_call fluka_openinp(const int&, DEFCHARA);
79 void type_of_call fluka_closeinp(const int&);
80 int type_of_call mcihad(const int&);
81 int type_of_call mpdgha(const int&);
85 // Class implementation for ROOT
90 //----------------------------------------------------------------------------
91 // TFluka constructors and destructors.
92 //______________________________________________________________________________
99 // Default constructor
102 fCurrentFlukaRegion = -1;
109 //______________________________________________________________________________
110 TFluka::TFluka(const char *title, Int_t verbosity, Bool_t isRootGeometrySupported)
111 :TVirtualMC("TFluka",title, isRootGeometrySupported),
112 fVerbosityLevel(verbosity),
118 // create geometry interface
119 if (fVerbosityLevel >=3)
120 cout << "<== TFluka::TFluka(" << title << ") constructor called." << endl;
123 fCurrentFlukaRegion = -1;
126 fGeom = new TFlukaMCGeometry("geom", "ALICE geometry");
127 if (verbosity > 2) fGeom->SetDebugMode(kTRUE);
131 //______________________________________________________________________________
135 if (fVerbosityLevel >=3)
136 cout << "<== TFluka::~TFluka() destructor called." << endl;
140 //______________________________________________________________________________
141 // TFluka control methods
142 //______________________________________________________________________________
143 void TFluka::Init() {
145 // Geometry initialisation
147 if (fVerbosityLevel >=3) cout << "==> TFluka::Init() called." << endl;
149 if (!gGeoManager) new TGeoManager("geom", "FLUKA geometry");
150 fApplication->ConstructGeometry();
151 TGeoVolume *top = (TGeoVolume*)gGeoManager->GetListOfVolumes()->First();
152 gGeoManager->SetTopVolume(top);
153 gGeoManager->CloseGeometry("di");
154 gGeoManager->DefaultColors(); // to be removed
155 fNVolumes = fGeom->NofVolumes();
156 fGeom->CreateFlukaMatFile("flukaMat.inp");
157 if (fVerbosityLevel >=3) {
158 printf("== Number of volumes: %i\n ==", fNVolumes);
159 cout << "\t* InitPhysics() - Prepare input file to be called" << endl;
161 // now we have TGeo geometry created and we have to patch alice.inp
162 // with the material mapping file FlukaMat.inp
166 //______________________________________________________________________________
167 void TFluka::FinishGeometry() {
169 // Build-up table with region to medium correspondance
171 if (fVerbosityLevel >=3) {
172 cout << "==> TFluka::FinishGeometry() called." << endl;
173 printf("----FinishGeometry - nothing to do with TGeo\n");
174 cout << "<== TFluka::FinishGeometry() called." << endl;
178 //______________________________________________________________________________
179 void TFluka::BuildPhysics() {
181 // Prepare FLUKA input files and call FLUKA physics initialisation
184 if (fVerbosityLevel >=3)
185 cout << "==> TFluka::BuildPhysics() called." << endl;
186 // Prepare input file with the current physics settings
188 cout << "\t* InitPhysics() - Prepare input file was called" << endl;
190 if (fVerbosityLevel >=2)
191 cout << "\t* Changing lfdrtr = (" << (GLOBAL.lfdrtr?'T':'F')
192 << ") in fluka..." << endl;
193 GLOBAL.lfdrtr = true;
195 if (fVerbosityLevel >=2)
196 cout << "\t* Opening file " << fInputFileName << endl;
197 const char* fname = fInputFileName;
198 fluka_openinp(lunin, PASSCHARA(fname));
200 if (fVerbosityLevel >=2)
201 cout << "\t* Calling flukam..." << endl;
204 if (fVerbosityLevel >=2)
205 cout << "\t* Closing file " << fInputFileName << endl;
206 fluka_closeinp(lunin);
210 if (fVerbosityLevel >=3)
211 cout << "<== TFluka::Init() called." << endl;
214 if (fVerbosityLevel >=3)
215 cout << "<== TFluka::BuildPhysics() called." << endl;
218 //______________________________________________________________________________
219 void TFluka::ProcessEvent() {
223 if (fVerbosityLevel >=3)
224 cout << "==> TFluka::ProcessEvent() called." << endl;
225 fApplication->GeneratePrimaries();
226 EPISOR.lsouit = true;
228 if (fVerbosityLevel >=3)
229 cout << "<== TFluka::ProcessEvent() called." << endl;
232 //______________________________________________________________________________
233 #if ROOT_VERSION_CODE >= 262150
234 Bool_t TFluka::ProcessRun(Int_t nevent) {
236 void TFluka::ProcessRun(Int_t nevent) {
242 if (fVerbosityLevel >=3)
243 cout << "==> TFluka::ProcessRun(" << nevent << ") called."
246 if (fVerbosityLevel >=2) {
247 cout << "\t* GLOBAL.fdrtr = " << (GLOBAL.lfdrtr?'T':'F') << endl;
248 cout << "\t* Calling flukam again..." << endl;
251 Int_t todo = TMath::Abs(nevent);
253 for (Int_t ev = 0; ev < todo; ev++) {
254 fApplication->InitGeometry();
255 fApplication->BeginEvent();
259 fApplication->FinishEvent();
260 if (fVerbosityLevel >=3)
261 cout << "<== TFluka::ProcessRun(" << nevent << ") called."
264 #if ROOT_VERSION_CODE >= 262150
269 //_____________________________________________________________________________
270 // methods for building/management of geometry
272 // functions from GCONS
273 //____________________________________________________________________________
274 void TFluka::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
275 Float_t &dens, Float_t &radl, Float_t &absl,
276 Float_t* ubuf, Int_t& nbuf) {
278 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
281 //______________________________________________________________________________
282 void TFluka::Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
283 Double_t &dens, Double_t &radl, Double_t &absl,
284 Double_t* ubuf, Int_t& nbuf) {
286 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
289 // detector composition
290 //______________________________________________________________________________
291 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
292 Double_t z, Double_t dens, Double_t radl, Double_t absl,
293 Float_t* buf, Int_t nwbuf) {
295 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
298 //______________________________________________________________________________
299 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
300 Double_t z, Double_t dens, Double_t radl, Double_t absl,
301 Double_t* buf, Int_t nwbuf) {
303 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
306 //______________________________________________________________________________
307 void TFluka::Mixture(Int_t& kmat, const char *name, Float_t *a,
308 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat) {
310 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
313 //______________________________________________________________________________
314 void TFluka::Mixture(Int_t& kmat, const char *name, Double_t *a,
315 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat) {
317 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
320 //______________________________________________________________________________
321 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
322 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
323 Double_t stemax, Double_t deemax, Double_t epsil,
324 Double_t stmin, Float_t* ubuf, Int_t nbuf) {
326 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
327 epsil, stmin, ubuf, nbuf);
330 //______________________________________________________________________________
331 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
332 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
333 Double_t stemax, Double_t deemax, Double_t epsil,
334 Double_t stmin, Double_t* ubuf, Int_t nbuf) {
336 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
337 epsil, stmin, ubuf, nbuf);
340 //______________________________________________________________________________
341 void TFluka::Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
342 Double_t thetaY, Double_t phiY, Double_t thetaZ,
345 fGeom->Matrix(krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ);
348 //______________________________________________________________________________
349 void TFluka::Gstpar(Int_t itmed, const char* param, Double_t parval) {
351 // Is it needed with TGeo ??? - to clear-up
354 if (fVerbosityLevel >=3) printf("Gstpar called with %6d %5s %12.4e %6d\n", itmed, param, parval, fGeom->GetFlukaMaterial(itmed));
356 Bool_t process = kFALSE;
357 if (strncmp(param, "DCAY", 4) == 0 ||
358 strncmp(param, "PAIR", 4) == 0 ||
359 strncmp(param, "COMP", 4) == 0 ||
360 strncmp(param, "PHOT", 4) == 0 ||
361 strncmp(param, "PFIS", 4) == 0 ||
362 strncmp(param, "DRAY", 4) == 0 ||
363 strncmp(param, "ANNI", 4) == 0 ||
364 strncmp(param, "BREM", 4) == 0 ||
365 strncmp(param, "MUNU", 4) == 0 ||
366 strncmp(param, "CKOV", 4) == 0 ||
367 strncmp(param, "HADR", 4) == 0 ||
368 strncmp(param, "LOSS", 4) == 0 ||
369 strncmp(param, "MULS", 4) == 0 ||
370 strncmp(param, "RAYL", 4) == 0)
375 SetProcess(param, Int_t (parval), fGeom->GetFlukaMaterial(itmed));
377 SetCut(param, parval, fGeom->GetFlukaMaterial(itmed));
381 // functions from GGEOM
382 //_____________________________________________________________________________
383 void TFluka::Gsatt(const char *name, const char *att, Int_t val)
385 fGeom->Gsatt(name,att, val);
388 //______________________________________________________________________________
389 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
390 Float_t *upar, Int_t np) {
392 return fGeom->Gsvolu(name, shape, nmed, upar, np);
395 //______________________________________________________________________________
396 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
397 Double_t *upar, Int_t np) {
399 return fGeom->Gsvolu(name, shape, nmed, upar, np);
402 //______________________________________________________________________________
403 void TFluka::Gsdvn(const char *name, const char *mother, Int_t ndiv,
406 fGeom->Gsdvn(name, mother, ndiv, iaxis);
409 //______________________________________________________________________________
410 void TFluka::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
411 Int_t iaxis, Double_t c0i, Int_t numed) {
413 fGeom->Gsdvn2(name, mother, ndiv, iaxis, c0i, numed);
416 //______________________________________________________________________________
417 void TFluka::Gsdvt(const char *name, const char *mother, Double_t step,
418 Int_t iaxis, Int_t numed, Int_t ndvmx) {
420 fGeom->Gsdvt(name, mother, step, iaxis, numed, ndvmx);
423 //______________________________________________________________________________
424 void TFluka::Gsdvt2(const char *name, const char *mother, Double_t step,
425 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx) {
427 fGeom->Gsdvt2(name, mother, step, iaxis, c0, numed, ndvmx);
430 //______________________________________________________________________________
431 void TFluka::Gsord(const char * /*name*/, Int_t /*iax*/) {
433 // Nothing to do with TGeo
436 //______________________________________________________________________________
437 void TFluka::Gspos(const char *name, Int_t nr, const char *mother,
438 Double_t x, Double_t y, Double_t z, Int_t irot,
441 fGeom->Gspos(name, nr, mother, x, y, z, irot, konly);
444 //______________________________________________________________________________
445 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
446 Double_t x, Double_t y, Double_t z, Int_t irot,
447 const char *konly, Float_t *upar, Int_t np) {
449 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
452 //______________________________________________________________________________
453 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
454 Double_t x, Double_t y, Double_t z, Int_t irot,
455 const char *konly, Double_t *upar, Int_t np) {
457 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
460 //______________________________________________________________________________
461 void TFluka::Gsbool(const char* /*onlyVolName*/, const char* /*manyVolName*/) {
463 // Nothing to do with TGeo
464 Warning("Gsbool", "Not implemented with TGeo");
467 //______________________________________________________________________________
468 void TFluka::SetCerenkov(Int_t itmed, Int_t npckov, Float_t* ppckov,
469 Float_t* absco, Float_t* effic, Float_t* rindex) {
471 // Set Cerenkov properties for medium itmed
473 // npckov: number of sampling points
474 // ppckov: energy values
475 // absco: absorption length
476 // effic: quantum efficiency
477 // rindex: refraction index
481 // Create object holding Cerenkov properties
483 TFlukaCerenkov* cerenkovProperties = new TFlukaCerenkov(npckov, ppckov, absco, effic, rindex);
485 // Pass object to medium
486 TGeoMedium* medium = gGeoManager->GetMedium(itmed);
487 medium->SetCerenkovProperties(cerenkovProperties);
490 //______________________________________________________________________________
491 void TFluka::SetCerenkov(Int_t /*itmed*/, Int_t /*npckov*/, Double_t * /*ppckov*/,
492 Double_t * /*absco*/, Double_t * /*effic*/, Double_t * /*rindex*/) {
494 // Not implemented with TGeo - what G4 did ? Any FLUKA card generated?
495 Warning("SetCerenkov", "Not implemented with TGeo");
499 //______________________________________________________________________________
500 void TFluka::WriteEuclid(const char* /*fileName*/, const char* /*topVol*/,
501 Int_t /*number*/, Int_t /*nlevel*/) {
504 Warning("WriteEuclid", "Not implemented with TGeo");
509 //_____________________________________________________________________________
510 // methods needed by the stepping
511 //____________________________________________________________________________
513 Int_t TFluka::GetMedium() const {
515 // Get the medium number for the current fluka region
517 return fGeom->GetMedium(); // this I need to check due to remapping !!!
522 //____________________________________________________________________________
523 // particle table usage
524 // ID <--> PDG transformations
525 //_____________________________________________________________________________
526 Int_t TFluka::IdFromPDG(Int_t pdg) const
529 // Return Fluka code from PDG and pseudo ENDF code
531 // Catch the feedback photons
532 if (pdg == 50000051) return (-1);
533 // MCIHAD() goes from pdg to fluka internal.
534 Int_t intfluka = mcihad(pdg);
535 // KPTOIP array goes from internal to official
536 return GetFlukaKPTOIP(intfluka);
539 //______________________________________________________________________________
540 Int_t TFluka::PDGFromId(Int_t id) const
543 // Return PDG code and pseudo ENDF code from Fluka code
545 // IPTOKP array goes from official to internal
549 if (fVerbosityLevel >= 1)
550 printf("\n PDGFromId: Cerenkov Photon \n");
554 if (id == 0 || id < -6 || id > 250) {
555 if (fVerbosityLevel >= 1)
556 printf("PDGFromId: Error id = 0\n");
560 Int_t intfluka = GetFlukaIPTOKP(id);
562 if (fVerbosityLevel >= 1)
563 printf("PDGFromId: Error intfluka = 0: %d\n", id);
565 } else if (intfluka < 0) {
566 if (fVerbosityLevel >= 1)
567 printf("PDGFromId: Error intfluka < 0: %d\n", id);
570 if (fVerbosityLevel >= 3)
571 printf("mpdgha called with %d %d \n", id, intfluka);
572 // MPDGHA() goes from fluka internal to pdg.
573 return mpdgha(intfluka);
576 //_____________________________________________________________________________
577 // methods for physics management
578 //____________________________________________________________________________
582 void TFluka::SetProcess(const char* flagName, Int_t flagValue, Int_t imat)
584 // Set process user flag for material imat
586 strcpy(&fProcessFlag[fNbOfProc][0],flagName);
587 fProcessValue[fNbOfProc] = flagValue;
588 fProcessMaterial[fNbOfProc] = imat;
592 //______________________________________________________________________________
594 #if ROOT_VERSION_CODE >= 262151
595 Bool_t TFluka::SetProcess(const char* flagName, Int_t flagValue)
597 void TFluka::SetProcess(const char* flagName, Int_t flagValue)
600 // Set process user flag
604 if (fNbOfProc < 100) {
605 for (i=0; i<fNbOfProc; i++) {
606 if (strcmp(&fProcessFlag[i][0],flagName) == 0) {
607 fProcessValue[fNbOfProc] = flagValue;
608 fProcessMaterial[fNbOfProc] = -1;
609 #if ROOT_VERSION_CODE >= 262151
616 strcpy(&fProcessFlag[fNbOfProc][0],flagName);
617 fProcessMaterial[fNbOfProc] = -1;
618 fProcessValue[fNbOfProc++] = flagValue;
622 cout << "Nb of SetProcess calls exceeds 100 - ignored" << endl;
623 #if ROOT_VERSION_CODE >= 262151
628 //______________________________________________________________________________
629 void TFluka::SetCut(const char* cutName, Double_t cutValue, Int_t imed)
631 // Set user cut value for material imed
633 strcpy(&fCutFlag[fNbOfCut][0],cutName);
634 fCutValue[fNbOfCut] = cutValue;
635 fCutMaterial[fNbOfCut] = imed;
639 //______________________________________________________________________________
640 #if ROOT_VERSION_CODE >= 262151
641 Bool_t TFluka::SetCut(const char* cutName, Double_t cutValue)
643 void TFluka::SetCut(const char* cutName, Double_t cutValue)
646 // Set user cut value
649 if (fNbOfCut < 100) {
650 for (i=0; i<fNbOfCut; i++) {
651 if (strcmp(&fCutFlag[i][0],cutName) == 0) {
652 fCutValue[fNbOfCut] = cutValue;
653 #if ROOT_VERSION_CODE >= 262151
661 strcpy(&fCutFlag[fNbOfCut][0],cutName);
662 fCutMaterial[fNbOfCut] = -1;
663 fCutValue[fNbOfCut++] = cutValue;
666 cout << "Nb of SetCut calls exceeds 100 - ignored" << endl;
667 #if ROOT_VERSION_CODE >= 262151
672 //______________________________________________________________________________
673 Double_t TFluka::Xsec(char*, Double_t, Int_t, Int_t)
675 printf("WARNING: Xsec not yet implemented !\n"); return -1.;
679 //______________________________________________________________________________
680 void TFluka::InitPhysics()
683 // Physics initialisation with preparation of FLUKA input cards
685 printf("=>InitPhysics\n");
689 FILE *pAliceCoreInp, *pAliceFlukaMat, *pAliceInp;
694 Double_t three = 3.0;
696 Float_t fLastMaterial = fGeom->GetLastMaterialIndex();
697 if (fVerbosityLevel >= 3) printf(" last FLUKA material is %g\n", fLastMaterial);
700 TList *matList = gGeoManager->GetListOfMaterials();
701 Int_t nmaterial = matList->GetSize();
702 fMaterials = new Int_t[nmaterial];
704 // construct file names
706 TString sAliceCoreInp = getenv("ALICE_ROOT");
707 sAliceCoreInp +="/TFluka/input/";
708 TString sAliceTmp = "flukaMat.inp";
709 TString sAliceInp = GetInputFileName();
710 sAliceCoreInp += GetCoreInputFileName();
714 if ((pAliceCoreInp = fopen(sAliceCoreInp.Data(),"r")) == NULL) {
715 printf("\nCannot open file %s\n",sAliceCoreInp.Data());
718 if ((pAliceFlukaMat = fopen(sAliceTmp.Data(),"r")) == NULL) {
719 printf("\nCannot open file %s\n",sAliceTmp.Data());
722 if ((pAliceInp = fopen(sAliceInp.Data(),"w")) == NULL) {
723 printf("\nCannot open file %s\n",sAliceInp.Data());
727 // copy core input file
729 Float_t fEventsPerRun;
731 while ((fgets(sLine,255,pAliceCoreInp)) != NULL) {
732 if (strncmp(sLine,"GEOEND",6) != 0)
733 fprintf(pAliceInp,"%s",sLine); // copy until GEOEND card
735 fprintf(pAliceInp,"GEOEND\n"); // add GEOEND card
738 } // end of while until GEOEND card
742 while ((fgets(sLine,255,pAliceFlukaMat)) != NULL) { // copy flukaMat.inp file
743 fprintf(pAliceInp,"%s\n",sLine);
746 while ((fgets(sLine,255,pAliceCoreInp)) != NULL) {
747 if (strncmp(sLine,"START",5) != 0)
748 fprintf(pAliceInp,"%s\n",sLine);
750 sscanf(sLine+10,"%10f",&fEventsPerRun);
753 } //end of while until START card
756 // in G3 the process control values meaning can be different for
757 // different processes, but for most of them is:
758 // 0 process is not activated
759 // 1 process is activated WITH generation of secondaries
760 // 2 process is activated WITHOUT generation of secondaries
761 // if process does not generate secondaries => 1 same as 2
770 // Loop over number of SetProcess calls
771 fprintf(pAliceInp,"*----------------------------------------------------------------------------- \n");
772 fprintf(pAliceInp,"*----- The following data are generated from SetProcess and SetCut calls ----- \n");
773 fprintf(pAliceInp,"*----------------------------------------------------------------------------- \n");
775 for (i = 0; i < fNbOfProc; i++) {
776 Float_t matMin = three;
777 Float_t matMax = fLastMaterial;
778 Bool_t global = kTRUE;
779 if (fProcessMaterial[i] != -1) {
780 matMin = Float_t(fProcessMaterial[i]);
786 // G3 default value: 1
787 // G4 processes: G4eplusAnnihilation/G4IeplusAnnihilation
790 // flag = 0 no annihilation
791 // flag = 1 annihilation, decays processed
792 // flag = 2 annihilation, no decay product stored
793 // gMC ->SetProcess("ANNI",1); // EMFCUT -1. 0. 0. 3. lastmat 0. ANNH-THR
794 if (strncmp(&fProcessFlag[i][0],"ANNI",4) == 0) {
795 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
796 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+ annihilation - resets to default=0.\n");
797 fprintf(pAliceInp,"*Generated from call: SetProcess('ANNI',1) or SetProcess('ANNI',2)\n");
798 // -one = kinetic energy threshold (GeV) for e+ annihilation (resets to default=0)
801 // matMin = lower bound of the material indices in which the respective thresholds apply
802 // matMax = upper bound of the material indices in which the respective thresholds apply
803 // one = step length in assigning indices
805 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fANNH-THR\n",-one,zero,zero,matMin,matMax,one);
807 else if (fProcessValue[i] == 0) {
808 fprintf(pAliceInp,"*\n*No annihilation - no FLUKA card generated\n");
809 fprintf(pAliceInp,"*Generated from call: SetProcess('ANNI',0)\n");
812 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('ANNI',?) call.\n");
813 fprintf(pAliceInp,"*No FLUKA card generated\n");
817 // bremsstrahlung and pair production are both activated
818 // G3 default value: 1
819 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
820 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
821 // G4LowEnergyBremstrahlung
822 // Particles: e-/e+; mu+/mu-
824 // flag = 0 no bremsstrahlung
825 // flag = 1 bremsstrahlung, photon processed
826 // flag = 2 bremsstrahlung, no photon stored
827 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
828 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
829 // G3 default value: 1
830 // G4 processes: G4GammaConversion,
831 // G4MuPairProduction/G4IMuPairProduction
832 // G4LowEnergyGammaConversion
833 // Particles: gamma, mu
835 // flag = 0 no delta rays
836 // flag = 1 delta rays, secondaries processed
837 // flag = 2 delta rays, no secondaries stored
838 // gMC ->SetProcess("PAIR",1); // PAIRBREM 1. 0. 0. 3. lastmat
839 // EMFCUT 0. 0. -1. 3. lastmat 0. PHOT-THR
840 else if ((strncmp(&fProcessFlag[i][0],"PAIR",4) == 0) && (fProcessValue[i] == 1 || fProcessValue[i] == 2)) {
842 for (j=0; j<fNbOfProc; j++) {
843 if ((strncmp(&fProcessFlag[j][0],"BREM",4) == 0) &&
844 (fProcessValue[j] == 1 || fProcessValue[j] == 2) &&
845 (fProcessMaterial[j] == fProcessMaterial[i])) {
846 fprintf(pAliceInp,"*\n*Bremsstrahlung and pair production by muons and charged hadrons both activated\n");
847 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1) and SetProcess('PAIR',1)\n");
848 fprintf(pAliceInp,"*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.\n");
849 fprintf(pAliceInp,"*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.\n");
850 // three = bremsstrahlung and pair production by muons and charged hadrons both are activated
851 fprintf(pAliceInp,"PAIRBREM %10.1f",three);
852 // direct pair production by muons
853 // G4 particles: "e-", "e+"
854 // G3 default value: 0.01 GeV
855 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
857 for (k=0; k<fNbOfCut; k++) {
858 if (strncmp(&fCutFlag[k][0],"PPCUTM",6) == 0 &&
859 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
861 fprintf(pAliceInp,"%10.4g",fCut);
862 // fCut; = e+, e- kinetic energy threshold (in GeV) for explicit pair production.
863 // muon and hadron bremsstrahlung
864 // G4 particles: "gamma"
865 // G3 default value: CUTGAM=0.001 GeV
866 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
868 for (k=0; k<fNbOfCut; k++) {
869 if (strncmp(&fCutFlag[k][0],"BCUTM",5) == 0 &&
870 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
872 fprintf(pAliceInp,"%10.4g%10.1f%10.1f\n",fCut,matMin,matMax);
873 // fCut = photon energy threshold (GeV) for explicit bremsstrahlung production
874 // matMin = lower bound of the material indices in which the respective thresholds apply
875 // matMax = upper bound of the material indices in which the respective thresholds apply
878 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.\n");
879 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1);\n");
881 for (k=0; k<fNbOfCut; k++) {
882 if (strncmp(&fCutFlag[k][0],"BCUTE",5) == 0 &&
883 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
885 //fCut = kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
888 // matMin = lower bound of the material indices in which the respective thresholds apply
889 // matMax = upper bound of the material indices in which the respective thresholds apply
890 // one = step length in assigning indices
892 fprintf(pAliceInp,"EMFCUT %10.4g%10.1f%10.1f%10.1f%10.1f%10.1fELPO-THR\n",fCut,zero,zero,matMin,matMax,one);
895 fprintf(pAliceInp,"*\n*Pair production by electrons is activated\n");
896 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1);\n");
898 for (k=0; k<fNbOfCut; k++) {
899 if (strncmp(&fCutFlag[k][0],"CUTGAM",6) == 0 &&
900 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
902 // fCut = energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
903 // matMin = lower bound of the material indices in which the respective thresholds apply
904 // matMax = upper bound of the material indices in which the respective thresholds apply
905 // one = step length in assigning indices
906 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.4g%10.1f%10.1f%10.1fPHOT-THR\n",zero,zero,fCut,matMin,matMax,one);
908 } // end of if for BREM
909 } // end of loop for BREM
911 // only pair production by muons and charged hadrons is activated
912 fprintf(pAliceInp,"*\n*Pair production by muons and charged hadrons is activated\n");
913 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)\n");
914 fprintf(pAliceInp,"*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.\n");
915 // direct pair production by muons
916 // G4 particles: "e-", "e+"
917 // G3 default value: 0.01 GeV
918 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
919 // one = pair production by muons and charged hadrons is activated
920 // zero = e+, e- kinetic energy threshold (in GeV) for explicit pair production.
921 // zero = no explicit bremsstrahlung production is simulated
922 // matMin = lower bound of the material indices in which the respective thresholds apply
923 // matMax = upper bound of the material indices in which the respective thresholds apply
924 fprintf(pAliceInp,"PAIRBREM %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
927 fprintf(pAliceInp,"*\n*Pair production by electrons is activated\n");
928 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)\n");
930 for (j=0; j<fNbOfCut; j++) {
931 if (strncmp(&fCutFlag[j][0],"CUTGAM",6) == 0 &&
932 (fCutMaterial[j] == fProcessMaterial[i])) fCut = fCutValue[j];
934 // zero = energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
935 // zero = energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
936 // fCut = energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
937 // matMin = lower bound of the material indices in which the respective thresholds apply
938 // matMax = upper bound of the material indices in which the respective thresholds apply
939 // one = step length in assigning indices
940 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.4g%10.1f%10.1f%10.1fPHOT-THR\n",zero,zero,fCut,matMin,matMax,one);
944 } // end of if for PAIR
949 // G3 default value: 1
950 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
951 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
952 // G4LowEnergyBremstrahlung
953 // Particles: e-/e+; mu+/mu-
955 // flag = 0 no bremsstrahlung
956 // flag = 1 bremsstrahlung, photon processed
957 // flag = 2 bremsstrahlung, no photon stored
958 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
959 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
960 else if (strncmp(&fProcessFlag[i][0],"BREM",4) == 0) {
961 for (j = 0; j < fNbOfProc; j++) {
962 if ((strncmp(&fProcessFlag[j][0],"PAIR",4) == 0) &&
963 fProcessValue[j] == 1 &&
964 (fProcessMaterial[j] == fProcessMaterial[i])) goto NOBREM;
966 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
967 fprintf(pAliceInp,"*\n*Bremsstrahlung by muons and charged hadrons is activated\n");
968 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1) or SetProcess('BREM',2)\n");
969 fprintf(pAliceInp,"*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.\n");
970 // two = bremsstrahlung by muons and charged hadrons is activated
972 // muon and hadron bremsstrahlung
973 // G4 particles: "gamma"
974 // G3 default value: CUTGAM=0.001 GeV
975 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
977 for (j=0; j<fNbOfCut; j++) {
978 if (strncmp(&fCutFlag[j][0],"BCUTM",5) == 0 &&
979 (fCutMaterial[j] == fProcessMaterial[i])) fCut = fCutValue[j];
981 // fCut = photon energy threshold (GeV) for explicit bremsstrahlung production
982 // matMin = lower bound of the material indices in which the respective thresholds apply
983 // matMax = upper bound of the material indices in which the respective thresholds apply
984 fprintf(pAliceInp,"PAIRBREM %10.1f%10.1f%10.4g%10.1f%10.1f\n",two,zero,fCut,matMin,matMax);
987 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.\n");
988 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1);");
989 // - one = kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
992 // matMin = lower bound of the material indices in which the respective thresholds apply
993 // matMax = upper bound of the material indices in which the respective thresholds apply
994 // one = step length in assigning indices
996 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fELPO-THR\n",-one,zero,zero,matMin,matMax,one);
998 else if (fProcessValue[i] == 0) {
999 fprintf(pAliceInp,"*\n*No bremsstrahlung - no FLUKA card generated\n");
1000 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',0)\n");
1003 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('BREM',?) call.\n");
1004 fprintf(pAliceInp,"*No FLUKA card generated\n");
1008 } // end of else if (strncmp(&fProcessFlag[i][0],"BREM",4) == 0)
1010 // Cerenkov photon generation
1011 // G3 default value: 0
1012 // G4 process: G4Cerenkov
1014 // Particles: charged
1016 // flag = 0 no Cerenkov photon generation
1017 // flag = 1 Cerenkov photon generation
1018 // flag = 2 Cerenkov photon generation with primary stopped at each step
1019 //xx gMC ->SetProcess("CKOV",1); // ??? Cerenkov photon generation
1021 else if (strncmp(&fProcessFlag[i][0],"CKOV",4) == 0) {
1022 if ((fProcessValue[i] == 1 || fProcessValue[i] == 2) && global) {
1024 fprintf(pAliceInp, "* \n");
1025 fprintf(pAliceInp, "*Cerenkov photon generation\n");
1026 fprintf(pAliceInp, "*Generated from call: SetProcess('CKOV',1) or SetProcess('CKOV',2)\n");
1028 for (Int_t im = 0; im < nmaterial; im++)
1030 TGeoMaterial* material = dynamic_cast<TGeoMaterial*> (matList->At(im));
1031 Int_t idmat = material->GetIndex();
1033 if (!global && idmat != fProcessMaterial[i]) continue;
1035 fMaterials[idmat] = im;
1036 // Skip media with no Cerenkov properties
1037 TFlukaCerenkov* cerenkovProp;
1038 if (!(cerenkovProp = dynamic_cast<TFlukaCerenkov*>(material->GetCerenkovProperties()))) continue;
1040 // This medium has Cerenkov properties
1043 // Write OPT-PROD card for each medium
1044 Float_t emin = cerenkovProp->GetMinimumEnergy();
1045 Float_t emax = cerenkovProp->GetMaximumEnergy();
1046 fprintf(pAliceInp, "OPT-PROD %10.4g%10.4g%10.4g%10.4g%10.4g%10.4gCERENKOV\n", emin, emax, 0.,
1047 Float_t(idmat), Float_t(idmat), 0.);
1049 // Write OPT-PROP card for each medium
1050 // Forcing FLUKA to call user routines (queffc.cxx, rflctv.cxx, rfrndx.cxx)
1052 fprintf(pAliceInp, "OPT-PROP %10.4g%10.4g%10.4g%10.1f%10.1f%10.1fWV-LIMIT\n",
1053 cerenkovProp->GetMinimumWavelength(),
1054 cerenkovProp->GetMaximumWavelength(),
1055 cerenkovProp->GetMaximumWavelength(),
1056 Float_t(idmat), Float_t(idmat), 0.0);
1058 if (cerenkovProp->IsMetal()) {
1059 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fMETAL\n",
1060 -100., -100., -100.,
1061 Float_t(idmat), Float_t(idmat), 0.0);
1063 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1f\n",
1064 -100., -100., -100.,
1065 Float_t(idmat), Float_t(idmat), 0.0);
1069 for (Int_t j = 0; j < 3; j++) {
1070 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1f&\n",
1071 -100., -100., -100.,
1072 Float_t(idmat), Float_t(idmat), 0.0);
1074 // Photon detection efficiency user defined
1076 if (cerenkovProp->IsSensitive())
1077 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fSENSITIV\n",
1078 -100., -100., -100.,
1079 Float_t(idmat), Float_t(idmat), 0.0);
1082 } else if (fProcessValue[i] == 0) {
1083 fprintf(pAliceInp,"*\n*No Cerenkov photon generation\n");
1084 fprintf(pAliceInp,"*Generated from call: SetProcess('CKOV',0)\n");
1088 // matMin = lower bound of the material indices in which the respective thresholds apply
1089 // matMax = upper bound of the material indices in which the respective thresholds apply
1090 // one = step length in assigning indices
1092 fprintf(pAliceInp,"OPT-PROD %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fCERE-OFF\n",zero,zero,zero,matMin,matMax,one);
1095 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('CKOV',?) call.\n");
1096 fprintf(pAliceInp,"*No FLUKA card generated\n");
1098 } // end of else if (strncmp(&fProcessFlag[i][0],"CKOV",4) == 0)
1100 // Compton scattering
1101 // G3 default value: 1
1102 // G4 processes: G4ComptonScattering,
1103 // G4LowEnergyCompton,
1104 // G4PolarizedComptonScattering
1107 // flag = 0 no Compton scattering
1108 // flag = 1 Compton scattering, electron processed
1109 // flag = 2 Compton scattering, no electron stored
1110 // gMC ->SetProcess("COMP",1); // EMFCUT -1. 0. 0. 3. lastmat 0. PHOT-THR
1111 else if (strncmp(&fProcessFlag[i][0],"COMP",4) == 0) {
1112 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1113 fprintf(pAliceInp,"*\n*Energy threshold (GeV) for Compton scattering - resets to default=0.\n");
1114 fprintf(pAliceInp,"*Generated from call: SetProcess('COMP',1);\n");
1115 // - one = energy threshold (GeV) for Compton scattering - resets to default=0.
1118 // matMin = lower bound of the material indices in which the respective thresholds apply
1119 // matMax = upper bound of the material indices in which the respective thresholds apply
1120 // one = step length in assigning indices
1122 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fPHOT-THR\n",-one,zero,zero,matMin,matMax,one);
1124 else if (fProcessValue[i] == 0) {
1125 fprintf(pAliceInp,"*\n*No Compton scattering - no FLUKA card generated\n");
1126 fprintf(pAliceInp,"*Generated from call: SetProcess('COMP',0)\n");
1129 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('COMP',?) call.\n");
1130 fprintf(pAliceInp,"*No FLUKA card generated\n");
1132 } // end of else if (strncmp(&fProcessFlag[i][0],"COMP",4) == 0)
1135 // G3 default value: 1
1136 // G4 process: G4Decay
1138 // Particles: all which decay is applicable for
1140 // flag = 0 no decays
1141 // flag = 1 decays, secondaries processed
1142 // flag = 2 decays, no secondaries stored
1143 //gMC ->SetProcess("DCAY",1); // not available
1144 else if ((strncmp(&fProcessFlag[i][0],"DCAY",4) == 0) && fProcessValue[i] == 1)
1145 cout << "SetProcess for flag=" << &fProcessFlag[i][0] << " value=" << fProcessValue[i] << " not avaliable!" << endl;
1148 // G3 default value: 2
1149 // !! G4 treats delta rays in different way
1150 // G4 processes: G4eIonisation/G4IeIonization,
1151 // G4MuIonisation/G4IMuIonization,
1152 // G4hIonisation/G4IhIonisation
1153 // Particles: charged
1155 // flag = 0 no energy loss
1156 // flag = 1 restricted energy loss fluctuations
1157 // flag = 2 complete energy loss fluctuations
1158 // flag = 3 same as 1
1159 // flag = 4 no energy loss fluctuations
1160 // gMC ->SetProcess("DRAY",0); // DELTARAY 1.E+6 0. 0. 3. lastmat 0.
1161 else if (strncmp(&fProcessFlag[i][0],"DRAY",4) == 0) {
1162 if (fProcessValue[i] == 0 || fProcessValue[i] == 4) {
1163 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for delta ray production\n");
1164 fprintf(pAliceInp,"*Generated from call: SetProcess('DRAY',0) or SetProcess('DRAY',4)\n");
1165 fprintf(pAliceInp,"*No delta ray production by muons - threshold set artificially high\n");
1166 Double_t emin = 1.0e+6; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1169 // matMin = lower bound of the material indices in which the respective thresholds apply
1170 // matMax = upper bound of the material indices in which the respective thresholds apply
1171 // one = step length in assigning indices
1172 fprintf(pAliceInp,"DELTARAY %10.4g%10.1f%10.1f%10.1f%10.1f%10.1f\n",emin,zero,zero,matMin,matMax,one);
1174 else if (fProcessValue[i] == 1 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1175 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for delta ray production\n");
1176 fprintf(pAliceInp,"*Generated from call: SetProcess('DRAY',flag), flag=1,2,3\n");
1177 fprintf(pAliceInp,"*Delta ray production by muons switched on\n");
1178 fprintf(pAliceInp,"*Energy threshold set by call SetCut('DCUTM',cut) or set to 1.0e+6.\n");
1180 for (j = 0; j < fNbOfCut; j++) {
1181 if (strncmp(&fCutFlag[j][0],"DCUTM",5) == 0 &&
1182 fCutMaterial[j] == fProcessMaterial[i]) fCut = fCutValue[j];
1184 // fCut = kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1187 // matMin = lower bound of the material indices in which the respective thresholds apply
1188 // matMax = upper bound of the material indices in which the respective thresholds apply
1189 // one = step length in assigning indices
1190 fprintf(pAliceInp,"DELTARAY %10.4g%10.1f%10.1f%10.1f%10.1f%10.1f\n",fCut,zero,zero,matMin,matMax,one);
1193 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('DRAY',?) call.\n");
1194 fprintf(pAliceInp,"*No FLUKA card generated\n");
1196 } // end of else if (strncmp(&fProcessFlag[i][0],"DRAY",4) == 0)
1199 // G3 default value: 1
1200 // G4 processes: all defined by TG4PhysicsConstructorHadron
1202 // Particles: hadrons
1204 // flag = 0 no multiple scattering
1205 // flag = 1 hadronic interactions, secondaries processed
1206 // flag = 2 hadronic interactions, no secondaries stored
1207 // gMC ->SetProcess("HADR",1); // ??? hadronic process
1208 //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) ?????
1209 else if (strncmp(&fProcessFlag[i][0],"HADR",4) == 0) {
1210 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1211 fprintf(pAliceInp,"*\n*Hadronic interaction is ON by default in FLUKA\n");
1212 fprintf(pAliceInp,"*No FLUKA card generated\n");
1214 else if (fProcessValue[i] == 0) {
1215 fprintf(pAliceInp,"*\n*Hadronic interaction is set OFF\n");
1216 fprintf(pAliceInp,"*Generated from call: SetProcess('HADR',0);\n");
1218 // three = multiple scattering for hadrons and muons is completely suppressed
1219 // zero = no spin-relativistic corrections
1220 // matMin = lower bound of the material indices in which the respective thresholds apply
1221 // matMax = upper bound of the material indices in which the respective thresholds apply
1222 fprintf(pAliceInp,"MULSOPT %10.1f%10.1f%10.1f%10.1f%10.1f\n",zero,three,zero,matMin,matMax);
1226 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('HADR',?) call.\n");
1227 fprintf(pAliceInp,"*No FLUKA card generated\n");
1229 } // end of else if (strncmp(&fProcessFlag[i][0],"HADR",4) == 0)
1233 // G3 default value: 2
1234 // G4 processes: G4eIonisation/G4IeIonization,
1235 // G4MuIonisation/G4IMuIonization,
1236 // G4hIonisation/G4IhIonisation
1238 // Particles: charged
1240 // flag=0 no energy loss
1241 // flag=1 restricted energy loss fluctuations
1242 // flag=2 complete energy loss fluctuations
1244 // flag=4 no energy loss fluctuations
1245 // If the value ILOSS is changed, then (in G3) cross-sections and energy
1246 // loss tables must be recomputed via the command 'PHYSI'
1247 // gMC ->SetProcess("LOSS",2); // ??? IONFLUCT ? energy loss
1248 else if (strncmp(&fProcessFlag[i][0],"LOSS",4) == 0) {
1249 if (fProcessValue[i] == 2) { // complete energy loss fluctuations
1250 fprintf(pAliceInp,"*\n*Complete energy loss fluctuations do not exist in FLUKA\n");
1251 fprintf(pAliceInp,"*Generated from call: SetProcess('LOSS',2);\n");
1252 fprintf(pAliceInp,"*flag=2=complete energy loss fluctuations\n");
1253 fprintf(pAliceInp,"*No FLUKA card generated\n");
1255 else if (fProcessValue[i] == 1 || fProcessValue[i] == 3) { // restricted energy loss fluctuations
1256 fprintf(pAliceInp,"*\n*Restricted energy loss fluctuations\n");
1257 fprintf(pAliceInp,"*Generated from call: SetProcess('LOSS',1) or SetProcess('LOSS',3)\n");
1258 // one = restricted energy loss fluctuations (for hadrons and muons) switched on
1259 // one = restricted energy loss fluctuations (for e+ and e-) switched on
1260 // one = minimal accuracy
1261 // matMin = lower bound of the material indices in which the respective thresholds apply
1262 // upper bound of the material indices in which the respective thresholds apply
1263 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,one,one,matMin,matMax);
1265 else if (fProcessValue[i] == 4) { // no energy loss fluctuations
1266 fprintf(pAliceInp,"*\n*No energy loss fluctuations\n");
1267 fprintf(pAliceInp,"*\n*Generated from call: SetProcess('LOSS',4)\n");
1268 // - one = restricted energy loss fluctuations (for hadrons and muons) switched off
1269 // - one = restricted energy loss fluctuations (for e+ and e-) switched off
1270 // one = minimal accuracy
1271 // matMin = lower bound of the material indices in which the respective thresholds apply
1272 // matMax = upper bound of the material indices in which the respective thresholds apply
1273 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",-one,-one,one,matMin,matMax);
1276 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('LOSS',?) call.\n");
1277 fprintf(pAliceInp,"*No FLUKA card generated\n");
1279 } // end of else if (strncmp(&fProcessFlag[i][0],"LOSS",4) == 0)
1282 // multiple scattering
1283 // G3 default value: 1
1284 // G4 process: G4MultipleScattering/G4IMultipleScattering
1286 // Particles: charged
1288 // flag = 0 no multiple scattering
1289 // flag = 1 Moliere or Coulomb scattering
1290 // flag = 2 Moliere or Coulomb scattering
1291 // flag = 3 Gaussian scattering
1292 // gMC ->SetProcess("MULS",1); // MULSOPT multiple scattering
1293 else if (strncmp(&fProcessFlag[i][0],"MULS",4) == 0) {
1294 if (fProcessValue[i] == 1 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1295 fprintf(pAliceInp,"*\n*Multiple scattering is ON by default for e+e- and for hadrons/muons\n");
1296 fprintf(pAliceInp,"*No FLUKA card generated\n");
1298 else if (fProcessValue[i] == 0) {
1299 fprintf(pAliceInp,"*\n*Multiple scattering is set OFF\n");
1300 fprintf(pAliceInp,"*Generated from call: SetProcess('MULS',0);\n");
1302 // three = multiple scattering for hadrons and muons is completely suppressed
1303 // three = multiple scattering for e+ and e- is completely suppressed
1304 // matMin = lower bound of the material indices in which the respective thresholds apply
1305 // matMax = upper bound of the material indices in which the respective thresholds apply
1306 fprintf(pAliceInp,"MULSOPT %10.1f%10.1f%10.1f%10.1f%10.1f\n",zero,three,three,matMin,matMax);
1309 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('MULS',?) call.\n");
1310 fprintf(pAliceInp,"*No FLUKA card generated\n");
1312 } // end of else if (strncmp(&fProcessFlag[i][0],"MULS",4) == 0)
1315 // muon nuclear interaction
1316 // G3 default value: 0
1317 // G4 processes: G4MuNuclearInteraction,
1318 // G4MuonMinusCaptureAtRest
1322 // flag = 0 no muon-nuclear interaction
1323 // flag = 1 nuclear interaction, secondaries processed
1324 // flag = 2 nuclear interaction, secondaries not processed
1325 // gMC ->SetProcess("MUNU",1); // MUPHOTON 1. 0. 0. 3. lastmat
1326 else if (strncmp(&fProcessFlag[i][0],"MUNU",4) == 0) {
1327 if (fProcessValue[i] == 1) {
1328 fprintf(pAliceInp,"*\n*Muon nuclear interactions with production of secondary hadrons\n");
1329 fprintf(pAliceInp,"*\n*Generated from call: SetProcess('MUNU',1);\n");
1330 // one = full simulation of muon nuclear interactions and production of secondary hadrons
1331 // zero = ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1332 // zero = fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1333 // matMin = lower bound of the material indices in which the respective thresholds apply
1334 // matMax = upper bound of the material indices in which the respective thresholds apply
1335 fprintf(pAliceInp,"MUPHOTON %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
1337 else if (fProcessValue[i] == 2) {
1338 fprintf(pAliceInp,"*\n*Muon nuclear interactions without production of secondary hadrons\n");
1339 fprintf(pAliceInp,"*Generated from call: SetProcess('MUNU',2);\n");
1340 // two = full simulation of muon nuclear interactions and production of secondary hadrons
1341 // zero = ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1342 // zero = fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1343 // matMin = lower bound of the material indices in which the respective thresholds apply
1344 // matMax = upper bound of the material indices in which the respective thresholds apply
1345 fprintf(pAliceInp,"MUPHOTON %10.1f%10.1f%10.1f%10.1f%10.1f\n",two,zero,zero,matMin,matMax);
1347 else if (fProcessValue[i] == 0) {
1348 fprintf(pAliceInp,"*\n*No muon nuclear interaction - no FLUKA card generated\n");
1349 fprintf(pAliceInp,"*Generated from call: SetProcess('MUNU',0)\n");
1352 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('MUNU',?) call.\n");
1353 fprintf(pAliceInp,"*No FLUKA card generated\n");
1355 } // end of else if (strncmp(&fProcessFlag[i][0],"MUNU",4) == 0)
1359 // G3 default value: 0
1364 // gMC ->SetProcess("PFIS",0); // PHOTONUC -1. 0. 0. 3. lastmat 0.
1365 // flag = 0 no photon fission
1366 // flag = 1 photon fission, secondaries processed
1367 // flag = 2 photon fission, no secondaries stored
1368 else if (strncmp(&fProcessFlag[i][0],"PFIS",4) == 0) {
1369 if (fProcessValue[i] == 0) {
1370 fprintf(pAliceInp,"*\n*No photonuclear interactions\n");
1371 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',0);\n");
1372 // - one = no photonuclear interactions
1375 // matMin = lower bound of the material indices in which the respective thresholds apply
1376 // matMax = upper bound of the material indices in which the respective thresholds apply
1377 fprintf(pAliceInp,"PHOTONUC %10.1f%10.1f%10.1f%10.1f%10.1f\n",-one,zero,zero,matMin,matMax);
1379 else if (fProcessValue[i] == 1) {
1380 fprintf(pAliceInp,"*\n*Photon nuclear interactions are activated at all energies\n");
1381 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',1);\n");
1382 // one = photonuclear interactions are activated at all energies
1385 // matMin = lower bound of the material indices in which the respective thresholds apply
1386 // matMax = upper bound of the material indices in which the respective thresholds apply
1387 fprintf(pAliceInp,"PHOTONUC %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
1389 else if (fProcessValue[i] == 0) {
1390 fprintf(pAliceInp,"*\n*No photofission - no FLUKA card generated\n");
1391 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',0)\n");
1394 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('PFIS',?) call.\n");
1395 fprintf(pAliceInp,"*No FLUKA card generated\n");
1400 // photo electric effect
1401 // G3 default value: 1
1402 // G4 processes: G4PhotoElectricEffect
1403 // G4LowEnergyPhotoElectric
1406 // flag = 0 no photo electric effect
1407 // flag = 1 photo electric effect, electron processed
1408 // flag = 2 photo electric effect, no electron stored
1409 // gMC ->SetProcess("PHOT",1); // EMFCUT 0. -1. 0. 3. lastmat 0. PHOT-THR
1410 else if (strncmp(&fProcessFlag[i][0],"PHOT",4) == 0) {
1411 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1412 fprintf(pAliceInp,"*\n*Photo electric effect is activated\n");
1413 fprintf(pAliceInp,"*Generated from call: SetProcess('PHOT',1);\n");
1415 // - one = resets to default=0.
1417 // matMin = lower bound of the material indices in which the respective thresholds apply
1418 // matMax = upper bound of the material indices in which the respective thresholds apply
1419 // one = step length in assigning indices
1421 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fPHOT-THR\n",zero,-one,zero,matMin,matMax,one);
1423 else if (fProcessValue[i] == 0) {
1424 fprintf(pAliceInp,"*\n*No photo electric effect - no FLUKA card generated\n");
1425 fprintf(pAliceInp,"*Generated from call: SetProcess('PHOT',0)\n");
1428 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('PHOT',?) call.\n");
1429 fprintf(pAliceInp,"*No FLUKA card generated\n");
1431 } // else if (strncmp(&fProcessFlag[i][0],"PHOT",4) == 0)
1434 // Rayleigh scattering
1435 // G3 default value: 0
1436 // G4 process: G4OpRayleigh
1438 // Particles: optical photon
1440 // flag = 0 Rayleigh scattering off
1441 // flag = 1 Rayleigh scattering on
1442 //xx gMC ->SetProcess("RAYL",1);
1443 else if (strncmp(&fProcessFlag[i][0],"RAYL",4) == 0) {
1444 if (fProcessValue[i] == 1) {
1445 fprintf(pAliceInp,"*\n*Rayleigh scattering is ON by default in FLUKA\n");
1446 fprintf(pAliceInp,"*No FLUKA card generated\n");
1448 else if (fProcessValue[i] == 0) {
1449 fprintf(pAliceInp,"*\n*Rayleigh scattering is set OFF\n");
1450 fprintf(pAliceInp,"*Generated from call: SetProcess('RAYL',0);\n");
1451 // - one = no Rayleigh scattering and no binding corrections for Compton
1452 // matMin = lower bound of the material indices in which the respective thresholds apply
1453 // matMax = upper bound of the material indices in which the respective thresholds apply
1454 fprintf(pAliceInp,"EMFRAY %10.1f%10.1f%10.1f%10.1f\n",-one,three,matMin,matMax);
1457 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('RAYL',?) call.\n");
1458 fprintf(pAliceInp,"*No FLUKA card generated\n");
1460 } // end of else if (strncmp(&fProcessFlag[i][0],"RAYL",4) == 0)
1463 // synchrotron radiation in magnetic field
1464 // G3 default value: 0
1465 // G4 process: G4SynchrotronRadiation
1469 // flag = 0 no synchrotron radiation
1470 // flag = 1 synchrotron radiation
1471 //xx gMC ->SetProcess("SYNC",1); // synchrotron radiation generation
1472 else if (strncmp(&fProcessFlag[i][0],"SYNC",4) == 0) {
1473 fprintf(pAliceInp,"*\n*Synchrotron radiation generation is NOT implemented in FLUKA\n");
1474 fprintf(pAliceInp,"*No FLUKA card generated\n");
1478 // Automatic calculation of tracking medium parameters
1479 // flag = 0 no automatic calculation
1480 // flag = 1 automatic calculation
1481 //xx gMC ->SetProcess("AUTO",1); // ??? automatic computation of the tracking medium parameters
1482 else if (strncmp(&fProcessFlag[i][0],"AUTO",4) == 0) {
1483 fprintf(pAliceInp,"*\n*Automatic calculation of tracking medium parameters is always ON in FLUKA\n");
1484 fprintf(pAliceInp,"*No FLUKA card generated\n");
1488 // To control energy loss fluctuation model
1489 // flag = 0 Urban model
1490 // flag = 1 PAI model
1491 // flag = 2 PAI+ASHO model (not active at the moment)
1492 //xx gMC ->SetProcess("STRA",1); // ??? energy fluctuation model
1493 else if (strncmp(&fProcessFlag[i][0],"STRA",4) == 0) {
1494 if (fProcessValue[i] == 0 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1495 fprintf(pAliceInp,"*\n*Ionization energy losses calculation is activated\n");
1496 fprintf(pAliceInp,"*Generated from call: SetProcess('STRA',n);, n=0,1,2\n");
1497 // one = restricted energy loss fluctuations (for hadrons and muons) switched on
1498 // one = restricted energy loss fluctuations (for e+ and e-) switched on
1499 // one = minimal accuracy
1500 // matMin = lower bound of the material indices in which the respective thresholds apply
1501 // matMax = upper bound of the material indices in which the respective thresholds apply
1502 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,one,one,matMin,matMax);
1505 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('STRA',?) call.\n");
1506 fprintf(pAliceInp,"*No FLUKA card generated\n");
1508 } // else if (strncmp(&fProcessFlag[i][0],"STRA",4) == 0)
1513 else { // processes not yet treated
1515 // light photon absorption (Cerenkov photons)
1516 // it is turned on when Cerenkov process is turned on
1517 // G3 default value: 0
1518 // G4 process: G4OpAbsorption, G4OpBoundaryProcess
1520 // Particles: optical photon
1522 // flag = 0 no absorption of Cerenkov photons
1523 // flag = 1 absorption of Cerenkov photons
1524 // gMC ->SetProcess("LABS",2); // ??? Cerenkov light absorption
1528 cout << "SetProcess for flag=" << &fProcessFlag[i][0] << " value=" << fProcessValue[i] << " not yet implemented!" << endl;
1530 } //end of loop number of SetProcess calls
1533 // Loop over number of SetCut calls
1534 for (Int_t i = 0; i < fNbOfCut; i++) {
1535 Float_t matMin = three;
1536 Float_t matMax = fLastMaterial;
1537 Bool_t global = kTRUE;
1538 if (fCutMaterial[i] != -1) {
1539 matMin = Float_t(fCutMaterial[i]);
1544 // cuts handled in SetProcess calls
1545 if (strncmp(&fCutFlag[i][0],"BCUTM",5) == 0) continue;
1546 else if (strncmp(&fCutFlag[i][0],"BCUTE",5) == 0) continue;
1547 else if (strncmp(&fCutFlag[i][0],"DCUTM",5) == 0) continue;
1548 else if (strncmp(&fCutFlag[i][0],"PPCUTM",6) == 0) continue;
1550 // delta-rays by electrons
1551 // G4 particles: "e-"
1552 // G3 default value: 10**4 GeV
1553 // gMC ->SetCut("DCUTE",cut); // cut for deltarays by electrons
1554 else if (strncmp(&fCutFlag[i][0],"DCUTE",5) == 0) {
1555 fprintf(pAliceInp,"*\n*Cut for delta rays by electrons\n");
1556 fprintf(pAliceInp,"*Generated from call: SetCut('DCUTE',cut);\n");
1560 // matMin = lower bound of the material indices in which the respective thresholds apply
1561 // matMax = upper bound of the material indices in which the respective thresholds apply
1562 // loop over materials for EMFCUT FLUKA cards
1563 for (j=0; j < matMax-matMin+1; j++) {
1564 Int_t nreg, imat, *reglist;
1566 imat = (Int_t) matMin + j;
1567 reglist = fGeom->GetMaterialList(imat, nreg);
1568 // loop over regions of a given material
1569 for (k=0; k<nreg; k++) {
1571 fprintf(pAliceInp,"EMFCUT %10.4g%10.1f%10.1f%10.1f%10.1f\n",-fCutValue[i],zero,zero,ireg,ireg);
1574 fprintf(pAliceInp,"DELTARAY %10.4g%10.3f%10.3f%10.1f%10.1f%10.1f\n",fCutValue[i], 100., 1.03, matMin, matMax, 1.0);
1575 fprintf(pAliceInp,"STEPSIZE %10.4g%10.3f%10.3f%10.1f%10.1f\n", 0.1, 1.0, 1.00,
1576 Float_t(gGeoManager->GetListOfUVolumes()->GetEntriesFast()-1), 1.0);
1577 } // end of if for delta-rays by electrons
1581 // G4 particles: "gamma"
1582 // G3 default value: 0.001 GeV
1583 // gMC ->SetCut("CUTGAM",cut); // cut for gammas
1585 else if (strncmp(&fCutFlag[i][0],"CUTGAM",6) == 0 && global) {
1586 fprintf(pAliceInp,"*\n*Cut for gamma\n");
1587 fprintf(pAliceInp,"*Generated from call: SetCut('CUTGAM',cut);\n");
1589 // 7.0 = lower bound of the particle id-numbers to which the cut-off
1590 fprintf(pAliceInp,"PART-THR %10.4g%10.1f\n",-fCutValue[i],7.0);
1592 else if (strncmp(&fCutFlag[i][0],"CUTGAM",6) == 0 && !global) {
1593 fprintf(pAliceInp,"*\n*Cut specific to material for gamma\n");
1594 fprintf(pAliceInp,"*Generated from call: SetCut('CUTGAM',cut);\n");
1596 // loop over materials for EMFCUT FLUKA cards
1597 for (j=0; j < matMax-matMin+1; j++) {
1598 Int_t nreg, imat, *reglist;
1600 imat = (Int_t) matMin + j;
1601 reglist = fGeom->GetMaterialList(imat, nreg);
1602 // loop over regions of a given material
1603 for (Int_t k=0; k<nreg; k++) {
1605 fprintf(pAliceInp,"EMFCUT %10.4g%10.4g%10.1f%10.1f%10.1f%10.1f\n", zero, fCutValue[i], zero, ireg, ireg, one);
1608 } // end of else if for gamma
1612 // G4 particles: "e-"
1614 // G3 default value: 0.001 GeV
1615 //gMC ->SetCut("CUTELE",cut); // cut for e+,e-
1616 else if (strncmp(&fCutFlag[i][0],"CUTELE",6) == 0 && global) {
1617 fprintf(pAliceInp,"*\n*Cut for electrons\n");
1618 fprintf(pAliceInp,"*Generated from call: SetCut('CUTELE',cut);\n");
1620 // three = lower bound of the particle id-numbers to which the cut-off
1621 // 4.0 = upper bound of the particle id-numbers to which the cut-off
1622 // one = step length in assigning numbers
1623 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],three,4.0,one);
1625 else if (strncmp(&fCutFlag[i][0],"CUTELE",6) == 0 && !global) {
1626 fprintf(pAliceInp,"*\n*Cut specific to material for electrons\n");
1627 fprintf(pAliceInp,"*Generated from call: SetCut('CUTELE',cut);\n");
1629 // loop over materials for EMFCUT FLUKA cards
1630 for (j=0; j < matMax-matMin+1; j++) {
1631 Int_t nreg, imat, *reglist;
1633 imat = (Int_t) matMin + j;
1634 reglist = fGeom->GetMaterialList(imat, nreg);
1635 // loop over regions of a given material
1636 for (k=0; k<nreg; k++) {
1638 fprintf(pAliceInp,"EMFCUT %10.4g%10.4g%10.1f%10.1f%10.1f%10.1f\n", -fCutValue[i], zero, zero, ireg, ireg, one);
1641 } // end of else if for electrons
1645 // G4 particles: of type "baryon", "meson", "nucleus" with zero charge
1646 // G3 default value: 0.01 GeV
1647 //gMC ->SetCut("CUTNEU",cut); // cut for neutral hadrons
1648 else if (strncmp(&fCutFlag[i][0],"CUTNEU",6) == 0 && global) {
1649 fprintf(pAliceInp,"*\n*Cut for neutral hadrons\n");
1650 fprintf(pAliceInp,"*Generated from call: SetCut('CUTNEU',cut);\n");
1653 // 9.0 = Antineutron
1654 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],8.0,9.0);
1656 // 12.0 = Kaon zero long
1657 // 12.0 = Kaon zero long
1658 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],12.0,12.0);
1660 // 17.0 = Lambda, 18.0 = Antilambda
1661 // 19.0 = Kaon zero short
1662 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],17.0,19.0);
1664 // 22.0 = Sigma zero, Pion zero, Kaon zero
1665 // 25.0 = Antikaon zero
1666 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],22.0,25.0);
1668 // 32.0 = Antisigma zero
1669 // 32.0 = Antisigma zero
1670 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],32.0,32.0);
1673 // 35.0 = AntiXi zero
1674 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],34.0,35.0);
1677 // 48.0 = AntiD zero
1678 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],47.0,48.0);
1682 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],53.0,53.0);
1684 // 55.0 = Xi'_c zero
1685 // 56.0 = Omega_c zero
1686 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],55.0,56.0);
1688 // 59.0 = AntiXi_c zero
1689 // 59.0 = AntiXi_c zero
1690 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],59.0,59.0);
1692 // 61.0 = AntiXi'_c zero
1693 // 62.0 = AntiOmega_c zero
1694 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],61.0,62.0);
1698 // G4 particles: of type "baryon", "meson", "nucleus" with non-zero charge
1699 // G3 default value: 0.01 GeV
1700 //gMC ->SetCut("CUTHAD",cut); // cut for charged hadrons
1701 else if (strncmp(&fCutFlag[i][0],"CUTHAD",6) == 0 && global) {
1702 fprintf(pAliceInp,"*\n*Cut for charged hadrons\n");
1703 fprintf(pAliceInp,"*Generated from call: SetCut('CUTHAD',cut);\n");
1707 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],1.0,2.0);
1709 // 13.0 = Positive Pion, Negative Pion, Positive Kaon
1710 // 16.0 = Negative Kaon
1711 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],13.0,16.0);
1713 // 20.0 = Negative Sigma
1714 // 21.0 = Positive Sigma
1715 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],20.0,21.0);
1717 // 31.0 = Antisigma minus
1718 // 33.0 = Antisigma plus
1719 // 2.0 = step length
1720 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],31.0,33.0,2.0);
1722 // 36.0 = Negative Xi, Positive Xi, Omega minus
1724 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],36.0,39.0);
1728 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],45.0,46.0);
1730 // 49.0 = D_s plus, D_s minus, Lambda_c plus
1732 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],49.0,52.0);
1734 // 54.0 = Xi'_c plus
1735 // 60.0 = AntiXi'_c minus
1736 // 6.0 = step length
1737 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],54.0,60.0,6.0);
1739 // 57.0 = Antilambda_c minus
1740 // 58.0 = AntiXi_c minus
1741 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],57.0,58.0);
1745 // G4 particles: "mu+", "mu-"
1746 // G3 default value: 0.01 GeV
1747 //gMC ->SetCut("CUTMUO",cut); // cut for mu+, mu-
1748 else if (strncmp(&fCutFlag[i][0],"CUTMUO",6)== 0 && global) {
1749 fprintf(pAliceInp,"*\n*Cut for muons\n");
1750 fprintf(pAliceInp,"*Generated from call: SetCut('CUTMUO',cut);\n");
1753 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],10.0,11.0);
1757 // time of flight cut in seconds
1758 // G4 particles: all
1759 // G3 default value: 0.01 GeV
1760 //gMC ->SetCut("TOFMAX",tofmax); // time of flight cuts in seconds
1761 else if (strncmp(&fCutFlag[i][0],"TOFMAX",6) == 0) {
1762 fprintf(pAliceInp,"*\n*Time of flight cuts in seconds\n");
1763 fprintf(pAliceInp,"*Generated from call: SetCut('TOFMAX',tofmax);\n");
1766 // -6.0 = lower bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1767 // 64.0 = upper bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1768 fprintf(pAliceInp,"TIME-CUT %10.4g%10.1f%10.1f%10.1f%10.1f\n",fCutValue[i]*1.e9,zero,zero,-6.0,64.0);
1772 cout << "SetCut for flag=" << &fCutFlag[i][0] << " value=" << fCutValue[i] << " not yet implemented!" << endl;
1775 cout << "SetCut for flag=" << &fCutFlag[i][0] << " value=" << fCutValue[i] << " (material specific) not yet implemented!" << endl;
1778 } //end of loop over SetCut calls
1780 // Add START and STOP card
1781 fprintf(pAliceInp,"START %10.1f\n",fEventsPerRun);
1782 fprintf(pAliceInp,"STOP \n");
1787 fclose(pAliceCoreInp);
1788 fclose(pAliceFlukaMat);
1791 } // end of InitPhysics
1794 //______________________________________________________________________________
1795 void TFluka::SetMaxStep(Double_t)
1797 // SetMaxStep is dummy procedure in TFluka !
1798 if (fVerbosityLevel >=3)
1799 cout << "SetMaxStep is dummy procedure in TFluka !" << endl;
1802 //______________________________________________________________________________
1803 void TFluka::SetMaxNStep(Int_t)
1805 // SetMaxNStep is dummy procedure in TFluka !
1806 if (fVerbosityLevel >=3)
1807 cout << "SetMaxNStep is dummy procedure in TFluka !" << endl;
1810 //______________________________________________________________________________
1811 void TFluka::SetUserDecay(Int_t)
1813 // SetUserDecay is dummy procedure in TFluka !
1814 if (fVerbosityLevel >=3)
1815 cout << "SetUserDecay is dummy procedure in TFluka !" << endl;
1819 // dynamic properties
1821 //______________________________________________________________________________
1822 void TFluka::TrackPosition(TLorentzVector& position) const
1824 // Return the current position in the master reference frame of the
1825 // track being transported
1826 // TRACKR.atrack = age of the particle
1827 // TRACKR.xtrack = x-position of the last point
1828 // TRACKR.ytrack = y-position of the last point
1829 // TRACKR.ztrack = z-position of the last point
1830 Int_t caller = GetCaller();
1831 if (caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
1832 position.SetX(GetXsco());
1833 position.SetY(GetYsco());
1834 position.SetZ(GetZsco());
1835 position.SetT(TRACKR.atrack);
1837 else if (caller == 4) { // mgdraw
1838 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1839 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1840 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1841 position.SetT(TRACKR.atrack);
1843 else if (caller == 5) { // sodraw
1844 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1845 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1846 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1850 Warning("TrackPosition","position not available");
1853 //______________________________________________________________________________
1854 void TFluka::TrackPosition(Double_t& x, Double_t& y, Double_t& z) const
1856 // Return the current position in the master reference frame of the
1857 // track being transported
1858 // TRACKR.atrack = age of the particle
1859 // TRACKR.xtrack = x-position of the last point
1860 // TRACKR.ytrack = y-position of the last point
1861 // TRACKR.ztrack = z-position of the last point
1862 Int_t caller = GetCaller();
1863 if (caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
1868 else if (caller == 4 || caller == 5) { // mgdraw, sodraw
1869 x = TRACKR.xtrack[TRACKR.ntrack];
1870 y = TRACKR.ytrack[TRACKR.ntrack];
1871 z = TRACKR.ztrack[TRACKR.ntrack];
1874 Warning("TrackPosition","position not available");
1877 //______________________________________________________________________________
1878 void TFluka::TrackMomentum(TLorentzVector& momentum) const
1880 // Return the direction and the momentum (GeV/c) of the track
1881 // currently being transported
1882 // TRACKR.ptrack = momentum of the particle (not always defined, if
1883 // < 0 must be obtained from etrack)
1884 // TRACKR.cx,y,ztrck = direction cosines of the current particle
1885 // TRACKR.etrack = total energy of the particle
1886 // TRACKR.jtrack = identity number of the particle
1887 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
1888 Int_t caller = GetCaller();
1889 if (caller != 2) { // not eedraw
1890 if (TRACKR.ptrack >= 0) {
1891 momentum.SetPx(TRACKR.ptrack*TRACKR.cxtrck);
1892 momentum.SetPy(TRACKR.ptrack*TRACKR.cytrck);
1893 momentum.SetPz(TRACKR.ptrack*TRACKR.cztrck);
1894 momentum.SetE(TRACKR.etrack);
1898 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
1899 momentum.SetPx(p*TRACKR.cxtrck);
1900 momentum.SetPy(p*TRACKR.cytrck);
1901 momentum.SetPz(p*TRACKR.cztrck);
1902 momentum.SetE(TRACKR.etrack);
1907 Warning("TrackMomentum","momentum not available");
1910 //______________________________________________________________________________
1911 void TFluka::TrackMomentum(Double_t& px, Double_t& py, Double_t& pz, Double_t& e) const
1913 // Return the direction and the momentum (GeV/c) of the track
1914 // currently being transported
1915 // TRACKR.ptrack = momentum of the particle (not always defined, if
1916 // < 0 must be obtained from etrack)
1917 // TRACKR.cx,y,ztrck = direction cosines of the current particle
1918 // TRACKR.etrack = total energy of the particle
1919 // TRACKR.jtrack = identity number of the particle
1920 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
1921 Int_t caller = GetCaller();
1922 if (caller != 2) { // not eedraw
1923 if (TRACKR.ptrack >= 0) {
1924 px = TRACKR.ptrack*TRACKR.cxtrck;
1925 py = TRACKR.ptrack*TRACKR.cytrck;
1926 pz = TRACKR.ptrack*TRACKR.cztrck;
1931 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
1932 px = p*TRACKR.cxtrck;
1933 py = p*TRACKR.cytrck;
1934 pz = p*TRACKR.cztrck;
1940 Warning("TrackMomentum","momentum not available");
1943 //______________________________________________________________________________
1944 Double_t TFluka::TrackStep() const
1946 // Return the length in centimeters of the current step
1947 // TRACKR.ctrack = total curved path
1948 Int_t caller = GetCaller();
1949 if (caller == 11 || caller==12 || caller == 3 || caller == 6) //bxdraw,endraw,usdraw
1951 else if (caller == 4) //mgdraw
1952 return TRACKR.ctrack;
1957 //______________________________________________________________________________
1958 Double_t TFluka::TrackLength() const
1960 // TRACKR.cmtrck = cumulative curved path since particle birth
1961 Int_t caller = GetCaller();
1962 if (caller == 11 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
1963 return TRACKR.cmtrck;
1968 //______________________________________________________________________________
1969 Double_t TFluka::TrackTime() const
1971 // Return the current time of flight of the track being transported
1972 // TRACKR.atrack = age of the particle
1973 Int_t caller = GetCaller();
1974 if (caller == 11 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
1975 return TRACKR.atrack;
1980 //______________________________________________________________________________
1981 Double_t TFluka::Edep() const
1983 // Energy deposition
1984 // if TRACKR.ntrack = 0, TRACKR.mtrack = 0:
1985 // -->local energy deposition (the value and the point are not recorded in TRACKR)
1986 // but in the variable "rull" of the procedure "endraw.cxx"
1987 // if TRACKR.ntrack > 0, TRACKR.mtrack = 0:
1988 // -->no energy loss along the track
1989 // if TRACKR.ntrack > 0, TRACKR.mtrack > 0:
1990 // -->energy loss distributed along the track
1991 // TRACKR.dtrack = energy deposition of the jth deposition even
1993 // If coming from bxdraw we have 2 steps of 0 length and 0 edep
1994 Int_t caller = GetCaller();
1995 if (caller == 11 || caller==12) return 0.0;
1997 for ( Int_t j=0;j<TRACKR.mtrack;j++) {
1998 sum +=TRACKR.dtrack[j];
2000 if (TRACKR.ntrack == 0 && TRACKR.mtrack == 0)
2007 //______________________________________________________________________________
2008 Int_t TFluka::TrackPid() const
2010 // Return the id of the particle transported
2011 // TRACKR.jtrack = identity number of the particle
2012 Int_t caller = GetCaller();
2013 if (caller != 2) // not eedraw
2014 return PDGFromId(TRACKR.jtrack);
2019 //______________________________________________________________________________
2020 Double_t TFluka::TrackCharge() const
2022 // Return charge of the track currently transported
2023 // PAPROP.ichrge = electric charge of the particle
2024 // TRACKR.jtrack = identity number of the particle
2025 Int_t caller = GetCaller();
2026 if (caller != 2) // not eedraw
2027 return PAPROP.ichrge[TRACKR.jtrack+6];
2032 //______________________________________________________________________________
2033 Double_t TFluka::TrackMass() const
2035 // PAPROP.am = particle mass in GeV
2036 // TRACKR.jtrack = identity number of the particle
2037 Int_t caller = GetCaller();
2038 if (caller != 2) // not eedraw
2039 return PAPROP.am[TRACKR.jtrack+6];
2044 //______________________________________________________________________________
2045 Double_t TFluka::Etot() const
2047 // TRACKR.etrack = total energy of the particle
2048 Int_t caller = GetCaller();
2049 if (caller != 2) // not eedraw
2050 return TRACKR.etrack;
2058 //______________________________________________________________________________
2059 Bool_t TFluka::IsNewTrack() const
2061 // Return true for the first call of Stepping()
2065 //______________________________________________________________________________
2066 Bool_t TFluka::IsTrackInside() const
2068 // True if the track is not at the boundary of the current volume
2069 // In Fluka a step is always inside one kind of material
2070 // If the step would go behind the region of one material,
2071 // it will be shortened to reach only the boundary.
2072 // Therefore IsTrackInside() is always true.
2073 Int_t caller = GetCaller();
2074 if (caller == 11 || caller==12) // bxdraw
2080 //______________________________________________________________________________
2081 Bool_t TFluka::IsTrackEntering() const
2083 // True if this is the first step of the track in the current volume
2085 Int_t caller = GetCaller();
2086 if (caller == 11) // bxdraw entering
2091 //______________________________________________________________________________
2092 Bool_t TFluka::IsTrackExiting() const
2094 // True if track is exiting volume
2096 Int_t caller = GetCaller();
2097 if (caller == 12) // bxdraw exiting
2102 //______________________________________________________________________________
2103 Bool_t TFluka::IsTrackOut() const
2105 // True if the track is out of the setup
2107 // Icode = 14: escape - call from Kaskad
2108 // Icode = 23: escape - call from Emfsco
2109 // Icode = 32: escape - call from Kasneu
2110 // Icode = 40: escape - call from Kashea
2111 // Icode = 51: escape - call from Kasoph
2116 fIcode == 51) return 1;
2120 //______________________________________________________________________________
2121 Bool_t TFluka::IsTrackDisappeared() const
2123 // means all inelastic interactions and decays
2124 // fIcode from usdraw
2125 if (fIcode == 101 || // inelastic interaction
2126 fIcode == 102 || // particle decay
2127 fIcode == 214 || // in-flight annihilation
2128 fIcode == 215 || // annihilation at rest
2129 fIcode == 217 || // pair production
2130 fIcode == 221) return 1;
2134 //______________________________________________________________________________
2135 Bool_t TFluka::IsTrackStop() const
2137 // True if the track energy has fallen below the threshold
2138 // means stopped by signal or below energy threshold
2139 // Icode = 12: stopping particle - call from Kaskad
2140 // Icode = 15: time kill - call from Kaskad
2141 // Icode = 21: below threshold, iarg=1 - call from Emfsco
2142 // Icode = 22: below threshold, iarg=2 - call from Emfsco
2143 // Icode = 24: time kill - call from Emfsco
2144 // Icode = 31: below threshold - call from Kasneu
2145 // Icode = 33: time kill - call from Kasneu
2146 // Icode = 41: time kill - call from Kashea
2147 // Icode = 52: time kill - call from Kasoph
2156 fIcode == 52) return 1;
2160 //______________________________________________________________________________
2161 Bool_t TFluka::IsTrackAlive() const
2163 // means not disappeared or not out
2164 if (IsTrackDisappeared() || IsTrackOut() ) return 0;
2172 //______________________________________________________________________________
2173 Int_t TFluka::NSecondaries() const
2176 // Number of secondary particles generated in the current step
2177 // FINUC.np = number of secondaries except light and heavy ions
2178 // FHEAVY.npheav = number of secondaries for light and heavy secondary ions
2179 Int_t caller = GetCaller();
2180 if (caller == 6) // valid only after usdraw
2181 return FINUC.np + FHEAVY.npheav;
2184 } // end of NSecondaries
2186 //______________________________________________________________________________
2187 void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
2188 TLorentzVector& position, TLorentzVector& momentum)
2190 // Copy particles from secondary stack to vmc stack
2193 Int_t caller = GetCaller();
2194 if (caller == 6) { // valid only after usdraw
2195 if (isec >= 0 && isec < FINUC.np) {
2196 particleId = PDGFromId(FINUC.kpart[isec]);
2197 position.SetX(fXsco);
2198 position.SetY(fYsco);
2199 position.SetZ(fZsco);
2200 position.SetT(TRACKR.atrack);
2201 momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
2202 momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
2203 momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
2204 momentum.SetE(FINUC.tki[isec] + PAPROP.am[FINUC.kpart[isec]+6]);
2206 else if (isec >= FINUC.np && isec < FINUC.np + FHEAVY.npheav) {
2207 Int_t jsec = isec - FINUC.np;
2208 particleId = FHEAVY.kheavy[jsec]; // this is Fluka id !!!
2209 position.SetX(fXsco);
2210 position.SetY(fYsco);
2211 position.SetZ(fZsco);
2212 position.SetT(TRACKR.atrack);
2213 momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
2214 momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
2215 momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
2216 if (FHEAVY.tkheav[jsec] >= 3 && FHEAVY.tkheav[jsec] <= 6)
2217 momentum.SetE(FHEAVY.tkheav[jsec] + PAPROP.am[jsec+6]);
2218 else if (FHEAVY.tkheav[jsec] > 6)
2219 momentum.SetE(FHEAVY.tkheav[jsec] + FHEAVY.amnhea[jsec]); // to be checked !!!
2222 Warning("GetSecondary","isec out of range");
2225 Warning("GetSecondary","no secondaries available");
2226 } // end of GetSecondary
2228 //______________________________________________________________________________
2229 TMCProcess TFluka::ProdProcess(Int_t) const
2232 // Name of the process that has produced the secondary particles
2233 // in the current step
2234 const TMCProcess kIpNoProc = kPNoProcess;
2235 const TMCProcess kIpPDecay = kPDecay;
2236 const TMCProcess kIpPPair = kPPair;
2237 // const TMCProcess kIpPPairFromPhoton = kPPairFromPhoton;
2238 // const TMCProcess kIpPPairFromVirtualPhoton = kPPairFromVirtualPhoton;
2239 const TMCProcess kIpPCompton = kPCompton;
2240 const TMCProcess kIpPPhotoelectric = kPPhotoelectric;
2241 const TMCProcess kIpPBrem = kPBrem;
2242 // const TMCProcess kIpPBremFromHeavy = kPBremFromHeavy;
2243 // const TMCProcess kIpPBremFromElectronOrPositron = kPBremFromElectronOrPositron;
2244 const TMCProcess kIpPDeltaRay = kPDeltaRay;
2245 // const TMCProcess kIpPMoller = kPMoller;
2246 // const TMCProcess kIpPBhabha = kPBhabha;
2247 const TMCProcess kIpPAnnihilation = kPAnnihilation;
2248 // const TMCProcess kIpPAnnihilInFlight = kPAnnihilInFlight;
2249 // const TMCProcess kIpPAnnihilAtRest = kPAnnihilAtRest;
2250 const TMCProcess kIpPHadronic = kPHadronic;
2251 const TMCProcess kIpPMuonNuclear = kPMuonNuclear;
2252 const TMCProcess kIpPPhotoFission = kPPhotoFission;
2253 const TMCProcess kIpPRayleigh = kPRayleigh;
2254 // const TMCProcess kIpPCerenkov = kPCerenkov;
2255 // const TMCProcess kIpPSynchrotron = kPSynchrotron;
2257 Int_t mugamma = TRACKR.jtrack == 7 || TRACKR.jtrack == 10 || TRACKR.jtrack == 11;
2258 if (fIcode == 102) return kIpPDecay;
2259 else if (fIcode == 104 || fIcode == 217) return kIpPPair;
2260 // else if (fIcode == 104) return kIpPairFromPhoton;
2261 // else if (fIcode == 217) return kIpPPairFromVirtualPhoton;
2262 else if (fIcode == 219) return kIpPCompton;
2263 else if (fIcode == 221) return kIpPPhotoelectric;
2264 else if (fIcode == 105 || fIcode == 208) return kIpPBrem;
2265 // else if (fIcode == 105) return kIpPBremFromHeavy;
2266 // else if (fIcode == 208) return kPBremFromElectronOrPositron;
2267 else if (fIcode == 103 || fIcode == 400) return kIpPDeltaRay;
2268 else if (fIcode == 210 || fIcode == 212) return kIpPDeltaRay;
2269 // else if (fIcode == 210) return kIpPMoller;
2270 // else if (fIcode == 212) return kIpPBhabha;
2271 else if (fIcode == 214 || fIcode == 215) return kIpPAnnihilation;
2272 // else if (fIcode == 214) return kIpPAnnihilInFlight;
2273 // else if (fIcode == 215) return kIpPAnnihilAtRest;
2274 else if (fIcode == 101) return kIpPHadronic;
2275 else if (fIcode == 101) {
2276 if (!mugamma) return kIpPHadronic;
2277 else if (TRACKR.jtrack == 7) return kIpPPhotoFission;
2278 else return kIpPMuonNuclear;
2280 else if (fIcode == 225) return kIpPRayleigh;
2281 // Fluka codes 100, 300 and 400 still to be investigasted
2282 else return kIpNoProc;
2285 //Int_t StepProcesses(TArrayI &proc) const
2286 // Return processes active in the current step
2288 //ck = total energy of the particl ????????????????
2292 //______________________________________________________________________________
2293 Int_t TFluka::VolId2Mate(Int_t id) const
2296 // Returns the material number for a given volume ID
2298 return fGeom->VolId2Mate(id);
2301 //______________________________________________________________________________
2302 const char* TFluka::VolName(Int_t id) const
2305 // Returns the volume name for a given volume ID
2307 return fGeom->VolName(id);
2310 //______________________________________________________________________________
2311 Int_t TFluka::VolId(const Text_t* volName) const
2314 // Converts from volume name to volume ID.
2315 // Time consuming. (Only used during set-up)
2316 // Could be replaced by hash-table
2318 return fGeom->VolId(volName);
2321 //______________________________________________________________________________
2322 Int_t TFluka::CurrentVolID(Int_t& copyNo) const
2325 // Return the logical id and copy number corresponding to the current fluka region
2327 return fGeom->CurrentVolID(copyNo);
2330 //______________________________________________________________________________
2331 Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
2334 // Return the logical id and copy number of off'th mother
2335 // corresponding to the current fluka region
2337 return fGeom->CurrentVolOffID(off, copyNo);
2340 //______________________________________________________________________________
2341 const char* TFluka::CurrentVolName() const
2344 // Return the current volume name
2346 return fGeom->CurrentVolName();
2349 //______________________________________________________________________________
2350 const char* TFluka::CurrentVolOffName(Int_t off) const
2353 // Return the volume name of the off'th mother of the current volume
2355 return fGeom->CurrentVolOffName(off);
2358 //______________________________________________________________________________
2359 Int_t TFluka::CurrentMaterial(Float_t & /*a*/, Float_t & /*z*/,
2360 Float_t & /*dens*/, Float_t & /*radl*/, Float_t & /*absl*/) const
2363 // Return the current medium number ??? what about material properties
2366 Int_t id = TFluka::CurrentVolID(copy);
2367 Int_t med = TFluka::VolId2Mate(id);
2371 //______________________________________________________________________________
2372 void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
2374 // Transforms a position from the world reference frame
2375 // to the current volume reference frame.
2377 // Geant3 desription:
2378 // ==================
2379 // Computes coordinates XD (in DRS)
2380 // from known coordinates XM in MRS
2381 // The local reference system can be initialized by
2382 // - the tracking routines and GMTOD used in GUSTEP
2383 // - a call to GMEDIA(XM,NUMED)
2384 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2385 // (inverse routine is GDTOM)
2387 // If IFLAG=1 convert coordinates
2388 // IFLAG=2 convert direction cosinus
2391 fGeom->Gmtod(xm,xd,iflag);
2394 //______________________________________________________________________________
2395 void TFluka::Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
2397 // Transforms a position from the world reference frame
2398 // to the current volume reference frame.
2400 // Geant3 desription:
2401 // ==================
2402 // Computes coordinates XD (in DRS)
2403 // from known coordinates XM in MRS
2404 // The local reference system can be initialized by
2405 // - the tracking routines and GMTOD used in GUSTEP
2406 // - a call to GMEDIA(XM,NUMED)
2407 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2408 // (inverse routine is GDTOM)
2410 // If IFLAG=1 convert coordinates
2411 // IFLAG=2 convert direction cosinus
2414 fGeom->Gmtod(xm,xd,iflag);
2417 //______________________________________________________________________________
2418 void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
2420 // Transforms a position from the current volume reference frame
2421 // to the world reference frame.
2423 // Geant3 desription:
2424 // ==================
2425 // Computes coordinates XM (Master Reference System
2426 // knowing the coordinates XD (Detector Ref System)
2427 // The local reference system can be initialized by
2428 // - the tracking routines and GDTOM used in GUSTEP
2429 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2430 // (inverse routine is GMTOD)
2432 // If IFLAG=1 convert coordinates
2433 // IFLAG=2 convert direction cosinus
2436 fGeom->Gdtom(xd,xm,iflag);
2439 //______________________________________________________________________________
2440 void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
2442 // Transforms a position from the current volume reference frame
2443 // to the world reference frame.
2445 // Geant3 desription:
2446 // ==================
2447 // Computes coordinates XM (Master Reference System
2448 // knowing the coordinates XD (Detector Ref System)
2449 // The local reference system can be initialized by
2450 // - the tracking routines and GDTOM used in GUSTEP
2451 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2452 // (inverse routine is GMTOD)
2454 // If IFLAG=1 convert coordinates
2455 // IFLAG=2 convert direction cosinus
2458 fGeom->Gdtom(xd,xm,iflag);
2460 //______________________________________________________________________________
2461 void TFluka::SetMreg(Int_t l)
2463 // Set current fluka region
2464 fCurrentFlukaRegion = l;