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 **************************************************************************/
18 #include <Riostream.h>
20 #include "TClonesArray.h"
21 #include "TFlukaGeo.h"
22 #include "TCallf77.h" //For the fortran calls
23 #include "Fdblprc.h" //(DBLPRC) fluka common
24 #include "Fepisor.h" //(EPISOR) fluka common
25 #include "Ffinuc.h" //(FINUC) fluka common
26 #include "Fiounit.h" //(IOUNIT) fluka common
27 #include "Fpaprop.h" //(PAPROP) fluka common
28 #include "Fpart.h" //(PART) fluka common
29 #include "Ftrackr.h" //(TRACKR) fluka common
30 #include "Fpaprop.h" //(PAPROP) fluka common
31 #include "Ffheavy.h" //(FHEAVY) fluka common
33 #include "TVirtualMC.h"
34 #include "TGeoManager.h"
35 #include "TFlukaMCGeometry.h"
37 #include "TLorentzVector.h"
39 // Fluka methods that may be needed.
41 # define flukam flukam_
42 # define fluka_openinp fluka_openinp_
43 # define fluka_closeinp fluka_closeinp_
44 # define mcihad mcihad_
45 # define mpdgha mpdgha_
47 # define flukam FLUKAM
48 # define fluka_openinp FLUKA_OPENINP
49 # define fluka_closeinp FLUKA_CLOSEINP
50 # define mcihad MCIHAD
51 # define mpdgha MPDGHA
57 // Prototypes for FLUKA functions
59 void type_of_call flukam(const int&);
60 void type_of_call fluka_openinp(const int&, DEFCHARA);
61 void type_of_call fluka_closeinp(const int&);
62 int type_of_call mcihad(const int&);
63 int type_of_call mpdgha(const int&);
67 // Class implementation for ROOT
72 //----------------------------------------------------------------------------
73 // TFluka constructors and destructors.
74 //______________________________________________________________________________
81 // Default constructor
84 fCurrentFlukaRegion = -1;
88 //______________________________________________________________________________
89 TFluka::TFluka(const char *title, Int_t verbosity, Bool_t isRootGeometrySupported)
90 :TVirtualMC("TFluka",title, isRootGeometrySupported),
91 fVerbosityLevel(verbosity),
96 // create geometry interface
97 if (fVerbosityLevel >=3)
98 cout << "<== TFluka::TFluka(" << title << ") constructor called." << endl;
101 fCurrentFlukaRegion = -1;
102 fGeom = new TFlukaMCGeometry("geom", "ALICE geometry");
105 //______________________________________________________________________________
107 if (fVerbosityLevel >=3)
108 cout << "==> TFluka::~TFluka() destructor called." << endl;
112 if (fVerbosityLevel >=3)
113 cout << "<== TFluka::~TFluka() destructor called." << endl;
117 //______________________________________________________________________________
118 // TFluka control methods
119 //______________________________________________________________________________
120 void TFluka::Init() {
122 if (fVerbosityLevel >=3)
123 cout << "==> TFluka::Init() called." << endl;
125 if (!gGeoManager) new TGeoManager("geom", "FLUKA geometry");
126 fApplication->ConstructGeometry();
127 TGeoVolume *top = (TGeoVolume*)gGeoManager->GetListOfVolumes()->First();
128 gGeoManager->SetTopVolume(top);
129 gGeoManager->CloseGeometry("di");
130 gGeoManager->DefaultColors(); // to be removed
131 fNVolumes = fGeom->NofVolumes();
132 printf("== Number of volumes: %i\n ==", fNVolumes);
133 fGeom->CreateFlukaMatFile("flukaMat.inp");
134 cout << "\t* InitPhysics() - Prepare input file to be called" << endl;
135 // now we have TGeo geometry created and we have to patch alice.inp
136 // with the material mapping file FlukaMat.inp
137 InitPhysics(); // prepare input file with the current physics settings
138 cout << "\t* InitPhysics() - Prepare input file was called" << endl;
140 if (fVerbosityLevel >=2)
141 cout << "\t* Changing lfdrtr = (" << (GLOBAL.lfdrtr?'T':'F')
142 << ") in fluka..." << endl;
143 GLOBAL.lfdrtr = true;
145 if (fVerbosityLevel >=2)
146 cout << "\t* Opening file " << sInputFileName << endl;
147 const char* fname = sInputFileName;
148 fluka_openinp(lunin, PASSCHARA(fname));
150 if (fVerbosityLevel >=2)
151 cout << "\t* Calling flukam..." << endl;
154 if (fVerbosityLevel >=2)
155 cout << "\t* Closing file " << sInputFileName << endl;
156 fluka_closeinp(lunin);
160 if (fVerbosityLevel >=3)
161 cout << "<== TFluka::Init() called." << endl;
164 //______________________________________________________________________________
165 void TFluka::FinishGeometry() {
167 // Build-up table with region to medium correspondance
169 if (fVerbosityLevel >=3)
170 cout << "==> TFluka::FinishGeometry() called." << endl;
172 printf("----FinishGeometry - nothing to do with TGeo\n");
174 if (fVerbosityLevel >=3)
175 cout << "<== TFluka::FinishGeometry() called." << endl;
178 //______________________________________________________________________________
179 void TFluka::BuildPhysics() {
180 if (fVerbosityLevel >=3)
181 cout << "==> TFluka::BuildPhysics() called." << endl;
184 if (fVerbosityLevel >=3)
185 cout << "<== TFluka::BuildPhysics() called." << endl;
188 //______________________________________________________________________________
189 void TFluka::ProcessEvent() {
190 if (fVerbosityLevel >=3)
191 cout << "==> TFluka::ProcessEvent() called." << endl;
192 fApplication->GeneratePrimaries();
193 EPISOR.lsouit = true;
195 if (fVerbosityLevel >=3)
196 cout << "<== TFluka::ProcessEvent() called." << endl;
199 //______________________________________________________________________________
200 void TFluka::ProcessRun(Int_t nevent) {
201 if (fVerbosityLevel >=3)
202 cout << "==> TFluka::ProcessRun(" << nevent << ") called."
205 if (fVerbosityLevel >=2) {
206 cout << "\t* GLOBAL.fdrtr = " << (GLOBAL.lfdrtr?'T':'F') << endl;
207 cout << "\t* Calling flukam again..." << endl;
209 fApplication->InitGeometry();
210 fApplication->BeginEvent();
212 fApplication->FinishEvent();
213 if (fVerbosityLevel >=3)
214 cout << "<== TFluka::ProcessRun(" << nevent << ") called."
219 //_____________________________________________________________________________
220 // methods for building/management of geometry
222 // functions from GCONS
223 //____________________________________________________________________________
224 void TFluka::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
225 Float_t &dens, Float_t &radl, Float_t &absl,
226 Float_t* ubuf, Int_t& nbuf) {
228 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
231 //______________________________________________________________________________
232 void TFluka::Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
233 Double_t &dens, Double_t &radl, Double_t &absl,
234 Double_t* ubuf, Int_t& nbuf) {
236 fGeom->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
239 // detector composition
240 //______________________________________________________________________________
241 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
242 Double_t z, Double_t dens, Double_t radl, Double_t absl,
243 Float_t* buf, Int_t nwbuf) {
245 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
248 //______________________________________________________________________________
249 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
250 Double_t z, Double_t dens, Double_t radl, Double_t absl,
251 Double_t* buf, Int_t nwbuf) {
253 fGeom->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
256 //______________________________________________________________________________
257 void TFluka::Mixture(Int_t& kmat, const char *name, Float_t *a,
258 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat) {
260 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
263 //______________________________________________________________________________
264 void TFluka::Mixture(Int_t& kmat, const char *name, Double_t *a,
265 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat) {
267 fGeom->Mixture(kmat, name, a, z, dens, nlmat, wmat);
270 //______________________________________________________________________________
271 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
272 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
273 Double_t stemax, Double_t deemax, Double_t epsil,
274 Double_t stmin, Float_t* ubuf, Int_t nbuf) {
276 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
277 epsil, stmin, ubuf, nbuf);
280 //______________________________________________________________________________
281 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
282 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
283 Double_t stemax, Double_t deemax, Double_t epsil,
284 Double_t stmin, Double_t* ubuf, Int_t nbuf) {
286 fGeom->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
287 epsil, stmin, ubuf, nbuf);
290 //______________________________________________________________________________
291 void TFluka::Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
292 Double_t thetaY, Double_t phiY, Double_t thetaZ,
295 fGeom->Matrix(krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ);
298 //______________________________________________________________________________
299 void TFluka::Gstpar(Int_t /*itmed*/, const char */*param*/, Double_t /*parval*/) {
301 // Is it needed with TGeo ??? - to clear-up
302 Warning("Gstpar", "Not implemented with TGeo");
305 // functions from GGEOM
306 //_____________________________________________________________________________
307 void TFluka::Gsatt(const char *name, const char *att, Int_t val)
309 fGeom->Gsatt(name,att, val);
312 //______________________________________________________________________________
313 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
314 Float_t *upar, Int_t np) {
316 return fGeom->Gsvolu(name, shape, nmed, upar, np);
319 //______________________________________________________________________________
320 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
321 Double_t *upar, Int_t np) {
323 return fGeom->Gsvolu(name, shape, nmed, upar, np);
326 //______________________________________________________________________________
327 void TFluka::Gsdvn(const char *name, const char *mother, Int_t ndiv,
330 fGeom->Gsdvn(name, mother, ndiv, iaxis);
333 //______________________________________________________________________________
334 void TFluka::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
335 Int_t iaxis, Double_t c0i, Int_t numed) {
337 fGeom->Gsdvn2(name, mother, ndiv, iaxis, c0i, numed);
340 //______________________________________________________________________________
341 void TFluka::Gsdvt(const char *name, const char *mother, Double_t step,
342 Int_t iaxis, Int_t numed, Int_t ndvmx) {
344 fGeom->Gsdvt(name, mother, step, iaxis, numed, ndvmx);
347 //______________________________________________________________________________
348 void TFluka::Gsdvt2(const char *name, const char *mother, Double_t step,
349 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx) {
351 fGeom->Gsdvt2(name, mother, step, iaxis, c0, numed, ndvmx);
354 //______________________________________________________________________________
355 void TFluka::Gsord(const char * /*name*/, Int_t /*iax*/) {
357 // Nothing to do with TGeo
360 //______________________________________________________________________________
361 void TFluka::Gspos(const char *name, Int_t nr, const char *mother,
362 Double_t x, Double_t y, Double_t z, Int_t irot,
365 fGeom->Gspos(name, nr, mother, x, y, z, irot, konly);
368 //______________________________________________________________________________
369 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
370 Double_t x, Double_t y, Double_t z, Int_t irot,
371 const char *konly, Float_t *upar, Int_t np) {
373 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
376 //______________________________________________________________________________
377 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
378 Double_t x, Double_t y, Double_t z, Int_t irot,
379 const char *konly, Double_t *upar, Int_t np) {
381 fGeom->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
384 //______________________________________________________________________________
385 void TFluka::Gsbool(const char* /*onlyVolName*/, const char* /*manyVolName*/) {
387 // Nothing to do with TGeo
388 Warning("Gsbool", "Not implemented with TGeo");
391 //______________________________________________________________________________
392 void TFluka::SetCerenkov(Int_t /*itmed*/, Int_t /*npckov*/, Float_t */*ppckov*/,
393 Float_t * /*absco*/, Float_t * /*effic*/, Float_t * /*rindex*/) {
395 // Not implemented with TGeo - what G4 did ? Any FLUKA card generated?
396 Warning("SetCerenkov", "Not implemented with TGeo");
399 //______________________________________________________________________________
400 void TFluka::SetCerenkov(Int_t /*itmed*/, Int_t /*npckov*/, Double_t * /*ppckov*/,
401 Double_t * /*absco*/, Double_t * /*effic*/, Double_t * /*rindex*/) {
403 // Not implemented with TGeo - what G4 did ? Any FLUKA card generated?
404 Warning("SetCerenkov", "Not implemented with TGeo");
408 //______________________________________________________________________________
409 void TFluka::WriteEuclid(const char* /*fileName*/, const char* /*topVol*/,
410 Int_t /*number*/, Int_t /*nlevel*/) {
413 Warning("WriteEuclid", "Not implemented with TGeo");
418 //_____________________________________________________________________________
419 // methods needed by the stepping
420 //____________________________________________________________________________
422 Int_t TFluka::GetMedium() const {
424 // Get the medium number for the current fluka region
426 return fGeom->GetMedium(); // this I need to check due to remapping !!!
431 //____________________________________________________________________________
432 // particle table usage
433 // ID <--> PDG transformations
434 //_____________________________________________________________________________
435 Int_t TFluka::IdFromPDG(Int_t pdg) const
438 // Return Fluka code from PDG and pseudo ENDF code
440 // Catch the feedback photons
441 if (pdg == 50000051) return (-1);
442 // MCIHAD() goes from pdg to fluka internal.
443 Int_t intfluka = mcihad(pdg);
444 // KPTOIP array goes from internal to official
445 return GetFlukaKPTOIP(intfluka);
448 //______________________________________________________________________________
449 Int_t TFluka::PDGFromId(Int_t id) const
452 // Return PDG code and pseudo ENDF code from Fluka code
454 // IPTOKP array goes from official to internal
458 if (fVerbosityLevel >= 1)
459 printf("\n PDGFromId: Cerenkov Photon \n");
464 if (fVerbosityLevel >= 1)
465 printf("PDGFromId: Error id = 0\n");
469 Int_t intfluka = GetFlukaIPTOKP(id);
471 if (fVerbosityLevel >= 1)
472 printf("PDGFromId: Error intfluka = 0: %d\n", id);
474 } else if (intfluka < 0) {
475 if (fVerbosityLevel >= 1)
476 printf("PDGFromId: Error intfluka < 0: %d\n", id);
479 if (fVerbosityLevel >= 3)
480 printf("mpdgha called with %d %d \n", id, intfluka);
481 // MPDGHA() goes from fluka internal to pdg.
482 return mpdgha(intfluka);
485 //_____________________________________________________________________________
486 // methods for physics management
487 //____________________________________________________________________________
492 //______________________________________________________________________________
493 void TFluka::SetProcess(const char* flagName, Int_t flagValue)
496 if (iNbOfProc < 100) {
497 for (i=0; i<iNbOfProc; i++) {
498 if (strcmp(&sProcessFlag[i][0],flagName) == 0) {
499 iProcessValue[iNbOfProc] = flagValue;
503 strcpy(&sProcessFlag[iNbOfProc][0],flagName);
504 iProcessValue[iNbOfProc++] = flagValue;
507 cout << "Nb of SetProcess calls exceeds 100 - ignored" << endl;
509 iNbOfProc = iNbOfProc;
512 //______________________________________________________________________________
513 void TFluka::SetCut(const char* cutName, Double_t cutValue)
516 if (iNbOfCut < 100) {
517 for (i=0; i<iNbOfCut; i++) {
518 if (strcmp(&sCutFlag[i][0],cutName) == 0) {
519 fCutValue[iNbOfCut] = cutValue;
523 strcpy(&sCutFlag[iNbOfCut][0],cutName);
524 fCutValue[iNbOfCut++] = cutValue;
527 cout << "Nb of SetCut calls exceeds 100 - ignored" << endl;
532 //______________________________________________________________________________
533 Double_t TFluka::Xsec(char*, Double_t, Int_t, Int_t)
535 printf("WARNING: Xsec not yet implemented !\n"); return -1.;
539 //______________________________________________________________________________
540 void TFluka::InitPhysics()
542 // Last material number taken from the "corealice.inp" file, presently 31
543 // !!! it should be available from Flugg !!!
546 Float_t fLastMaterial = 31.0;
548 // construct file names
549 TString sAliceInp = getenv("ALICE_ROOT");
550 TString sAliceTmp = sAliceInp;
551 sAliceInp +="/TFluka/input/";
552 sAliceTmp +="/tmp/flukaMat.inp";
553 TString sAliceCoreInp = sAliceInp;
554 sAliceInp += GetInputFileName();
555 sAliceCoreInp += GetCoreInputFileName();
556 ifstream AliceCoreInp(sAliceCoreInp.Data());
557 ifstream AliceFlukaMat(sAliceTmp.Data());
558 ofstream AliceInp(sAliceInp.Data());
560 // copy core input file
562 Float_t fEventsPerRun;
564 while (AliceCoreInp.getline(sLine,255)) {
565 if (strncmp(sLine,"GEOEND",6) != 0)
566 AliceInp << sLine << endl; // copy until GEOEND card
568 AliceInp << "GEOEND" << endl; // add GEOEND card
571 } // end of while until GEOEND card
574 while (AliceFlukaMat.getline(sLine,255)) { // copy flukaMat.inp file
575 AliceInp << sLine << endl;
578 while (AliceCoreInp.getline(sLine,255)) {
579 if (strncmp(sLine,"START",5) != 0)
580 AliceInp << sLine << endl;
582 sscanf(sLine+10,"%10f",&fEventsPerRun);
585 } //end of while until START card
588 // in G3 the process control values meaning can be different for
589 // different processes, but for most of them is:
590 // 0 process is not activated
591 // 1 process is activated WITH generation of secondaries
592 // 2 process is activated WITHOUT generation of secondaries
593 // if process does not generate secondaries => 1 same as 2
602 // Loop over number of SetProcess calls
603 AliceInp << "*----------------------------------------------------------------------------- ";
605 AliceInp << "*----- The following data are generated from SetProcess and SetCut calls ----- ";
607 AliceInp << "*----------------------------------------------------------------------------- ";
609 for (i=0; i<iNbOfProc; i++) {
612 // G3 default value: 1
613 // G4 processes: G4eplusAnnihilation/G4IeplusAnnihilation
616 // flag = 0 no annihilation
617 // flag = 1 annihilation, decays processed
618 // flag = 2 annihilation, no decay product stored
619 // gMC ->SetProcess("ANNI",1); // EMFCUT -1. 0. 0. 3. lastmat 0. ANNH-THR
620 if (strncmp(&sProcessFlag[i][0],"ANNI",4) == 0) {
621 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
624 AliceInp << "*Kinetic energy threshold (GeV) for e+ annihilation - resets to default=0.";
626 AliceInp << "*Generated from call: SetProcess('ANNI',1) or SetProcess('ANNI',2)";
628 AliceInp << setw(10) << "EMFCUT ";
629 AliceInp << setiosflags(ios::scientific) << setprecision(5);
630 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
631 AliceInp << setw(10) << -1.0; // kinetic energy threshold (GeV) for e+ annihilation (resets to default=0)
632 AliceInp << setw(10) << 0.0; // not used
633 AliceInp << setw(10) << 0.0; // not used
634 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
635 AliceInp << setw(10) << setprecision(2);
636 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
637 AliceInp << setprecision(1);
638 AliceInp << setw(10) << 1.0; // step length in assigning indices
639 AliceInp << setw(8) << "ANNH-THR";
642 else if (iProcessValue[i] == 0) {
645 AliceInp << "*No annihilation - no FLUKA card generated";
647 AliceInp << "*Generated from call: SetProcess('ANNI',0)";
653 AliceInp << "*Illegal flag value in SetProcess('ANNI',?) call.";
655 AliceInp << "*No FLUKA card generated";
660 // bremsstrahlung and pair production are both activated
661 // G3 default value: 1
662 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
663 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
664 // G4LowEnergyBremstrahlung
665 // Particles: e-/e+; mu+/mu-
667 // flag = 0 no bremsstrahlung
668 // flag = 1 bremsstrahlung, photon processed
669 // flag = 2 bremsstrahlung, no photon stored
670 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
671 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
672 // G3 default value: 1
673 // G4 processes: G4GammaConversion,
674 // G4MuPairProduction/G4IMuPairProduction
675 // G4LowEnergyGammaConversion
676 // Particles: gamma, mu
678 // flag = 0 no delta rays
679 // flag = 1 delta rays, secondaries processed
680 // flag = 2 delta rays, no secondaries stored
681 // gMC ->SetProcess("PAIR",1); // PAIRBREM 1. 0. 0. 3. lastmat
682 // EMFCUT 0. 0. -1. 3. lastmat 0. PHOT-THR
683 else if ((strncmp(&sProcessFlag[i][0],"PAIR",4) == 0) && (iProcessValue[i] == 1 || iProcessValue[i] == 2)) {
684 for (j=0; j<iNbOfProc; j++) {
685 if ((strncmp(&sProcessFlag[j][0],"BREM",4) == 0) && (iProcessValue[j] == 1 || iProcessValue[j] == 2)) {
688 AliceInp << "*Bremsstrahlung and pair production by muons and charged hadrons both activated";
690 AliceInp << "*Generated from call: SetProcess('BREM',1) and SetProcess('PAIR',1)";
692 AliceInp << "*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.";
694 AliceInp << "*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.";
696 AliceInp << setw(10) << "PAIRBREM ";
697 AliceInp << setiosflags(ios::scientific) << setprecision(5);
698 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
699 AliceInp << setw(10) << 3.0; // bremsstrahlung and pair production by muons and charged hadrons both are activated
700 // direct pair production by muons
701 // G4 particles: "e-", "e+"
702 // G3 default value: 0.01 GeV
703 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
705 for (k=0; k<iNbOfCut; k++) {
706 if (strncmp(&sCutFlag[k][0],"PPCUTM",6) == 0) fCut = fCutValue[k];
708 AliceInp << setiosflags(ios::scientific) << setprecision(5);
709 AliceInp << setw(10) << fCut; // e+, e- kinetic energy threshold (in GeV) for explicit pair production.
710 // muon and hadron bremsstrahlung
711 // G4 particles: "gamma"
712 // G3 default value: CUTGAM=0.001 GeV
713 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
715 for (k=0; k<iNbOfCut; k++) {
716 if (strncmp(&sCutFlag[k][0],"BCUTM",5) == 0) fCut = fCutValue[k];
718 AliceInp << setiosflags(ios::scientific) << setprecision(5);
719 AliceInp << setw(10) << fCut; // photon energy threshold (GeV) for explicit bremsstrahlung production
720 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
721 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
722 AliceInp << setw(10) << setprecision(2);
723 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
729 AliceInp << "*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.";
731 AliceInp << "*Generated from call: SetProcess('BREM',1);";
733 AliceInp << setw(10) << "EMFCUT ";
735 for (k=0; k<iNbOfCut; k++) {
736 if (strncmp(&sCutFlag[k][0],"BCUTE",5) == 0) fCut = fCutValue[k];
738 AliceInp << setiosflags(ios::scientific) << setprecision(5);
739 AliceInp << setw(10) << fCut; // kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
740 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
741 AliceInp << setw(10) << 0.0; // not used
742 AliceInp << setw(10) << 0.0; // not used
743 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
744 AliceInp << setw(10) << setprecision(2);
745 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
746 AliceInp << setprecision(1);
747 AliceInp << setw(10) << 1.0; // step length in assigning indices
748 AliceInp << setw(8) << "ELPO-THR";
754 AliceInp << "*Pair production by electrons is activated";
756 AliceInp << "*Generated from call: SetProcess('PAIR',1);";
758 AliceInp << setw(10) << "EMFCUT ";
759 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
760 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
761 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
763 for (j=0; j<iNbOfCut; j++) {
764 if (strncmp(&sCutFlag[j][0],"CUTGAM",6) == 0) fCut = fCutValue[j];
766 AliceInp << setiosflags(ios::scientific) << setprecision(5);
767 AliceInp << setw(10) << fCut; // energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
768 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
769 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
770 AliceInp << setprecision(2);
771 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
772 AliceInp << setprecision(1);
773 AliceInp << setw(10) << 1.0; // step length in assigning indices
774 AliceInp << setw(8) << "PHOT-THR";
777 } // end of if for BREM
778 } // end of loop for BREM
780 // only pair production by muons and charged hadrons is activated
783 AliceInp << "*Pair production by muons and charged hadrons is activated";
785 AliceInp << "*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)";
787 AliceInp << "*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.";
789 AliceInp << setw(10) << "PAIRBREM ";
790 AliceInp << setiosflags(ios::scientific) << setprecision(5);
791 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
792 AliceInp << setw(10) << 1.0; // pair production by muons and charged hadrons is activated
793 // direct pair production by muons
794 // G4 particles: "e-", "e+"
795 // G3 default value: 0.01 GeV
796 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
797 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
798 AliceInp << setw(10) << 0.0; // e+, e- kinetic energy threshold (in GeV) for explicit pair production.
799 AliceInp << setw(10) << 0.0; // no explicit bremsstrahlung production is simulated
800 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
801 AliceInp << setprecision(2);
802 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
808 AliceInp << "*Pair production by electrons is activated";
810 AliceInp << "*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)";
812 AliceInp << setw(10) << "EMFCUT ";
813 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
814 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
815 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
818 for (j=0; j<iNbOfCut; j++) {
819 if (strncmp(&sCutFlag[j][0],"CUTGAM",6) == 0) fCut = fCutValue[j];
821 AliceInp << setiosflags(ios::scientific) << setprecision(5);
822 AliceInp << setw(10) << fCut; // energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
823 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
824 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
825 AliceInp << setprecision(2);
826 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
827 AliceInp << setprecision(1);
828 AliceInp << setw(10) << 1.0; // step length in assigning indices
829 AliceInp << setw(8) << "PHOT-THR";
834 } // end of if for PAIR
839 // G3 default value: 1
840 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
841 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
842 // G4LowEnergyBremstrahlung
843 // Particles: e-/e+; mu+/mu-
845 // flag = 0 no bremsstrahlung
846 // flag = 1 bremsstrahlung, photon processed
847 // flag = 2 bremsstrahlung, no photon stored
848 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
849 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
850 else if (strncmp(&sProcessFlag[i][0],"BREM",4) == 0) {
851 for (j=0; j<iNbOfProc; j++) {
852 if ((strncmp(&sProcessFlag[j][0],"PAIR",4) == 0) && iProcessValue[j] == 1) goto NOBREM;
854 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
857 AliceInp << "*Bremsstrahlung by muons and charged hadrons is activated";
859 AliceInp << "*Generated from call: SetProcess('BREM',1) or SetProcess('BREM',2)";
861 AliceInp << "*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.";
863 AliceInp << setw(10) << "PAIRBREM ";
864 AliceInp << setiosflags(ios::scientific) << setprecision(5);
865 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
866 AliceInp << setw(10) << 2.0; // bremsstrahlung by muons and charged hadrons is activated
867 AliceInp << setw(10) << 0.0; // no meaning
868 // muon and hadron bremsstrahlung
869 // G4 particles: "gamma"
870 // G3 default value: CUTGAM=0.001 GeV
871 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
873 for (j=0; j<iNbOfCut; j++) {
874 if (strncmp(&sCutFlag[j][0],"BCUTM",5) == 0) fCut = fCutValue[j];
876 AliceInp << setw(10) << fCut; // photon energy threshold (GeV) for explicit bremsstrahlung production
877 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
878 AliceInp << setw(10) << setprecision(2);
879 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
885 AliceInp << "*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.";
887 AliceInp << "*Generated from call: SetProcess('BREM',1);";
889 AliceInp << setw(10) << "EMFCUT ";
890 AliceInp << setiosflags(ios::scientific) << setprecision(5);
891 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
892 AliceInp << setw(10) << -1.0; // kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
893 AliceInp << setw(10) << 0.0; // not used
894 AliceInp << setw(10) << 0.0; // not used
895 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
896 AliceInp << setw(10) << setprecision(2);
897 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
898 AliceInp << setprecision(1);
899 AliceInp << setw(10) << 1.0; // step length in assigning indices
900 AliceInp << setw(8) << "ELPO-THR";
903 else if (iProcessValue[i] == 0) {
906 AliceInp << "*No bremsstrahlung - no FLUKA card generated";
908 AliceInp << "*Generated from call: SetProcess('BREM',0)";
914 AliceInp << "*Illegal flag value in SetProcess('BREM',?) call.";
916 AliceInp << "*No FLUKA card generated";
921 } // end of else if (strncmp(&sProcessFlag[i][0],"BREM",4) == 0)
924 // Cerenkov photon generation
925 // G3 default value: 0
926 // G4 process: G4Cerenkov
928 // Particles: charged
930 // flag = 0 no Cerenkov photon generation
931 // flag = 1 Cerenkov photon generation
932 // flag = 2 Cerenkov photon generation with primary stopped at each step
933 //xx gMC ->SetProcess("CKOV",1); // ??? Cerenkov photon generation
934 else if (strncmp(&sProcessFlag[i][0],"CKOV",4) == 0) {
935 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
938 AliceInp << "*Cerenkov photon generation";
940 AliceInp << "*Generated from call: SetProcess('CKOV',1) or SetProcess('CKOV',2)";
942 AliceInp << setw(10) << "OPT-PROD ";
943 AliceInp << setiosflags(ios::scientific) << setprecision(5);
944 AliceInp << setw(10) << 2.07e-9 ; // minimum Cerenkov photon emission energy (in GeV!). Default: 2.07E-9 GeV (corresponding to 600 nm)
945 AliceInp << setw(10) << 4.96e-9; // maximum Cerenkov photon emission energy (in GeV!). Default: 4.96E-9 GeV (corresponding to 250 nm)
946 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
947 AliceInp << setw(10) << 0.0; // not used
948 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
949 AliceInp << setprecision(2);
950 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
951 AliceInp << setprecision(1);
952 AliceInp << setw(10) << 1.0; // step length in assigning indices
953 AliceInp << setw(8) << "CERENKOV";
956 else if (iProcessValue[i] == 0) {
959 AliceInp << "*No Cerenkov photon generation";
961 AliceInp << "*Generated from call: SetProcess('CKOV',0)";
963 AliceInp << setw(10) << "OPT-PROD ";
964 AliceInp << setiosflags(ios::scientific) << setprecision(5);
965 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
966 AliceInp << setw(10) << 0.0; // not used
967 AliceInp << setw(10) << 0.0; // not used
968 AliceInp << setw(10) << 0.0; // not used
969 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
970 AliceInp << setprecision(2);
971 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
972 AliceInp << setprecision(1);
973 AliceInp << setw(10) << 1.0; // step length in assigning indices
974 AliceInp << setw(8) << "CERE-OFF";
980 AliceInp << "*Illegal flag value in SetProcess('CKOV',?) call.";
982 AliceInp << "*No FLUKA card generated";
985 } // end of else if (strncmp(&sProcessFlag[i][0],"CKOV",4) == 0)
988 // Compton scattering
989 // G3 default value: 1
990 // G4 processes: G4ComptonScattering,
991 // G4LowEnergyCompton,
992 // G4PolarizedComptonScattering
995 // flag = 0 no Compton scattering
996 // flag = 1 Compton scattering, electron processed
997 // flag = 2 Compton scattering, no electron stored
998 // gMC ->SetProcess("COMP",1); // EMFCUT -1. 0. 0. 3. lastmat 0. PHOT-THR
999 else if (strncmp(&sProcessFlag[i][0],"COMP",4) == 0) {
1000 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1003 AliceInp << "*Energy threshold (GeV) for Compton scattering - resets to default=0.";
1005 AliceInp << "*Generated from call: SetProcess('COMP',1);";
1007 AliceInp << setw(10) << "EMFCUT ";
1008 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1009 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1010 AliceInp << setw(10) << -1.0; // energy threshold (GeV) for Compton scattering - resets to default=0.
1011 AliceInp << setw(10) << 0.0; // not used
1012 AliceInp << setw(10) << 0.0; // not used
1013 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1014 AliceInp << setprecision(2);
1015 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1016 AliceInp << setprecision(1);
1017 AliceInp << setw(10) << 1.0; // step length in assigning indices
1018 AliceInp << setw(8) << "PHOT-THR";
1021 else if (iProcessValue[i] == 0) {
1024 AliceInp << "*No Compton scattering - no FLUKA card generated";
1026 AliceInp << "*Generated from call: SetProcess('COMP',0)";
1032 AliceInp << "*Illegal flag value in SetProcess('COMP',?) call.";
1034 AliceInp << "*No FLUKA card generated";
1037 } // end of else if (strncmp(&sProcessFlag[i][0],"COMP",4) == 0)
1040 // G3 default value: 1
1041 // G4 process: G4Decay
1043 // Particles: all which decay is applicable for
1045 // flag = 0 no decays
1046 // flag = 1 decays, secondaries processed
1047 // flag = 2 decays, no secondaries stored
1048 //gMC ->SetProcess("DCAY",1); // not available
1049 else if ((strncmp(&sProcessFlag[i][0],"DCAY",4) == 0) && iProcessValue[i] == 1)
1050 cout << "SetProcess for flag=" << &sProcessFlag[i][0] << " value=" << iProcessValue[i] << " not avaliable!" << endl;
1053 // G3 default value: 2
1054 // !! G4 treats delta rays in different way
1055 // G4 processes: G4eIonisation/G4IeIonization,
1056 // G4MuIonisation/G4IMuIonization,
1057 // G4hIonisation/G4IhIonisation
1058 // Particles: charged
1060 // flag = 0 no energy loss
1061 // flag = 1 restricted energy loss fluctuations
1062 // flag = 2 complete energy loss fluctuations
1063 // flag = 3 same as 1
1064 // flag = 4 no energy loss fluctuations
1065 // gMC ->SetProcess("DRAY",0); // DELTARAY 1.E+6 0. 0. 3. lastmat 0.
1066 else if (strncmp(&sProcessFlag[i][0],"DRAY",4) == 0) {
1067 if (iProcessValue[i] == 0 || iProcessValue[i] == 4) {
1070 AliceInp << "*Kinetic energy threshold (GeV) for delta ray production";
1072 AliceInp << "*Generated from call: SetProcess('DRAY',0) or SetProcess('DRAY',4)";
1074 AliceInp << "*No delta ray production by muons - threshold set artificially high";
1076 AliceInp << setw(10) << "DELTARAY ";
1077 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1078 AliceInp << setw(10) << 1.0e+6; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1079 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1080 AliceInp << setw(10) << 0.0; // ignored
1081 AliceInp << setw(10) << 0.0; // ignored
1082 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1083 AliceInp << setw(10) << setprecision(2);
1084 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1085 AliceInp << setprecision(1);
1086 AliceInp << setw(10) << 1.0; // step length in assigning indices
1089 else if (iProcessValue[i] == 1 || iProcessValue[i] == 2 || iProcessValue[i] == 3) {
1092 AliceInp << "*Kinetic energy threshold (GeV) for delta ray production";
1094 AliceInp << "*Generated from call: SetProcess('DRAY',flag), flag=1,2,3";
1096 AliceInp << "*Delta ray production by muons switched on";
1098 AliceInp << "*Energy threshold set by call SetCut('DCUTM',cut) or set to 0.";
1100 AliceInp << setw(10) << "DELTARAY ";
1101 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1103 for (j=0; j<iNbOfCut; j++) {
1104 if (strncmp(&sCutFlag[j][0],"DCUTM",5) == 0) fCut = fCutValue[j];
1106 AliceInp << setw(10) << fCut; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1107 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1108 AliceInp << setw(10) << 0.0; // ignored
1109 AliceInp << setw(10) << 0.0; // ignored
1110 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1111 AliceInp << setw(10) << setprecision(2);
1112 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1113 AliceInp << setprecision(1);
1114 AliceInp << setw(10) << 1.0; // step length in assigning indices
1120 AliceInp << "*Illegal flag value in SetProcess('DRAY',?) call.";
1122 AliceInp << "*No FLUKA card generated";
1125 } // end of else if (strncmp(&sProcessFlag[i][0],"DRAY",4) == 0)
1128 // G3 default value: 1
1129 // G4 processes: all defined by TG4PhysicsConstructorHadron
1131 // Particles: hadrons
1133 // flag = 0 no multiple scattering
1134 // flag = 1 hadronic interactions, secondaries processed
1135 // flag = 2 hadronic interactions, no secondaries stored
1136 // gMC ->SetProcess("HADR",1); // ??? hadronic process
1137 //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) ?????
1138 else if (strncmp(&sProcessFlag[i][0],"HADR",4) == 0) {
1139 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1142 AliceInp << "*Hadronic interaction is ON by default in FLUKA";
1144 AliceInp << "*No FLUKA card generated";
1147 else if (iProcessValue[i] == 0) {
1150 AliceInp << "*Hadronic interaction is set OFF";
1152 AliceInp << "*Generated from call: SetProcess('HADR',0);";
1154 AliceInp << setw(10) << "MULSOPT ";
1155 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1156 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1157 AliceInp << setw(10) << 0.0; // ignored
1158 AliceInp << setw(10) << 3.0; // multiple scattering for hadrons and muons is completely suppressed
1159 AliceInp << setw(10) << 0.0; // no spin-relativistic corrections
1160 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1161 AliceInp << setprecision(2);
1162 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1169 AliceInp << "*Illegal flag value in SetProcess('HADR',?) call.";
1171 AliceInp << "*No FLUKA card generated";
1174 } // end of else if (strncmp(&sProcessFlag[i][0],"HADR",4) == 0)
1178 // G3 default value: 2
1179 // G4 processes: G4eIonisation/G4IeIonization,
1180 // G4MuIonisation/G4IMuIonization,
1181 // G4hIonisation/G4IhIonisation
1183 // Particles: charged
1185 // flag=0 no energy loss
1186 // flag=1 restricted energy loss fluctuations
1187 // flag=2 complete energy loss fluctuations
1189 // flag=4 no energy loss fluctuations
1190 // If the value ILOSS is changed, then (in G3) cross-sections and energy
1191 // loss tables must be recomputed via the command 'PHYSI'
1192 // gMC ->SetProcess("LOSS",2); // ??? IONFLUCT ? energy loss
1193 else if (strncmp(&sProcessFlag[i][0],"LOSS",4) == 0) {
1194 if (iProcessValue[i] == 2) { // complete energy loss fluctuations
1197 AliceInp << "*Complete energy loss fluctuations do not exist in FLUKA";
1199 AliceInp << "*Generated from call: SetProcess('LOSS',2);";
1201 AliceInp << "*flag=2=complete energy loss fluctuations";
1203 AliceInp << "*No input card generated";
1206 else if (iProcessValue[i] == 1 || iProcessValue[i] == 3) { // restricted energy loss fluctuations
1209 AliceInp << "*Restricted energy loss fluctuations";
1211 AliceInp << "*Generated from call: SetProcess('LOSS',1) or SetProcess('LOSS',3)";
1213 AliceInp << setw(10) << "IONFLUCT ";
1214 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1215 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1216 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations (for hadrons and muons) switched on
1217 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations (for e+ and e-) switched on
1218 AliceInp << setw(10) << 1.0; // minimal accuracy
1219 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1220 AliceInp << setprecision(2);
1221 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1224 else if (iProcessValue[i] == 4) { // no energy loss fluctuations
1227 AliceInp << "*No energy loss fluctuations";
1229 AliceInp << "*Generated from call: SetProcess('LOSS',4)";
1231 AliceInp << setw(10) << -1.0; // restricted energy loss fluctuations (for hadrons and muons) switched off
1232 AliceInp << setw(10) << -1.0; // restricted energy loss fluctuations (for e+ and e-) switched off
1233 AliceInp << setw(10) << 1.0; // minimal accuracy
1234 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1235 AliceInp << setprecision(2);
1236 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1242 AliceInp << "*Illegal flag value in SetProcess('LOSS',?) call.";
1244 AliceInp << "*No FLUKA card generated";
1247 } // end of else if (strncmp(&sProcessFlag[i][0],"LOSS",4) == 0)
1250 // multiple scattering
1251 // G3 default value: 1
1252 // G4 process: G4MultipleScattering/G4IMultipleScattering
1254 // Particles: charged
1256 // flag = 0 no multiple scattering
1257 // flag = 1 Moliere or Coulomb scattering
1258 // flag = 2 Moliere or Coulomb scattering
1259 // flag = 3 Gaussian scattering
1260 // gMC ->SetProcess("MULS",1); // MULSOPT multiple scattering
1261 else if (strncmp(&sProcessFlag[i][0],"MULS",4) == 0) {
1262 if (iProcessValue[i] == 1 || iProcessValue[i] == 2 || iProcessValue[i] == 3) {
1265 AliceInp << "*Multiple scattering is ON by default for e+e- and for hadrons/muons";
1267 AliceInp << "*No FLUKA card generated";
1270 else if (iProcessValue[i] == 0) {
1273 AliceInp << "*Multiple scattering is set OFF";
1275 AliceInp << "*Generated from call: SetProcess('MULS',0);";
1277 AliceInp << setw(10) << "MULSOPT ";
1278 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1279 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1280 AliceInp << setw(10) << 0.0; // ignored
1281 AliceInp << setw(10) << 3.0; // multiple scattering for hadrons and muons is completely suppressed
1282 AliceInp << setw(10) << 3.0; // multiple scattering for e+ and e- is completely suppressed
1283 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1284 AliceInp << setprecision(2);
1285 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1291 AliceInp << "*Illegal flag value in SetProcess('MULS',?) call.";
1293 AliceInp << "*No FLUKA card generated";
1296 } // end of else if (strncmp(&sProcessFlag[i][0],"MULS",4) == 0)
1299 // muon nuclear interaction
1300 // G3 default value: 0
1301 // G4 processes: G4MuNuclearInteraction,
1302 // G4MuonMinusCaptureAtRest
1306 // flag = 0 no muon-nuclear interaction
1307 // flag = 1 nuclear interaction, secondaries processed
1308 // flag = 2 nuclear interaction, secondaries not processed
1309 // gMC ->SetProcess("MUNU",1); // MUPHOTON 1. 0. 0. 3. lastmat
1310 else if (strncmp(&sProcessFlag[i][0],"MUNU",4) == 0) {
1311 if (iProcessValue[i] == 1) {
1314 AliceInp << "*Muon nuclear interactions with production of secondary hadrons";
1316 AliceInp << "*Generated from call: SetProcess('MUNU',1);";
1318 AliceInp << setw(10) << "MUPHOTON ";
1319 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1320 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1321 AliceInp << setw(10) << 1.0; // full simulation of muon nuclear interactions and production of secondary hadrons
1322 AliceInp << setw(10) << 0.0; // ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1323 AliceInp << setw(10) << 0.0; // fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1324 AliceInp << setprecision(1);
1325 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1326 AliceInp << setprecision(2);
1327 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1330 else if (iProcessValue[i] == 2) {
1333 AliceInp << "*Muon nuclear interactions without production of secondary hadrons";
1335 AliceInp << "*Generated from call: SetProcess('MUNU',2);";
1337 AliceInp << setw(10) << "MUPHOTON ";
1338 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1339 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1340 AliceInp << setw(10) << 2.0; // full simulation of muon nuclear interactions and production of secondary hadrons
1341 AliceInp << setw(10) << 0.0; // ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1342 AliceInp << setw(10) << 0.0; // fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1343 AliceInp << setprecision(1);
1344 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1345 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1348 else if (iProcessValue[i] == 0) {
1351 AliceInp << "*No muon nuclear interaction - no FLUKA card generated";
1353 AliceInp << "*Generated from call: SetProcess('MUNU',0)";
1359 AliceInp << "*Illegal flag value in SetProcess('MUNU',?) call.";
1361 AliceInp << "*No FLUKA card generated";
1364 } // end of else if (strncmp(&sProcessFlag[i][0],"MUNU",4) == 0)
1368 // G3 default value: 0
1373 // gMC ->SetProcess("PFIS",0); // PHOTONUC -1. 0. 0. 3. lastmat 0.
1374 // flag = 0 no photon fission
1375 // flag = 1 photon fission, secondaries processed
1376 // flag = 2 photon fission, no secondaries stored
1377 else if (strncmp(&sProcessFlag[i][0],"PFIS",4) == 0) {
1378 if (iProcessValue[i] == 0) {
1381 AliceInp << "*No photonuclear interactions";
1383 AliceInp << "*Generated from call: SetProcess('PFIS',0);";
1385 AliceInp << setw(10) << "PHOTONUC ";
1386 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1387 AliceInp << setw(10) << -1.0; // no photonuclear interactions
1388 AliceInp << setw(10) << 0.0; // not used
1389 AliceInp << setw(10) << 0.0; // not used
1390 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1391 AliceInp << setprecision(2);
1392 AliceInp << setw(10) << fLastMaterial;
1393 AliceInp << setprecision(1); // upper bound of the material indices in which the respective thresholds apply
1394 AliceInp << setprecision(1);
1395 AliceInp << setw(10) << 1.0; // step length in assigning indices
1398 else if (iProcessValue[i] == 1) {
1401 AliceInp << "*Photon nuclear interactions are activated at all energies";
1403 AliceInp << "*Generated from call: SetProcess('PFIS',1);";
1405 AliceInp << setw(10) << "PHOTONUC ";
1406 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1407 AliceInp << setw(10) << 1.0; // photonuclear interactions are activated at all energies
1408 AliceInp << setw(10) << 0.0; // not used
1409 AliceInp << setw(10) << 0.0; // not used
1410 AliceInp << setprecision(2);
1411 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1412 AliceInp << setw(10) << fLastMaterial;
1413 AliceInp << setprecision(1); // upper bound of the material indices in which the respective thresholds apply
1414 AliceInp << setprecision(1);
1415 AliceInp << setw(10) << 1.0; // step length in assigning indices
1418 else if (iProcessValue[i] == 0) {
1421 AliceInp << "*No photofission - no FLUKA card generated";
1423 AliceInp << "*Generated from call: SetProcess('PFIS',0)";
1429 AliceInp << "*Illegal flag value in SetProcess('PFIS',?) call.";
1431 AliceInp << "*No FLUKA card generated";
1437 // photo electric effect
1438 // G3 default value: 1
1439 // G4 processes: G4PhotoElectricEffect
1440 // G4LowEnergyPhotoElectric
1443 // flag = 0 no photo electric effect
1444 // flag = 1 photo electric effect, electron processed
1445 // flag = 2 photo electric effect, no electron stored
1446 // gMC ->SetProcess("PHOT",1); // EMFCUT 0. -1. 0. 3. lastmat 0. PHOT-THR
1447 else if (strncmp(&sProcessFlag[i][0],"PHOT",4) == 0) {
1448 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1451 AliceInp << "*Photo electric effect is activated";
1453 AliceInp << "*Generated from call: SetProcess('PHOT',1);";
1455 AliceInp << setw(10) << "EMFCUT ";
1456 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1457 AliceInp << setw(10) << 0.0; // ignored
1458 AliceInp << setw(10) << -1.0; // resets to default=0.
1459 AliceInp << setw(10) << 0.0; // ignored
1460 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1461 AliceInp << setprecision(2);
1462 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1463 AliceInp << setprecision(1);
1464 AliceInp << setw(10) << 1.0; // step length in assigning indices
1465 AliceInp << setw(8) << "PHOT-THR";
1468 else if (iProcessValue[i] == 0) {
1471 AliceInp << "*No photo electric effect - no FLUKA card generated";
1473 AliceInp << "*Generated from call: SetProcess('PHOT',0)";
1479 AliceInp << "*Illegal flag value in SetProcess('PHOT',?) call.";
1481 AliceInp << "*No FLUKA card generated";
1484 } // else if (strncmp(&sProcessFlag[i][0],"PHOT",4) == 0)
1487 // Rayleigh scattering
1488 // G3 default value: 0
1489 // G4 process: G4OpRayleigh
1491 // Particles: optical photon
1493 // flag = 0 Rayleigh scattering off
1494 // flag = 1 Rayleigh scattering on
1495 //xx gMC ->SetProcess("RAYL",1);
1496 else if (strncmp(&sProcessFlag[i][0],"RAYL",4) == 0) {
1497 if (iProcessValue[i] == 1) {
1500 AliceInp << "*Rayleigh scattering is ON by default in FLUKA";
1502 AliceInp << "*No FLUKA card generated";
1505 else if (iProcessValue[i] == 0) {
1508 AliceInp << "*Rayleigh scattering is set OFF";
1510 AliceInp << "*Generated from call: SetProcess('RAYL',0);";
1512 AliceInp << setw(10) << "EMFRAY ";
1513 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1514 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1515 AliceInp << setw(10) << -1.0; // no Rayleigh scattering and no binding corrections for Compton
1516 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1517 AliceInp << setprecision(2);
1518 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1524 AliceInp << "*Illegal flag value in SetProcess('RAYL',?) call.";
1526 AliceInp << "*No FLUKA card generated";
1529 } // end of else if (strncmp(&sProcessFlag[i][0],"RAYL",4) == 0)
1532 // synchrotron radiation in magnetic field
1533 // G3 default value: 0
1534 // G4 process: G4SynchrotronRadiation
1538 // flag = 0 no synchrotron radiation
1539 // flag = 1 synchrotron radiation
1540 //xx gMC ->SetProcess("SYNC",1); // synchrotron radiation generation
1541 else if (strncmp(&sProcessFlag[i][0],"SYNC",4) == 0) {
1544 AliceInp << "*Synchrotron radiation generation is NOT implemented in FLUKA";
1546 AliceInp << "*No FLUKA card generated";
1551 // Automatic calculation of tracking medium parameters
1552 // flag = 0 no automatic calculation
1553 // flag = 1 automatic calculation
1554 //xx gMC ->SetProcess("AUTO",1); // ??? automatic computation of the tracking medium parameters
1555 else if (strncmp(&sProcessFlag[i][0],"AUTO",4) == 0) {
1558 AliceInp << "*Automatic calculation of tracking medium parameters is always ON in FLUKA";
1560 AliceInp << "*No FLUKA card generated";
1565 // To control energy loss fluctuation model
1566 // flag = 0 Urban model
1567 // flag = 1 PAI model
1568 // flag = 2 PAI+ASHO model (not active at the moment)
1569 //xx gMC ->SetProcess("STRA",1); // ??? energy fluctuation model
1570 else if (strncmp(&sProcessFlag[i][0],"STRA",4) == 0) {
1571 if (iProcessValue[i] == 0 || iProcessValue[i] == 2 || iProcessValue[i] == 3) {
1574 AliceInp << "*Ionization energy losses calculation is activated";
1576 AliceInp << "*Generated from call: SetProcess('STRA',n);, n=0,1,2";
1578 AliceInp << setw(10) << "IONFLUCT ";
1579 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1580 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations
1581 // (for hadrons and muons) switched on
1582 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations
1583 // (for e+ and e-) switched on
1584 AliceInp << setw(10) << 1.0; // minimal accuracy
1585 AliceInp << setw(10) << 3.0; // upper bound of the material indices in
1586 // which the respective thresholds apply
1587 AliceInp << setprecision(2);
1588 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1589 AliceInp << setprecision(1);
1590 AliceInp << setw(10) << 1.0; // step length in assigning indices
1596 AliceInp << "*Illegal flag value in SetProcess('STRA',?) call.";
1598 AliceInp << "*No FLUKA card generated";
1601 } // else if (strncmp(&sProcessFlag[i][0],"STRA",4) == 0)
1606 else { // processes not yet treated
1608 // light photon absorption (Cerenkov photons)
1609 // it is turned on when Cerenkov process is turned on
1610 // G3 default value: 0
1611 // G4 process: G4OpAbsorption, G4OpBoundaryProcess
1613 // Particles: optical photon
1615 // flag = 0 no absorption of Cerenkov photons
1616 // flag = 1 absorption of Cerenkov photons
1617 // gMC ->SetProcess("LABS",2); // ??? Cerenkov light absorption
1621 cout << "SetProcess for flag=" << &sProcessFlag[i][0] << " value=" << iProcessValue[i] << " not yet implemented!" << endl;
1623 } //end of loop number of SetProcess calls
1626 // Loop over number of SetCut calls
1627 for (Int_t i=0; i<iNbOfCut; i++) {
1629 // cuts used in SetProcess calls
1630 if (strncmp(&sCutFlag[i][0],"BCUTM",5) == 0) continue;
1631 else if (strncmp(&sCutFlag[i][0],"BCUTE",5) == 0) continue;
1632 else if (strncmp(&sCutFlag[i][0],"DCUTM",5) == 0) continue;
1633 else if (strncmp(&sCutFlag[i][0],"PPCUTM",6) == 0) continue;
1636 // G4 particles: "gamma"
1637 // G3 default value: 0.001 GeV
1638 //gMC ->SetCut("CUTGAM",cut); // cut for gammas
1639 else if (strncmp(&sCutFlag[i][0],"CUTGAM",6) == 0) {
1642 AliceInp << "*Cut for gamma";
1644 AliceInp << "*Generated from call: SetCut('CUTGAM',cut);";
1646 AliceInp << setw(10) << "PART-THR ";
1647 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1648 AliceInp << setw(10) << -fCutValue[i];
1649 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1650 AliceInp << setw(10) << 7.0;
1655 // G4 particles: "e-"
1657 // G3 default value: 0.001 GeV
1658 //gMC ->SetCut("CUTELE",cut); // cut for e+,e-
1659 else if (strncmp(&sCutFlag[i][0],"CUTELE",6) == 0) {
1662 AliceInp << "*Cut for electrons";
1664 AliceInp << "*Generated from call: SetCut('CUTELE',cut);";
1666 AliceInp << setw(10) << "PART-THR ";
1667 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1668 AliceInp << setw(10) << -fCutValue[i];
1669 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1670 AliceInp << setw(10) << 3.0;
1671 AliceInp << setw(10) << 4.0;
1672 AliceInp << setw(10) << 1.0;
1677 // G4 particles: of type "baryon", "meson", "nucleus" with zero charge
1678 // G3 default value: 0.01 GeV
1679 //gMC ->SetCut("CUTNEU",cut); // cut for neutral hadrons
1680 else if (strncmp(&sCutFlag[i][0],"CUTNEU",6) == 0) {
1683 AliceInp << "*Cut for neutral hadrons";
1685 AliceInp << "*Generated from call: SetCut('CUTNEU',cut);";
1687 AliceInp << setw(10) << "PART-THR ";
1688 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1689 AliceInp << setw(10) << -fCutValue[i];
1690 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1691 AliceInp << setw(10) << 8.0; // Neutron
1692 AliceInp << setw(10) << 9.0; // Antineutron
1694 AliceInp << setw(10) << "PART-THR ";
1695 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1696 AliceInp << setw(10) << -fCutValue[i];
1697 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1698 AliceInp << setw(10) << 12.0; // Kaon zero long
1699 AliceInp << setw(10) << 12.0; // Kaon zero long
1701 AliceInp << setw(10) << "PART-THR ";
1702 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1703 AliceInp << setw(10) << -fCutValue[i];
1704 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1705 AliceInp << setw(10) << 17.0; // Lambda, 18=Antilambda
1706 AliceInp << setw(10) << 19.0; // Kaon zero short
1708 AliceInp << setw(10) << "PART-THR ";
1709 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1710 AliceInp << setw(10) << -fCutValue[i];
1711 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1712 AliceInp << setw(10) << 22.0; // Sigma zero, Pion zero, Kaon zero
1713 AliceInp << setw(10) << 25.0; // Antikaon zero
1715 AliceInp << setw(10) << "PART-THR ";
1716 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1717 AliceInp << setw(10) << -fCutValue[i];
1718 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1719 AliceInp << setw(10) << 32.0; // Antisigma zero
1720 AliceInp << setw(10) << 32.0; // Antisigma zero
1722 AliceInp << setw(10) << "PART-THR ";
1723 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1724 AliceInp << setw(10) << -fCutValue[i];
1725 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1726 AliceInp << setw(10) << 34.0; // Xi zero
1727 AliceInp << setw(10) << 35.0; // AntiXi zero
1729 AliceInp << setw(10) << "PART-THR ";
1730 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1731 AliceInp << setw(10) << -fCutValue[i];
1732 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1733 AliceInp << setw(10) << 47.0; // D zero
1734 AliceInp << setw(10) << 48.0; // AntiD zero
1736 AliceInp << setw(10) << "PART-THR ";
1737 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1738 AliceInp << setw(10) << -fCutValue[i];
1739 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1740 AliceInp << setw(10) << 53.0; // Xi_c zero
1741 AliceInp << setw(10) << 53.0; // Xi_c zero
1743 AliceInp << setw(10) << "PART-THR ";
1744 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1745 AliceInp << setw(10) << -fCutValue[i];
1746 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1747 AliceInp << setw(10) << 55.0; // Xi'_c zero
1748 AliceInp << setw(10) << 56.0; // Omega_c zero
1750 AliceInp << setw(10) << "PART-THR ";
1751 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1752 AliceInp << setw(10) << -fCutValue[i];
1753 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1754 AliceInp << setw(10) << 59.0; // AntiXi_c zero
1755 AliceInp << setw(10) << 59.0; // AntiXi_c zero
1757 AliceInp << setw(10) << "PART-THR ";
1758 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1759 AliceInp << setw(10) << -fCutValue[i];
1760 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1761 AliceInp << setw(10) << 61.0; // AntiXi'_c zero
1762 AliceInp << setw(10) << 62.0; // AntiOmega_c zero
1767 // G4 particles: of type "baryon", "meson", "nucleus" with non-zero charge
1768 // G3 default value: 0.01 GeV
1769 //gMC ->SetCut("CUTHAD",cut); // cut for charged hadrons
1770 else if (strncmp(&sCutFlag[i][0],"CUTHAD",6) == 0) {
1773 AliceInp << "*Cut for charged hadrons";
1775 AliceInp << "*Generated from call: SetCut('CUTHAD',cut);";
1777 AliceInp << setw(10) << "PART-THR ";
1778 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1779 AliceInp << setw(10) << -fCutValue[i];
1780 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1781 AliceInp << setw(10) << 1.0; // Proton
1782 AliceInp << setw(10) << 2.0; // Antiproton
1784 AliceInp << setw(10) << "PART-THR ";
1785 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1786 AliceInp << setw(10) << -fCutValue[i];
1787 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1788 AliceInp << setw(10) << 13.0; // Positive Pion, Negative Pion, Positive Kaon
1789 AliceInp << setw(10) << 16.0; // Negative Kaon
1791 AliceInp << setw(10) << "PART-THR ";
1792 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1793 AliceInp << setw(10) << -fCutValue[i];
1794 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1795 AliceInp << setw(10) << 20.0; // Negative Sigma
1796 AliceInp << setw(10) << 16.0; // Positive Sigma
1798 AliceInp << setw(10) << "PART-THR ";
1799 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1800 AliceInp << setw(10) << -fCutValue[i];
1801 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1802 AliceInp << setw(10) << 31.0; // Antisigma minus
1803 AliceInp << setw(10) << 33.0; // Antisigma plus
1804 AliceInp << setprecision(1);
1805 AliceInp << setw(10) << 2.0; // step length
1807 AliceInp << setw(10) << "PART-THR ";
1808 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1809 AliceInp << setw(10) << -fCutValue[i];
1810 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1811 AliceInp << setw(10) << 36.0; // Negative Xi, Positive Xi, Omega minus
1812 AliceInp << setw(10) << 39.0; // Antiomega
1814 AliceInp << setw(10) << "PART-THR ";
1815 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1816 AliceInp << setw(10) << -fCutValue[i];
1817 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1818 AliceInp << setw(10) << 45.0; // D plus
1819 AliceInp << setw(10) << 46.0; // D minus
1821 AliceInp << setw(10) << "PART-THR ";
1822 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1823 AliceInp << setw(10) << -fCutValue[i];
1824 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1825 AliceInp << setw(10) << 49.0; // D_s plus, D_s minus, Lambda_c plus
1826 AliceInp << setw(10) << 52.0; // Xi_c plus
1828 AliceInp << setw(10) << "PART-THR ";
1829 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1830 AliceInp << setw(10) << -fCutValue[i];
1831 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1832 AliceInp << setw(10) << 54.0; // Xi'_c plus
1833 AliceInp << setw(10) << 60.0; // AntiXi'_c minus
1834 AliceInp << setprecision(1);
1835 AliceInp << setw(10) << 6.0; // step length
1837 AliceInp << setw(10) << "PART-THR ";
1838 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1839 AliceInp << setw(10) << -fCutValue[i];
1840 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1841 AliceInp << setw(10) << 57.0; // Antilambda_c minus
1842 AliceInp << setw(10) << 58.0; // AntiXi_c minus
1847 // G4 particles: "mu+", "mu-"
1848 // G3 default value: 0.01 GeV
1849 //gMC ->SetCut("CUTMUO",cut); // cut for mu+, mu-
1850 else if (strncmp(&sCutFlag[i][0],"CUTMUO",6) == 0) {
1853 AliceInp << "*Cut for muons";
1855 AliceInp << "*Generated from call: SetCut('CUTMUO',cut);";
1857 AliceInp << setw(10) << "PART-THR ";
1858 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1859 AliceInp << setw(10) << -fCutValue[i];
1860 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1861 AliceInp << setprecision(2);
1862 AliceInp << setw(10) << 10.0;
1863 AliceInp << setw(10) << 11.0;
1866 // delta-rays by electrons
1867 // G4 particles: "e-"
1868 // G3 default value: 10**4 GeV
1869 // gMC ->SetCut("DCUTE",cut); // cut for deltarays by electrons ???????????????
1870 else if (strncmp(&sCutFlag[i][0],"DCUTE",5) == 0) {
1873 AliceInp << "*Cut for delta rays by electrons ????????????";
1875 AliceInp << "*Generated from call: SetCut('DCUTE',cut);";
1877 AliceInp << setw(10) << "EMFCUT ";
1878 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1879 AliceInp << setw(10) << -fCutValue[i];
1880 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1881 AliceInp << setw(10) << 0.0;
1882 AliceInp << setw(10) << 0.0;
1883 AliceInp << setw(10) << 3.0;
1884 AliceInp << setprecision(2);
1885 AliceInp << setw(10) << fLastMaterial;
1886 AliceInp << setprecision(1);
1887 AliceInp << setw(10) << 1.0;
1892 // time of flight cut in seconds
1893 // G4 particles: all
1894 // G3 default value: 0.01 GeV
1895 //gMC ->SetCut("TOFMAX",tofmax); // time of flight cuts in seconds
1896 else if (strncmp(&sCutFlag[i][0],"TOFMAX",6) == 0) {
1899 AliceInp << "*Time of flight cuts in seconds";
1901 AliceInp << "*Generated from call: SetCut('TOFMAX',tofmax);";
1903 AliceInp << setw(10) << "TIME-CUT ";
1904 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1905 AliceInp << setw(10) << fCutValue[i]*1.e9;
1906 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1907 AliceInp << setw(10) << 0.0;
1908 AliceInp << setw(10) << 0.0;
1909 AliceInp << setw(10) << -6.0; // lower bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1910 AliceInp << setprecision(2);
1911 AliceInp << setw(10) << 64.0; // upper bound of the particle numbers for which the transport time cut-off and/or the start signal is to be applied
1912 AliceInp << setprecision(1);
1913 AliceInp << setw(10) << 1.0; // step length in assigning numbers
1918 cout << "SetCut for flag=" << &sCutFlag[i][0] << " value=" << fCutValue[i] << " not yet implemented!" << endl;
1920 } //end of loop over SeCut calls
1922 // Add START and STOP card
1923 AliceInp << setw(10) << "START ";
1924 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint);
1925 AliceInp << setw(10) << fEventsPerRun;
1927 AliceInp << setw(10) << "STOP ";
1930 } // end of InitPhysics
1933 //______________________________________________________________________________
1934 void TFluka::SetMaxStep(Double_t)
1936 // SetMaxStep is dummy procedure in TFluka !
1937 if (fVerbosityLevel >=3)
1938 cout << "SetMaxStep is dummy procedure in TFluka !" << endl;
1941 //______________________________________________________________________________
1942 void TFluka::SetMaxNStep(Int_t)
1944 // SetMaxNStep is dummy procedure in TFluka !
1945 if (fVerbosityLevel >=3)
1946 cout << "SetMaxNStep is dummy procedure in TFluka !" << endl;
1949 //______________________________________________________________________________
1950 void TFluka::SetUserDecay(Int_t)
1952 // SetUserDecay is dummy procedure in TFluka !
1953 if (fVerbosityLevel >=3)
1954 cout << "SetUserDecay is dummy procedure in TFluka !" << endl;
1958 // dynamic properties
1960 //______________________________________________________________________________
1961 void TFluka::TrackPosition(TLorentzVector& position) const
1963 // Return the current position in the master reference frame of the
1964 // track being transported
1965 // TRACKR.atrack = age of the particle
1966 // TRACKR.xtrack = x-position of the last point
1967 // TRACKR.ytrack = y-position of the last point
1968 // TRACKR.ztrack = z-position of the last point
1969 Int_t caller = GetCaller();
1970 if (caller == 1 || caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
1971 position.SetX(GetXsco());
1972 position.SetY(GetYsco());
1973 position.SetZ(GetZsco());
1974 position.SetT(TRACKR.atrack);
1976 else if (caller == 4) { // mgdraw
1977 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1978 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1979 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1980 position.SetT(TRACKR.atrack);
1982 else if (caller == 5) { // sodraw
1983 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1984 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1985 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1989 Warning("TrackPosition","position not available");
1992 //______________________________________________________________________________
1993 void TFluka::TrackPosition(Double_t& x, Double_t& y, Double_t& z) const
1995 // Return the current position in the master reference frame of the
1996 // track being transported
1997 // TRACKR.atrack = age of the particle
1998 // TRACKR.xtrack = x-position of the last point
1999 // TRACKR.ytrack = y-position of the last point
2000 // TRACKR.ztrack = z-position of the last point
2001 Int_t caller = GetCaller();
2002 if (caller == 1 || caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
2007 else if (caller == 4) { // mgdraw
2008 x = TRACKR.xtrack[TRACKR.ntrack];
2009 y = TRACKR.ytrack[TRACKR.ntrack];
2010 z = TRACKR.ztrack[TRACKR.ntrack];
2012 else if (caller == 5) { // sodraw
2013 x = TRACKR.xtrack[TRACKR.ntrack];
2014 y = TRACKR.ytrack[TRACKR.ntrack];
2015 z = TRACKR.ztrack[TRACKR.ntrack];
2018 Warning("TrackPosition","position not available");
2021 //______________________________________________________________________________
2022 void TFluka::TrackMomentum(TLorentzVector& momentum) const
2024 // Return the direction and the momentum (GeV/c) of the track
2025 // currently being transported
2026 // TRACKR.ptrack = momentum of the particle (not always defined, if
2027 // < 0 must be obtained from etrack)
2028 // TRACKR.cx,y,ztrck = direction cosines of the current particle
2029 // TRACKR.etrack = total energy of the particle
2030 // TRACKR.jtrack = identity number of the particle
2031 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
2032 Int_t caller = GetCaller();
2033 if (caller != 2) { // not eedraw
2034 if (TRACKR.ptrack >= 0) {
2035 momentum.SetPx(TRACKR.ptrack*TRACKR.cxtrck);
2036 momentum.SetPy(TRACKR.ptrack*TRACKR.cytrck);
2037 momentum.SetPz(TRACKR.ptrack*TRACKR.cztrck);
2038 momentum.SetE(TRACKR.etrack);
2042 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
2043 momentum.SetPx(p*TRACKR.cxtrck);
2044 momentum.SetPy(p*TRACKR.cytrck);
2045 momentum.SetPz(p*TRACKR.cztrck);
2046 momentum.SetE(TRACKR.etrack);
2051 Warning("TrackMomentum","momentum not available");
2054 //______________________________________________________________________________
2055 void TFluka::TrackMomentum(Double_t& px, Double_t& py, Double_t& pz, Double_t& e) const
2057 // Return the direction and the momentum (GeV/c) of the track
2058 // currently being transported
2059 // TRACKR.ptrack = momentum of the particle (not always defined, if
2060 // < 0 must be obtained from etrack)
2061 // TRACKR.cx,y,ztrck = direction cosines of the current particle
2062 // TRACKR.etrack = total energy of the particle
2063 // TRACKR.jtrack = identity number of the particle
2064 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
2065 Int_t caller = GetCaller();
2066 if (caller != 2) { // not eedraw
2067 if (TRACKR.ptrack >= 0) {
2068 px = TRACKR.ptrack*TRACKR.cxtrck;
2069 py = TRACKR.ptrack*TRACKR.cytrck;
2070 pz = TRACKR.ptrack*TRACKR.cztrck;
2075 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
2076 px = p*TRACKR.cxtrck;
2077 py = p*TRACKR.cytrck;
2078 pz = p*TRACKR.cztrck;
2084 Warning("TrackMomentum","momentum not available");
2087 //______________________________________________________________________________
2088 Double_t TFluka::TrackStep() const
2090 // Return the length in centimeters of the current step
2091 // TRACKR.ctrack = total curved path
2092 Int_t caller = GetCaller();
2093 if (caller == 1 || caller == 3 || caller == 6) //bxdraw,endraw,usdraw
2095 else if (caller == 4) //mgdraw
2096 return TRACKR.ctrack;
2101 //______________________________________________________________________________
2102 Double_t TFluka::TrackLength() const
2104 // TRACKR.cmtrck = cumulative curved path since particle birth
2105 Int_t caller = GetCaller();
2106 if (caller == 1 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
2107 return TRACKR.cmtrck;
2112 //______________________________________________________________________________
2113 Double_t TFluka::TrackTime() const
2115 // Return the current time of flight of the track being transported
2116 // TRACKR.atrack = age of the particle
2117 Int_t caller = GetCaller();
2118 if (caller == 1 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
2119 return TRACKR.atrack;
2124 //______________________________________________________________________________
2125 Double_t TFluka::Edep() const
2127 // Energy deposition
2128 // if TRACKR.ntrack = 0, TRACKR.mtrack = 0:
2129 // -->local energy deposition (the value and the point are not recorded in TRACKR)
2130 // but in the variable "rull" of the procedure "endraw.cxx"
2131 // if TRACKR.ntrack > 0, TRACKR.mtrack = 0:
2132 // -->no energy loss along the track
2133 // if TRACKR.ntrack > 0, TRACKR.mtrack > 0:
2134 // -->energy loss distributed along the track
2135 // TRACKR.dtrack = energy deposition of the jth deposition even
2137 for ( Int_t j=0;j<TRACKR.mtrack;j++) {
2138 sum +=TRACKR.dtrack[j];
2140 if (TRACKR.ntrack == 0 && TRACKR.mtrack == 0)
2147 //______________________________________________________________________________
2148 Int_t TFluka::TrackPid() const
2150 // Return the id of the particle transported
2151 // TRACKR.jtrack = identity number of the particle
2152 Int_t caller = GetCaller();
2153 if (caller != 2) // not eedraw
2154 return PDGFromId(TRACKR.jtrack);
2159 //______________________________________________________________________________
2160 Double_t TFluka::TrackCharge() const
2162 // Return charge of the track currently transported
2163 // PAPROP.ichrge = electric charge of the particle
2164 // TRACKR.jtrack = identity number of the particle
2165 Int_t caller = GetCaller();
2166 if (caller != 2) // not eedraw
2167 return PAPROP.ichrge[TRACKR.jtrack+6];
2172 //______________________________________________________________________________
2173 Double_t TFluka::TrackMass() const
2175 // PAPROP.am = particle mass in GeV
2176 // TRACKR.jtrack = identity number of the particle
2177 Int_t caller = GetCaller();
2178 if (caller != 2) // not eedraw
2179 return PAPROP.am[TRACKR.jtrack+6];
2184 //______________________________________________________________________________
2185 Double_t TFluka::Etot() const
2187 // TRACKR.etrack = total energy of the particle
2188 Int_t caller = GetCaller();
2189 if (caller != 2) // not eedraw
2190 return TRACKR.etrack;
2198 //______________________________________________________________________________
2199 Bool_t TFluka::IsNewTrack() const
2201 // True if the track has positive cummulative length
2202 Int_t caller = GetCaller();
2203 if (caller != 2) { // not eedraw
2204 if (TRACKR.cmtrck > 0.0)
2213 //______________________________________________________________________________
2214 Bool_t TFluka::IsTrackInside() const
2216 // True if the track is not at the boundary of the current volume
2217 // In Fluka a step is always inside one kind of material
2218 // If the step would go behind the region of one material,
2219 // it will be shortened to reach only the boundary.
2220 // Therefore IsTrackInside() is always true.
2221 Int_t caller = GetCaller();
2222 if (caller == 1) // bxdraw
2228 //______________________________________________________________________________
2229 Bool_t TFluka::IsTrackEntering() const
2231 // True if this is the first step of the track in the current volume
2233 Int_t caller = GetCaller();
2234 if (caller == 11) // bxdraw entering
2239 //______________________________________________________________________________
2240 Bool_t TFluka::IsTrackExiting() const
2242 Int_t caller = GetCaller();
2243 if (caller == 12) // bxdraw exiting
2248 //______________________________________________________________________________
2249 Bool_t TFluka::IsTrackOut() const
2251 // True if the track is out of the setup
2253 // Icode = 14: escape - call from Kaskad
2254 // Icode = 23: escape - call from Emfsco
2255 // Icode = 32: escape - call from Kasneu
2256 // Icode = 40: escape - call from Kashea
2257 // Icode = 51: escape - call from Kasoph
2262 fIcode == 51) return 1;
2266 //______________________________________________________________________________
2267 Bool_t TFluka::IsTrackDisappeared() const
2269 // means all inelastic interactions and decays
2270 // fIcode from usdraw
2271 if (fIcode == 101 || // inelastic interaction
2272 fIcode == 102 || // particle decay
2273 fIcode == 214 || // in-flight annihilation
2274 fIcode == 215 || // annihilation at rest
2275 fIcode == 217 || // pair production
2276 fIcode == 221) return 1;
2280 //______________________________________________________________________________
2281 Bool_t TFluka::IsTrackStop() const
2283 // True if the track energy has fallen below the threshold
2284 // means stopped by signal or below energy threshold
2285 // Icode = 12: stopping particle - call from Kaskad
2286 // Icode = 15: time kill - call from Kaskad
2287 // Icode = 21: below threshold, iarg=1 - call from Emfsco
2288 // Icode = 22: below threshold, iarg=2 - call from Emfsco
2289 // Icode = 24: time kill - call from Emfsco
2290 // Icode = 31: below threshold - call from Kasneu
2291 // Icode = 33: time kill - call from Kasneu
2292 // Icode = 41: time kill - call from Kashea
2293 // Icode = 52: time kill - call from Kasoph
2302 fIcode == 52) return 1;
2306 //______________________________________________________________________________
2307 Bool_t TFluka::IsTrackAlive() const
2309 // means not disappeared or not out
2310 if (IsTrackDisappeared() || IsTrackOut() ) return 0;
2318 //______________________________________________________________________________
2319 Int_t TFluka::NSecondaries() const
2320 // Number of secondary particles generated in the current step
2321 // FINUC.np = number of secondaries except light and heavy ions
2322 // FHEAVY.npheav = number of secondaries for light and heavy secondary ions
2324 Int_t caller = GetCaller();
2325 if (caller == 6) // valid only after usdraw
2326 return FINUC.np + FHEAVY.npheav;
2329 } // end of NSecondaries
2331 //______________________________________________________________________________
2332 void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
2333 TLorentzVector& position, TLorentzVector& momentum)
2335 Int_t caller = GetCaller();
2336 if (caller == 6) { // valid only after usdraw
2337 if (isec >= 0 && isec < FINUC.np) {
2338 particleId = PDGFromId(FINUC.kpart[isec]);
2339 position.SetX(fXsco);
2340 position.SetY(fYsco);
2341 position.SetZ(fZsco);
2342 position.SetT(TRACKR.atrack);
2343 // position.SetT(TRACKR.atrack+FINUC.agesec[isec]); //not yet implem.
2344 momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
2345 momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
2346 momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
2347 momentum.SetE(FINUC.tki[isec] + PAPROP.am[FINUC.kpart[isec]+6]);
2349 else if (isec >= FINUC.np && isec < FINUC.np + FHEAVY.npheav) {
2350 Int_t jsec = isec - FINUC.np;
2351 particleId = FHEAVY.kheavy[jsec]; // this is Fluka id !!!
2352 position.SetX(fXsco);
2353 position.SetY(fYsco);
2354 position.SetZ(fZsco);
2355 position.SetT(TRACKR.atrack);
2356 // position.SetT(TRACKR.atrack+FHEAVY.agheav[jsec]); //not yet implem.
2357 momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
2358 momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
2359 momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
2360 if (FHEAVY.tkheav[jsec] >= 3 && FHEAVY.tkheav[jsec] <= 6)
2361 momentum.SetE(FHEAVY.tkheav[jsec] + PAPROP.am[jsec+6]);
2362 else if (FHEAVY.tkheav[jsec] > 6)
2363 momentum.SetE(FHEAVY.tkheav[jsec] + FHEAVY.amnhea[jsec]); // to be checked !!!
2366 Warning("GetSecondary","isec out of range");
2369 Warning("GetSecondary","no secondaries available");
2370 } // end of GetSecondary
2372 //______________________________________________________________________________
2373 TMCProcess TFluka::ProdProcess(Int_t) const
2374 // Name of the process that has produced the secondary particles
2375 // in the current step
2377 const TMCProcess kIpNoProc = kPNoProcess;
2378 const TMCProcess kIpPDecay = kPDecay;
2379 const TMCProcess kIpPPair = kPPair;
2380 // const TMCProcess kIpPPairFromPhoton = kPPairFromPhoton;
2381 // const TMCProcess kIpPPairFromVirtualPhoton = kPPairFromVirtualPhoton;
2382 const TMCProcess kIpPCompton = kPCompton;
2383 const TMCProcess kIpPPhotoelectric = kPPhotoelectric;
2384 const TMCProcess kIpPBrem = kPBrem;
2385 // const TMCProcess kIpPBremFromHeavy = kPBremFromHeavy;
2386 // const TMCProcess kIpPBremFromElectronOrPositron = kPBremFromElectronOrPositron;
2387 const TMCProcess kIpPDeltaRay = kPDeltaRay;
2388 // const TMCProcess kIpPMoller = kPMoller;
2389 // const TMCProcess kIpPBhabha = kPBhabha;
2390 const TMCProcess kIpPAnnihilation = kPAnnihilation;
2391 // const TMCProcess kIpPAnnihilInFlight = kPAnnihilInFlight;
2392 // const TMCProcess kIpPAnnihilAtRest = kPAnnihilAtRest;
2393 const TMCProcess kIpPHadronic = kPHadronic;
2394 const TMCProcess kIpPMuonNuclear = kPMuonNuclear;
2395 const TMCProcess kIpPPhotoFission = kPPhotoFission;
2396 const TMCProcess kIpPRayleigh = kPRayleigh;
2397 // const TMCProcess kIpPCerenkov = kPCerenkov;
2398 // const TMCProcess kIpPSynchrotron = kPSynchrotron;
2400 Int_t mugamma = TRACKR.jtrack == 7 || TRACKR.jtrack == 10 || TRACKR.jtrack == 11;
2401 if (fIcode == 102) return kIpPDecay;
2402 else if (fIcode == 104 || fIcode == 217) return kIpPPair;
2403 // else if (fIcode == 104) return kIpPairFromPhoton;
2404 // else if (fIcode == 217) return kIpPPairFromVirtualPhoton;
2405 else if (fIcode == 219) return kIpPCompton;
2406 else if (fIcode == 221) return kIpPPhotoelectric;
2407 else if (fIcode == 105 || fIcode == 208) return kIpPBrem;
2408 // else if (fIcode == 105) return kIpPBremFromHeavy;
2409 // else if (fIcode == 208) return kPBremFromElectronOrPositron;
2410 else if (fIcode == 103 || fIcode == 400) return kIpPDeltaRay;
2411 else if (fIcode == 210 || fIcode == 212) return kIpPDeltaRay;
2412 // else if (fIcode == 210) return kIpPMoller;
2413 // else if (fIcode == 212) return kIpPBhabha;
2414 else if (fIcode == 214 || fIcode == 215) return kIpPAnnihilation;
2415 // else if (fIcode == 214) return kIpPAnnihilInFlight;
2416 // else if (fIcode == 215) return kIpPAnnihilAtRest;
2417 else if (fIcode == 101) return kIpPHadronic;
2418 else if (fIcode == 101) {
2419 if (!mugamma) return kIpPHadronic;
2420 else if (TRACKR.jtrack == 7) return kIpPPhotoFission;
2421 else return kIpPMuonNuclear;
2423 else if (fIcode == 225) return kIpPRayleigh;
2424 // Fluka codes 100, 300 and 400 still to be investigasted
2425 else return kIpNoProc;
2428 //Int_t StepProcesses(TArrayI &proc) const
2429 // Return processes active in the current step
2431 //ck = total energy of the particl ????????????????
2435 //______________________________________________________________________________
2436 Int_t TFluka::VolId2Mate(Int_t id) const
2439 // Returns the material number for a given volume ID
2441 return fGeom->VolId2Mate(id);
2444 //______________________________________________________________________________
2445 const char* TFluka::VolName(Int_t id) const
2448 // Returns the volume name for a given volume ID
2450 return fGeom->VolName(id);
2453 //______________________________________________________________________________
2454 Int_t TFluka::VolId(const Text_t* volName) const
2457 // Converts from volume name to volume ID.
2458 // Time consuming. (Only used during set-up)
2459 // Could be replaced by hash-table
2461 return fGeom->VolId(volName);
2464 //______________________________________________________________________________
2465 Int_t TFluka::CurrentVolID(Int_t& copyNo) const
2468 // Return the logical id and copy number corresponding to the current fluka region
2470 return fGeom->CurrentVolID(copyNo);
2473 //______________________________________________________________________________
2474 Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
2477 // Return the logical id and copy number of off'th mother
2478 // corresponding to the current fluka region
2480 return fGeom->CurrentVolOffID(off, copyNo);
2483 //______________________________________________________________________________
2484 const char* TFluka::CurrentVolName() const
2487 // Return the current volume name
2489 return fGeom->CurrentVolName();
2492 //______________________________________________________________________________
2493 const char* TFluka::CurrentVolOffName(Int_t off) const
2496 // Return the volume name of the off'th mother of the current volume
2498 return fGeom->CurrentVolOffName(off);
2501 //______________________________________________________________________________
2502 Int_t TFluka::CurrentMaterial(Float_t & /*a*/, Float_t & /*z*/,
2503 Float_t & /*dens*/, Float_t & /*radl*/, Float_t & /*absl*/) const
2506 // Return the current medium number ??? what about material properties
2509 Int_t id = TFluka::CurrentVolID(copy);
2510 Int_t med = TFluka::VolId2Mate(id);
2514 //______________________________________________________________________________
2515 void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
2517 // Transforms a position from the world reference frame
2518 // to the current volume reference frame.
2520 // Geant3 desription:
2521 // ==================
2522 // Computes coordinates XD (in DRS)
2523 // from known coordinates XM in MRS
2524 // The local reference system can be initialized by
2525 // - the tracking routines and GMTOD used in GUSTEP
2526 // - a call to GMEDIA(XM,NUMED)
2527 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2528 // (inverse routine is GDTOM)
2530 // If IFLAG=1 convert coordinates
2531 // IFLAG=2 convert direction cosinus
2534 fGeom->Gmtod(xm,xd,iflag);
2537 //______________________________________________________________________________
2538 void TFluka::Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
2540 // Transforms a position from the world reference frame
2541 // to the current volume reference frame.
2543 // Geant3 desription:
2544 // ==================
2545 // Computes coordinates XD (in DRS)
2546 // from known coordinates XM in MRS
2547 // The local reference system can be initialized by
2548 // - the tracking routines and GMTOD used in GUSTEP
2549 // - a call to GMEDIA(XM,NUMED)
2550 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2551 // (inverse routine is GDTOM)
2553 // If IFLAG=1 convert coordinates
2554 // IFLAG=2 convert direction cosinus
2557 fGeom->Gmtod(xm,xd,iflag);
2560 //______________________________________________________________________________
2561 void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
2563 // Transforms a position from the current volume reference frame
2564 // to the world reference frame.
2566 // Geant3 desription:
2567 // ==================
2568 // Computes coordinates XM (Master Reference System
2569 // knowing the coordinates XD (Detector Ref System)
2570 // The local reference system can be initialized by
2571 // - the tracking routines and GDTOM used in GUSTEP
2572 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2573 // (inverse routine is GMTOD)
2575 // If IFLAG=1 convert coordinates
2576 // IFLAG=2 convert direction cosinus
2579 fGeom->Gdtom(xd,xm,iflag);
2582 //______________________________________________________________________________
2583 void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
2585 // Transforms a position from the current volume reference frame
2586 // to the world reference frame.
2588 // Geant3 desription:
2589 // ==================
2590 // Computes coordinates XM (Master Reference System
2591 // knowing the coordinates XD (Detector Ref System)
2592 // The local reference system can be initialized by
2593 // - the tracking routines and GDTOM used in GUSTEP
2594 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2595 // (inverse routine is GMTOD)
2597 // If IFLAG=1 convert coordinates
2598 // IFLAG=2 convert direction cosinus
2601 fGeom->Gdtom(xd,xm,iflag);
2604 // ===============================================================
2605 void TFluka::FutoTest()
2607 Int_t icode, mreg, newreg, particleId;
2608 Double_t rull, xsco, ysco, zsco;
2609 TLorentzVector position, momentum;
2612 if (fVerbosityLevel >=3)
2613 cout << " icode=" << icode << endl;
2614 } else if (icode > 0 && icode <= 5) {
2617 if (fVerbosityLevel >=3)
2618 cout << " icode=" << icode
2621 TrackPosition(position);
2622 TrackMomentum(momentum);
2623 if (fVerbosityLevel >=3) {
2624 cout << "TLorentzVector positionX=" << position.X()
2625 << "positionY=" << position.Y()
2626 << "positionZ=" << position.Z()
2627 << "timeT=" << position.T() << endl;
2628 cout << "TLorentzVector momentumX=" << momentum.X()
2629 << "momentumY=" << momentum.Y()
2630 << "momentumZ=" << momentum.Z()
2631 << "energyE=" << momentum.E() << endl;
2632 cout << "TrackStep=" << TrackStep() << endl;
2633 cout << "TrackLength=" << TrackLength() << endl;
2634 cout << "TrackTime=" << TrackTime() << endl;
2635 cout << "Edep=" << Edep() << endl;
2636 cout << "TrackPid=" << TrackPid() << endl;
2637 cout << "TrackCharge=" << TrackCharge() << endl;
2638 cout << "TrackMass=" << TrackMass() << endl;
2639 cout << "Etot=" << Etot() << endl;
2640 cout << "IsNewTrack=" << IsNewTrack() << endl;
2641 cout << "IsTrackInside=" << IsTrackInside() << endl;
2642 cout << "IsTrackEntering=" << IsTrackEntering() << endl;
2643 cout << "IsTrackExiting=" << IsTrackExiting() << endl;
2644 cout << "IsTrackOut=" << IsTrackOut() << endl;
2645 cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
2646 cout << "IsTrackAlive=" << IsTrackAlive() << endl;
2649 Float_t x = position.X();
2650 Float_t y = position.Y();
2651 Float_t z = position.Z();
2654 xm[0] = x; xm[1] = y; xm[2] = z;
2655 if (fVerbosityLevel >= 3)
2656 printf("Global trackPosition: %f %f %f \n", x, y, z);
2658 if (fVerbosityLevel >= 3)
2659 printf("Local trackPosition: %f %f %f \n", xd[0], xd[1], xd[2]);
2661 if (fVerbosityLevel >= 3)
2662 printf("New trackPosition: %f %f %f \n", xm[0], xm[1], xm[2]);
2663 } else if((icode >= 10 && icode <= 15) ||
2664 (icode >= 20 && icode <= 24) ||
2665 (icode >= 30 && icode <= 33) ||
2666 (icode >= 40 && icode <= 41) ||
2667 (icode >= 50 && icode <= 52)) {
2675 if (fVerbosityLevel >=3) {
2676 cout << " icode=" << icode
2681 << " zsco=" << zsco << endl;
2683 TrackPosition(position);
2684 TrackMomentum(momentum);
2685 if (fVerbosityLevel >=3) {
2686 cout << "Edep=" << Edep() << endl;
2687 cout << "Etot=" << Etot() << endl;
2688 cout << "TrackPid=" << TrackPid() << endl;
2689 cout << "TrackCharge=" << TrackCharge() << endl;
2690 cout << "TrackMass=" << TrackMass() << endl;
2691 cout << "IsTrackOut=" << IsTrackOut() << endl;
2692 cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
2693 cout << "IsTrackStop=" << IsTrackStop() << endl;
2694 cout << "IsTrackAlive=" << IsTrackAlive() << endl;
2696 } else if((icode >= 100 && icode <= 105) ||
2700 (icode >= 214 && icode <= 215) ||
2713 if (fVerbosityLevel >=3) {
2714 cout << " icode=" << icode
2718 << " zsco=" << zsco << endl;
2719 cout << "TrackPid=" << TrackPid() << endl;
2720 cout << "NSecondaries=" << NSecondaries() << endl;
2723 for (Int_t isec=0; isec< NSecondaries(); isec++) {
2724 TFluka::GetSecondary(isec, particleId, position, momentum);
2725 if (fVerbosityLevel >=3) {
2726 cout << "TLorentzVector positionX=" << position.X()
2727 << "positionY=" << position.Y()
2728 << "positionZ=" << position.Z()
2729 << "timeT=" << position.T() << endl;
2730 cout << "TLorentzVector momentumX=" << momentum.X()
2731 << "momentumY=" << momentum.Y()
2732 << "momentumZ=" << momentum.Z()
2733 << "energyE=" << momentum.E() << endl;
2734 cout << "TrackPid=" << particleId << endl;
2737 } else if((icode == 19) ||
2743 newreg = GetNewreg();
2747 if (fVerbosityLevel >=3) {
2748 cout << " icode=" << icode
2750 << " newreg=" << newreg
2753 << " zsco=" << zsco << endl;
2756 } // end of FutoTest