FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Geane.C
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // Configuration macro for Geane VirtualMC
10 
11 void Config()
12 {
13  TGeoMedium *m = gGeoManager->GetMedium("air");
14  if (m != NULL)
15  m->SetParam(6, 0.005); // epsil
16  TGeoMedium *m2 = gGeoManager->GetMedium("FscScint");
17  if (m2 != NULL)
18  m2->SetParam(6, 0.005); // epsil
19  TGeoMedium *m3 = gGeoManager->GetMedium("lead");
20  if (m3 != NULL)
21  m3->SetParam(6, 0.005); // epsil
22 
23  gMC3 = new TGeant3TGeo("C++ Interface to Geant3");
24  cout << "-I- G3Config: Geant3 with TGeo has been created for Geane." << endl;
25  // create Cbm Specific Stack
26  PndStack *st = new PndStack(10);
27  gMC3->SetStack(st);
28 
29  // only from geant3 rev. 252 on --------
30  // NOPRNT = 1 means no IERR printout
31  // NOPRNT = 0 means IERR are printed
32  if (gROOT->GetVersionCode() >= 334848) {
33  Ertrio1_t *fErtrio1 = gMC3->fErtrio1;
34  fErtrio1->noprnt = 1;
35  cout << "-I- Geane.C: NOPRNT flag set to " << fErtrio1->noprnt << endl;
36  if (fErtrio1->noprnt == 1) {
37  cout << "-I- Geane.C: IERR flags are not printed. If you want to switch them on, please set "
38  "fErtrio1->noprnt = 0 in Geane.C"
39  << endl;
40  }
41  }
42  // -------------------------------------
43 
44  // ******* GEANEconfiguration for simulated Runs *******
45  gMC3->SetDEBU(0, 0, 1);
46  gMC3->SetSWIT(4, 10);
47 
48  gMC3->SetDCAY(0);
49  gMC3->SetPAIR(0);
50  gMC3->SetCOMP(0);
51  gMC3->SetPHOT(0);
52  gMC3->SetPFIS(0);
53  gMC3->SetDRAY(0);
54  gMC3->SetANNI(0);
55  gMC3->SetBREM(1);
56  gMC3->SetMUNU(0);
57  gMC3->SetCKOV(0);
58  gMC3->SetHADR(0); // Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)//4 fluka 5 gcalor
59  gMC3->SetLOSS(4);
60  gMC3->SetMULS(1); // 1=Moliere,3=Gaussian
61  gMC3->SetRAYL(0);
62  gMC3->SetSTRA(0);
63 
64  gMC3->SetAUTO(1); // Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
65  gMC3->SetABAN(0); // Restore 3.16 behaviour for abandoned tracks
66  gMC3->SetOPTI(0); // Select optimisation level for GEANT geometry searches (0,1,2)
67  gMC3->SetERAN(5.e-7);
68 
69  // -------->>>>> PAY ATTENTION!!!!!
70  // For a correct use of GEANE, you MUST use the cuts as set below!!!
71  // i.e. Since GEANE is tracking only the primary particle, DCUTE, DCUTM, BCUTE and BCUTM must be put
72  // at very high values (10 TeV) in order to calculate properly the energy loss.
73  // For a more complete explanation of the chosen values, refer to GEANT manual
74 
75  Float_t cut = 1.e-3; // 1 MeV cut by default
76  Float_t cutd = 1.e4; // 10 TeV - Threshold for delta-rays
77  Float_t cutb = cutd; // 10 TeV - Cut for bremsstrahlung
78  Float_t tofmax = 1.e10; // seconds
79  Float_t usrcuts[5] = {0., 0., 0., 0., 0.}; // usercuts
80  Float_t gcalpha = 0.999; // Optimal value for alpha
81 
82  cout << "Energy straggling area parameter from user set to: " << gcalpha << endl;
83  if (gcalpha < 0.9) {
84  gcalpha = 0.9;
85  cout << "User alpha parameter too low: forced to 0.9" << endl;
86  }
87 
88  // set cuts here
89  // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
90  gMC3->SetCUTS(cut, // CUTGAM = gammas
91  cut, // CUTELE = electrons
92  cut, // CUTNEU = neutral hadrons
93  cut, // CUTHAD = charged hadrons
94  cut, // CUTMUO = muons
95  cutb, // BCUTE = electron bremsstrahlung
96  cutb, // BCUTM = muon bremsstrahlung
97  cutd, // DCUTE = delta rays by electrons
98  cutd, // DCUTM = delta rays by muons
99  cutb, // PPCUTM = pair production by muons
100  tofmax, // TOFMAX = time of flight cut
101  usrcuts);
102 
103  gMC3->SetECut(gcalpha);
104 }
void Config()
Configuration macro for Geant3 VirtualMC.
Definition: flConfig.C:10