2 // Template for a Config.C file
3 // to be used by AliMuonAccEffSubmitter, which will
4 // replace all instances of VAR_ with something
5 // relevant and useable...
7 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <TVirtualMC.h>
13 #include <TGeant3TGeo.h>
14 #include "STEER/AliRunLoader.h"
15 #include "STEER/AliRun.h"
16 #include "STEER/AliConfig.h"
17 #include "PYTHIA6/AliDecayerPythia.h"
18 #include "PYTHIA6/AliGenPythia.h"
19 #include "TDPMjet/AliGenDPMjet.h"
20 #include "STEER/AliMagFCheb.h"
21 #include "STRUCT/AliBODY.h"
22 #include "STRUCT/AliMAG.h"
23 #include "STRUCT/AliABSOv3.h"
24 #include "STRUCT/AliDIPOv3.h"
25 #include "STRUCT/AliHALLv3.h"
26 #include "STRUCT/AliFRAMEv2.h"
27 #include "STRUCT/AliSHILv3.h"
28 #include "STRUCT/AliPIPEv3.h"
29 #include "ITS/AliITSv11Hybrid.h"
30 #include "TPC/AliTPCv2.h"
31 #include "TOF/AliTOFv6T0.h"
32 #include "HMPID/AliHMPIDv3.h"
33 #include "ZDC/AliZDCv3.h"
34 #include "TRD/AliTRDv1.h"
35 #include "TRD/AliTRDgeometry.h"
36 #include "FMD/AliFMDv1.h"
37 #include "MUON/AliMUONv1.h"
38 #include "PHOS/AliPHOSv1.h"
39 #include "PHOS/AliPHOSSimParam.h"
40 #include "PMD/AliPMDv1.h"
41 #include "T0/AliT0v1.h"
42 #include "EMCAL/AliEMCALv2.h"
43 #include "ACORDE/AliACORDEv1.h"
44 #include "VZERO/AliVZEROv7.h"
53 // Libraries required by geant321
55 gSystem->Load("VAR_LHAPDF"); // Parton density functions
56 gSystem->Load("libEGPythia6"); // TGenerator interface
57 if ( TString("VAR_GENERATOR").Contains("pythia6",TString::kIgnoreCase) )
59 std::cout << "Setting up Pythia6 required env. variables" << std::endl;
63 else gSystem->Load("libpythia6"); // Pythia 6.2 (for decayer)
64 gSystem->Load("libAliPythia6"); // ALICE specific implementations
65 gSystem->Load("libgeant321");
67 if ( TString("VAR_GENERATOR").Contains("pythia8",TString::kIgnoreCase) )
69 std::cout << "Setting up Pythia8 required libraries and env. variables" << std::endl;
70 gSystem->Load("libpythia8");
71 gSystem->Load("libAliPythia8");
79 new TGeant3TGeo("C++ Interface to Geant3");
81 //=======================================================================
82 // Create the output file
87 cout<<"Config.C: Creating Run Loader ..."<<endl;
88 rl = AliRunLoader::Open("galice.root",
89 AliConfig::GetDefaultEventFolderName(),
93 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
96 rl->SetCompressionLevel(2);
97 rl->SetNumberOfEventsPerFile(5000);
98 gAlice->SetRunLoader(rl);
100 if ( TString("VAR_TRIGGER_CONFIGURATION").Length() > 0 )
102 AliSimulation::Instance()->SetTriggerConfig("VAR_TRIGGER_CONFIGURATION");
103 cout<<"Trigger configuration is set to VAR_TRIGGER_CONFIGURATION" << std::endl;
107 //=======================================================================
108 // ************* STEERING parameters FOR ALICE SIMULATION **************
109 // --- Specify event type to be tracked through the ALICE setup
110 // --- All positions are in cm, angles in degrees, and P and E in GeV
113 gMC->SetProcess("DCAY",1);
114 gMC->SetProcess("PAIR",1);
115 gMC->SetProcess("COMP",1);
116 gMC->SetProcess("PHOT",1);
117 gMC->SetProcess("PFIS",0);
118 gMC->SetProcess("DRAY",0);
119 gMC->SetProcess("ANNI",1);
120 gMC->SetProcess("BREM",1);
121 gMC->SetProcess("MUNU",1);
122 gMC->SetProcess("CKOV",1);
123 gMC->SetProcess("HADR",1);
124 gMC->SetProcess("LOSS",2);
125 gMC->SetProcess("MULS",1);
126 gMC->SetProcess("RAYL",1);
128 Float_t cut = 1.e-3; // 1MeV cut by default
129 Float_t tofmax = 1.e10;
131 gMC->SetCut("CUTGAM", cut);
132 gMC->SetCut("CUTELE", cut);
133 gMC->SetCut("CUTNEU", cut);
134 gMC->SetCut("CUTHAD", cut);
135 gMC->SetCut("CUTMUO", cut);
136 gMC->SetCut("BCUTE", cut);
137 gMC->SetCut("BCUTM", cut);
138 gMC->SetCut("DCUTE", cut);
139 gMC->SetCut("DCUTM", cut);
140 gMC->SetCut("PPCUTM", cut);
141 gMC->SetCut("TOFMAX", tofmax);
143 //======================//
144 // Set External decayer //
145 //======================//
146 TVirtualMCDecayer* decayer = new AliDecayerPythia;
148 /* FIXME: put back polarization switch ?
149 if (polar == kNO_pol){
150 decayer = new AliDecayerPythia();
151 } else if (polar == kTH_pol){
152 decayer = new AliDecayerPolarized(1.,AliDecayerPolarized::kHelicity,AliDecayerPolarized::kMuon);
153 } else if (polar == kT_pol){
154 decayer = new AliDecayerPolarized(1.,AliDecayerPolarized::kColSop,AliDecayerPolarized::kMuon);
155 } else if (polar == kLH_pol){
156 decayer = new AliDecayerPolarized(-1.,AliDecayerPolarized::kHelicity,AliDecayerPolarized::kMuon);
157 } else if (polar == kL_pol){
158 decayer = new AliDecayerPolarized(-1.,AliDecayerPolarized::kColSop,AliDecayerPolarized::kMuon);
162 decayer->SetForceDecay(kAll);
164 gMC->SetExternalDecayer(decayer);
166 //=========================//
167 // Generator Configuration //
168 //=========================//
170 //AliGenerator* gener = CreateGenerator();
172 std::cout << "VAR_GENERATOR settings " << std::endl;
173 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
174 gSystem->AddIncludePath("-I$ALICE_ROOT/EVGEN");
175 gSystem->AddIncludePath("-I$ALICE_ROOT/STEER/STEER");
176 gROOT->LoadMacro("VAR_GENERATOR.C+");
177 AliGenerator* gener = VAR_GENERATOR();
179 TString slibs = gSystem->GetLibraries();
180 TObjArray* olibs = slibs.Tokenize(" ");
183 std::cout << "List of libraries=" << std::endl;
184 while ( ( s = static_cast<TObjString*>(next())) )
186 std::cout << s->String().Data() << std::endl;
190 gener->SetOrigin(0., 0., 0.); // Taken from OCDB
192 Float_t sigmax = 0.0025;
193 Float_t sigmay = 0.0029;
195 gener->SetSigma(sigmax, sigmay, 0.); // Sigma in (X,Y,Z) (cm) on IP position, sigmaz taken from OCDB
196 gener->SetVertexSmear(kPerEvent);
217 //=================== Alice BODY parameters =============================
218 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
222 //=================== MAG parameters ============================
223 // --- Start with Magnet since detector layouts may be depending ---
224 // --- on the selected Magnet dimensions ---
225 AliMAG *MAG = new AliMAG("MAG", "Magnet");
230 //=================== ABSO parameters ============================
231 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
236 //=================== DIPO parameters ============================
238 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
243 //=================== HALL parameters ============================
245 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
250 //=================== FRAME parameters ============================
252 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
258 //=================== SHIL parameters ============================
260 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
265 //=================== PIPE parameters ============================
267 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
272 //=================== ITS parameters ============================
274 AliITS *ITS = new AliITSv11("ITS","ITS v11");
279 //=================== ZDC parameters ============================
281 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
282 ZDC->SetSpectatorsTrack();
283 ZDC->SetLumiLength(0.);
288 //=================== FMD parameters ============================
290 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
295 //=================== MUON parameters ===========================
296 // New MUONv1 version (geometry defined via builders)
297 AliMUON *MUON = new AliMUONv1("MUON", "default");
298 MUON->SetTriggerEffCells(1);
299 MUON->SetTriggerResponseV1(2);
304 //=================== T0 parameters ============================
305 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
310 //=================== ACORDE parameters ============================
312 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");