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;
250 fApplication->InitGeometry();
251 fApplication->BeginEvent();
253 fApplication->FinishEvent();
254 if (fVerbosityLevel >=3)
255 cout << "<== TFluka::ProcessRun(" << nevent << ") called."
258 #if ROOT_VERSION_CODE >= 262150
263 //_____________________________________________________________________________
264 // methods for building/management of geometry
266 // functions from GCONS
267 //____________________________________________________________________________
268 void TFluka::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
269 Float_t &dens, Float_t &radl, Float_t &absl,
270 Float_t* ubuf, Int_t& nbuf) {
272 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
275 //______________________________________________________________________________
276 void TFluka::Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
277 Double_t &dens, Double_t &radl, Double_t &absl,
278 Double_t* ubuf, Int_t& nbuf) {
280 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
283 // detector composition
284 //______________________________________________________________________________
285 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
286 Double_t z, Double_t dens, Double_t radl, Double_t absl,
287 Float_t* buf, Int_t nwbuf) {
289 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
292 //______________________________________________________________________________
293 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
294 Double_t z, Double_t dens, Double_t radl, Double_t absl,
295 Double_t* buf, Int_t nwbuf) {
297 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
300 //______________________________________________________________________________
301 void TFluka::Mixture(Int_t& kmat, const char *name, Float_t *a,
302 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat) {
304 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
307 //______________________________________________________________________________
308 void TFluka::Mixture(Int_t& kmat, const char *name, Double_t *a,
309 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat) {
311 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
314 //______________________________________________________________________________
315 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
316 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
317 Double_t stemax, Double_t deemax, Double_t epsil,
318 Double_t stmin, Float_t* ubuf, Int_t nbuf) {
320 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
321 epsil, stmin, ubuf, nbuf);
324 //______________________________________________________________________________
325 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
326 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
327 Double_t stemax, Double_t deemax, Double_t epsil,
328 Double_t stmin, Double_t* ubuf, Int_t nbuf) {
330 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
331 epsil, stmin, ubuf, nbuf);
334 //______________________________________________________________________________
335 void TFluka::Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
336 Double_t thetaY, Double_t phiY, Double_t thetaZ,
339 fGeom->Matrix(krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ);
342 //______________________________________________________________________________
343 void TFluka::Gstpar(Int_t itmed, const char* param, Double_t parval) {
345 // Is it needed with TGeo ??? - to clear-up
348 if (fVerbosityLevel >=3) printf("Gstpar called with %6d %5s %12.4e %6d\n", itmed, param, parval, fGeom->GetFlukaMaterial(itmed));
350 Bool_t process = kFALSE;
351 if (strncmp(param, "DCAY", 4) == 0 ||
352 strncmp(param, "PAIR", 4) == 0 ||
353 strncmp(param, "COMP", 4) == 0 ||
354 strncmp(param, "PHOT", 4) == 0 ||
355 strncmp(param, "PFIS", 4) == 0 ||
356 strncmp(param, "DRAY", 4) == 0 ||
357 strncmp(param, "ANNI", 4) == 0 ||
358 strncmp(param, "BREM", 4) == 0 ||
359 strncmp(param, "MUNU", 4) == 0 ||
360 strncmp(param, "CKOV", 4) == 0 ||
361 strncmp(param, "HADR", 4) == 0 ||
362 strncmp(param, "LOSS", 4) == 0 ||
363 strncmp(param, "MULS", 4) == 0 ||
364 strncmp(param, "RAYL", 4) == 0)
369 SetProcess(param, Int_t (parval), fGeom->GetFlukaMaterial(itmed));
371 SetCut(param, parval, fGeom->GetFlukaMaterial(itmed));
375 // functions from GGEOM
376 //_____________________________________________________________________________
377 void TFluka::Gsatt(const char *name, const char *att, Int_t val)
379 fGeom->Gsatt(name,att, val);
382 //______________________________________________________________________________
383 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
384 Float_t *upar, Int_t np) {
386 return fGeom->Gsvolu(name, shape, nmed, upar, np);
389 //______________________________________________________________________________
390 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
391 Double_t *upar, Int_t np) {
393 return fGeom->Gsvolu(name, shape, nmed, upar, np);
396 //______________________________________________________________________________
397 void TFluka::Gsdvn(const char *name, const char *mother, Int_t ndiv,
400 fGeom->Gsdvn(name, mother, ndiv, iaxis);
403 //______________________________________________________________________________
404 void TFluka::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
405 Int_t iaxis, Double_t c0i, Int_t numed) {
407 fGeom->Gsdvn2(name, mother, ndiv, iaxis, c0i, numed);
410 //______________________________________________________________________________
411 void TFluka::Gsdvt(const char *name, const char *mother, Double_t step,
412 Int_t iaxis, Int_t numed, Int_t ndvmx) {
414 fGeom->Gsdvt(name, mother, step, iaxis, numed, ndvmx);
417 //______________________________________________________________________________
418 void TFluka::Gsdvt2(const char *name, const char *mother, Double_t step,
419 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx) {
421 fGeom->Gsdvt2(name, mother, step, iaxis, c0, numed, ndvmx);
424 //______________________________________________________________________________
425 void TFluka::Gsord(const char * /*name*/, Int_t /*iax*/) {
427 // Nothing to do with TGeo
430 //______________________________________________________________________________
431 void TFluka::Gspos(const char *name, Int_t nr, const char *mother,
432 Double_t x, Double_t y, Double_t z, Int_t irot,
435 fGeom->Gspos(name, nr, mother, x, y, z, irot, konly);
438 //______________________________________________________________________________
439 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
440 Double_t x, Double_t y, Double_t z, Int_t irot,
441 const char *konly, Float_t *upar, Int_t np) {
443 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
446 //______________________________________________________________________________
447 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
448 Double_t x, Double_t y, Double_t z, Int_t irot,
449 const char *konly, Double_t *upar, Int_t np) {
451 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
454 //______________________________________________________________________________
455 void TFluka::Gsbool(const char* /*onlyVolName*/, const char* /*manyVolName*/) {
457 // Nothing to do with TGeo
458 Warning("Gsbool", "Not implemented with TGeo");
461 //______________________________________________________________________________
462 void TFluka::SetCerenkov(Int_t itmed, Int_t npckov, Float_t* ppckov,
463 Float_t* absco, Float_t* effic, Float_t* rindex) {
465 // Set Cerenkov properties for medium itmed
467 // npckov: number of sampling points
468 // ppckov: energy values
469 // absco: absorption length
470 // effic: quantum efficiency
471 // rindex: refraction index
475 // Create object holding Cerenkov properties
477 TFlukaCerenkov* cerenkovProperties = new TFlukaCerenkov(npckov, ppckov, absco, effic, rindex);
479 // Pass object to medium
480 TGeoMedium* medium = gGeoManager->GetMedium(itmed);
481 medium->SetCerenkovProperties(cerenkovProperties);
484 //______________________________________________________________________________
485 void TFluka::SetCerenkov(Int_t /*itmed*/, Int_t /*npckov*/, Double_t * /*ppckov*/,
486 Double_t * /*absco*/, Double_t * /*effic*/, Double_t * /*rindex*/) {
488 // Not implemented with TGeo - what G4 did ? Any FLUKA card generated?
489 Warning("SetCerenkov", "Not implemented with TGeo");
493 //______________________________________________________________________________
494 void TFluka::WriteEuclid(const char* /*fileName*/, const char* /*topVol*/,
495 Int_t /*number*/, Int_t /*nlevel*/) {
498 Warning("WriteEuclid", "Not implemented with TGeo");
503 //_____________________________________________________________________________
504 // methods needed by the stepping
505 //____________________________________________________________________________
507 Int_t TFluka::GetMedium() const {
509 // Get the medium number for the current fluka region
511 return fGeom->GetMedium(); // this I need to check due to remapping !!!
516 //____________________________________________________________________________
517 // particle table usage
518 // ID <--> PDG transformations
519 //_____________________________________________________________________________
520 Int_t TFluka::IdFromPDG(Int_t pdg) const
523 // Return Fluka code from PDG and pseudo ENDF code
525 // Catch the feedback photons
526 if (pdg == 50000051) return (-1);
527 // MCIHAD() goes from pdg to fluka internal.
528 Int_t intfluka = mcihad(pdg);
529 // KPTOIP array goes from internal to official
530 return GetFlukaKPTOIP(intfluka);
533 //______________________________________________________________________________
534 Int_t TFluka::PDGFromId(Int_t id) const
537 // Return PDG code and pseudo ENDF code from Fluka code
539 // IPTOKP array goes from official to internal
543 if (fVerbosityLevel >= 1)
544 printf("\n PDGFromId: Cerenkov Photon \n");
548 if (id == 0 || id < -6 || id > 250) {
549 if (fVerbosityLevel >= 1)
550 printf("PDGFromId: Error id = 0\n");
554 Int_t intfluka = GetFlukaIPTOKP(id);
556 if (fVerbosityLevel >= 1)
557 printf("PDGFromId: Error intfluka = 0: %d\n", id);
559 } else if (intfluka < 0) {
560 if (fVerbosityLevel >= 1)
561 printf("PDGFromId: Error intfluka < 0: %d\n", id);
564 if (fVerbosityLevel >= 3)
565 printf("mpdgha called with %d %d \n", id, intfluka);
566 // MPDGHA() goes from fluka internal to pdg.
567 return mpdgha(intfluka);
570 //_____________________________________________________________________________
571 // methods for physics management
572 //____________________________________________________________________________
577 void TFluka::SetProcess(const char* flagName, Int_t flagValue, Int_t imat)
579 // Set process user flag for material imat
581 strcpy(&fProcessFlag[fNbOfProc][0],flagName);
582 fProcessValue[fNbOfProc] = flagValue;
583 fProcessMaterial[fNbOfProc] = imat;
587 //______________________________________________________________________________
588 void TFluka::SetProcess(const char* flagName, Int_t flagValue)
590 // Set process user flag
594 if (fNbOfProc < 100) {
595 for (i=0; i<fNbOfProc; i++) {
596 if (strcmp(&fProcessFlag[i][0],flagName) == 0) {
597 fProcessValue[fNbOfProc] = flagValue;
598 fProcessMaterial[fNbOfProc] = -1;
602 strcpy(&fProcessFlag[fNbOfProc][0],flagName);
603 fProcessMaterial[fNbOfProc] = -1;
604 fProcessValue[fNbOfProc++] = flagValue;
608 cout << "Nb of SetProcess calls exceeds 100 - ignored" << endl;
611 //______________________________________________________________________________
612 void TFluka::SetCut(const char* cutName, Double_t cutValue, Int_t imed)
614 // Set user cut value for material imed
616 strcpy(&fCutFlag[fNbOfCut][0],cutName);
617 fCutValue[fNbOfCut] = cutValue;
618 fCutMaterial[fNbOfCut] = imed;
622 //______________________________________________________________________________
623 void TFluka::SetCut(const char* cutName, Double_t cutValue)
625 // Set user cut value
628 if (fNbOfCut < 100) {
629 for (i=0; i<fNbOfCut; i++) {
630 if (strcmp(&fCutFlag[i][0],cutName) == 0) {
631 fCutValue[fNbOfCut] = cutValue;
635 strcpy(&fCutFlag[fNbOfCut][0],cutName);
636 fCutMaterial[fNbOfCut] = -1;
637 fCutValue[fNbOfCut++] = cutValue;
640 cout << "Nb of SetCut calls exceeds 100 - ignored" << endl;
643 //______________________________________________________________________________
644 Double_t TFluka::Xsec(char*, Double_t, Int_t, Int_t)
646 printf("WARNING: Xsec not yet implemented !\n"); return -1.;
650 //______________________________________________________________________________
651 void TFluka::InitPhysics()
654 // Physics initialisation with preparation of FLUKA input cards
656 printf("=>InitPhysics\n");
660 FILE *pAliceCoreInp, *pAliceFlukaMat, *pAliceInp;
665 Double_t three = 3.0;
667 Float_t fLastMaterial = fGeom->GetLastMaterialIndex();
668 if (fVerbosityLevel >= 3) printf(" last FLUKA material is %g\n", fLastMaterial);
671 TList *matList = gGeoManager->GetListOfMaterials();
672 Int_t nmaterial = matList->GetSize();
673 fMaterials = new Int_t[nmaterial];
675 // construct file names
677 TString sAliceCoreInp = getenv("ALICE_ROOT");
678 sAliceCoreInp +="/TFluka/input/";
679 TString sAliceTmp = "flukaMat.inp";
680 TString sAliceInp = GetInputFileName();
681 sAliceCoreInp += GetCoreInputFileName();
685 if ((pAliceCoreInp = fopen(sAliceCoreInp.Data(),"r")) == NULL) {
686 printf("\nCannot open file %s\n",sAliceCoreInp.Data());
689 if ((pAliceFlukaMat = fopen(sAliceTmp.Data(),"r")) == NULL) {
690 printf("\nCannot open file %s\n",sAliceTmp.Data());
693 if ((pAliceInp = fopen(sAliceInp.Data(),"w")) == NULL) {
694 printf("\nCannot open file %s\n",sAliceInp.Data());
698 // copy core input file
700 Float_t fEventsPerRun;
702 while ((fgets(sLine,255,pAliceCoreInp)) != NULL) {
703 if (strncmp(sLine,"GEOEND",6) != 0)
704 fprintf(pAliceInp,"%s",sLine); // copy until GEOEND card
706 fprintf(pAliceInp,"GEOEND\n"); // add GEOEND card
709 } // end of while until GEOEND card
713 while ((fgets(sLine,255,pAliceFlukaMat)) != NULL) { // copy flukaMat.inp file
714 fprintf(pAliceInp,"%s\n",sLine);
717 while ((fgets(sLine,255,pAliceCoreInp)) != NULL) {
718 if (strncmp(sLine,"START",5) != 0)
719 fprintf(pAliceInp,"%s\n",sLine);
721 sscanf(sLine+10,"%10f",&fEventsPerRun);
724 } //end of while until START card
727 // in G3 the process control values meaning can be different for
728 // different processes, but for most of them is:
729 // 0 process is not activated
730 // 1 process is activated WITH generation of secondaries
731 // 2 process is activated WITHOUT generation of secondaries
732 // if process does not generate secondaries => 1 same as 2
741 // Loop over number of SetProcess calls
742 fprintf(pAliceInp,"*----------------------------------------------------------------------------- \n");
743 fprintf(pAliceInp,"*----- The following data are generated from SetProcess and SetCut calls ----- \n");
744 fprintf(pAliceInp,"*----------------------------------------------------------------------------- \n");
746 for (i = 0; i < fNbOfProc; i++) {
747 Float_t matMin = three;
748 Float_t matMax = fLastMaterial;
749 Bool_t global = kTRUE;
750 if (fProcessMaterial[i] != -1) {
751 matMin = Float_t(fProcessMaterial[i]);
757 // G3 default value: 1
758 // G4 processes: G4eplusAnnihilation/G4IeplusAnnihilation
761 // flag = 0 no annihilation
762 // flag = 1 annihilation, decays processed
763 // flag = 2 annihilation, no decay product stored
764 // gMC ->SetProcess("ANNI",1); // EMFCUT -1. 0. 0. 3. lastmat 0. ANNH-THR
765 if (strncmp(&fProcessFlag[i][0],"ANNI",4) == 0) {
766 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
767 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+ annihilation - resets to default=0.\n");
768 fprintf(pAliceInp,"*Generated from call: SetProcess('ANNI',1) or SetProcess('ANNI',2)\n");
769 // -one = kinetic energy threshold (GeV) for e+ annihilation (resets to default=0)
772 // matMin = lower bound of the material indices in which the respective thresholds apply
773 // matMax = upper bound of the material indices in which the respective thresholds apply
774 // one = step length in assigning indices
776 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fANNH-THR\n",-one,zero,zero,matMin,matMax,one);
778 else if (fProcessValue[i] == 0) {
779 fprintf(pAliceInp,"*\n*No annihilation - no FLUKA card generated\n");
780 fprintf(pAliceInp,"*Generated from call: SetProcess('ANNI',0)\n");
783 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('ANNI',?) call.\n");
784 fprintf(pAliceInp,"*No FLUKA card generated\n");
788 // bremsstrahlung and pair production are both activated
789 // G3 default value: 1
790 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
791 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
792 // G4LowEnergyBremstrahlung
793 // Particles: e-/e+; mu+/mu-
795 // flag = 0 no bremsstrahlung
796 // flag = 1 bremsstrahlung, photon processed
797 // flag = 2 bremsstrahlung, no photon stored
798 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
799 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
800 // G3 default value: 1
801 // G4 processes: G4GammaConversion,
802 // G4MuPairProduction/G4IMuPairProduction
803 // G4LowEnergyGammaConversion
804 // Particles: gamma, mu
806 // flag = 0 no delta rays
807 // flag = 1 delta rays, secondaries processed
808 // flag = 2 delta rays, no secondaries stored
809 // gMC ->SetProcess("PAIR",1); // PAIRBREM 1. 0. 0. 3. lastmat
810 // EMFCUT 0. 0. -1. 3. lastmat 0. PHOT-THR
811 else if ((strncmp(&fProcessFlag[i][0],"PAIR",4) == 0) && (fProcessValue[i] == 1 || fProcessValue[i] == 2)) {
813 for (j=0; j<fNbOfProc; j++) {
814 if ((strncmp(&fProcessFlag[j][0],"BREM",4) == 0) &&
815 (fProcessValue[j] == 1 || fProcessValue[j] == 2) &&
816 (fProcessMaterial[j] == fProcessMaterial[i])) {
817 fprintf(pAliceInp,"*\n*Bremsstrahlung and pair production by muons and charged hadrons both activated\n");
818 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1) and SetProcess('PAIR',1)\n");
819 fprintf(pAliceInp,"*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.\n");
820 fprintf(pAliceInp,"*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.\n");
821 // three = bremsstrahlung and pair production by muons and charged hadrons both are activated
822 fprintf(pAliceInp,"PAIRBREM %10.1f",three);
823 // direct pair production by muons
824 // G4 particles: "e-", "e+"
825 // G3 default value: 0.01 GeV
826 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
828 for (k=0; k<fNbOfCut; k++) {
829 if (strncmp(&fCutFlag[k][0],"PPCUTM",6) == 0 &&
830 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
832 fprintf(pAliceInp,"%10.4g",fCut);
833 // fCut; = e+, e- kinetic energy threshold (in GeV) for explicit pair production.
834 // muon and hadron bremsstrahlung
835 // G4 particles: "gamma"
836 // G3 default value: CUTGAM=0.001 GeV
837 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
839 for (k=0; k<fNbOfCut; k++) {
840 if (strncmp(&fCutFlag[k][0],"BCUTM",5) == 0 &&
841 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
843 fprintf(pAliceInp,"%10.4g%10.1f%10.1f\n",fCut,matMin,matMax);
844 // fCut = photon energy threshold (GeV) for explicit bremsstrahlung production
845 // matMin = lower bound of the material indices in which the respective thresholds apply
846 // matMax = upper bound of the material indices in which the respective thresholds apply
849 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.\n");
850 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1);\n");
852 for (k=0; k<fNbOfCut; k++) {
853 if (strncmp(&fCutFlag[k][0],"BCUTE",5) == 0 &&
854 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
856 //fCut = kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
859 // matMin = lower bound of the material indices in which the respective thresholds apply
860 // matMax = upper bound of the material indices in which the respective thresholds apply
861 // one = step length in assigning indices
863 fprintf(pAliceInp,"EMFCUT %10.4g%10.1f%10.1f%10.1f%10.1f%10.1fELPO-THR\n",fCut,zero,zero,matMin,matMax,one);
866 fprintf(pAliceInp,"*\n*Pair production by electrons is activated\n");
867 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1);\n");
869 for (k=0; k<fNbOfCut; k++) {
870 if (strncmp(&fCutFlag[k][0],"CUTGAM",6) == 0 &&
871 (fCutMaterial[k] == fProcessMaterial[i])) fCut = fCutValue[k];
873 // fCut = energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
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
876 // one = step length in assigning indices
877 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.4g%10.1f%10.1f%10.1fPHOT-THR\n",zero,zero,fCut,matMin,matMax,one);
879 } // end of if for BREM
880 } // end of loop for BREM
882 // only pair production by muons and charged hadrons is activated
883 fprintf(pAliceInp,"*\n*Pair production by muons and charged hadrons is activated\n");
884 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)\n");
885 fprintf(pAliceInp,"*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.\n");
886 // direct pair production by muons
887 // G4 particles: "e-", "e+"
888 // G3 default value: 0.01 GeV
889 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
890 // one = pair production by muons and charged hadrons is activated
891 // zero = e+, e- kinetic energy threshold (in GeV) for explicit pair production.
892 // zero = no explicit bremsstrahlung production is simulated
893 // matMin = lower bound of the material indices in which the respective thresholds apply
894 // matMax = upper bound of the material indices in which the respective thresholds apply
895 fprintf(pAliceInp,"PAIRBREM %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
898 fprintf(pAliceInp,"*\n*Pair production by electrons is activated\n");
899 fprintf(pAliceInp,"*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)\n");
901 for (j=0; j<fNbOfCut; j++) {
902 if (strncmp(&fCutFlag[j][0],"CUTGAM",6) == 0 &&
903 (fCutMaterial[j] == fProcessMaterial[i])) fCut = fCutValue[j];
905 // zero = energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
906 // zero = energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
907 // fCut = energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
908 // matMin = lower bound of the material indices in which the respective thresholds apply
909 // matMax = upper bound of the material indices in which the respective thresholds apply
910 // one = step length in assigning indices
911 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.4g%10.1f%10.1f%10.1fPHOT-THR\n",zero,zero,fCut,matMin,matMax,one);
915 } // end of if for PAIR
920 // G3 default value: 1
921 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
922 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
923 // G4LowEnergyBremstrahlung
924 // Particles: e-/e+; mu+/mu-
926 // flag = 0 no bremsstrahlung
927 // flag = 1 bremsstrahlung, photon processed
928 // flag = 2 bremsstrahlung, no photon stored
929 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
930 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
931 else if (strncmp(&fProcessFlag[i][0],"BREM",4) == 0) {
932 for (j = 0; j < fNbOfProc; j++) {
933 if ((strncmp(&fProcessFlag[j][0],"PAIR",4) == 0) &&
934 fProcessValue[j] == 1 &&
935 (fProcessMaterial[j] == fProcessMaterial[i])) goto NOBREM;
937 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
938 fprintf(pAliceInp,"*\n*Bremsstrahlung by muons and charged hadrons is activated\n");
939 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1) or SetProcess('BREM',2)\n");
940 fprintf(pAliceInp,"*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.\n");
941 // two = bremsstrahlung by muons and charged hadrons is activated
943 // muon and hadron bremsstrahlung
944 // G4 particles: "gamma"
945 // G3 default value: CUTGAM=0.001 GeV
946 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
948 for (j=0; j<fNbOfCut; j++) {
949 if (strncmp(&fCutFlag[j][0],"BCUTM",5) == 0 &&
950 (fCutMaterial[j] == fProcessMaterial[i])) fCut = fCutValue[j];
952 // fCut = photon energy threshold (GeV) for explicit bremsstrahlung production
953 // matMin = lower bound of the material indices in which the respective thresholds apply
954 // matMax = upper bound of the material indices in which the respective thresholds apply
955 fprintf(pAliceInp,"PAIRBREM %10.1f%10.1f%10.4g%10.1f%10.1f\n",two,zero,fCut,matMin,matMax);
958 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.\n");
959 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',1);");
960 // - one = kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
963 // matMin = lower bound of the material indices in which the respective thresholds apply
964 // matMax = upper bound of the material indices in which the respective thresholds apply
965 // one = step length in assigning indices
967 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fELPO-THR\n",-one,zero,zero,matMin,matMax,one);
969 else if (fProcessValue[i] == 0) {
970 fprintf(pAliceInp,"*\n*No bremsstrahlung - no FLUKA card generated\n");
971 fprintf(pAliceInp,"*Generated from call: SetProcess('BREM',0)\n");
974 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('BREM',?) call.\n");
975 fprintf(pAliceInp,"*No FLUKA card generated\n");
979 } // end of else if (strncmp(&fProcessFlag[i][0],"BREM",4) == 0)
981 // Cerenkov photon generation
982 // G3 default value: 0
983 // G4 process: G4Cerenkov
985 // Particles: charged
987 // flag = 0 no Cerenkov photon generation
988 // flag = 1 Cerenkov photon generation
989 // flag = 2 Cerenkov photon generation with primary stopped at each step
990 //xx gMC ->SetProcess("CKOV",1); // ??? Cerenkov photon generation
992 else if (strncmp(&fProcessFlag[i][0],"CKOV",4) == 0) {
993 if ((fProcessValue[i] == 1 || fProcessValue[i] == 2) && global) {
995 fprintf(pAliceInp, "* \n");
996 fprintf(pAliceInp, "*Cerenkov photon generation\n");
997 fprintf(pAliceInp, "*Generated from call: SetProcess('CKOV',1) or SetProcess('CKOV',2)\n");
999 for (Int_t im = 0; im < nmaterial; im++)
1001 TGeoMaterial* material = dynamic_cast<TGeoMaterial*> (matList->At(im));
1002 Int_t idmat = material->GetIndex();
1004 if (!global && idmat != fProcessMaterial[i]) continue;
1006 fMaterials[idmat] = im;
1007 // Skip media with no Cerenkov properties
1008 TFlukaCerenkov* cerenkovProp;
1009 if (!(cerenkovProp = dynamic_cast<TFlukaCerenkov*>(material->GetCerenkovProperties()))) continue;
1011 // This medium has Cerenkov properties
1014 // Write OPT-PROD card for each medium
1015 Float_t emin = cerenkovProp->GetMinimumEnergy();
1016 Float_t emax = cerenkovProp->GetMaximumEnergy();
1017 fprintf(pAliceInp, "OPT-PROD %10.4g%10.4g%10.4g%10.4g%10.4g%10.4gCERENKOV\n", emin, emax, 0.,
1018 Float_t(idmat), Float_t(idmat), 0.);
1020 // Write OPT-PROP card for each medium
1021 // Forcing FLUKA to call user routines (queffc.cxx, rflctv.cxx, rfrndx.cxx)
1023 fprintf(pAliceInp, "OPT-PROP %10.4g%10.4g%10.4g%10.1f%10.1f%10.1fWV-LIMIT\n",
1024 cerenkovProp->GetMinimumWavelength(),
1025 cerenkovProp->GetMaximumWavelength(),
1026 cerenkovProp->GetMaximumWavelength(),
1027 Float_t(idmat), Float_t(idmat), 0.0);
1029 if (cerenkovProp->IsMetal()) {
1030 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fMETAL\n",
1031 -100., -100., -100.,
1032 Float_t(idmat), Float_t(idmat), 0.0);
1034 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1f\n",
1035 -100., -100., -100.,
1036 Float_t(idmat), Float_t(idmat), 0.0);
1040 for (Int_t j = 0; j < 3; j++) {
1041 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1f&\n",
1042 -100., -100., -100.,
1043 Float_t(idmat), Float_t(idmat), 0.0);
1045 // Photon detection efficiency user defined
1047 if (cerenkovProp->IsSensitive())
1048 fprintf(pAliceInp, "OPT-PROP %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fSENSITIV\n",
1049 -100., -100., -100.,
1050 Float_t(idmat), Float_t(idmat), 0.0);
1053 } else if (fProcessValue[i] == 0) {
1054 fprintf(pAliceInp,"*\n*No Cerenkov photon generation\n");
1055 fprintf(pAliceInp,"*Generated from call: SetProcess('CKOV',0)\n");
1059 // matMin = lower bound of the material indices in which the respective thresholds apply
1060 // matMax = upper bound of the material indices in which the respective thresholds apply
1061 // one = step length in assigning indices
1063 fprintf(pAliceInp,"OPT-PROD %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fCERE-OFF\n",zero,zero,zero,matMin,matMax,one);
1066 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('CKOV',?) call.\n");
1067 fprintf(pAliceInp,"*No FLUKA card generated\n");
1069 } // end of else if (strncmp(&fProcessFlag[i][0],"CKOV",4) == 0)
1071 // Compton scattering
1072 // G3 default value: 1
1073 // G4 processes: G4ComptonScattering,
1074 // G4LowEnergyCompton,
1075 // G4PolarizedComptonScattering
1078 // flag = 0 no Compton scattering
1079 // flag = 1 Compton scattering, electron processed
1080 // flag = 2 Compton scattering, no electron stored
1081 // gMC ->SetProcess("COMP",1); // EMFCUT -1. 0. 0. 3. lastmat 0. PHOT-THR
1082 else if (strncmp(&fProcessFlag[i][0],"COMP",4) == 0) {
1083 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1084 fprintf(pAliceInp,"*\n*Energy threshold (GeV) for Compton scattering - resets to default=0.\n");
1085 fprintf(pAliceInp,"*Generated from call: SetProcess('COMP',1);\n");
1086 // - one = energy threshold (GeV) for Compton scattering - resets to default=0.
1089 // matMin = lower bound of the material indices in which the respective thresholds apply
1090 // matMax = upper bound of the material indices in which the respective thresholds apply
1091 // one = step length in assigning indices
1093 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fPHOT-THR\n",-one,zero,zero,matMin,matMax,one);
1095 else if (fProcessValue[i] == 0) {
1096 fprintf(pAliceInp,"*\n*No Compton scattering - no FLUKA card generated\n");
1097 fprintf(pAliceInp,"*Generated from call: SetProcess('COMP',0)\n");
1100 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('COMP',?) call.\n");
1101 fprintf(pAliceInp,"*No FLUKA card generated\n");
1103 } // end of else if (strncmp(&fProcessFlag[i][0],"COMP",4) == 0)
1106 // G3 default value: 1
1107 // G4 process: G4Decay
1109 // Particles: all which decay is applicable for
1111 // flag = 0 no decays
1112 // flag = 1 decays, secondaries processed
1113 // flag = 2 decays, no secondaries stored
1114 //gMC ->SetProcess("DCAY",1); // not available
1115 else if ((strncmp(&fProcessFlag[i][0],"DCAY",4) == 0) && fProcessValue[i] == 1)
1116 cout << "SetProcess for flag=" << &fProcessFlag[i][0] << " value=" << fProcessValue[i] << " not avaliable!" << endl;
1119 // G3 default value: 2
1120 // !! G4 treats delta rays in different way
1121 // G4 processes: G4eIonisation/G4IeIonization,
1122 // G4MuIonisation/G4IMuIonization,
1123 // G4hIonisation/G4IhIonisation
1124 // Particles: charged
1126 // flag = 0 no energy loss
1127 // flag = 1 restricted energy loss fluctuations
1128 // flag = 2 complete energy loss fluctuations
1129 // flag = 3 same as 1
1130 // flag = 4 no energy loss fluctuations
1131 // gMC ->SetProcess("DRAY",0); // DELTARAY 1.E+6 0. 0. 3. lastmat 0.
1132 else if (strncmp(&fProcessFlag[i][0],"DRAY",4) == 0) {
1133 if (fProcessValue[i] == 0 || fProcessValue[i] == 4) {
1134 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for delta ray production\n");
1135 fprintf(pAliceInp,"*Generated from call: SetProcess('DRAY',0) or SetProcess('DRAY',4)\n");
1136 fprintf(pAliceInp,"*No delta ray production by muons - threshold set artificially high\n");
1137 Double_t emin = 1.0e+6; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1140 // matMin = lower bound of the material indices in which the respective thresholds apply
1141 // matMax = upper bound of the material indices in which the respective thresholds apply
1142 // one = step length in assigning indices
1143 fprintf(pAliceInp,"DELTARAY %10.4g%10.1f%10.1f%10.1f%10.1f%10.1f\n",emin,zero,zero,matMin,matMax,one);
1145 else if (fProcessValue[i] == 1 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1146 fprintf(pAliceInp,"*\n*Kinetic energy threshold (GeV) for delta ray production\n");
1147 fprintf(pAliceInp,"*Generated from call: SetProcess('DRAY',flag), flag=1,2,3\n");
1148 fprintf(pAliceInp,"*Delta ray production by muons switched on\n");
1149 fprintf(pAliceInp,"*Energy threshold set by call SetCut('DCUTM',cut) or set to 1.0e+6.\n");
1151 for (j = 0; j < fNbOfCut; j++) {
1152 if (strncmp(&fCutFlag[j][0],"DCUTM",5) == 0 &&
1153 fCutMaterial[j] == fProcessMaterial[i]) fCut = fCutValue[j];
1155 // fCut = kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1158 // matMin = lower bound of the material indices in which the respective thresholds apply
1159 // matMax = upper bound of the material indices in which the respective thresholds apply
1160 // one = step length in assigning indices
1161 fprintf(pAliceInp,"DELTARAY %10.4g%10.1f%10.1f%10.1f%10.1f%10.1f\n",fCut,zero,zero,matMin,matMax,one);
1164 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('DRAY',?) call.\n");
1165 fprintf(pAliceInp,"*No FLUKA card generated\n");
1167 } // end of else if (strncmp(&fProcessFlag[i][0],"DRAY",4) == 0)
1170 // G3 default value: 1
1171 // G4 processes: all defined by TG4PhysicsConstructorHadron
1173 // Particles: hadrons
1175 // flag = 0 no multiple scattering
1176 // flag = 1 hadronic interactions, secondaries processed
1177 // flag = 2 hadronic interactions, no secondaries stored
1178 // gMC ->SetProcess("HADR",1); // ??? hadronic process
1179 //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) ?????
1180 else if (strncmp(&fProcessFlag[i][0],"HADR",4) == 0) {
1181 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1182 fprintf(pAliceInp,"*\n*Hadronic interaction is ON by default in FLUKA\n");
1183 fprintf(pAliceInp,"*No FLUKA card generated\n");
1185 else if (fProcessValue[i] == 0) {
1186 fprintf(pAliceInp,"*\n*Hadronic interaction is set OFF\n");
1187 fprintf(pAliceInp,"*Generated from call: SetProcess('HADR',0);\n");
1189 // three = multiple scattering for hadrons and muons is completely suppressed
1190 // zero = no spin-relativistic corrections
1191 // matMin = lower bound of the material indices in which the respective thresholds apply
1192 // matMax = upper bound of the material indices in which the respective thresholds apply
1193 fprintf(pAliceInp,"MULSOPT %10.1f%10.1f%10.1f%10.1f%10.1f\n",zero,three,zero,matMin,matMax);
1197 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('HADR',?) call.\n");
1198 fprintf(pAliceInp,"*No FLUKA card generated\n");
1200 } // end of else if (strncmp(&fProcessFlag[i][0],"HADR",4) == 0)
1204 // G3 default value: 2
1205 // G4 processes: G4eIonisation/G4IeIonization,
1206 // G4MuIonisation/G4IMuIonization,
1207 // G4hIonisation/G4IhIonisation
1209 // Particles: charged
1211 // flag=0 no energy loss
1212 // flag=1 restricted energy loss fluctuations
1213 // flag=2 complete energy loss fluctuations
1215 // flag=4 no energy loss fluctuations
1216 // If the value ILOSS is changed, then (in G3) cross-sections and energy
1217 // loss tables must be recomputed via the command 'PHYSI'
1218 // gMC ->SetProcess("LOSS",2); // ??? IONFLUCT ? energy loss
1219 else if (strncmp(&fProcessFlag[i][0],"LOSS",4) == 0) {
1220 if (fProcessValue[i] == 2) { // complete energy loss fluctuations
1221 fprintf(pAliceInp,"*\n*Complete energy loss fluctuations do not exist in FLUKA\n");
1222 fprintf(pAliceInp,"*Generated from call: SetProcess('LOSS',2);\n");
1223 fprintf(pAliceInp,"*flag=2=complete energy loss fluctuations\n");
1224 fprintf(pAliceInp,"*No FLUKA card generated\n");
1226 else if (fProcessValue[i] == 1 || fProcessValue[i] == 3) { // restricted energy loss fluctuations
1227 fprintf(pAliceInp,"*\n*Restricted energy loss fluctuations\n");
1228 fprintf(pAliceInp,"*Generated from call: SetProcess('LOSS',1) or SetProcess('LOSS',3)\n");
1229 // one = restricted energy loss fluctuations (for hadrons and muons) switched on
1230 // one = restricted energy loss fluctuations (for e+ and e-) switched on
1231 // one = minimal accuracy
1232 // matMin = lower bound of the material indices in which the respective thresholds apply
1233 // upper bound of the material indices in which the respective thresholds apply
1234 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,one,one,matMin,matMax);
1236 else if (fProcessValue[i] == 4) { // no energy loss fluctuations
1237 fprintf(pAliceInp,"*\n*No energy loss fluctuations\n");
1238 fprintf(pAliceInp,"*\n*Generated from call: SetProcess('LOSS',4)\n");
1239 // - one = restricted energy loss fluctuations (for hadrons and muons) switched off
1240 // - one = restricted energy loss fluctuations (for e+ and e-) switched off
1241 // one = minimal accuracy
1242 // matMin = lower bound of the material indices in which the respective thresholds apply
1243 // matMax = upper bound of the material indices in which the respective thresholds apply
1244 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",-one,-one,one,matMin,matMax);
1247 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('LOSS',?) call.\n");
1248 fprintf(pAliceInp,"*No FLUKA card generated\n");
1250 } // end of else if (strncmp(&fProcessFlag[i][0],"LOSS",4) == 0)
1253 // multiple scattering
1254 // G3 default value: 1
1255 // G4 process: G4MultipleScattering/G4IMultipleScattering
1257 // Particles: charged
1259 // flag = 0 no multiple scattering
1260 // flag = 1 Moliere or Coulomb scattering
1261 // flag = 2 Moliere or Coulomb scattering
1262 // flag = 3 Gaussian scattering
1263 // gMC ->SetProcess("MULS",1); // MULSOPT multiple scattering
1264 else if (strncmp(&fProcessFlag[i][0],"MULS",4) == 0) {
1265 if (fProcessValue[i] == 1 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1266 fprintf(pAliceInp,"*\n*Multiple scattering is ON by default for e+e- and for hadrons/muons\n");
1267 fprintf(pAliceInp,"*No FLUKA card generated\n");
1269 else if (fProcessValue[i] == 0) {
1270 fprintf(pAliceInp,"*\n*Multiple scattering is set OFF\n");
1271 fprintf(pAliceInp,"*Generated from call: SetProcess('MULS',0);\n");
1273 // three = multiple scattering for hadrons and muons is completely suppressed
1274 // three = multiple scattering for e+ and e- is completely suppressed
1275 // matMin = lower bound of the material indices in which the respective thresholds apply
1276 // matMax = upper bound of the material indices in which the respective thresholds apply
1277 fprintf(pAliceInp,"MULSOPT %10.1f%10.1f%10.1f%10.1f%10.1f\n",zero,three,three,matMin,matMax);
1280 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('MULS',?) call.\n");
1281 fprintf(pAliceInp,"*No FLUKA card generated\n");
1283 } // end of else if (strncmp(&fProcessFlag[i][0],"MULS",4) == 0)
1286 // muon nuclear interaction
1287 // G3 default value: 0
1288 // G4 processes: G4MuNuclearInteraction,
1289 // G4MuonMinusCaptureAtRest
1293 // flag = 0 no muon-nuclear interaction
1294 // flag = 1 nuclear interaction, secondaries processed
1295 // flag = 2 nuclear interaction, secondaries not processed
1296 // gMC ->SetProcess("MUNU",1); // MUPHOTON 1. 0. 0. 3. lastmat
1297 else if (strncmp(&fProcessFlag[i][0],"MUNU",4) == 0) {
1298 if (fProcessValue[i] == 1) {
1299 fprintf(pAliceInp,"*\n*Muon nuclear interactions with production of secondary hadrons\n");
1300 fprintf(pAliceInp,"*\n*Generated from call: SetProcess('MUNU',1);\n");
1301 // one = full simulation of muon nuclear interactions and production of secondary hadrons
1302 // zero = ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1303 // zero = fraction of rho-like interactions ( must be < 1) - Default = 0.75.
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,"MUPHOTON %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
1308 else if (fProcessValue[i] == 2) {
1309 fprintf(pAliceInp,"*\n*Muon nuclear interactions without production of secondary hadrons\n");
1310 fprintf(pAliceInp,"*Generated from call: SetProcess('MUNU',2);\n");
1311 // two = full simulation of muon nuclear interactions and production of secondary hadrons
1312 // zero = ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1313 // zero = fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1314 // matMin = lower bound of the material indices in which the respective thresholds apply
1315 // matMax = upper bound of the material indices in which the respective thresholds apply
1316 fprintf(pAliceInp,"MUPHOTON %10.1f%10.1f%10.1f%10.1f%10.1f\n",two,zero,zero,matMin,matMax);
1318 else if (fProcessValue[i] == 0) {
1319 fprintf(pAliceInp,"*\n*No muon nuclear interaction - no FLUKA card generated\n");
1320 fprintf(pAliceInp,"*Generated from call: SetProcess('MUNU',0)\n");
1323 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('MUNU',?) call.\n");
1324 fprintf(pAliceInp,"*No FLUKA card generated\n");
1326 } // end of else if (strncmp(&fProcessFlag[i][0],"MUNU",4) == 0)
1330 // G3 default value: 0
1335 // gMC ->SetProcess("PFIS",0); // PHOTONUC -1. 0. 0. 3. lastmat 0.
1336 // flag = 0 no photon fission
1337 // flag = 1 photon fission, secondaries processed
1338 // flag = 2 photon fission, no secondaries stored
1339 else if (strncmp(&fProcessFlag[i][0],"PFIS",4) == 0) {
1340 if (fProcessValue[i] == 0) {
1341 fprintf(pAliceInp,"*\n*No photonuclear interactions\n");
1342 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',0);\n");
1343 // - one = no photonuclear interactions
1346 // matMin = lower bound of the material indices in which the respective thresholds apply
1347 // matMax = upper bound of the material indices in which the respective thresholds apply
1348 fprintf(pAliceInp,"PHOTONUC %10.1f%10.1f%10.1f%10.1f%10.1f\n",-one,zero,zero,matMin,matMax);
1350 else if (fProcessValue[i] == 1) {
1351 fprintf(pAliceInp,"*\n*Photon nuclear interactions are activated at all energies\n");
1352 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',1);\n");
1353 // one = photonuclear interactions are activated at all energies
1356 // matMin = lower bound of the material indices in which the respective thresholds apply
1357 // matMax = upper bound of the material indices in which the respective thresholds apply
1358 fprintf(pAliceInp,"PHOTONUC %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,zero,zero,matMin,matMax);
1360 else if (fProcessValue[i] == 0) {
1361 fprintf(pAliceInp,"*\n*No photofission - no FLUKA card generated\n");
1362 fprintf(pAliceInp,"*Generated from call: SetProcess('PFIS',0)\n");
1365 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('PFIS',?) call.\n");
1366 fprintf(pAliceInp,"*No FLUKA card generated\n");
1371 // photo electric effect
1372 // G3 default value: 1
1373 // G4 processes: G4PhotoElectricEffect
1374 // G4LowEnergyPhotoElectric
1377 // flag = 0 no photo electric effect
1378 // flag = 1 photo electric effect, electron processed
1379 // flag = 2 photo electric effect, no electron stored
1380 // gMC ->SetProcess("PHOT",1); // EMFCUT 0. -1. 0. 3. lastmat 0. PHOT-THR
1381 else if (strncmp(&fProcessFlag[i][0],"PHOT",4) == 0) {
1382 if (fProcessValue[i] == 1 || fProcessValue[i] == 2) {
1383 fprintf(pAliceInp,"*\n*Photo electric effect is activated\n");
1384 fprintf(pAliceInp,"*Generated from call: SetProcess('PHOT',1);\n");
1386 // - one = resets to default=0.
1388 // matMin = lower bound of the material indices in which the respective thresholds apply
1389 // matMax = upper bound of the material indices in which the respective thresholds apply
1390 // one = step length in assigning indices
1392 fprintf(pAliceInp,"EMFCUT %10.1f%10.1f%10.1f%10.1f%10.1f%10.1fPHOT-THR\n",zero,-one,zero,matMin,matMax,one);
1394 else if (fProcessValue[i] == 0) {
1395 fprintf(pAliceInp,"*\n*No photo electric effect - no FLUKA card generated\n");
1396 fprintf(pAliceInp,"*Generated from call: SetProcess('PHOT',0)\n");
1399 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('PHOT',?) call.\n");
1400 fprintf(pAliceInp,"*No FLUKA card generated\n");
1402 } // else if (strncmp(&fProcessFlag[i][0],"PHOT",4) == 0)
1405 // Rayleigh scattering
1406 // G3 default value: 0
1407 // G4 process: G4OpRayleigh
1409 // Particles: optical photon
1411 // flag = 0 Rayleigh scattering off
1412 // flag = 1 Rayleigh scattering on
1413 //xx gMC ->SetProcess("RAYL",1);
1414 else if (strncmp(&fProcessFlag[i][0],"RAYL",4) == 0) {
1415 if (fProcessValue[i] == 1) {
1416 fprintf(pAliceInp,"*\n*Rayleigh scattering is ON by default in FLUKA\n");
1417 fprintf(pAliceInp,"*No FLUKA card generated\n");
1419 else if (fProcessValue[i] == 0) {
1420 fprintf(pAliceInp,"*\n*Rayleigh scattering is set OFF\n");
1421 fprintf(pAliceInp,"*Generated from call: SetProcess('RAYL',0);\n");
1422 // - one = no Rayleigh scattering and no binding corrections for Compton
1423 // matMin = lower bound of the material indices in which the respective thresholds apply
1424 // matMax = upper bound of the material indices in which the respective thresholds apply
1425 fprintf(pAliceInp,"EMFRAY %10.1f%10.1f%10.1f%10.1f\n",-one,three,matMin,matMax);
1428 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('RAYL',?) call.\n");
1429 fprintf(pAliceInp,"*No FLUKA card generated\n");
1431 } // end of else if (strncmp(&fProcessFlag[i][0],"RAYL",4) == 0)
1434 // synchrotron radiation in magnetic field
1435 // G3 default value: 0
1436 // G4 process: G4SynchrotronRadiation
1440 // flag = 0 no synchrotron radiation
1441 // flag = 1 synchrotron radiation
1442 //xx gMC ->SetProcess("SYNC",1); // synchrotron radiation generation
1443 else if (strncmp(&fProcessFlag[i][0],"SYNC",4) == 0) {
1444 fprintf(pAliceInp,"*\n*Synchrotron radiation generation is NOT implemented in FLUKA\n");
1445 fprintf(pAliceInp,"*No FLUKA card generated\n");
1449 // Automatic calculation of tracking medium parameters
1450 // flag = 0 no automatic calculation
1451 // flag = 1 automatic calculation
1452 //xx gMC ->SetProcess("AUTO",1); // ??? automatic computation of the tracking medium parameters
1453 else if (strncmp(&fProcessFlag[i][0],"AUTO",4) == 0) {
1454 fprintf(pAliceInp,"*\n*Automatic calculation of tracking medium parameters is always ON in FLUKA\n");
1455 fprintf(pAliceInp,"*No FLUKA card generated\n");
1459 // To control energy loss fluctuation model
1460 // flag = 0 Urban model
1461 // flag = 1 PAI model
1462 // flag = 2 PAI+ASHO model (not active at the moment)
1463 //xx gMC ->SetProcess("STRA",1); // ??? energy fluctuation model
1464 else if (strncmp(&fProcessFlag[i][0],"STRA",4) == 0) {
1465 if (fProcessValue[i] == 0 || fProcessValue[i] == 2 || fProcessValue[i] == 3) {
1466 fprintf(pAliceInp,"*\n*Ionization energy losses calculation is activated\n");
1467 fprintf(pAliceInp,"*Generated from call: SetProcess('STRA',n);, n=0,1,2\n");
1468 // one = restricted energy loss fluctuations (for hadrons and muons) switched on
1469 // one = restricted energy loss fluctuations (for e+ and e-) switched on
1470 // one = minimal accuracy
1471 // matMin = lower bound of the material indices in which the respective thresholds apply
1472 // matMax = upper bound of the material indices in which the respective thresholds apply
1473 fprintf(pAliceInp,"IONFLUCT %10.1f%10.1f%10.1f%10.1f%10.1f\n",one,one,one,matMin,matMax);
1476 fprintf(pAliceInp,"*\n*Illegal flag value in SetProcess('STRA',?) call.\n");
1477 fprintf(pAliceInp,"*No FLUKA card generated\n");
1479 } // else if (strncmp(&fProcessFlag[i][0],"STRA",4) == 0)
1484 else { // processes not yet treated
1486 // light photon absorption (Cerenkov photons)
1487 // it is turned on when Cerenkov process is turned on
1488 // G3 default value: 0
1489 // G4 process: G4OpAbsorption, G4OpBoundaryProcess
1491 // Particles: optical photon
1493 // flag = 0 no absorption of Cerenkov photons
1494 // flag = 1 absorption of Cerenkov photons
1495 // gMC ->SetProcess("LABS",2); // ??? Cerenkov light absorption
1499 cout << "SetProcess for flag=" << &fProcessFlag[i][0] << " value=" << fProcessValue[i] << " not yet implemented!" << endl;
1501 } //end of loop number of SetProcess calls
1504 // Loop over number of SetCut calls
1505 for (Int_t i = 0; i < fNbOfCut; i++) {
1506 Float_t matMin = three;
1507 Float_t matMax = fLastMaterial;
1508 Bool_t global = kTRUE;
1509 if (fCutMaterial[i] != -1) {
1510 matMin = Float_t(fCutMaterial[i]);
1515 // cuts handled in SetProcess calls
1516 if (strncmp(&fCutFlag[i][0],"BCUTM",5) == 0) continue;
1517 else if (strncmp(&fCutFlag[i][0],"BCUTE",5) == 0) continue;
1518 else if (strncmp(&fCutFlag[i][0],"DCUTM",5) == 0) continue;
1519 else if (strncmp(&fCutFlag[i][0],"PPCUTM",6) == 0) continue;
1521 // delta-rays by electrons
1522 // G4 particles: "e-"
1523 // G3 default value: 10**4 GeV
1524 // gMC ->SetCut("DCUTE",cut); // cut for deltarays by electrons
1525 else if (strncmp(&fCutFlag[i][0],"DCUTE",5) == 0) {
1526 fprintf(pAliceInp,"*\n*Cut for delta rays by electrons\n");
1527 fprintf(pAliceInp,"*Generated from call: SetCut('DCUTE',cut);\n");
1531 // matMin = lower bound of the material indices in which the respective thresholds apply
1532 // matMax = upper bound of the material indices in which the respective thresholds apply
1533 // loop over materials for EMFCUT FLUKA cards
1534 for (j=0; j < matMax-matMin+1; j++) {
1535 Int_t nreg, imat, *reglist;
1537 imat = (Int_t) matMin + j;
1538 reglist = fGeom->GetMaterialList(imat, nreg);
1539 // loop over regions of a given material
1540 for (k=0; k<nreg; k++) {
1542 fprintf(pAliceInp,"EMFCUT %10.4g%10.1f%10.1f%10.1f%10.1f\n",-fCutValue[i],zero,zero,ireg,ireg);
1545 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);
1546 fprintf(pAliceInp,"STEPSIZE %10.4g%10.3f%10.3f%10.1f%10.1f\n", 0.1, 1.0, 1.00,
1547 Float_t(gGeoManager->GetListOfUVolumes()->GetEntriesFast()-1), 1.0);
1548 } // end of if for delta-rays by electrons
1552 // G4 particles: "gamma"
1553 // G3 default value: 0.001 GeV
1554 // gMC ->SetCut("CUTGAM",cut); // cut for gammas
1556 else if (strncmp(&fCutFlag[i][0],"CUTGAM",6) == 0 && global) {
1557 fprintf(pAliceInp,"*\n*Cut for gamma\n");
1558 fprintf(pAliceInp,"*Generated from call: SetCut('CUTGAM',cut);\n");
1560 // 7.0 = lower bound of the particle id-numbers to which the cut-off
1561 fprintf(pAliceInp,"PART-THR %10.4g%10.1f\n",-fCutValue[i],7.0);
1563 else if (strncmp(&fCutFlag[i][0],"CUTGAM",6) == 0 && !global) {
1564 fprintf(pAliceInp,"*\n*Cut specific to material for gamma\n");
1565 fprintf(pAliceInp,"*Generated from call: SetCut('CUTGAM',cut);\n");
1567 // loop over materials for EMFCUT FLUKA cards
1568 for (j=0; j < matMax-matMin+1; j++) {
1569 Int_t nreg, imat, *reglist;
1571 imat = (Int_t) matMin + j;
1572 reglist = fGeom->GetMaterialList(imat, nreg);
1573 // loop over regions of a given material
1574 for (Int_t k=0; k<nreg; k++) {
1576 fprintf(pAliceInp,"EMFCUT %10.4g%10.4g%10.1f%10.1f%10.1f%10.1f\n", zero, fCutValue[i], zero, ireg, ireg, one);
1579 } // end of else if for gamma
1583 // G4 particles: "e-"
1585 // G3 default value: 0.001 GeV
1586 //gMC ->SetCut("CUTELE",cut); // cut for e+,e-
1587 else if (strncmp(&fCutFlag[i][0],"CUTELE",6) == 0 && global) {
1588 fprintf(pAliceInp,"*\n*Cut for electrons\n");
1589 fprintf(pAliceInp,"*Generated from call: SetCut('CUTELE',cut);\n");
1591 // three = lower bound of the particle id-numbers to which the cut-off
1592 // 4.0 = upper bound of the particle id-numbers to which the cut-off
1593 // one = step length in assigning numbers
1594 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],three,4.0,one);
1596 else if (strncmp(&fCutFlag[i][0],"CUTELE",6) == 0 && !global) {
1597 fprintf(pAliceInp,"*\n*Cut specific to material for electrons\n");
1598 fprintf(pAliceInp,"*Generated from call: SetCut('CUTELE',cut);\n");
1600 // loop over materials for EMFCUT FLUKA cards
1601 for (j=0; j < matMax-matMin+1; j++) {
1602 Int_t nreg, imat, *reglist;
1604 imat = (Int_t) matMin + j;
1605 reglist = fGeom->GetMaterialList(imat, nreg);
1606 // loop over regions of a given material
1607 for (k=0; k<nreg; k++) {
1609 fprintf(pAliceInp,"EMFCUT %10.4g%10.4g%10.1f%10.1f%10.1f%10.1f\n", -fCutValue[i], zero, zero, ireg, ireg, one);
1612 } // end of else if for electrons
1616 // G4 particles: of type "baryon", "meson", "nucleus" with zero charge
1617 // G3 default value: 0.01 GeV
1618 //gMC ->SetCut("CUTNEU",cut); // cut for neutral hadrons
1619 else if (strncmp(&fCutFlag[i][0],"CUTNEU",6) == 0 && global) {
1620 fprintf(pAliceInp,"*\n*Cut for neutral hadrons\n");
1621 fprintf(pAliceInp,"*Generated from call: SetCut('CUTNEU',cut);\n");
1624 // 9.0 = Antineutron
1625 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],8.0,9.0);
1627 // 12.0 = Kaon zero long
1628 // 12.0 = Kaon zero long
1629 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],12.0,12.0);
1631 // 17.0 = Lambda, 18.0 = Antilambda
1632 // 19.0 = Kaon zero short
1633 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],17.0,19.0);
1635 // 22.0 = Sigma zero, Pion zero, Kaon zero
1636 // 25.0 = Antikaon zero
1637 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],22.0,25.0);
1639 // 32.0 = Antisigma zero
1640 // 32.0 = Antisigma zero
1641 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],32.0,32.0);
1644 // 35.0 = AntiXi zero
1645 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],34.0,35.0);
1648 // 48.0 = AntiD zero
1649 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],47.0,48.0);
1653 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],53.0,53.0);
1655 // 55.0 = Xi'_c zero
1656 // 56.0 = Omega_c zero
1657 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],55.0,56.0);
1659 // 59.0 = AntiXi_c zero
1660 // 59.0 = AntiXi_c zero
1661 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],59.0,59.0);
1663 // 61.0 = AntiXi'_c zero
1664 // 62.0 = AntiOmega_c zero
1665 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],61.0,62.0);
1669 // G4 particles: of type "baryon", "meson", "nucleus" with non-zero charge
1670 // G3 default value: 0.01 GeV
1671 //gMC ->SetCut("CUTHAD",cut); // cut for charged hadrons
1672 else if (strncmp(&fCutFlag[i][0],"CUTHAD",6) == 0 && global) {
1673 fprintf(pAliceInp,"*\n*Cut for charged hadrons\n");
1674 fprintf(pAliceInp,"*Generated from call: SetCut('CUTHAD',cut);\n");
1678 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],1.0,2.0);
1680 // 13.0 = Positive Pion, Negative Pion, Positive Kaon
1681 // 16.0 = Negative Kaon
1682 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],13.0,16.0);
1684 // 20.0 = Negative Sigma
1685 // 21.0 = Positive Sigma
1686 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],20.0,21.0);
1688 // 31.0 = Antisigma minus
1689 // 33.0 = Antisigma plus
1690 // 2.0 = step length
1691 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],31.0,33.0,2.0);
1693 // 36.0 = Negative Xi, Positive Xi, Omega minus
1695 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],36.0,39.0);
1699 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],45.0,46.0);
1701 // 49.0 = D_s plus, D_s minus, Lambda_c plus
1703 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],49.0,52.0);
1705 // 54.0 = Xi'_c plus
1706 // 60.0 = AntiXi'_c minus
1707 // 6.0 = step length
1708 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f%10.1f\n",-fCutValue[i],54.0,60.0,6.0);
1710 // 57.0 = Antilambda_c minus
1711 // 58.0 = AntiXi_c minus
1712 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],57.0,58.0);
1716 // G4 particles: "mu+", "mu-"
1717 // G3 default value: 0.01 GeV
1718 //gMC ->SetCut("CUTMUO",cut); // cut for mu+, mu-
1719 else if (strncmp(&fCutFlag[i][0],"CUTMUO",6)== 0 && global) {
1720 fprintf(pAliceInp,"*\n*Cut for muons\n");
1721 fprintf(pAliceInp,"*Generated from call: SetCut('CUTMUO',cut);\n");
1724 fprintf(pAliceInp,"PART-THR %10.4g%10.1f%10.1f\n",-fCutValue[i],10.0,11.0);
1728 // time of flight cut in seconds
1729 // G4 particles: all
1730 // G3 default value: 0.01 GeV
1731 //gMC ->SetCut("TOFMAX",tofmax); // time of flight cuts in seconds
1732 else if (strncmp(&fCutFlag[i][0],"TOFMAX",6) == 0) {
1733 fprintf(pAliceInp,"*\n*Time of flight cuts in seconds\n");
1734 fprintf(pAliceInp,"*Generated from call: SetCut('TOFMAX',tofmax);\n");
1737 // -6.0 = lower bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1738 // 64.0 = upper bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1739 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);
1743 cout << "SetCut for flag=" << &fCutFlag[i][0] << " value=" << fCutValue[i] << " not yet implemented!" << endl;
1746 cout << "SetCut for flag=" << &fCutFlag[i][0] << " value=" << fCutValue[i] << " (material specific) not yet implemented!" << endl;
1749 } //end of loop over SetCut calls
1751 // Add START and STOP card
1752 fprintf(pAliceInp,"START %10.1f\n",fEventsPerRun);
1753 fprintf(pAliceInp,"STOP \n");
1758 fclose(pAliceCoreInp);
1759 fclose(pAliceFlukaMat);
1762 } // end of InitPhysics
1765 //______________________________________________________________________________
1766 void TFluka::SetMaxStep(Double_t)
1768 // SetMaxStep is dummy procedure in TFluka !
1769 if (fVerbosityLevel >=3)
1770 cout << "SetMaxStep is dummy procedure in TFluka !" << endl;
1773 //______________________________________________________________________________
1774 void TFluka::SetMaxNStep(Int_t)
1776 // SetMaxNStep is dummy procedure in TFluka !
1777 if (fVerbosityLevel >=3)
1778 cout << "SetMaxNStep is dummy procedure in TFluka !" << endl;
1781 //______________________________________________________________________________
1782 void TFluka::SetUserDecay(Int_t)
1784 // SetUserDecay is dummy procedure in TFluka !
1785 if (fVerbosityLevel >=3)
1786 cout << "SetUserDecay is dummy procedure in TFluka !" << endl;
1790 // dynamic properties
1792 //______________________________________________________________________________
1793 void TFluka::TrackPosition(TLorentzVector& position) const
1795 // Return the current position in the master reference frame of the
1796 // track being transported
1797 // TRACKR.atrack = age of the particle
1798 // TRACKR.xtrack = x-position of the last point
1799 // TRACKR.ytrack = y-position of the last point
1800 // TRACKR.ztrack = z-position of the last point
1801 Int_t caller = GetCaller();
1802 if (caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
1803 position.SetX(GetXsco());
1804 position.SetY(GetYsco());
1805 position.SetZ(GetZsco());
1806 position.SetT(TRACKR.atrack);
1808 else if (caller == 4) { // mgdraw
1809 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1810 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1811 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1812 position.SetT(TRACKR.atrack);
1814 else if (caller == 5) { // sodraw
1815 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1816 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1817 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1821 Warning("TrackPosition","position not available");
1824 //______________________________________________________________________________
1825 void TFluka::TrackPosition(Double_t& x, Double_t& y, Double_t& z) const
1827 // Return the current position in the master reference frame of the
1828 // track being transported
1829 // TRACKR.atrack = age of the particle
1830 // TRACKR.xtrack = x-position of the last point
1831 // TRACKR.ytrack = y-position of the last point
1832 // TRACKR.ztrack = z-position of the last point
1833 Int_t caller = GetCaller();
1834 if (caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
1839 else if (caller == 4 || caller == 5) { // mgdraw, sodraw
1840 x = TRACKR.xtrack[TRACKR.ntrack];
1841 y = TRACKR.ytrack[TRACKR.ntrack];
1842 z = TRACKR.ztrack[TRACKR.ntrack];
1845 Warning("TrackPosition","position not available");
1848 //______________________________________________________________________________
1849 void TFluka::TrackMomentum(TLorentzVector& momentum) const
1851 // Return the direction and the momentum (GeV/c) of the track
1852 // currently being transported
1853 // TRACKR.ptrack = momentum of the particle (not always defined, if
1854 // < 0 must be obtained from etrack)
1855 // TRACKR.cx,y,ztrck = direction cosines of the current particle
1856 // TRACKR.etrack = total energy of the particle
1857 // TRACKR.jtrack = identity number of the particle
1858 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
1859 Int_t caller = GetCaller();
1860 if (caller != 2) { // not eedraw
1861 if (TRACKR.ptrack >= 0) {
1862 momentum.SetPx(TRACKR.ptrack*TRACKR.cxtrck);
1863 momentum.SetPy(TRACKR.ptrack*TRACKR.cytrck);
1864 momentum.SetPz(TRACKR.ptrack*TRACKR.cztrck);
1865 momentum.SetE(TRACKR.etrack);
1869 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
1870 momentum.SetPx(p*TRACKR.cxtrck);
1871 momentum.SetPy(p*TRACKR.cytrck);
1872 momentum.SetPz(p*TRACKR.cztrck);
1873 momentum.SetE(TRACKR.etrack);
1878 Warning("TrackMomentum","momentum not available");
1881 //______________________________________________________________________________
1882 void TFluka::TrackMomentum(Double_t& px, Double_t& py, Double_t& pz, Double_t& e) const
1884 // Return the direction and the momentum (GeV/c) of the track
1885 // currently being transported
1886 // TRACKR.ptrack = momentum of the particle (not always defined, if
1887 // < 0 must be obtained from etrack)
1888 // TRACKR.cx,y,ztrck = direction cosines of the current particle
1889 // TRACKR.etrack = total energy of the particle
1890 // TRACKR.jtrack = identity number of the particle
1891 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
1892 Int_t caller = GetCaller();
1893 if (caller != 2) { // not eedraw
1894 if (TRACKR.ptrack >= 0) {
1895 px = TRACKR.ptrack*TRACKR.cxtrck;
1896 py = TRACKR.ptrack*TRACKR.cytrck;
1897 pz = TRACKR.ptrack*TRACKR.cztrck;
1902 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
1903 px = p*TRACKR.cxtrck;
1904 py = p*TRACKR.cytrck;
1905 pz = p*TRACKR.cztrck;
1911 Warning("TrackMomentum","momentum not available");
1914 //______________________________________________________________________________
1915 Double_t TFluka::TrackStep() const
1917 // Return the length in centimeters of the current step
1918 // TRACKR.ctrack = total curved path
1919 Int_t caller = GetCaller();
1920 if (caller == 11 || caller==12 || caller == 3 || caller == 6) //bxdraw,endraw,usdraw
1922 else if (caller == 4) //mgdraw
1923 return TRACKR.ctrack;
1928 //______________________________________________________________________________
1929 Double_t TFluka::TrackLength() const
1931 // TRACKR.cmtrck = cumulative curved path since particle birth
1932 Int_t caller = GetCaller();
1933 if (caller == 11 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
1934 return TRACKR.cmtrck;
1939 //______________________________________________________________________________
1940 Double_t TFluka::TrackTime() const
1942 // Return the current time of flight of the track being transported
1943 // TRACKR.atrack = age of the particle
1944 Int_t caller = GetCaller();
1945 if (caller == 11 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
1946 return TRACKR.atrack;
1951 //______________________________________________________________________________
1952 Double_t TFluka::Edep() const
1954 // Energy deposition
1955 // if TRACKR.ntrack = 0, TRACKR.mtrack = 0:
1956 // -->local energy deposition (the value and the point are not recorded in TRACKR)
1957 // but in the variable "rull" of the procedure "endraw.cxx"
1958 // if TRACKR.ntrack > 0, TRACKR.mtrack = 0:
1959 // -->no energy loss along the track
1960 // if TRACKR.ntrack > 0, TRACKR.mtrack > 0:
1961 // -->energy loss distributed along the track
1962 // TRACKR.dtrack = energy deposition of the jth deposition even
1964 // If coming from bxdraw we have 2 steps of 0 length and 0 edep
1965 Int_t caller = GetCaller();
1966 if (caller == 11 || caller==12) return 0.0;
1968 for ( Int_t j=0;j<TRACKR.mtrack;j++) {
1969 sum +=TRACKR.dtrack[j];
1971 if (TRACKR.ntrack == 0 && TRACKR.mtrack == 0)
1978 //______________________________________________________________________________
1979 Int_t TFluka::TrackPid() const
1981 // Return the id of the particle transported
1982 // TRACKR.jtrack = identity number of the particle
1983 Int_t caller = GetCaller();
1984 if (caller != 2) // not eedraw
1985 return PDGFromId(TRACKR.jtrack);
1990 //______________________________________________________________________________
1991 Double_t TFluka::TrackCharge() const
1993 // Return charge of the track currently transported
1994 // PAPROP.ichrge = electric charge of the particle
1995 // TRACKR.jtrack = identity number of the particle
1996 Int_t caller = GetCaller();
1997 if (caller != 2) // not eedraw
1998 return PAPROP.ichrge[TRACKR.jtrack+6];
2003 //______________________________________________________________________________
2004 Double_t TFluka::TrackMass() const
2006 // PAPROP.am = particle mass in GeV
2007 // TRACKR.jtrack = identity number of the particle
2008 Int_t caller = GetCaller();
2009 if (caller != 2) // not eedraw
2010 return PAPROP.am[TRACKR.jtrack+6];
2015 //______________________________________________________________________________
2016 Double_t TFluka::Etot() const
2018 // TRACKR.etrack = total energy of the particle
2019 Int_t caller = GetCaller();
2020 if (caller != 2) // not eedraw
2021 return TRACKR.etrack;
2029 //______________________________________________________________________________
2030 Bool_t TFluka::IsNewTrack() const
2032 // Return true for the first call of Stepping()
2036 //______________________________________________________________________________
2037 Bool_t TFluka::IsTrackInside() const
2039 // True if the track is not at the boundary of the current volume
2040 // In Fluka a step is always inside one kind of material
2041 // If the step would go behind the region of one material,
2042 // it will be shortened to reach only the boundary.
2043 // Therefore IsTrackInside() is always true.
2044 Int_t caller = GetCaller();
2045 if (caller == 11 || caller==12) // bxdraw
2051 //______________________________________________________________________________
2052 Bool_t TFluka::IsTrackEntering() const
2054 // True if this is the first step of the track in the current volume
2056 Int_t caller = GetCaller();
2057 if (caller == 11) // bxdraw entering
2062 //______________________________________________________________________________
2063 Bool_t TFluka::IsTrackExiting() const
2065 // True if track is exiting volume
2067 Int_t caller = GetCaller();
2068 if (caller == 12) // bxdraw exiting
2073 //______________________________________________________________________________
2074 Bool_t TFluka::IsTrackOut() const
2076 // True if the track is out of the setup
2078 // Icode = 14: escape - call from Kaskad
2079 // Icode = 23: escape - call from Emfsco
2080 // Icode = 32: escape - call from Kasneu
2081 // Icode = 40: escape - call from Kashea
2082 // Icode = 51: escape - call from Kasoph
2087 fIcode == 51) return 1;
2091 //______________________________________________________________________________
2092 Bool_t TFluka::IsTrackDisappeared() const
2094 // means all inelastic interactions and decays
2095 // fIcode from usdraw
2096 if (fIcode == 101 || // inelastic interaction
2097 fIcode == 102 || // particle decay
2098 fIcode == 214 || // in-flight annihilation
2099 fIcode == 215 || // annihilation at rest
2100 fIcode == 217 || // pair production
2101 fIcode == 221) return 1;
2105 //______________________________________________________________________________
2106 Bool_t TFluka::IsTrackStop() const
2108 // True if the track energy has fallen below the threshold
2109 // means stopped by signal or below energy threshold
2110 // Icode = 12: stopping particle - call from Kaskad
2111 // Icode = 15: time kill - call from Kaskad
2112 // Icode = 21: below threshold, iarg=1 - call from Emfsco
2113 // Icode = 22: below threshold, iarg=2 - call from Emfsco
2114 // Icode = 24: time kill - call from Emfsco
2115 // Icode = 31: below threshold - call from Kasneu
2116 // Icode = 33: time kill - call from Kasneu
2117 // Icode = 41: time kill - call from Kashea
2118 // Icode = 52: time kill - call from Kasoph
2127 fIcode == 52) return 1;
2131 //______________________________________________________________________________
2132 Bool_t TFluka::IsTrackAlive() const
2134 // means not disappeared or not out
2135 if (IsTrackDisappeared() || IsTrackOut() ) return 0;
2143 //______________________________________________________________________________
2144 Int_t TFluka::NSecondaries() const
2147 // Number of secondary particles generated in the current step
2148 // FINUC.np = number of secondaries except light and heavy ions
2149 // FHEAVY.npheav = number of secondaries for light and heavy secondary ions
2150 Int_t caller = GetCaller();
2151 if (caller == 6) // valid only after usdraw
2152 return FINUC.np + FHEAVY.npheav;
2155 } // end of NSecondaries
2157 //______________________________________________________________________________
2158 void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
2159 TLorentzVector& position, TLorentzVector& momentum)
2161 // Copy particles from secondary stack to vmc stack
2164 Int_t caller = GetCaller();
2165 if (caller == 6) { // valid only after usdraw
2166 if (isec >= 0 && isec < FINUC.np) {
2167 particleId = PDGFromId(FINUC.kpart[isec]);
2168 position.SetX(fXsco);
2169 position.SetY(fYsco);
2170 position.SetZ(fZsco);
2171 position.SetT(TRACKR.atrack);
2172 momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
2173 momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
2174 momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
2175 momentum.SetE(FINUC.tki[isec] + PAPROP.am[FINUC.kpart[isec]+6]);
2177 else if (isec >= FINUC.np && isec < FINUC.np + FHEAVY.npheav) {
2178 Int_t jsec = isec - FINUC.np;
2179 particleId = FHEAVY.kheavy[jsec]; // this is Fluka id !!!
2180 position.SetX(fXsco);
2181 position.SetY(fYsco);
2182 position.SetZ(fZsco);
2183 position.SetT(TRACKR.atrack);
2184 momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
2185 momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
2186 momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
2187 if (FHEAVY.tkheav[jsec] >= 3 && FHEAVY.tkheav[jsec] <= 6)
2188 momentum.SetE(FHEAVY.tkheav[jsec] + PAPROP.am[jsec+6]);
2189 else if (FHEAVY.tkheav[jsec] > 6)
2190 momentum.SetE(FHEAVY.tkheav[jsec] + FHEAVY.amnhea[jsec]); // to be checked !!!
2193 Warning("GetSecondary","isec out of range");
2196 Warning("GetSecondary","no secondaries available");
2197 } // end of GetSecondary
2199 //______________________________________________________________________________
2200 TMCProcess TFluka::ProdProcess(Int_t) const
2203 // Name of the process that has produced the secondary particles
2204 // in the current step
2205 const TMCProcess kIpNoProc = kPNoProcess;
2206 const TMCProcess kIpPDecay = kPDecay;
2207 const TMCProcess kIpPPair = kPPair;
2208 // const TMCProcess kIpPPairFromPhoton = kPPairFromPhoton;
2209 // const TMCProcess kIpPPairFromVirtualPhoton = kPPairFromVirtualPhoton;
2210 const TMCProcess kIpPCompton = kPCompton;
2211 const TMCProcess kIpPPhotoelectric = kPPhotoelectric;
2212 const TMCProcess kIpPBrem = kPBrem;
2213 // const TMCProcess kIpPBremFromHeavy = kPBremFromHeavy;
2214 // const TMCProcess kIpPBremFromElectronOrPositron = kPBremFromElectronOrPositron;
2215 const TMCProcess kIpPDeltaRay = kPDeltaRay;
2216 // const TMCProcess kIpPMoller = kPMoller;
2217 // const TMCProcess kIpPBhabha = kPBhabha;
2218 const TMCProcess kIpPAnnihilation = kPAnnihilation;
2219 // const TMCProcess kIpPAnnihilInFlight = kPAnnihilInFlight;
2220 // const TMCProcess kIpPAnnihilAtRest = kPAnnihilAtRest;
2221 const TMCProcess kIpPHadronic = kPHadronic;
2222 const TMCProcess kIpPMuonNuclear = kPMuonNuclear;
2223 const TMCProcess kIpPPhotoFission = kPPhotoFission;
2224 const TMCProcess kIpPRayleigh = kPRayleigh;
2225 // const TMCProcess kIpPCerenkov = kPCerenkov;
2226 // const TMCProcess kIpPSynchrotron = kPSynchrotron;
2228 Int_t mugamma = TRACKR.jtrack == 7 || TRACKR.jtrack == 10 || TRACKR.jtrack == 11;
2229 if (fIcode == 102) return kIpPDecay;
2230 else if (fIcode == 104 || fIcode == 217) return kIpPPair;
2231 // else if (fIcode == 104) return kIpPairFromPhoton;
2232 // else if (fIcode == 217) return kIpPPairFromVirtualPhoton;
2233 else if (fIcode == 219) return kIpPCompton;
2234 else if (fIcode == 221) return kIpPPhotoelectric;
2235 else if (fIcode == 105 || fIcode == 208) return kIpPBrem;
2236 // else if (fIcode == 105) return kIpPBremFromHeavy;
2237 // else if (fIcode == 208) return kPBremFromElectronOrPositron;
2238 else if (fIcode == 103 || fIcode == 400) return kIpPDeltaRay;
2239 else if (fIcode == 210 || fIcode == 212) return kIpPDeltaRay;
2240 // else if (fIcode == 210) return kIpPMoller;
2241 // else if (fIcode == 212) return kIpPBhabha;
2242 else if (fIcode == 214 || fIcode == 215) return kIpPAnnihilation;
2243 // else if (fIcode == 214) return kIpPAnnihilInFlight;
2244 // else if (fIcode == 215) return kIpPAnnihilAtRest;
2245 else if (fIcode == 101) return kIpPHadronic;
2246 else if (fIcode == 101) {
2247 if (!mugamma) return kIpPHadronic;
2248 else if (TRACKR.jtrack == 7) return kIpPPhotoFission;
2249 else return kIpPMuonNuclear;
2251 else if (fIcode == 225) return kIpPRayleigh;
2252 // Fluka codes 100, 300 and 400 still to be investigasted
2253 else return kIpNoProc;
2256 //Int_t StepProcesses(TArrayI &proc) const
2257 // Return processes active in the current step
2259 //ck = total energy of the particl ????????????????
2263 //______________________________________________________________________________
2264 Int_t TFluka::VolId2Mate(Int_t id) const
2267 // Returns the material number for a given volume ID
2269 return fGeom->VolId2Mate(id);
2272 //______________________________________________________________________________
2273 const char* TFluka::VolName(Int_t id) const
2276 // Returns the volume name for a given volume ID
2278 return fGeom->VolName(id);
2281 //______________________________________________________________________________
2282 Int_t TFluka::VolId(const Text_t* volName) const
2285 // Converts from volume name to volume ID.
2286 // Time consuming. (Only used during set-up)
2287 // Could be replaced by hash-table
2289 return fGeom->VolId(volName);
2292 //______________________________________________________________________________
2293 Int_t TFluka::CurrentVolID(Int_t& copyNo) const
2296 // Return the logical id and copy number corresponding to the current fluka region
2298 return fGeom->CurrentVolID(copyNo);
2301 //______________________________________________________________________________
2302 Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
2305 // Return the logical id and copy number of off'th mother
2306 // corresponding to the current fluka region
2308 return fGeom->CurrentVolOffID(off, copyNo);
2311 //______________________________________________________________________________
2312 const char* TFluka::CurrentVolName() const
2315 // Return the current volume name
2317 return fGeom->CurrentVolName();
2320 //______________________________________________________________________________
2321 const char* TFluka::CurrentVolOffName(Int_t off) const
2324 // Return the volume name of the off'th mother of the current volume
2326 return fGeom->CurrentVolOffName(off);
2329 //______________________________________________________________________________
2330 Int_t TFluka::CurrentMaterial(Float_t & /*a*/, Float_t & /*z*/,
2331 Float_t & /*dens*/, Float_t & /*radl*/, Float_t & /*absl*/) const
2334 // Return the current medium number ??? what about material properties
2337 Int_t id = TFluka::CurrentVolID(copy);
2338 Int_t med = TFluka::VolId2Mate(id);
2342 //______________________________________________________________________________
2343 void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
2345 // Transforms a position from the world reference frame
2346 // to the current volume reference frame.
2348 // Geant3 desription:
2349 // ==================
2350 // Computes coordinates XD (in DRS)
2351 // from known coordinates XM in MRS
2352 // The local reference system can be initialized by
2353 // - the tracking routines and GMTOD used in GUSTEP
2354 // - a call to GMEDIA(XM,NUMED)
2355 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2356 // (inverse routine is GDTOM)
2358 // If IFLAG=1 convert coordinates
2359 // IFLAG=2 convert direction cosinus
2362 fGeom->Gmtod(xm,xd,iflag);
2365 //______________________________________________________________________________
2366 void TFluka::Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
2368 // Transforms a position from the world reference frame
2369 // to the current volume reference frame.
2371 // Geant3 desription:
2372 // ==================
2373 // Computes coordinates XD (in DRS)
2374 // from known coordinates XM in MRS
2375 // The local reference system can be initialized by
2376 // - the tracking routines and GMTOD used in GUSTEP
2377 // - a call to GMEDIA(XM,NUMED)
2378 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2379 // (inverse routine is GDTOM)
2381 // If IFLAG=1 convert coordinates
2382 // IFLAG=2 convert direction cosinus
2385 fGeom->Gmtod(xm,xd,iflag);
2388 //______________________________________________________________________________
2389 void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
2391 // Transforms a position from the current volume reference frame
2392 // to the world reference frame.
2394 // Geant3 desription:
2395 // ==================
2396 // Computes coordinates XM (Master Reference System
2397 // knowing the coordinates XD (Detector Ref System)
2398 // The local reference system can be initialized by
2399 // - the tracking routines and GDTOM used in GUSTEP
2400 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2401 // (inverse routine is GMTOD)
2403 // If IFLAG=1 convert coordinates
2404 // IFLAG=2 convert direction cosinus
2407 fGeom->Gdtom(xd,xm,iflag);
2410 //______________________________________________________________________________
2411 void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
2413 // Transforms a position from the current volume reference frame
2414 // to the world reference frame.
2416 // Geant3 desription:
2417 // ==================
2418 // Computes coordinates XM (Master Reference System
2419 // knowing the coordinates XD (Detector Ref System)
2420 // The local reference system can be initialized by
2421 // - the tracking routines and GDTOM used in GUSTEP
2422 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2423 // (inverse routine is GMTOD)
2425 // If IFLAG=1 convert coordinates
2426 // IFLAG=2 convert direction cosinus
2429 fGeom->Gdtom(xd,xm,iflag);
2431 //______________________________________________________________________________
2432 void TFluka::SetMreg(Int_t l)
2434 // Set current fluka region
2435 fCurrentFlukaRegion = l;