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 Revision 1.18 2003/06/10 11:22:28 morsch
19 Physics configuration via modified input cards. (E. Futo)
21 Revision 1.17 2003/06/05 10:22:57 morsch
22 All printout under verbosity level control.
24 Revision 1.16 2003/03/26 13:30:35 morsch
25 SetTrackIsExiting, SetTrackIsEntering, SetTrackIsInside added.
27 Revision 1.15 2003/02/18 16:12:17 morsch
28 Protect mpdgha against negative argument.
30 Revision 1.14 2003/02/18 12:47:59 morsch
31 Gmtod and Gdtom added.
33 Revision 1.13 2003/01/31 14:01:51 morsch
35 - Getters related to geometry.
36 - Communication with run manager (event steering)
38 Revision 1.12 2003/01/31 12:18:53 morsch
39 Corrected indices. (E. Futo)
41 Revision 1.9 2002/12/06 12:41:29 morsch
42 Mess from last merge cleaned up.
44 Revision 1.8 2002/12/06 12:28:44 morsch
45 Region to media mapping corrected and improved.
47 Revision 1.7 2002/12/06 12:21:32 morsch
48 User stepping methods added (E. Futo)
50 Revision 1.6 2002/11/21 18:40:06 iglez2
53 Revision 1.5 2002/11/07 17:59:10 iglez2
54 Included the geometry through geant4_vmc/FLUGG
56 Revision 1.4 2002/11/04 16:00:46 iglez2
57 The conversion between ID and PDG now uses Fluka routines and arrays which is more consistent.
59 Revision 1.3 2002/10/22 15:12:14 alibrary
60 Introducing Riostream.h
62 Revision 1.2 2002/10/14 14:57:40 hristov
63 Merging the VirtualMC branch to the main development branch (HEAD)
65 Revision 1.1.2.8 2002/10/08 16:33:17 iglez2
66 LSOUIT is set to true before the second call to flukam.
68 Revision 1.1.2.7 2002/10/08 09:30:37 iglez2
69 Solved stupid missing ;
71 Revision 1.1.2.6 2002/10/07 13:40:22 iglez2
72 First implementations of the PDG <--> Fluka Id conversion routines
74 Revision 1.1.2.5 2002/09/26 16:26:03 iglez2
76 Call to gAlice->Generator()->Generate()
78 Revision 1.1.2.4 2002/09/26 13:22:23 iglez2
79 Naive implementation of ProcessRun and ProcessEvent
80 Opening/Closing of input file (sInputFileName) with FORTRAN unit 5 before/after the first call to flukam inside Init()
82 Revision 1.1.2.3 2002/09/20 15:35:51 iglez2
83 Modification of LFDRTR. Value is passed to FLUKA !!!
85 Revision 1.1.2.2 2002/09/18 14:34:44 iglez2
86 Revised version with all pure virtual methods implemented
88 Revision 1.1.2.1 2002/07/24 08:49:41 alibrary
89 Adding TFluka to VirtualMC
91 Revision 1.1 2002/07/05 13:10:07 morsch
92 First commit of Fluka interface.
96 #include <Riostream.h>
98 #include "TClonesArray.h"
100 #include "TCallf77.h" //For the fortran calls
101 #include "Fdblprc.h" //(DBLPRC) fluka common
102 #include "Fepisor.h" //(EPISOR) fluka common
103 #include "Ffinuc.h" //(FINUC) fluka common
104 #include "Fiounit.h" //(IOUNIT) fluka common
105 #include "Fpaprop.h" //(PAPROP) fluka common
106 #include "Fpart.h" //(PART) fluka common
107 #include "Ftrackr.h" //(TRACKR) fluka common
108 #include "Fpaprop.h" //(PAPROP) fluka common
109 #include "Ffheavy.h" //(FHEAVY) fluka common
111 #include "TVirtualMC.h"
112 #include "TG4GeometryManager.h" //For the geometry management
113 #include "TG4DetConstruction.h" //For the detector construction
115 #include "FGeometryInit.hh"
116 #include "TLorentzVector.h"
117 #include "FlukaVolume.h"
119 // Fluka methods that may be needed.
121 # define flukam flukam_
122 # define fluka_openinp fluka_openinp_
123 # define fluka_closeinp fluka_closeinp_
124 # define mcihad mcihad_
125 # define mpdgha mpdgha_
127 # define flukam FLUKAM
128 # define fluka_openinp FLUKA_OPENINP
129 # define fluka_closeinp FLUKA_CLOSEINP
130 # define mcihad MCIHAD
131 # define mpdgha MPDGHA
137 // Prototypes for FLUKA functions
139 void type_of_call flukam(const int&);
140 void type_of_call fluka_openinp(const int&, DEFCHARA);
141 void type_of_call fluka_closeinp(const int&);
142 int type_of_call mcihad(const int&);
143 int type_of_call mpdgha(const int&);
147 // Class implementation for ROOT
152 //----------------------------------------------------------------------------
153 // TFluka constructors and destructors.
154 //____________________________________________________________________________
160 fCurrentFlukaRegion(-1)
163 // Default constructor
167 TFluka::TFluka(const char *title, Int_t verbosity)
168 :TVirtualMC("TFluka",title),
169 fVerbosityLevel(verbosity),
174 fCurrentFlukaRegion(-1)
176 if (fVerbosityLevel >=3)
177 cout << "==> TFluka::TFluka(" << title << ") constructor called." << endl;
180 // create geometry manager
181 if (fVerbosityLevel >=2)
182 cout << "\t* Creating G4 Geometry manager..." << endl;
183 fGeometryManager = new TG4GeometryManager();
184 if (fVerbosityLevel >=2)
185 cout << "\t* Creating G4 Detector..." << endl;
186 fDetector = new TG4DetConstruction();
187 FGeometryInit* geominit = FGeometryInit::GetInstance();
189 geominit->setDetConstruction(fDetector);
191 cerr << "ERROR: Could not create FGeometryInit!" << endl;
192 cerr << " Exiting!!!" << endl;
196 if (fVerbosityLevel >=3)
197 cout << "<== TFluka::TFluka(" << title << ") constructor called." << endl;
199 fVolumeMediaMap = new TClonesArray("FlukaVolume",1000);
205 if (fVerbosityLevel >=3)
206 cout << "==> TFluka::~TFluka() destructor called." << endl;
208 delete fGeometryManager;
209 fVolumeMediaMap->Delete();
210 delete fVolumeMediaMap;
213 if (fVerbosityLevel >=3)
214 cout << "<== TFluka::~TFluka() destructor called." << endl;
218 //_____________________________________________________________________________
219 // TFluka control methods
220 //____________________________________________________________________________
221 void TFluka::Init() {
223 if (fVerbosityLevel >=3)
224 cout << "==> TFluka::Init() called." << endl;
226 cout << "\t* InitPhysics() - Prepare input file to be called" << endl;
227 InitPhysics(); // prepare input file
228 cout << "\t* InitPhysics() - Prepare input file called" << endl;
230 if (fVerbosityLevel >=2)
231 cout << "\t* Changing lfdrtr = (" << (GLOBAL.lfdrtr?'T':'F')
232 << ") in fluka..." << endl;
233 GLOBAL.lfdrtr = true;
235 if (fVerbosityLevel >=2)
236 cout << "\t* Opening file " << sInputFileName << endl;
237 const char* fname = sInputFileName;
238 fluka_openinp(lunin, PASSCHARA(fname));
240 if (fVerbosityLevel >=2)
241 cout << "\t* Calling flukam..." << endl;
244 if (fVerbosityLevel >=2)
245 cout << "\t* Closing file " << sInputFileName << endl;
246 fluka_closeinp(lunin);
250 if (fVerbosityLevel >=3)
251 cout << "<== TFluka::Init() called." << endl;
255 void TFluka::FinishGeometry() {
257 // Build-up table with region to medium correspondance
261 if (fVerbosityLevel >=3)
262 cout << "==> TFluka::FinishGeometry() called." << endl;
264 // fGeometryManager->Ggclos();
266 FGeometryInit* flugg = FGeometryInit::GetInstance();
268 fMediaByRegion = new Int_t[fNVolumes+2];
269 for (Int_t i = 0; i < fNVolumes; i++)
271 FlukaVolume* vol = dynamic_cast<FlukaVolume*>((*fVolumeMediaMap)[i]);
272 TString volName = vol->GetName();
273 Int_t media = vol->GetMedium();
274 if (fVerbosityLevel >= 3)
275 printf("Finish Geometry: volName, media %d %s %d \n", i, volName.Data(), media);
276 strcpy(tmp, volName.Data());
278 flugg->SetMediumFromName(tmp, media, i+1);
279 fMediaByRegion[i] = media;
282 flugg->BuildMediaMap();
284 if (fVerbosityLevel >=3)
285 cout << "<== TFluka::FinishGeometry() called." << endl;
288 void TFluka::BuildPhysics() {
289 if (fVerbosityLevel >=3)
290 cout << "==> TFluka::BuildPhysics() called." << endl;
293 if (fVerbosityLevel >=3)
294 cout << "<== TFluka::BuildPhysics() called." << endl;
297 void TFluka::ProcessEvent() {
298 if (fVerbosityLevel >=3)
299 cout << "==> TFluka::ProcessEvent() called." << endl;
300 fApplication->GeneratePrimaries();
301 EPISOR.lsouit = true;
303 if (fVerbosityLevel >=3)
304 cout << "<== TFluka::ProcessEvent() called." << endl;
308 void TFluka::ProcessRun(Int_t nevent) {
309 if (fVerbosityLevel >=3)
310 cout << "==> TFluka::ProcessRun(" << nevent << ") called."
313 if (fVerbosityLevel >=2) {
314 cout << "\t* GLOBAL.fdrtr = " << (GLOBAL.lfdrtr?'T':'F') << endl;
315 cout << "\t* Calling flukam again..." << endl;
317 fApplication->InitGeometry();
318 fApplication->BeginEvent();
320 fApplication->FinishEvent();
321 if (fVerbosityLevel >=3)
322 cout << "<== TFluka::ProcessRun(" << nevent << ") called."
327 //_____________________________________________________________________________
328 // methods for building/management of geometry
329 //____________________________________________________________________________
330 // functions from GCONS
331 void TFluka::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
332 Float_t &dens, Float_t &radl, Float_t &absl,
333 Float_t* ubuf, Int_t& nbuf) {
335 fGeometryManager->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
338 void TFluka::Gfmate(Int_t imat, char *name, Double_t &a, Double_t &z,
339 Double_t &dens, Double_t &radl, Double_t &absl,
340 Double_t* ubuf, Int_t& nbuf) {
342 fGeometryManager->Gfmate(imat, name, a, z, dens, radl, absl, ubuf, nbuf);
345 // detector composition
346 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
347 Double_t z, Double_t dens, Double_t radl, Double_t absl,
348 Float_t* buf, Int_t nwbuf) {
351 ->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
353 void TFluka::Material(Int_t& kmat, const char* name, Double_t a,
354 Double_t z, Double_t dens, Double_t radl, Double_t absl,
355 Double_t* buf, Int_t nwbuf) {
358 ->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
361 void TFluka::Mixture(Int_t& kmat, const char *name, Float_t *a,
362 Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat) {
365 ->Mixture(kmat, name, a, z, dens, nlmat, wmat);
367 void TFluka::Mixture(Int_t& kmat, const char *name, Double_t *a,
368 Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat) {
371 ->Mixture(kmat, name, a, z, dens, nlmat, wmat);
374 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
375 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
376 Double_t stemax, Double_t deemax, Double_t epsil,
377 Double_t stmin, Float_t* ubuf, Int_t nbuf) {
380 ->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
381 epsil, stmin, ubuf, nbuf);
383 void TFluka::Medium(Int_t& kmed, const char *name, Int_t nmat,
384 Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
385 Double_t stemax, Double_t deemax, Double_t epsil,
386 Double_t stmin, Double_t* ubuf, Int_t nbuf) {
389 ->Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax,
390 epsil, stmin, ubuf, nbuf);
393 void TFluka::Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
394 Double_t thetaY, Double_t phiY, Double_t thetaZ,
398 ->Matrix(krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ);
401 void TFluka::Gstpar(Int_t itmed, const char *param, Double_t parval) {
403 fGeometryManager->Gstpar(itmed, param, parval);
406 // functions from GGEOM
407 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
408 Float_t *upar, Int_t np) {
410 // fVolumeMediaMap[TString(name)] = nmed;
411 if (fVerbosityLevel >= 3)
412 printf("TFluka::Gsvolu() name = %s, nmed = %d\n", name, nmed);
414 TClonesArray &lvols = *fVolumeMediaMap;
415 new(lvols[fNVolumes++])
416 FlukaVolume(name, nmed);
417 return fGeometryManager->Gsvolu(name, shape, nmed, upar, np);
419 Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
420 Double_t *upar, Int_t np) {
422 TClonesArray &lvols = *fVolumeMediaMap;
423 new(lvols[fNVolumes++])
424 FlukaVolume(name, nmed);
426 return fGeometryManager->Gsvolu(name, shape, nmed, upar, np);
429 void TFluka::Gsdvn(const char *name, const char *mother, Int_t ndiv,
432 // The medium of the daughter is the one of the mother
433 Int_t volid = TFluka::VolId(mother);
434 Int_t med = TFluka::VolId2Mate(volid);
435 TClonesArray &lvols = *fVolumeMediaMap;
436 new(lvols[fNVolumes++])
437 FlukaVolume(name, med);
438 fGeometryManager->Gsdvn(name, mother, ndiv, iaxis);
441 void TFluka::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
442 Int_t iaxis, Double_t c0i, Int_t numed) {
444 TClonesArray &lvols = *fVolumeMediaMap;
445 new(lvols[fNVolumes++])
446 FlukaVolume(name, numed);
447 fGeometryManager->Gsdvn2(name, mother, ndiv, iaxis, c0i, numed);
450 void TFluka::Gsdvt(const char *name, const char *mother, Double_t step,
451 Int_t iaxis, Int_t numed, Int_t ndvmx) {
453 TClonesArray &lvols = *fVolumeMediaMap;
454 new(lvols[fNVolumes++])
455 FlukaVolume(name, numed);
456 fGeometryManager->Gsdvt(name, mother, step, iaxis, numed, ndvmx);
459 void TFluka::Gsdvt2(const char *name, const char *mother, Double_t step,
460 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx) {
462 TClonesArray &lvols = *fVolumeMediaMap;
463 new(lvols[fNVolumes++])
464 FlukaVolume(name, numed);
465 fGeometryManager->Gsdvt2(name, mother, step, iaxis, c0, numed, ndvmx);
468 void TFluka::Gsord(const char *name, Int_t iax) {
470 fGeometryManager->Gsord(name, iax);
473 void TFluka::Gspos(const char *name, Int_t nr, const char *mother,
474 Double_t x, Double_t y, Double_t z, Int_t irot,
477 fGeometryManager->Gspos(name, nr, mother, x, y, z, irot, konly);
480 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
481 Double_t x, Double_t y, Double_t z, Int_t irot,
482 const char *konly, Float_t *upar, Int_t np) {
484 fGeometryManager->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
486 void TFluka::Gsposp(const char *name, Int_t nr, const char *mother,
487 Double_t x, Double_t y, Double_t z, Int_t irot,
488 const char *konly, Double_t *upar, Int_t np) {
490 fGeometryManager->Gsposp(name, nr, mother, x, y, z, irot, konly, upar, np);
493 void TFluka::Gsbool(const char* onlyVolName, const char* manyVolName) {
495 fGeometryManager->Gsbool(onlyVolName, manyVolName);
498 void TFluka::SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
499 Float_t *absco, Float_t *effic, Float_t *rindex) {
501 fGeometryManager->SetCerenkov(itmed, npckov, ppckov, absco, effic, rindex);
503 void TFluka::SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov,
504 Double_t *absco, Double_t *effic, Double_t *rindex) {
506 fGeometryManager->SetCerenkov(itmed, npckov, ppckov, absco, effic, rindex);
510 void TFluka::WriteEuclid(const char* fileName, const char* topVol,
511 Int_t number, Int_t nlevel) {
513 fGeometryManager->WriteEuclid(fileName, topVol, number, nlevel);
518 //_____________________________________________________________________________
519 // methods needed by the stepping
520 //____________________________________________________________________________
522 Int_t TFluka::GetMedium() const {
524 // Get the medium number for the current fluka region
526 FGeometryInit* flugg = FGeometryInit::GetInstance();
527 return flugg->GetMedium(fCurrentFlukaRegion);
532 //____________________________________________________________________________
533 // particle table usage
534 // ID <--> PDG transformations
535 //_____________________________________________________________________________
536 Int_t TFluka::IdFromPDG(Int_t pdg) const
539 // Return Fluka code from PDG and pseudo ENDF code
541 // MCIHAD() goes from pdg to fluka internal.
542 Int_t intfluka = mcihad(pdg);
543 // KPTOIP array goes from internal to official
544 return GetFlukaKPTOIP(intfluka);
547 Int_t TFluka::PDGFromId(Int_t id) const
550 // Return PDG code and pseudo ENDF code from Fluka code
552 //IPTOKP array goes from official to internal
554 if (fVerbosityLevel >= 1)
555 printf("PDGFromId: Error id = 0");
559 Int_t intfluka = GetFlukaIPTOKP(id);
561 if (fVerbosityLevel >= 1)
562 printf("PDGFromId: Error intfluka = 0");
564 } else if (intfluka < 0) {
565 if (fVerbosityLevel >= 1)
566 printf("PDGFromId: Error intfluka < 0");
569 if (fVerbosityLevel >= 3)
570 printf("mpdgha called with %d %d \n", id, intfluka);
571 return mpdgha(intfluka);
574 //_____________________________________________________________________________
575 // methods for physics management
576 //____________________________________________________________________________
581 void TFluka::SetProcess(const char* flagName, Int_t flagValue)
584 if (iNbOfProc < 100) {
585 for (i=0; i<iNbOfProc; i++) {
586 if (strcmp(&sProcessFlag[i][0],flagName) == 0) {
587 iProcessValue[iNbOfProc] = flagValue;
591 strcpy(&sProcessFlag[iNbOfProc][0],flagName);
592 iProcessValue[iNbOfProc++] = flagValue;
595 cout << "Nb of SetProcess calls exceeds 100 - ignored" << endl;
597 iNbOfProc = iNbOfProc;
600 void TFluka::SetCut(const char* cutName, Double_t cutValue)
603 if (iNbOfCut < 100) {
604 for (i=0; i<iNbOfCut; i++) {
605 if (strcmp(&sCutFlag[i][0],cutName) == 0) {
606 fCutValue[iNbOfCut] = cutValue;
610 strcpy(&sCutFlag[iNbOfCut][0],cutName);
611 fCutValue[iNbOfCut++] = cutValue;
614 cout << "Nb of SetCut calls exceeds 100 - ignored" << endl;
619 Double_t TFluka::Xsec(char*, Double_t, Int_t, Int_t)
621 printf("WARNING: Xsec not yet implemented !\n"); return -1.;
625 void TFluka::InitPhysics()
627 // Last material number taken from the "corealice.inp" file, presently 31
628 // !!! it should be available from Flugg !!!
631 Float_t fLastMaterial = 31.0;
633 // construct file names
634 TString sAliceInp = getenv("ALICE_ROOT");
635 sAliceInp +="/TFluka/input/";
636 TString sAliceCoreInp = sAliceInp;
637 sAliceInp += GetInputFileName();
638 sAliceCoreInp += GetCoreInputFileName();
639 ifstream AliceCoreInp(sAliceCoreInp.Data());
640 ofstream AliceInp(sAliceInp.Data());
642 // copy core input file until (not included) START card
644 Float_t fEventsPerRun;
645 while (AliceCoreInp.getline(sLine,255)) {
646 if (strncmp(sLine,"START",5) != 0)
647 AliceInp << sLine << endl;
649 sscanf(sLine+10,"%10f",&fEventsPerRun);
655 // in G3 the process control values meaning can be different for
656 // different processes, but for most of them is:
657 // 0 process is not activated
658 // 1 process is activated WITH generation of secondaries
659 // 2 process is activated WITHOUT generation of secondaries
660 // if process does not generate secondaries => 1 same as 2
669 // Loop over number of SetProcess calls
670 AliceInp << "*----------------------------------------------------------------------------- ";
672 AliceInp << "*----- The following data are generated from SetProcess and SetCut calls ----- ";
674 AliceInp << "*----------------------------------------------------------------------------- ";
676 for (i=0; i<iNbOfProc; i++) {
679 // G3 default value: 1
680 // G4 processes: G4eplusAnnihilation/G4IeplusAnnihilation
683 // flag = 0 no annihilation
684 // flag = 1 annihilation, decays processed
685 // flag = 2 annihilation, no decay product stored
686 // gMC ->SetProcess("ANNI",1); // EMFCUT -1. 0. 0. 3. lastmat 0. ANNH-THR
687 if (strncmp(&sProcessFlag[i][0],"ANNI",4) == 0) {
688 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
691 AliceInp << "*Kinetic energy threshold (GeV) for e+ annihilation - resets to default=0.";
693 AliceInp << "*Generated from call: SetProcess('ANNI',1) or SetProcess('ANNI',2)";
695 AliceInp << setw(10) << "EMFCUT ";
696 AliceInp << setiosflags(ios::scientific) << setprecision(5);
697 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
698 AliceInp << setw(10) << -1.0; // kinetic energy threshold (GeV) for e+ annihilation (resets to default=0)
699 AliceInp << setw(10) << 0.0; // not used
700 AliceInp << setw(10) << 0.0; // not used
701 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
702 AliceInp << setw(10) << setprecision(2);
703 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
704 AliceInp << setprecision(1);
705 AliceInp << setw(10) << 1.0; // step length in assigning indices
706 AliceInp << setw(8) << "ANNH-THR";
709 else if (iProcessValue[i] == 0) {
712 AliceInp << "*No annihilation - no FLUKA card generated";
714 AliceInp << "*Generated from call: SetProcess('ANNI',0)";
720 AliceInp << "*Illegal flag value in SetProcess('ANNI',?) call.";
722 AliceInp << "*No FLUKA card generated";
727 // bremsstrahlung and pair production are both activated
728 // G3 default value: 1
729 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
730 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
731 // G4LowEnergyBremstrahlung
732 // Particles: e-/e+; mu+/mu-
734 // flag = 0 no bremsstrahlung
735 // flag = 1 bremsstrahlung, photon processed
736 // flag = 2 bremsstrahlung, no photon stored
737 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
738 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
739 // G3 default value: 1
740 // G4 processes: G4GammaConversion,
741 // G4MuPairProduction/G4IMuPairProduction
742 // G4LowEnergyGammaConversion
743 // Particles: gamma, mu
745 // flag = 0 no delta rays
746 // flag = 1 delta rays, secondaries processed
747 // flag = 2 delta rays, no secondaries stored
748 // gMC ->SetProcess("PAIR",1); // PAIRBREM 1. 0. 0. 3. lastmat
749 // EMFCUT 0. 0. -1. 3. lastmat 0. PHOT-THR
750 else if ((strncmp(&sProcessFlag[i][0],"PAIR",4) == 0) && (iProcessValue[i] == 1 || iProcessValue[i] == 2)) {
751 for (j=0; j<iNbOfProc; j++) {
752 if ((strncmp(&sProcessFlag[j][0],"BREM",4) == 0) && (iProcessValue[j] == 1 || iProcessValue[j] == 2)) {
755 AliceInp << "*Bremsstrahlung and pair production by muons and charged hadrons both activated";
757 AliceInp << "*Generated from call: SetProcess('BREM',1) and SetProcess('PAIR',1)";
759 AliceInp << "*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.";
761 AliceInp << "*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.";
763 AliceInp << setw(10) << "PAIRBREM ";
764 AliceInp << setiosflags(ios::scientific) << setprecision(5);
765 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
766 AliceInp << setw(10) << 3.0; // bremsstrahlung and pair production by muons and charged hadrons both are activated
767 // direct pair production by muons
768 // G4 particles: "e-", "e+"
769 // G3 default value: 0.01 GeV
770 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
772 for (k=0; k<iNbOfCut; k++) {
773 if (strncmp(&sCutFlag[k][0],"PPCUTM",6) == 0) fCut = fCutValue[k];
775 AliceInp << setiosflags(ios::scientific) << setprecision(5);
776 AliceInp << setw(10) << fCut; // e+, e- kinetic energy threshold (in GeV) for explicit pair production.
777 // muon and hadron bremsstrahlung
778 // G4 particles: "gamma"
779 // G3 default value: CUTGAM=0.001 GeV
780 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
782 for (k=0; k<iNbOfCut; k++) {
783 if (strncmp(&sCutFlag[k][0],"BCUTM",5) == 0) fCut = fCutValue[k];
785 AliceInp << setiosflags(ios::scientific) << setprecision(5);
786 AliceInp << setw(10) << fCut; // photon energy threshold (GeV) for explicit bremsstrahlung production
787 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
788 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
789 AliceInp << setw(10) << setprecision(2);
790 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
796 AliceInp << "*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.";
798 AliceInp << "*Generated from call: SetProcess('BREM',1);";
800 AliceInp << setw(10) << "EMFCUT ";
802 for (k=0; k<iNbOfCut; k++) {
803 if (strncmp(&sCutFlag[k][0],"BCUTE",5) == 0) fCut = fCutValue[k];
805 AliceInp << setiosflags(ios::scientific) << setprecision(5);
806 AliceInp << setw(10) << fCut; // kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
807 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
808 AliceInp << setw(10) << 0.0; // not used
809 AliceInp << setw(10) << 0.0; // not used
810 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
811 AliceInp << setw(10) << setprecision(2);
812 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
813 AliceInp << setprecision(1);
814 AliceInp << setw(10) << 1.0; // step length in assigning indices
815 AliceInp << setw(8) << "ELPO-THR";
821 AliceInp << "*Pair production by electrons is activated";
823 AliceInp << "*Generated from call: SetProcess('PAIR',1);";
825 AliceInp << setw(10) << "EMFCUT ";
826 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
827 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
828 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
830 for (j=0; j<iNbOfCut; j++) {
831 if (strncmp(&sCutFlag[j][0],"CUTGAM",6) == 0) fCut = fCutValue[j];
833 AliceInp << setiosflags(ios::scientific) << setprecision(5);
834 AliceInp << setw(10) << fCut; // energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
835 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
836 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
837 AliceInp << setprecision(2);
838 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
839 AliceInp << setprecision(1);
840 AliceInp << setw(10) << 1.0; // step length in assigning indices
841 AliceInp << setw(8) << "PHOT-THR";
844 } // end of if for BREM
845 } // end of loop for BREM
847 // only pair production by muons and charged hadrons is activated
850 AliceInp << "*Pair production by muons and charged hadrons is activated";
852 AliceInp << "*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)";
854 AliceInp << "*Energy threshold set by call SetCut('PPCUTM',cut) or set to 0.";
856 AliceInp << setw(10) << "PAIRBREM ";
857 AliceInp << setiosflags(ios::scientific) << setprecision(5);
858 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
859 AliceInp << setw(10) << 1.0; // pair production by muons and charged hadrons is activated
860 // direct pair production by muons
861 // G4 particles: "e-", "e+"
862 // G3 default value: 0.01 GeV
863 //gMC ->SetCut("PPCUTM",cut); // total energy cut for direct pair prod. by muons
864 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
865 AliceInp << setw(10) << 0.0; // e+, e- kinetic energy threshold (in GeV) for explicit pair production.
866 AliceInp << setw(10) << 0.0; // no explicit bremsstrahlung production is simulated
867 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
868 AliceInp << setprecision(2);
869 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
875 AliceInp << "*Pair production by electrons is activated";
877 AliceInp << "*Generated from call: SetProcess('PAIR',1) or SetProcess('PAIR',2)";
879 AliceInp << setw(10) << "EMFCUT ";
880 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
881 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Compton scattering (= 0.0 : ignored)
882 AliceInp << setw(10) << 0.0; // energy threshold (GeV) for Photoelectric (= 0.0 : ignored)
885 for (j=0; j<iNbOfCut; j++) {
886 if (strncmp(&sCutFlag[j][0],"CUTGAM",6) == 0) fCut = fCutValue[j];
888 AliceInp << setiosflags(ios::scientific) << setprecision(5);
889 AliceInp << setw(10) << fCut; // energy threshold (GeV) for gamma pair production (< 0.0 : resets to default, = 0.0 : ignored)
890 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
891 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
892 AliceInp << setprecision(2);
893 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
894 AliceInp << setprecision(1);
895 AliceInp << setw(10) << 1.0; // step length in assigning indices
896 AliceInp << setw(8) << "PHOT-THR";
901 } // end of if for PAIR
906 // G3 default value: 1
907 // G4 processes: G4eBremsstrahlung/G4IeBremsstrahlung,
908 // G4MuBremsstrahlung/G4IMuBremsstrahlung,
909 // G4LowEnergyBremstrahlung
910 // Particles: e-/e+; mu+/mu-
912 // flag = 0 no bremsstrahlung
913 // flag = 1 bremsstrahlung, photon processed
914 // flag = 2 bremsstrahlung, no photon stored
915 // gMC ->SetProcess("BREM",1); // PAIRBREM 2. 0. 0. 3. lastmat
916 // EMFCUT -1. 0. 0. 3. lastmat 0. ELPO-THR
917 else if (strncmp(&sProcessFlag[i][0],"BREM",4) == 0) {
918 for (j=0; j<iNbOfProc; j++) {
919 if ((strncmp(&sProcessFlag[j][0],"PAIR",4) == 0) && iProcessValue[j] == 1) goto NOBREM;
921 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
924 AliceInp << "*Bremsstrahlung by muons and charged hadrons is activated";
926 AliceInp << "*Generated from call: SetProcess('BREM',1) or SetProcess('BREM',2)";
928 AliceInp << "*Energy threshold set by call SetCut('BCUTM',cut) or set to 0.";
930 AliceInp << setw(10) << "PAIRBREM ";
931 AliceInp << setiosflags(ios::scientific) << setprecision(5);
932 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
933 AliceInp << setw(10) << 2.0; // bremsstrahlung by muons and charged hadrons is activated
934 AliceInp << setw(10) << 0.0; // no meaning
935 // muon and hadron bremsstrahlung
936 // G4 particles: "gamma"
937 // G3 default value: CUTGAM=0.001 GeV
938 //gMC ->SetCut("BCUTM",cut); // cut for muon and hadron bremsstrahlung
940 for (j=0; j<iNbOfCut; j++) {
941 if (strncmp(&sCutFlag[j][0],"BCUTM",5) == 0) fCut = fCutValue[j];
943 AliceInp << setw(10) << fCut; // photon energy threshold (GeV) for explicit bremsstrahlung production
944 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
945 AliceInp << setw(10) << setprecision(2);
946 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
952 AliceInp << "*Kinetic energy threshold (GeV) for e+/e- bremsstrahlung - resets to default=0.";
954 AliceInp << "*Generated from call: SetProcess('BREM',1);";
956 AliceInp << setw(10) << "EMFCUT ";
957 AliceInp << setiosflags(ios::scientific) << setprecision(5);
958 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
959 AliceInp << setw(10) << -1.0; // kinetic energy threshold (GeV) for e+/e- bremsstrahlung (resets to default=0)
960 AliceInp << setw(10) << 0.0; // not used
961 AliceInp << setw(10) << 0.0; // not used
962 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
963 AliceInp << setw(10) << setprecision(2);
964 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
965 AliceInp << setprecision(1);
966 AliceInp << setw(10) << 1.0; // step length in assigning indices
967 AliceInp << setw(8) << "ELPO-THR";
970 else if (iProcessValue[i] == 0) {
973 AliceInp << "*No bremsstrahlung - no FLUKA card generated";
975 AliceInp << "*Generated from call: SetProcess('BREM',0)";
981 AliceInp << "*Illegal flag value in SetProcess('BREM',?) call.";
983 AliceInp << "*No FLUKA card generated";
988 } // end of else if (strncmp(&sProcessFlag[i][0],"BREM",4) == 0)
991 // Cerenkov photon generation
992 // G3 default value: 0
993 // G4 process: G4Cerenkov
995 // Particles: charged
997 // flag = 0 no Cerenkov photon generation
998 // flag = 1 Cerenkov photon generation
999 // flag = 2 Cerenkov photon generation with primary stopped at each step
1000 //xx gMC ->SetProcess("CKOV",1); // ??? Cerenkov photon generation
1001 else if (strncmp(&sProcessFlag[i][0],"CKOV",4) == 0) {
1002 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1005 AliceInp << "*Cerenkov photon generation";
1007 AliceInp << "*Generated from call: SetProcess('CKOV',1) or SetProcess('CKOV',2)";
1009 AliceInp << setw(10) << "OPT-PROD ";
1010 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1011 AliceInp << setw(10) << 2.07e-9 ; // minimum Cerenkov photon emission energy (in GeV!). Default: 2.07E-9 GeV (corresponding to 600 nm)
1012 AliceInp << setw(10) << 4.96e-9; // maximum Cerenkov photon emission energy (in GeV!). Default: 4.96E-9 GeV (corresponding to 250 nm)
1013 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1014 AliceInp << setw(10) << 0.0; // not used
1015 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1016 AliceInp << setprecision(2);
1017 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1018 AliceInp << setprecision(1);
1019 AliceInp << setw(10) << 1.0; // step length in assigning indices
1020 AliceInp << setw(8) << "CERENKOV";
1023 else if (iProcessValue[i] == 0) {
1026 AliceInp << "*No Cerenkov photon generation";
1028 AliceInp << "*Generated from call: SetProcess('CKOV',0)";
1030 AliceInp << setw(10) << "OPT-PROD ";
1031 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1032 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1033 AliceInp << setw(10) << 0.0; // not used
1034 AliceInp << setw(10) << 0.0; // not used
1035 AliceInp << setw(10) << 0.0; // not used
1036 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1037 AliceInp << setprecision(2);
1038 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1039 AliceInp << setprecision(1);
1040 AliceInp << setw(10) << 1.0; // step length in assigning indices
1041 AliceInp << setw(8) << "CERE-OFF";
1047 AliceInp << "*Illegal flag value in SetProcess('CKOV',?) call.";
1049 AliceInp << "*No FLUKA card generated";
1052 } // end of else if (strncmp(&sProcessFlag[i][0],"CKOV",4) == 0)
1055 // Compton scattering
1056 // G3 default value: 1
1057 // G4 processes: G4ComptonScattering,
1058 // G4LowEnergyCompton,
1059 // G4PolarizedComptonScattering
1062 // flag = 0 no Compton scattering
1063 // flag = 1 Compton scattering, electron processed
1064 // flag = 2 Compton scattering, no electron stored
1065 // gMC ->SetProcess("COMP",1); // EMFCUT -1. 0. 0. 3. lastmat 0. PHOT-THR
1066 else if (strncmp(&sProcessFlag[i][0],"COMP",4) == 0) {
1067 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1070 AliceInp << "*Energy threshold (GeV) for Compton scattering - resets to default=0.";
1072 AliceInp << "*Generated from call: SetProcess('COMP',1);";
1074 AliceInp << setw(10) << "EMFCUT ";
1075 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1076 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1077 AliceInp << setw(10) << -1.0; // energy threshold (GeV) for Compton scattering - resets to default=0.
1078 AliceInp << setw(10) << 0.0; // not used
1079 AliceInp << setw(10) << 0.0; // not used
1080 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1081 AliceInp << setprecision(2);
1082 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1083 AliceInp << setprecision(1);
1084 AliceInp << setw(10) << 1.0; // step length in assigning indices
1085 AliceInp << setw(8) << "PHOT-THR";
1088 else if (iProcessValue[i] == 0) {
1091 AliceInp << "*No Compton scattering - no FLUKA card generated";
1093 AliceInp << "*Generated from call: SetProcess('COMP',0)";
1099 AliceInp << "*Illegal flag value in SetProcess('COMP',?) call.";
1101 AliceInp << "*No FLUKA card generated";
1104 } // end of else if (strncmp(&sProcessFlag[i][0],"COMP",4) == 0)
1107 // G3 default value: 1
1108 // G4 process: G4Decay
1110 // Particles: all which decay is applicable for
1112 // flag = 0 no decays
1113 // flag = 1 decays, secondaries processed
1114 // flag = 2 decays, no secondaries stored
1115 //gMC ->SetProcess("DCAY",1); // not available
1116 else if ((strncmp(&sProcessFlag[i][0],"DCAY",4) == 0) && iProcessValue[i] == 1)
1117 cout << "SetProcess for flag=" << &sProcessFlag[i][0] << " value=" << iProcessValue[i] << " not avaliable!" << endl;
1120 // G3 default value: 2
1121 // !! G4 treats delta rays in different way
1122 // G4 processes: G4eIonisation/G4IeIonization,
1123 // G4MuIonisation/G4IMuIonization,
1124 // G4hIonisation/G4IhIonisation
1125 // Particles: charged
1127 // flag = 0 no energy loss
1128 // flag = 1 restricted energy loss fluctuations
1129 // flag = 2 complete energy loss fluctuations
1130 // flag = 3 same as 1
1131 // flag = 4 no energy loss fluctuations
1132 // gMC ->SetProcess("DRAY",0); // DELTARAY 1.E+6 0. 0. 3. lastmat 0.
1133 else if (strncmp(&sProcessFlag[i][0],"DRAY",4) == 0) {
1134 if (iProcessValue[i] == 0 || iProcessValue[i] == 4) {
1137 AliceInp << "*Kinetic energy threshold (GeV) for delta ray production";
1139 AliceInp << "*Generated from call: SetProcess('DRAY',0) or SetProcess('DRAY',4)";
1141 AliceInp << "*No delta ray production by muons - threshold set artificially high";
1143 AliceInp << setw(10) << "DELTARAY ";
1144 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1145 AliceInp << setw(10) << 1.0e+6; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1146 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1147 AliceInp << setw(10) << 0.0; // ignored
1148 AliceInp << setw(10) << 0.0; // ignored
1149 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1150 AliceInp << setw(10) << setprecision(2);
1151 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1152 AliceInp << setprecision(1);
1153 AliceInp << setw(10) << 1.0; // step length in assigning indices
1156 else if (iProcessValue[i] == 1 || iProcessValue[i] == 2 || iProcessValue[i] == 3) {
1159 AliceInp << "*Kinetic energy threshold (GeV) for delta ray production";
1161 AliceInp << "*Generated from call: SetProcess('DRAY',flag), flag=1,2,3";
1163 AliceInp << "*Delta ray production by muons switched on";
1165 AliceInp << "*Energy threshold set by call SetCut('DCUTM',cut) or set to 0.";
1167 AliceInp << setw(10) << "DELTARAY ";
1168 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1170 for (j=0; j<iNbOfCut; j++) {
1171 if (strncmp(&sCutFlag[j][0],"DCUTM",5) == 0) fCut = fCutValue[j];
1173 AliceInp << setw(10) << fCut; // kinetic energy threshold (GeV) for delta ray production (discrete energy transfer)
1174 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1175 AliceInp << setw(10) << 0.0; // ignored
1176 AliceInp << setw(10) << 0.0; // ignored
1177 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1178 AliceInp << setw(10) << setprecision(2);
1179 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1180 AliceInp << setprecision(1);
1181 AliceInp << setw(10) << 1.0; // step length in assigning indices
1187 AliceInp << "*Illegal flag value in SetProcess('DRAY',?) call.";
1189 AliceInp << "*No FLUKA card generated";
1192 } // end of else if (strncmp(&sProcessFlag[i][0],"DRAY",4) == 0)
1195 // G3 default value: 1
1196 // G4 processes: all defined by TG4PhysicsConstructorHadron
1198 // Particles: hadrons
1200 // flag = 0 no multiple scattering
1201 // flag = 1 hadronic interactions, secondaries processed
1202 // flag = 2 hadronic interactions, no secondaries stored
1203 // gMC ->SetProcess("HADR",1); // ??? hadronic process
1204 //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) ?????
1205 else if (strncmp(&sProcessFlag[i][0],"HADR",4) == 0) {
1206 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1209 AliceInp << "*Hadronic interaction is ON by default in FLUKA";
1211 AliceInp << "*No FLUKA card generated";
1214 else if (iProcessValue[i] == 0) {
1217 AliceInp << "*Hadronic interaction is set OFF";
1219 AliceInp << "*Generated from call: SetProcess('HADR',0);";
1221 AliceInp << setw(10) << "MULSOPT ";
1222 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1223 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1224 AliceInp << setw(10) << 0.0; // ignored
1225 AliceInp << setw(10) << 3.0; // multiple scattering for hadrons and muons is completely suppressed
1226 AliceInp << setw(10) << 0.0; // no spin-relativistic corrections
1227 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1228 AliceInp << setprecision(2);
1229 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1236 AliceInp << "*Illegal flag value in SetProcess('HADR',?) call.";
1238 AliceInp << "*No FLUKA card generated";
1241 } // end of else if (strncmp(&sProcessFlag[i][0],"HADR",4) == 0)
1245 // G3 default value: 2
1246 // G4 processes: G4eIonisation/G4IeIonization,
1247 // G4MuIonisation/G4IMuIonization,
1248 // G4hIonisation/G4IhIonisation
1250 // Particles: charged
1252 // flag=0 no energy loss
1253 // flag=1 restricted energy loss fluctuations
1254 // flag=2 complete energy loss fluctuations
1256 // flag=4 no energy loss fluctuations
1257 // If the value ILOSS is changed, then (in G3) cross-sections and energy
1258 // loss tables must be recomputed via the command 'PHYSI'
1259 // gMC ->SetProcess("LOSS",2); // ??? IONFLUCT ? energy loss
1260 else if (strncmp(&sProcessFlag[i][0],"LOSS",4) == 0) {
1261 if (iProcessValue[i] == 2) { // complete energy loss fluctuations
1264 AliceInp << "*Complete energy loss fluctuations do not exist in FLUKA";
1266 AliceInp << "*Generated from call: SetProcess('LOSS',2);";
1268 AliceInp << "*flag=2=complete energy loss fluctuations";
1270 AliceInp << "*No input card generated";
1273 else if (iProcessValue[i] == 1 || iProcessValue[i] == 3) { // restricted energy loss fluctuations
1276 AliceInp << "*Restricted energy loss fluctuations";
1278 AliceInp << "*Generated from call: SetProcess('LOSS',1) or SetProcess('LOSS',3)";
1280 AliceInp << setw(10) << "IONFLUCT ";
1281 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1282 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1283 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations (for hadrons and muons) switched on
1284 AliceInp << setw(10) << 1.0; // restricted energy loss fluctuations (for e+ and e-) switched on
1285 AliceInp << setw(10) << 1.0; // minimal accuracy
1286 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1287 AliceInp << setprecision(2);
1288 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1291 else if (iProcessValue[i] == 4) { // no energy loss fluctuations
1294 AliceInp << "*No energy loss fluctuations";
1296 AliceInp << "*Generated from call: SetProcess('LOSS',4)";
1298 AliceInp << setw(10) << -1.0; // restricted energy loss fluctuations (for hadrons and muons) switched off
1299 AliceInp << setw(10) << -1.0; // restricted energy loss fluctuations (for e+ and e-) switched off
1300 AliceInp << setw(10) << 1.0; // minimal accuracy
1301 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1302 AliceInp << setprecision(2);
1303 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1309 AliceInp << "*Illegal flag value in SetProcess('LOSS',?) call.";
1311 AliceInp << "*No FLUKA card generated";
1314 } // end of else if (strncmp(&sProcessFlag[i][0],"LOSS",4) == 0)
1317 // multiple scattering
1318 // G3 default value: 1
1319 // G4 process: G4MultipleScattering/G4IMultipleScattering
1321 // Particles: charged
1323 // flag = 0 no multiple scattering
1324 // flag = 1 Moliere or Coulomb scattering
1325 // flag = 2 Moliere or Coulomb scattering
1326 // flag = 3 Gaussian scattering
1327 // gMC ->SetProcess("MULS",1); // MULSOPT multiple scattering
1328 else if (strncmp(&sProcessFlag[i][0],"MULS",4) == 0) {
1329 if (iProcessValue[i] == 1 || iProcessValue[i] == 2 || iProcessValue[i] == 3) {
1332 AliceInp << "*Multiple scattering is ON by default for e+e- and for hadrons/muons";
1334 AliceInp << "*No FLUKA card generated";
1337 else if (iProcessValue[i] == 0) {
1340 AliceInp << "*Multiple scattering is set OFF";
1342 AliceInp << "*Generated from call: SetProcess('MULS',0);";
1344 AliceInp << setw(10) << "MULSOPT ";
1345 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1346 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1347 AliceInp << setw(10) << 0.0; // ignored
1348 AliceInp << setw(10) << 3.0; // multiple scattering for hadrons and muons is completely suppressed
1349 AliceInp << setw(10) << 3.0; // multiple scattering for e+ and e- is completely suppressed
1350 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1351 AliceInp << setprecision(2);
1352 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1358 AliceInp << "*Illegal flag value in SetProcess('MULS',?) call.";
1360 AliceInp << "*No FLUKA card generated";
1363 } // end of else if (strncmp(&sProcessFlag[i][0],"MULS",4) == 0)
1366 // muon nuclear interaction
1367 // G3 default value: 0
1368 // G4 processes: G4MuNuclearInteraction,
1369 // G4MuonMinusCaptureAtRest
1373 // flag = 0 no muon-nuclear interaction
1374 // flag = 1 nuclear interaction, secondaries processed
1375 // flag = 2 nuclear interaction, secondaries not processed
1376 // gMC ->SetProcess("MUNU",1); // MUPHOTON 1. 0. 0. 3. lastmat
1377 else if (strncmp(&sProcessFlag[i][0],"MUNU",4) == 0) {
1378 if (iProcessValue[i] == 1) {
1381 AliceInp << "*Muon nuclear interactions with production of secondary hadrons";
1383 AliceInp << "*Generated from call: SetProcess('MUNU',1);";
1385 AliceInp << setw(10) << "MUPHOTON ";
1386 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1387 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1388 AliceInp << setw(10) << 1.0; // full simulation of muon nuclear interactions and production of secondary hadrons
1389 AliceInp << setw(10) << 0.0; // ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1390 AliceInp << setw(10) << 0.0; // fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1391 AliceInp << setprecision(1);
1392 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1393 AliceInp << setprecision(2);
1394 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1397 else if (iProcessValue[i] == 2) {
1400 AliceInp << "*Muon nuclear interactions without production of secondary hadrons";
1402 AliceInp << "*Generated from call: SetProcess('MUNU',2);";
1404 AliceInp << setw(10) << "MUPHOTON ";
1405 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1406 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1407 AliceInp << setw(10) << 2.0; // full simulation of muon nuclear interactions and production of secondary hadrons
1408 AliceInp << setw(10) << 0.0; // ratio of longitudinal to transverse virtual photon cross-section - Default = 0.25.
1409 AliceInp << setw(10) << 0.0; // fraction of rho-like interactions ( must be < 1) - Default = 0.75.
1410 AliceInp << setprecision(1);
1411 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1412 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1415 else if (iProcessValue[i] == 0) {
1418 AliceInp << "*No muon nuclear interaction - no FLUKA card generated";
1420 AliceInp << "*Generated from call: SetProcess('MUNU',0)";
1426 AliceInp << "*Illegal flag value in SetProcess('MUNU',?) call.";
1428 AliceInp << "*No FLUKA card generated";
1431 } // end of else if (strncmp(&sProcessFlag[i][0],"MUNU",4) == 0)
1435 // G3 default value: 0
1440 // gMC ->SetProcess("PFIS",0); // PHOTONUC -1. 0. 0. 3. lastmat 0.
1441 // flag = 0 no photon fission
1442 // flag = 1 photon fission, secondaries processed
1443 // flag = 2 photon fission, no secondaries stored
1444 else if (strncmp(&sProcessFlag[i][0],"PFIS",4) == 0) {
1445 if (iProcessValue[i] == 0) {
1448 AliceInp << "*No photonuclear interactions";
1450 AliceInp << "*Generated from call: SetProcess('PFIS',0);";
1452 AliceInp << setw(10) << "PHOTONUC ";
1453 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1454 AliceInp << setw(10) << -1.0; // no photonuclear interactions
1455 AliceInp << setw(10) << 0.0; // not used
1456 AliceInp << setw(10) << 0.0; // not used
1457 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1458 AliceInp << setprecision(2);
1459 AliceInp << setw(10) << fLastMaterial;
1460 AliceInp << setprecision(1); // upper bound of the material indices in which the respective thresholds apply
1461 AliceInp << setprecision(1);
1462 AliceInp << setw(10) << 1.0; // step length in assigning indices
1465 else if (iProcessValue[i] == 1) {
1468 AliceInp << "*Photon nuclear interactions are activated at all energies";
1470 AliceInp << "*Generated from call: SetProcess('PFIS',1);";
1472 AliceInp << setw(10) << "PHOTONUC ";
1473 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1474 AliceInp << setw(10) << 1.0; // photonuclear interactions are activated at all energies
1475 AliceInp << setw(10) << 0.0; // not used
1476 AliceInp << setw(10) << 0.0; // not used
1477 AliceInp << setprecision(2);
1478 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1479 AliceInp << setw(10) << fLastMaterial;
1480 AliceInp << setprecision(1); // upper bound of the material indices in which the respective thresholds apply
1481 AliceInp << setprecision(1);
1482 AliceInp << setw(10) << 1.0; // step length in assigning indices
1485 else if (iProcessValue[i] == 0) {
1488 AliceInp << "*No photofission - no FLUKA card generated";
1490 AliceInp << "*Generated from call: SetProcess('PFIS',0)";
1496 AliceInp << "*Illegal flag value in SetProcess('PFIS',?) call.";
1498 AliceInp << "*No FLUKA card generated";
1504 // photo electric effect
1505 // G3 default value: 1
1506 // G4 processes: G4PhotoElectricEffect
1507 // G4LowEnergyPhotoElectric
1510 // flag = 0 no photo electric effect
1511 // flag = 1 photo electric effect, electron processed
1512 // flag = 2 photo electric effect, no electron stored
1513 // gMC ->SetProcess("PHOT",1); // EMFCUT 0. -1. 0. 3. lastmat 0. PHOT-THR
1514 else if (strncmp(&sProcessFlag[i][0],"PHOT",4) == 0) {
1515 if (iProcessValue[i] == 1 || iProcessValue[i] == 2) {
1518 AliceInp << "*Photo electric effect is activated";
1520 AliceInp << "*Generated from call: SetProcess('PHOT',1);";
1522 AliceInp << setw(10) << "EMFCUT ";
1523 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1524 AliceInp << setw(10) << 0.0; // ignored
1525 AliceInp << setw(10) << -1.0; // resets to default=0.
1526 AliceInp << setw(10) << 0.0; // ignored
1527 AliceInp << setw(10) << 3.0; // upper bound of the material indices in which the respective thresholds apply
1528 AliceInp << setprecision(2);
1529 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1530 AliceInp << setprecision(1);
1531 AliceInp << setw(10) << 1.0; // step length in assigning indices
1532 AliceInp << setw(8) << "PHOT-THR";
1535 else if (iProcessValue[i] == 0) {
1538 AliceInp << "*No photo electric effect - no FLUKA card generated";
1540 AliceInp << "*Generated from call: SetProcess('PHOT',0)";
1546 AliceInp << "*Illegal flag value in SetProcess('PHOT',?) call.";
1548 AliceInp << "*No FLUKA card generated";
1551 } // else if (strncmp(&sProcessFlag[i][0],"PHOT",4) == 0)
1553 // Rayleigh scattering
1554 // G3 default value: 0
1555 // G4 process: G4OpRayleigh
1557 // Particles: optical photon
1559 // flag = 0 Rayleigh scattering off
1560 // flag = 1 Rayleigh scattering on
1561 //xx gMC ->SetProcess("RAYL",1);
1562 else if (strncmp(&sProcessFlag[i][0],"RAYL",4) == 0) {
1563 if (iProcessValue[i] == 1) {
1566 AliceInp << "*Rayleigh scattering is ON by default in FLUKA";
1568 AliceInp << "*No FLUKA card generated";
1571 else if (iProcessValue[i] == 0) {
1574 AliceInp << "*Rayleigh scattering is set OFF";
1576 AliceInp << "*Generated from call: SetProcess('RAYL',0);";
1578 AliceInp << setw(10) << "EMFRAY ";
1579 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1580 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1581 AliceInp << setw(10) << -1.0; // no Rayleigh scattering and no binding corrections for Compton
1582 AliceInp << setw(10) << 3.0; // lower bound of the material indices in which the respective thresholds apply
1583 AliceInp << setprecision(2);
1584 AliceInp << setw(10) << fLastMaterial; // upper bound of the material indices in which the respective thresholds apply
1590 AliceInp << "*Illegal flag value in SetProcess('RAYL',?) call.";
1592 AliceInp << "*No FLUKA card generated";
1595 } // end of else if (strncmp(&sProcessFlag[i][0],"RAYL",4) == 0)
1598 else { // processes not yet treated
1600 // Automatic calculation of tracking medium parameters
1601 // flag = 0 no automatic calculation
1602 // flag = 1 automatic calculation
1603 //xx gMC ->SetProcess("AUTO",1); // ??? automatic computation of the tracking medium parameters
1606 // light photon absorption (Cerenkov photons)
1607 // it is turned on when Cerenkov process is turned on
1608 // G3 default value: 0
1609 // G4 process: G4OpAbsorption, G4OpBoundaryProcess
1611 // Particles: optical photon
1613 // flag = 0 no absorption of Cerenkov photons
1614 // flag = 1 absorption of Cerenkov photons
1615 // gMC ->SetProcess("LABS",2); // ??? Cerenkov light absorption
1618 // To control energy loss fluctuation model
1619 // flag = 0 Urban model
1620 // flag = 1 PAI model
1621 // flag = 2 PAI+ASHO model (not active at the moment)
1622 //xx gMC ->SetProcess("STRA",1); // ??? energy fluctuation model
1624 // synchrotron radiation in magnetic field
1625 // G3 default value: 0
1626 // G4 process: G4SynchrotronRadiation
1630 // flag = 0 no synchrotron radiation
1631 // flag = 1 synchrotron radiation
1632 //xx gMC ->SetProcess("SYNC",1); // ??? synchrotron radiation generation
1634 cout << "SetProcess for flag=" << &sProcessFlag[i][0] << " value=" << iProcessValue[i] << " not yet implemented!" << endl;
1636 } //end of loop number of SetProcess calls
1639 // Loop over number of SetCut calls
1640 for (Int_t i=0; i<iNbOfCut; i++) {
1642 // cuts used in SetProcess calls
1643 if (strncmp(&sCutFlag[i][0],"BCUTM",5) == 0) continue;
1644 else if (strncmp(&sCutFlag[i][0],"BCUTE",5) == 0) continue;
1645 else if (strncmp(&sCutFlag[i][0],"DCUTM",5) == 0) continue;
1646 else if (strncmp(&sCutFlag[i][0],"PPCUTM",6) == 0) continue;
1649 // G4 particles: "gamma"
1650 // G3 default value: 0.001 GeV
1651 //gMC ->SetCut("CUTGAM",cut); // cut for gammas
1652 else if (strncmp(&sCutFlag[i][0],"CUTGAM",6) == 0) {
1655 AliceInp << "*Cut for gamma";
1657 AliceInp << "*Generated from call: SetCut('CUTGAM',cut);";
1659 AliceInp << setw(10) << "PART-THR ";
1660 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1661 AliceInp << setw(10) << -fCutValue[i];
1662 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1663 AliceInp << setw(10) << 7.0;
1668 // G4 particles: "e-"
1670 // G3 default value: 0.001 GeV
1671 //gMC ->SetCut("CUTELE",cut); // cut for e+,e-
1672 else if (strncmp(&sCutFlag[i][0],"CUTELE",6) == 0) {
1675 AliceInp << "*Cut for electrons";
1677 AliceInp << "*Generated from call: SetCut('CUTELE',cut);";
1679 AliceInp << setw(10) << "PART-THR ";
1680 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1681 AliceInp << setw(10) << -fCutValue[i];
1682 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1683 AliceInp << setw(10) << 3.0;
1684 AliceInp << setw(10) << 4.0;
1685 AliceInp << setw(10) << 1.0;
1690 // G4 particles: of type "baryon", "meson", "nucleus" with zero charge
1691 // G3 default value: 0.01 GeV
1692 //gMC ->SetCut("CUTNEU",cut); // cut for neutral hadrons
1693 else if (strncmp(&sCutFlag[i][0],"CUTNEU",6) == 0) {
1696 AliceInp << "*Cut for neutral hadrons";
1698 AliceInp << "*Generated from call: SetCut('CUTNEU',cut);";
1700 AliceInp << setw(10) << "PART-THR ";
1701 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1702 AliceInp << setw(10) << -fCutValue[i];
1703 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1704 AliceInp << setw(10) << 8.0; // Neutron
1705 AliceInp << setw(10) << 9.0; // Antineutron
1707 AliceInp << setw(10) << "PART-THR ";
1708 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1709 AliceInp << setw(10) << -fCutValue[i];
1710 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1711 AliceInp << setw(10) << 12.0; // Kaon zero long
1712 AliceInp << setw(10) << 12.0; // Kaon zero long
1714 AliceInp << setw(10) << "PART-THR ";
1715 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1716 AliceInp << setw(10) << -fCutValue[i];
1717 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1718 AliceInp << setw(10) << 17.0; // Lambda, 18=Antilambda
1719 AliceInp << setw(10) << 19.0; // Kaon zero short
1721 AliceInp << setw(10) << "PART-THR ";
1722 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1723 AliceInp << setw(10) << -fCutValue[i];
1724 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1725 AliceInp << setw(10) << 22.0; // Sigma zero, Pion zero, Kaon zero
1726 AliceInp << setw(10) << 25.0; // Antikaon zero
1728 AliceInp << setw(10) << "PART-THR ";
1729 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1730 AliceInp << setw(10) << -fCutValue[i];
1731 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1732 AliceInp << setw(10) << 32.0; // Antisigma zero
1733 AliceInp << setw(10) << 32.0; // Antisigma zero
1735 AliceInp << setw(10) << "PART-THR ";
1736 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1737 AliceInp << setw(10) << -fCutValue[i];
1738 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1739 AliceInp << setw(10) << 34.0; // Xi zero
1740 AliceInp << setw(10) << 35.0; // AntiXi zero
1742 AliceInp << setw(10) << "PART-THR ";
1743 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1744 AliceInp << setw(10) << -fCutValue[i];
1745 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1746 AliceInp << setw(10) << 47.0; // D zero
1747 AliceInp << setw(10) << 48.0; // AntiD zero
1749 AliceInp << setw(10) << "PART-THR ";
1750 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1751 AliceInp << setw(10) << -fCutValue[i];
1752 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1753 AliceInp << setw(10) << 53.0; // Xi_c zero
1754 AliceInp << setw(10) << 53.0; // Xi_c zero
1756 AliceInp << setw(10) << "PART-THR ";
1757 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1758 AliceInp << setw(10) << -fCutValue[i];
1759 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1760 AliceInp << setw(10) << 55.0; // Xi'_c zero
1761 AliceInp << setw(10) << 56.0; // Omega_c zero
1763 AliceInp << setw(10) << "PART-THR ";
1764 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1765 AliceInp << setw(10) << -fCutValue[i];
1766 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1767 AliceInp << setw(10) << 59.0; // AntiXi_c zero
1768 AliceInp << setw(10) << 59.0; // AntiXi_c zero
1770 AliceInp << setw(10) << "PART-THR ";
1771 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1772 AliceInp << setw(10) << -fCutValue[i];
1773 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1774 AliceInp << setw(10) << 61.0; // AntiXi'_c zero
1775 AliceInp << setw(10) << 62.0; // AntiOmega_c zero
1780 // G4 particles: of type "baryon", "meson", "nucleus" with non-zero charge
1781 // G3 default value: 0.01 GeV
1782 //gMC ->SetCut("CUTHAD",cut); // cut for charged hadrons
1783 else if (strncmp(&sCutFlag[i][0],"CUTHAD",6) == 0) {
1786 AliceInp << "*Cut for charged hadrons";
1788 AliceInp << "*Generated from call: SetCut('CUTHAD',cut);";
1790 AliceInp << setw(10) << "PART-THR ";
1791 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1792 AliceInp << setw(10) << -fCutValue[i];
1793 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1794 AliceInp << setw(10) << 1.0; // Proton
1795 AliceInp << setw(10) << 2.0; // Antiproton
1797 AliceInp << setw(10) << "PART-THR ";
1798 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1799 AliceInp << setw(10) << -fCutValue[i];
1800 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1801 AliceInp << setw(10) << 13.0; // Positive Pion, Negative Pion, Positive Kaon
1802 AliceInp << setw(10) << 16.0; // Negative Kaon
1804 AliceInp << setw(10) << "PART-THR ";
1805 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1806 AliceInp << setw(10) << -fCutValue[i];
1807 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1808 AliceInp << setw(10) << 20.0; // Negative Sigma
1809 AliceInp << setw(10) << 16.0; // Positive Sigma
1811 AliceInp << setw(10) << "PART-THR ";
1812 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1813 AliceInp << setw(10) << -fCutValue[i];
1814 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1815 AliceInp << setw(10) << 31.0; // Antisigma minus
1816 AliceInp << setw(10) << 33.0; // Antisigma plus
1817 AliceInp << setprecision(1);
1818 AliceInp << setw(10) << 2.0; // step length
1820 AliceInp << setw(10) << "PART-THR ";
1821 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1822 AliceInp << setw(10) << -fCutValue[i];
1823 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1824 AliceInp << setw(10) << 36.0; // Negative Xi, Positive Xi, Omega minus
1825 AliceInp << setw(10) << 39.0; // Antiomega
1827 AliceInp << setw(10) << "PART-THR ";
1828 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1829 AliceInp << setw(10) << -fCutValue[i];
1830 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1831 AliceInp << setw(10) << 45.0; // D plus
1832 AliceInp << setw(10) << 46.0; // D minus
1834 AliceInp << setw(10) << "PART-THR ";
1835 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1836 AliceInp << setw(10) << -fCutValue[i];
1837 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1838 AliceInp << setw(10) << 49.0; // D_s plus, D_s minus, Lambda_c plus
1839 AliceInp << setw(10) << 52.0; // Xi_c plus
1841 AliceInp << setw(10) << "PART-THR ";
1842 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1843 AliceInp << setw(10) << -fCutValue[i];
1844 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1845 AliceInp << setw(10) << 54.0; // Xi'_c plus
1846 AliceInp << setw(10) << 60.0; // AntiXi'_c minus
1847 AliceInp << setprecision(1);
1848 AliceInp << setw(10) << 6.0; // step length
1850 AliceInp << setw(10) << "PART-THR ";
1851 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1852 AliceInp << setw(10) << -fCutValue[i];
1853 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
1854 AliceInp << setw(10) << 57.0; // Antilambda_c minus
1855 AliceInp << setw(10) << 58.0; // AntiXi_c minus
1860 // G4 particles: "mu+", "mu-"
1861 // G3 default value: 0.01 GeV
1862 //gMC ->SetCut("CUTMUO",cut); // cut for mu+, mu-
1863 else if (strncmp(&sCutFlag[i][0],"CUTMUO",6) == 0) {
1866 AliceInp << "*Cut for muons";
1868 AliceInp << "*Generated from call: SetCut('CUTMUO',cut);";
1870 AliceInp << setw(10) << "PART-THR ";
1871 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1872 AliceInp << setw(10) << -fCutValue[i];
1873 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1874 AliceInp << setprecision(2);
1875 AliceInp << setw(10) << 10.0;
1876 AliceInp << setw(10) << 11.0;
1879 // delta-rays by electrons
1880 // G4 particles: "e-"
1881 // G3 default value: 10**4 GeV
1882 // gMC ->SetCut("DCUTE",cut); // cut for deltarays by electrons ???????????????
1883 else if (strncmp(&sCutFlag[i][0],"DCUTE",5) == 0) {
1886 AliceInp << "*Cut for delta rays by electrons ????????????";
1888 AliceInp << "*Generated from call: SetCut('DCUTE',cut);";
1890 AliceInp << setw(10) << "EMFCUT ";
1891 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1892 AliceInp << setw(10) << -fCutValue[i];
1893 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1894 AliceInp << setw(10) << 0.0;
1895 AliceInp << setw(10) << 0.0;
1896 AliceInp << setw(10) << 3.0;
1897 AliceInp << setprecision(2);
1898 AliceInp << setw(10) << fLastMaterial;
1899 AliceInp << setprecision(1);
1900 AliceInp << setw(10) << 1.0;
1905 // time of flight cut in seconds
1906 // G4 particles: all
1907 // G3 default value: 0.01 GeV
1908 //gMC ->SetCut("TOFMAX",tofmax); // time of flight cuts in seconds
1909 else if (strncmp(&sCutFlag[i][0],"TOFMAX",6) == 0) {
1912 AliceInp << "*Time of flight cuts in seconds";
1914 AliceInp << "*Generated from call: SetCut('TOFMAX',tofmax);";
1916 AliceInp << setw(10) << "TIME-CUT ";
1917 AliceInp << setiosflags(ios::scientific) << setprecision(5);
1918 AliceInp << setw(10) << fCutValue[i]*1.e9;
1919 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(1);
1920 AliceInp << setw(10) << 0.0;
1921 AliceInp << setw(10) << 0.0;
1922 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
1923 AliceInp << setprecision(2);
1924 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
1925 AliceInp << setprecision(1);
1926 AliceInp << setw(10) << 1.0; // step length in assigning numbers
1931 cout << "SetCut for flag=" << &sCutFlag[i][0] << " value=" << fCutValue[i] << " not yet implemented!" << endl;
1933 } //end of loop over SeCut calls
1935 // Add START and STOP card
1936 AliceInp << setw(10) << "START ";
1937 AliceInp << setiosflags(ios::fixed) << setiosflags(ios::showpoint);
1938 AliceInp << setw(10) << fEventsPerRun;
1940 AliceInp << setw(10) << "STOP ";
1946 void TFluka::SetMaxStep(Double_t)
1948 // SetMaxStep is dummy procedure in TFluka !
1949 if (fVerbosityLevel >=3)
1950 cout << "SetMaxStep is dummy procedure in TFluka !" << endl;
1953 void TFluka::SetMaxNStep(Int_t)
1955 // SetMaxNStep is dummy procedure in TFluka !
1956 if (fVerbosityLevel >=3)
1957 cout << "SetMaxNStep is dummy procedure in TFluka !" << endl;
1960 void TFluka::SetUserDecay(Int_t)
1962 // SetUserDecay is dummy procedure in TFluka !
1963 if (fVerbosityLevel >=3)
1964 cout << "SetUserDecay is dummy procedure in TFluka !" << endl;
1968 // dynamic properties
1970 void TFluka::TrackPosition(TLorentzVector& position) const
1972 // Return the current position in the master reference frame of the
1973 // track being transported
1974 // TRACKR.atrack = age of the particle
1975 // TRACKR.xtrack = x-position of the last point
1976 // TRACKR.ytrack = y-position of the last point
1977 // TRACKR.ztrack = z-position of the last point
1978 Int_t caller = GetCaller();
1979 if (caller == 1 || caller == 3 || caller == 6) { //bxdraw,endraw,usdraw
1980 position.SetX(GetXsco());
1981 position.SetY(GetYsco());
1982 position.SetZ(GetZsco());
1983 position.SetT(TRACKR.atrack);
1985 else if (caller == 4) { // mgdraw
1986 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1987 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1988 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1989 position.SetT(TRACKR.atrack);
1991 else if (caller == 5) { // sodraw
1992 position.SetX(TRACKR.xtrack[TRACKR.ntrack]);
1993 position.SetY(TRACKR.ytrack[TRACKR.ntrack]);
1994 position.SetZ(TRACKR.ztrack[TRACKR.ntrack]);
1998 Warning("TrackPosition","position not available");
2002 void TFluka::TrackPosition(Double_t& x, Double_t& y, Double_t& z) const
2004 // Return the current position in the master reference frame of the
2005 // track being transported
2006 // TRACKR.atrack = age of the particle
2007 // TRACKR.xtrack = x-position of the last point
2008 // TRACKR.ytrack = y-position of the last point
2009 // TRACKR.ztrack = z-position of the last point
2010 Int_t caller = GetCaller();
2011 if (caller == 1 || caller == 3 || caller == 6) { //bxdraw,endraw,usdraw
2016 else if (caller == 4) { // mgdraw
2017 x = TRACKR.xtrack[TRACKR.ntrack];
2018 y = TRACKR.ytrack[TRACKR.ntrack];
2019 z = TRACKR.ztrack[TRACKR.ntrack];
2021 else if (caller == 5) { // sodraw
2022 x = TRACKR.xtrack[TRACKR.ntrack];
2023 y = TRACKR.ytrack[TRACKR.ntrack];
2024 z = TRACKR.ztrack[TRACKR.ntrack];
2027 Warning("TrackPosition","position not available");
2030 void TFluka::TrackMomentum(TLorentzVector& momentum) const
2032 // Return the direction and the momentum (GeV/c) of the track
2033 // currently being transported
2034 // TRACKR.ptrack = momentum of the particle (not always defined, if
2035 // < 0 must be obtained from etrack)
2036 // TRACKR.cx,y,ztrck = direction cosines of the current particle
2037 // TRACKR.etrack = total energy of the particle
2038 // TRACKR.jtrack = identity number of the particle
2039 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
2040 Int_t caller = GetCaller();
2041 if (caller != 2) { // not eedraw
2042 if (TRACKR.ptrack >= 0) {
2043 momentum.SetPx(TRACKR.ptrack*TRACKR.cxtrck);
2044 momentum.SetPy(TRACKR.ptrack*TRACKR.cytrck);
2045 momentum.SetPz(TRACKR.ptrack*TRACKR.cztrck);
2046 momentum.SetE(TRACKR.etrack);
2050 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
2051 momentum.SetPx(p*TRACKR.cxtrck);
2052 momentum.SetPy(p*TRACKR.cytrck);
2053 momentum.SetPz(p*TRACKR.cztrck);
2054 momentum.SetE(TRACKR.etrack);
2059 Warning("TrackMomentum","momentum not available");
2062 void TFluka::TrackMomentum(Double_t& px, Double_t& py, Double_t& pz, Double_t& e) const
2064 // Return the direction and the momentum (GeV/c) of the track
2065 // currently being transported
2066 // TRACKR.ptrack = momentum of the particle (not always defined, if
2067 // < 0 must be obtained from etrack)
2068 // TRACKR.cx,y,ztrck = direction cosines of the current particle
2069 // TRACKR.etrack = total energy of the particle
2070 // TRACKR.jtrack = identity number of the particle
2071 // PAPROP.am[TRACKR.jtrack] = particle mass in gev
2072 Int_t caller = GetCaller();
2073 if (caller != 2) { // not eedraw
2074 if (TRACKR.ptrack >= 0) {
2075 px = TRACKR.ptrack*TRACKR.cxtrck;
2076 py = TRACKR.ptrack*TRACKR.cytrck;
2077 pz = TRACKR.ptrack*TRACKR.cztrck;
2082 Double_t p = sqrt(TRACKR.etrack*TRACKR.etrack - PAPROP.am[TRACKR.jtrack+6]*PAPROP.am[TRACKR.jtrack+6]);
2083 px = p*TRACKR.cxtrck;
2084 py = p*TRACKR.cytrck;
2085 pz = p*TRACKR.cztrck;
2091 Warning("TrackMomentum","momentum not available");
2094 Double_t TFluka::TrackStep() const
2096 // Return the length in centimeters of the current step
2097 // TRACKR.ctrack = total curved path
2098 Int_t caller = GetCaller();
2099 if (caller == 1 || caller == 3 || caller == 6) //bxdraw,endraw,usdraw
2101 else if (caller == 4) //mgdraw
2102 return TRACKR.ctrack;
2107 Double_t TFluka::TrackLength() const
2110 // This is the sum of substeps !!!
2111 // TRACKR.ctrack = total curved path of the current step
2112 // Sum of the substeps is identical to TRACKR.ctrack if the is no mag. field
2113 // The sum of all step length starting from the beginning of the track
2114 // for the time being returns only the length in centimeters of the current step
2116 Int_t caller = GetCaller();
2117 if (caller == 1 || caller == 3 || caller == 4 || caller == 6) { //bxdraw,endraw,mgdraw,usdraw
2118 for ( Int_t j=0;j<TRACKR.ntrack;j++) {
2119 sum +=TRACKR.ttrack[j];
2127 Double_t TFluka::TrackTime() const
2129 // Return the current time of flight of the track being transported
2130 // TRACKR.atrack = age of the particle
2131 Int_t caller = GetCaller();
2132 if (caller == 1 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
2133 return TRACKR.atrack;
2138 Double_t TFluka::Edep() const
2140 // Energy deposition
2141 // if TRACKR.ntrack = 0, TRACKR.mtrack = 0:
2142 // -->local energy deposition (the value and the point are not recorded in TRACKR)
2143 // but in the variable "rull" of the procedure "endraw.cxx"
2144 // if TRACKR.ntrack > 0, TRACKR.mtrack = 0:
2145 // -->no energy loss along the track
2146 // if TRACKR.ntrack > 0, TRACKR.mtrack > 0:
2147 // -->energy loss distributed along the track
2148 // TRACKR.dtrack = energy deposition of the jth deposition even
2150 for ( Int_t j=0;j<TRACKR.mtrack;j++) {
2151 sum +=TRACKR.dtrack[j];
2153 if (TRACKR.ntrack == 0 && TRACKR.mtrack == 0)
2160 Int_t TFluka::TrackPid() const
2162 // Return the id of the particle transported
2163 // TRACKR.jtrack = identity number of the particle
2164 Int_t caller = GetCaller();
2165 if (caller != 2) // not eedraw
2166 return PDGFromId(TRACKR.jtrack);
2171 Double_t TFluka::TrackCharge() const
2173 // Return charge of the track currently transported
2174 // PAPROP.ichrge = electric charge of the particle
2175 // TRACKR.jtrack = identity number of the particle
2176 Int_t caller = GetCaller();
2177 if (caller != 2) // not eedraw
2178 return PAPROP.ichrge[TRACKR.jtrack+6];
2183 Double_t TFluka::TrackMass() const
2185 // PAPROP.am = particle mass in GeV
2186 // TRACKR.jtrack = identity number of the particle
2187 Int_t caller = GetCaller();
2188 if (caller != 2) // not eedraw
2189 return PAPROP.am[TRACKR.jtrack+6];
2194 Double_t TFluka::Etot() const
2196 // TRACKR.etrack = total energy of the particle
2197 Int_t caller = GetCaller();
2198 if (caller != 2) // not eedraw
2199 return TRACKR.etrack;
2207 Bool_t TFluka::IsNewTrack() const
2210 // True if the track is not at the boundary of the current volume
2211 // Not true in some cases in bxdraw - to be solved
2212 Int_t caller = GetCaller();
2214 return 1; // how to handle double step ?????????????
2216 return 0; // ??????????????
2219 Bool_t TFluka::IsTrackInside() const
2221 // True if the track is not at the boundary of the current volume
2222 // In Fluka a step is always inside one kind of material
2223 // If the step would go behind the region of one material,
2224 // it will be shortened to reach only the boundary.
2225 // Therefore IsTrackInside() is always true.
2226 Int_t caller = GetCaller();
2227 if (caller == 1) // bxdraw
2233 Bool_t TFluka::IsTrackEntering() const
2235 // True if this is the first step of the track in the current volume
2237 Int_t caller = GetCaller();
2238 if (caller == 11 || caller == 4) // bxdraw entering
2243 Bool_t TFluka::IsTrackExiting() const
2245 Int_t caller = GetCaller();
2246 if (caller == 12) // bxdraw exiting
2251 Bool_t TFluka::IsTrackOut() const
2253 // True if the track is out of the setup
2255 // Icode = 14: escape - call from Kaskad
2256 // Icode = 23: escape - call from Emfsco
2257 // Icode = 32: escape - call from Kasneu
2258 // Icode = 40: escape - call from Kashea
2259 // Icode = 51: escape - call from Kasoph
2264 iIcode == 51) return 1;
2268 Bool_t TFluka::IsTrackDisappeared() const
2270 // means all inelastic interactions and decays
2271 // iIcode from usdraw
2272 if (iIcode == 101 || // inelastic interaction
2273 iIcode == 102 || // particle decay
2274 iIcode == 214 || // in-flight annihilation
2275 iIcode == 215 || // annihilation at rest
2276 iIcode == 217 || // pair production
2277 iIcode == 221) return 1;
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 iIcode == 52) return 1;
2306 Bool_t TFluka::IsTrackAlive() const
2308 // means not disappeared or not out
2309 if (IsTrackDisappeared() || IsTrackOut() ) return 0;
2317 Int_t TFluka::NSecondaries() const
2318 // Number of secondary particles generated in the current step
2319 // FINUC.np = number of secondaries except light and heavy ions
2320 // FHEAVY.npheav = number of secondaries for light and heavy secondary ions
2322 Int_t caller = GetCaller();
2323 if (caller == 6) // valid only after usdraw
2324 return FINUC.np + FHEAVY.npheav;
2327 } // end of NSecondaries
2329 void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
2330 TLorentzVector& position, TLorentzVector& momentum)
2332 Int_t caller = GetCaller();
2333 if (caller == 6) { // valid only after usdraw
2334 if (isec >= 0 && isec < FINUC.np) {
2335 particleId = PDGFromId(FINUC.kpart[isec]);
2336 position.SetX(fXsco);
2337 position.SetY(fYsco);
2338 position.SetZ(fZsco);
2339 position.SetT(TRACKR.atrack);
2340 // position.SetT(TRACKR.atrack+FINUC.agesec[isec]); //not yet implem.
2341 momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
2342 momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
2343 momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
2344 momentum.SetE(FINUC.tki[isec] + PAPROP.am[FINUC.kpart[isec]+6]);
2346 else if (isec >= FINUC.np && isec < FINUC.np + FHEAVY.npheav) {
2347 Int_t jsec = isec - FINUC.np;
2348 particleId = FHEAVY.kheavy[jsec]; // this is Fluka id !!!
2349 position.SetX(fXsco);
2350 position.SetY(fYsco);
2351 position.SetZ(fZsco);
2352 position.SetT(TRACKR.atrack);
2353 // position.SetT(TRACKR.atrack+FHEAVY.agheav[jsec]); //not yet implem.
2354 momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
2355 momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
2356 momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
2357 if (FHEAVY.tkheav[jsec] >= 3 && FHEAVY.tkheav[jsec] <= 6)
2358 momentum.SetE(FHEAVY.tkheav[jsec] + PAPROP.am[jsec+6]);
2359 else if (FHEAVY.tkheav[jsec] > 6)
2360 momentum.SetE(FHEAVY.tkheav[jsec] + FHEAVY.amnhea[jsec]); // to be checked !!!
2363 Warning("GetSecondary","isec out of range");
2366 Warning("GetSecondary","no secondaries available");
2367 } // end of GetSecondary
2369 TMCProcess TFluka::ProdProcess(Int_t isec) const
2370 // Name of the process that has produced the secondary particles
2371 // in the current step
2373 const TMCProcess kIpNoProc = kPNoProcess;
2374 const TMCProcess kIpPDecay = kPDecay;
2375 const TMCProcess kIpPPair = kPPair;
2376 // const TMCProcess kIpPPairFromPhoton = kPPairFromPhoton;
2377 // const TMCProcess kIpPPairFromVirtualPhoton = kPPairFromVirtualPhoton;
2378 const TMCProcess kIpPCompton = kPCompton;
2379 const TMCProcess kIpPPhotoelectric = kPPhotoelectric;
2380 const TMCProcess kIpPBrem = kPBrem;
2381 // const TMCProcess kIpPBremFromHeavy = kPBremFromHeavy;
2382 // const TMCProcess kIpPBremFromElectronOrPositron = kPBremFromElectronOrPositron;
2383 const TMCProcess kIpPDeltaRay = kPDeltaRay;
2384 // const TMCProcess kIpPMoller = kPMoller;
2385 // const TMCProcess kIpPBhabha = kPBhabha;
2386 const TMCProcess kIpPAnnihilation = kPAnnihilation;
2387 // const TMCProcess kIpPAnnihilInFlight = kPAnnihilInFlight;
2388 // const TMCProcess kIpPAnnihilAtRest = kPAnnihilAtRest;
2389 const TMCProcess kIpPHadronic = kPHadronic;
2390 const TMCProcess kIpPMuonNuclear = kPMuonNuclear;
2391 const TMCProcess kIpPPhotoFission = kPPhotoFission;
2392 const TMCProcess kIpPRayleigh = kPRayleigh;
2393 // const TMCProcess kIpPCerenkov = kPCerenkov;
2394 // const TMCProcess kIpPSynchrotron = kPSynchrotron;
2396 Int_t mugamma = TRACKR.jtrack == 7 || TRACKR.jtrack == 10 || TRACKR.jtrack == 11;
2397 if (iIcode == 102) return kIpPDecay;
2398 else if (iIcode == 104 || iIcode == 217) return kIpPPair;
2399 // else if (iIcode == 104) return kIpPairFromPhoton;
2400 // else if (iIcode == 217) return kIpPPairFromVirtualPhoton;
2401 else if (iIcode == 219) return kIpPCompton;
2402 else if (iIcode == 221) return kIpPPhotoelectric;
2403 else if (iIcode == 105 || iIcode == 208) return kIpPBrem;
2404 // else if (iIcode == 105) return kIpPBremFromHeavy;
2405 // else if (iIcode == 208) return kPBremFromElectronOrPositron;
2406 else if (iIcode == 103 || iIcode == 400) return kIpPDeltaRay;
2407 else if (iIcode == 210 || iIcode == 212) return kIpPDeltaRay;
2408 // else if (iIcode == 210) return kIpPMoller;
2409 // else if (iIcode == 212) return kIpPBhabha;
2410 else if (iIcode == 214 || iIcode == 215) return kIpPAnnihilation;
2411 // else if (iIcode == 214) return kIpPAnnihilInFlight;
2412 // else if (iIcode == 215) return kIpPAnnihilAtRest;
2413 else if (iIcode == 101) return kIpPHadronic;
2414 else if (iIcode == 101) {
2415 if (!mugamma) return kIpPHadronic;
2416 else if (TRACKR.jtrack == 7) return kIpPPhotoFission;
2417 else return kIpPMuonNuclear;
2419 else if (iIcode == 225) return kIpPRayleigh;
2420 // Fluka codes 100, 300 and 400 still to be investigasted
2421 else return kIpNoProc;
2424 //Int_t StepProcesses(TArrayI &proc) const
2425 // Return processes active in the current step
2427 //ck = total energy of the particl ????????????????
2431 Int_t TFluka::VolId2Mate(Int_t id) const
2434 // Returns the material number for a given volume ID
2436 if (fVerbosityLevel >= 3)
2437 printf("VolId2Mate %d %d\n", id, fMediaByRegion[id]);
2438 return fMediaByRegion[id-1];
2441 const char* TFluka::VolName(Int_t id) const
2444 // Returns the volume name for a given volume ID
2446 FlukaVolume* vol = dynamic_cast<FlukaVolume*>((*fVolumeMediaMap)[id-1]);
2447 const char* name = vol->GetName();
2448 if (fVerbosityLevel >= 3)
2449 printf("VolName %d %s \n", id, name);
2453 Int_t TFluka::VolId(const Text_t* volName) const
2456 // Converts from volume name to volume ID.
2457 // Time consuming. (Only used during set-up)
2458 // Could be replaced by hash-table
2462 for (i = 0; i < fNVolumes; i++)
2464 FlukaVolume* vol = dynamic_cast<FlukaVolume*>((*fVolumeMediaMap)[i]);
2465 TString name = vol->GetName();
2466 strcpy(tmp, name.Data());
2468 if (!strcmp(tmp, volName)) break;
2476 Int_t TFluka::CurrentVolID(Int_t& copyNo) const
2479 // Return the logical id and copy number corresponding to the current fluka region
2481 int ir = fCurrentFlukaRegion;
2482 int id = (FGeometryInit::GetInstance())->CurrentVolID(ir, copyNo);
2483 if (fVerbosityLevel >= 3)
2484 printf("CurrentVolID: %d %d %d \n", ir, id, copyNo);
2489 Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
2492 // Return the logical id and copy number of off'th mother
2493 // corresponding to the current fluka region
2496 return CurrentVolID(copyNo);
2498 int ir = fCurrentFlukaRegion;
2499 int id = (FGeometryInit::GetInstance())->CurrentVolOffID(ir, off, copyNo);
2500 if (fVerbosityLevel >= 3)
2501 printf("CurrentVolOffID: %d %d %d \n", ir, id, copyNo);
2503 if (fVerbosityLevel >= 0)
2504 printf("CurrentVolOffID: Warning Mother not found !!!\n");
2509 const char* TFluka::CurrentVolName() const
2512 // Return the current volume name
2515 Int_t id = TFluka::CurrentVolID(copy);
2516 const char* name = TFluka::VolName(id);
2517 if (fVerbosityLevel >= 3)
2518 printf("CurrentVolumeName: %d %s \n", fCurrentFlukaRegion, name);
2522 const char* TFluka::CurrentVolOffName(Int_t off) const
2525 // Return the volume name of the off'th mother of the current volume
2528 Int_t id = TFluka::CurrentVolOffID(off, copy);
2529 const char* name = TFluka::VolName(id);
2530 if (fVerbosityLevel >= 3)
2531 printf("CurrentVolumeOffName: %d %s \n", fCurrentFlukaRegion, name);
2535 Int_t TFluka::CurrentMaterial(Float_t &a, Float_t &z,
2536 Float_t &dens, Float_t &radl, Float_t &absl) const
2539 // Return the current medium number
2542 Int_t id = TFluka::CurrentVolID(copy);
2543 Int_t med = TFluka::VolId2Mate(id);
2544 if (fVerbosityLevel >= 3)
2545 printf("CurrentMaterial: %d %d \n", fCurrentFlukaRegion, med);
2549 void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
2551 // Transforms a position from the world reference frame
2552 // to the current volume reference frame.
2554 // Geant3 desription:
2555 // ==================
2556 // Computes coordinates XD (in DRS)
2557 // from known coordinates XM in MRS
2558 // The local reference system can be initialized by
2559 // - the tracking routines and GMTOD used in GUSTEP
2560 // - a call to GMEDIA(XM,NUMED)
2561 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2562 // (inverse routine is GDTOM)
2564 // If IFLAG=1 convert coordinates
2565 // IFLAG=2 convert direction cosinus
2568 Double_t xmD[3], xdD[3];
2569 xmD[0] = xm[0]; xmD[1] = xm[1]; xmD[2] = xm[2];
2570 (FGeometryInit::GetInstance())->Gmtod(xmD, xdD, iflag);
2571 xd[0] = xdD[0]; xd[1] = xdD[1]; xd[2] = xdD[2];
2575 void TFluka::Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
2577 // Transforms a position from the world reference frame
2578 // to the current volume reference frame.
2580 // Geant3 desription:
2581 // ==================
2582 // Computes coordinates XD (in DRS)
2583 // from known coordinates XM in MRS
2584 // The local reference system can be initialized by
2585 // - the tracking routines and GMTOD used in GUSTEP
2586 // - a call to GMEDIA(XM,NUMED)
2587 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2588 // (inverse routine is GDTOM)
2590 // If IFLAG=1 convert coordinates
2591 // IFLAG=2 convert direction cosinus
2594 Double_t xmD[3], xdD[3];
2595 xdD[0] = xd[0]; xdD[1] = xd[1]; xdD[2] = xd[2];
2596 (FGeometryInit::GetInstance())->Gdtom(xmD, xdD, iflag);
2597 xm[0] = xmD[0]; xm[1] = xmD[1]; xm[2] = xmD[2];
2600 void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
2602 // Transforms a position from the current volume reference frame
2603 // to the world reference frame.
2605 // Geant3 desription:
2606 // ==================
2607 // Computes coordinates XM (Master Reference System
2608 // knowing the coordinates XD (Detector Ref System)
2609 // The local reference system can be initialized by
2610 // - the tracking routines and GDTOM used in GUSTEP
2611 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2612 // (inverse routine is GMTOD)
2614 // If IFLAG=1 convert coordinates
2615 // IFLAG=2 convert direction cosinus
2621 void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
2623 // Transforms a position from the current volume reference frame
2624 // to the world reference frame.
2626 // Geant3 desription:
2627 // ==================
2628 // Computes coordinates XM (Master Reference System
2629 // knowing the coordinates XD (Detector Ref System)
2630 // The local reference system can be initialized by
2631 // - the tracking routines and GDTOM used in GUSTEP
2632 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2633 // (inverse routine is GMTOD)
2635 // If IFLAG=1 convert coordinates
2636 // IFLAG=2 convert direction cosinus
2640 (FGeometryInit::GetInstance())->Gdtom(xm, xd, iflag);
2643 // ===============================================================
2644 void TFluka::FutoTest()
2646 Int_t icode, mreg, newreg, particleId;
2647 Double_t rull, xsco, ysco, zsco;
2648 TLorentzVector position, momentum;
2651 if (fVerbosityLevel >=3)
2652 cout << " icode=" << icode << endl;
2653 } else if (icode > 0 && icode <= 5) {
2656 if (fVerbosityLevel >=3)
2657 cout << " icode=" << icode
2660 TrackPosition(position);
2661 TrackMomentum(momentum);
2662 if (fVerbosityLevel >=3) {
2663 cout << "TLorentzVector positionX=" << position.X()
2664 << "positionY=" << position.Y()
2665 << "positionZ=" << position.Z()
2666 << "timeT=" << position.T() << endl;
2667 cout << "TLorentzVector momentumX=" << momentum.X()
2668 << "momentumY=" << momentum.Y()
2669 << "momentumZ=" << momentum.Z()
2670 << "energyE=" << momentum.E() << endl;
2671 cout << "TrackStep=" << TrackStep() << endl;
2672 cout << "TrackLength=" << TrackLength() << endl;
2673 cout << "TrackTime=" << TrackTime() << endl;
2674 cout << "Edep=" << Edep() << endl;
2675 cout << "TrackPid=" << TrackPid() << endl;
2676 cout << "TrackCharge=" << TrackCharge() << endl;
2677 cout << "TrackMass=" << TrackMass() << endl;
2678 cout << "Etot=" << Etot() << endl;
2679 cout << "IsNewTrack=" << IsNewTrack() << endl;
2680 cout << "IsTrackInside=" << IsTrackInside() << endl;
2681 cout << "IsTrackEntering=" << IsTrackEntering() << endl;
2682 cout << "IsTrackExiting=" << IsTrackExiting() << endl;
2683 cout << "IsTrackOut=" << IsTrackOut() << endl;
2684 cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
2685 cout << "IsTrackAlive=" << IsTrackAlive() << endl;
2688 Float_t x = position.X();
2689 Float_t y = position.Y();
2690 Float_t z = position.Z();
2693 xm[0] = x; xm[1] = y; xm[2] = z;
2694 if (fVerbosityLevel >= 3)
2695 printf("Global trackPosition: %f %f %f \n", x, y, z);
2697 if (fVerbosityLevel >= 3)
2698 printf("Local trackPosition: %f %f %f \n", xd[0], xd[1], xd[2]);
2700 if (fVerbosityLevel >= 3)
2701 printf("New trackPosition: %f %f %f \n", xm[0], xm[1], xm[2]);
2702 } else if((icode >= 10 && icode <= 15) ||
2703 (icode >= 20 && icode <= 24) ||
2704 (icode >= 30 && icode <= 33) ||
2705 (icode >= 40 && icode <= 41) ||
2706 (icode >= 50 && icode <= 52)) {
2714 if (fVerbosityLevel >=3) {
2715 cout << " icode=" << icode
2720 << " zsco=" << zsco << endl;
2722 TrackPosition(position);
2723 TrackMomentum(momentum);
2724 if (fVerbosityLevel >=3) {
2725 cout << "Edep=" << Edep() << endl;
2726 cout << "Etot=" << Etot() << endl;
2727 cout << "TrackPid=" << TrackPid() << endl;
2728 cout << "TrackCharge=" << TrackCharge() << endl;
2729 cout << "TrackMass=" << TrackMass() << endl;
2730 cout << "IsTrackOut=" << IsTrackOut() << endl;
2731 cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
2732 cout << "IsTrackStop=" << IsTrackStop() << endl;
2733 cout << "IsTrackAlive=" << IsTrackAlive() << endl;
2735 } else if((icode >= 100 && icode <= 105) ||
2739 (icode >= 214 && icode <= 215) ||
2752 if (fVerbosityLevel >=3) {
2753 cout << " icode=" << icode
2757 << " zsco=" << zsco << endl;
2758 cout << "TrackPid=" << TrackPid() << endl;
2759 cout << "NSecondaries=" << NSecondaries() << endl;
2762 for (Int_t isec=0; isec< NSecondaries(); isec++) {
2763 TFluka::GetSecondary(isec, particleId, position, momentum);
2764 if (fVerbosityLevel >=3) {
2765 cout << "TLorentzVector positionX=" << position.X()
2766 << "positionY=" << position.Y()
2767 << "positionZ=" << position.Z()
2768 << "timeT=" << position.T() << endl;
2769 cout << "TLorentzVector momentumX=" << momentum.X()
2770 << "momentumY=" << momentum.Y()
2771 << "momentumZ=" << momentum.Z()
2772 << "energyE=" << momentum.E() << endl;
2773 cout << "TrackPid=" << particleId << endl;
2776 } else if((icode == 19) ||
2782 newreg = GetNewreg();
2786 if (fVerbosityLevel >=3) {
2787 cout << " icode=" << icode
2789 << " newreg=" << newreg
2792 << " zsco=" << zsco << endl;
2795 } // end of FutoTest