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("liblhapdf"); // Parton density functions
56 gSystem->Load("libEGPythia6"); // TGenerator interface
57 gSystem->Load("libpythia6"); // Pythia 6.2 (for decayer)
58 gSystem->Load("libAliPythia6"); // ALICE specific implementations
59 gSystem->Load("libgeant321");
61 if ( TString("VAR_GENERATOR").Contains("pythia8",TString::kIgnoreCase) )
63 std::cout << "Setting up Pythia8 required libraries and env. variables" << std::endl;
64 gSystem->Load("libpythia8");
65 gSystem->Load("libAliPythia8");
70 if ( TString("VAR_GENERATOR").Contains("pythia6",TString::kIgnoreCase) )
72 std::cout << "Setting up Pythia6 required env. variables" << std::endl;
81 new TGeant3TGeo("C++ Interface to Geant3");
83 //=======================================================================
84 // Create the output file
89 cout<<"Config.C: Creating Run Loader ..."<<endl;
90 rl = AliRunLoader::Open("galice.root",
91 AliConfig::GetDefaultEventFolderName(),
95 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
98 rl->SetCompressionLevel(2);
99 rl->SetNumberOfEventsPerFile(5000);
100 gAlice->SetRunLoader(rl);
102 if ( TString("VAR_TRIGGER_CONFIGURATION").Length() > 0 )
104 AliSimulation::Instance()->SetTriggerConfig("VAR_TRIGGER_CONFIGURATION");
105 cout<<"Trigger configuration is set to VAR_TRIGGER_CONFIGURATION" << std::endl;
109 //=======================================================================
110 // ************* STEERING parameters FOR ALICE SIMULATION **************
111 // --- Specify event type to be tracked through the ALICE setup
112 // --- All positions are in cm, angles in degrees, and P and E in GeV
115 gMC->SetProcess("DCAY",1);
116 gMC->SetProcess("PAIR",1);
117 gMC->SetProcess("COMP",1);
118 gMC->SetProcess("PHOT",1);
119 gMC->SetProcess("PFIS",0);
120 gMC->SetProcess("DRAY",0);
121 gMC->SetProcess("ANNI",1);
122 gMC->SetProcess("BREM",1);
123 gMC->SetProcess("MUNU",1);
124 gMC->SetProcess("CKOV",1);
125 gMC->SetProcess("HADR",1);
126 gMC->SetProcess("LOSS",2);
127 gMC->SetProcess("MULS",1);
128 gMC->SetProcess("RAYL",1);
130 Float_t cut = 1.e-3; // 1MeV cut by default
131 Float_t tofmax = 1.e10;
133 gMC->SetCut("CUTGAM", cut);
134 gMC->SetCut("CUTELE", cut);
135 gMC->SetCut("CUTNEU", cut);
136 gMC->SetCut("CUTHAD", cut);
137 gMC->SetCut("CUTMUO", cut);
138 gMC->SetCut("BCUTE", cut);
139 gMC->SetCut("BCUTM", cut);
140 gMC->SetCut("DCUTE", cut);
141 gMC->SetCut("DCUTM", cut);
142 gMC->SetCut("PPCUTM", cut);
143 gMC->SetCut("TOFMAX", tofmax);
145 //======================//
146 // Set External decayer //
147 //======================//
148 TVirtualMCDecayer* decayer = new AliDecayerPythia;
150 /* FIXME: put back polarization switch ?
151 if (polar == kNO_pol){
152 decayer = new AliDecayerPythia();
153 } else if (polar == kTH_pol){
154 decayer = new AliDecayerPolarized(1.,AliDecayerPolarized::kHelicity,AliDecayerPolarized::kMuon);
155 } else if (polar == kT_pol){
156 decayer = new AliDecayerPolarized(1.,AliDecayerPolarized::kColSop,AliDecayerPolarized::kMuon);
157 } else if (polar == kLH_pol){
158 decayer = new AliDecayerPolarized(-1.,AliDecayerPolarized::kHelicity,AliDecayerPolarized::kMuon);
159 } else if (polar == kL_pol){
160 decayer = new AliDecayerPolarized(-1.,AliDecayerPolarized::kColSop,AliDecayerPolarized::kMuon);
164 decayer->SetForceDecay(kAll);
166 gMC->SetExternalDecayer(decayer);
168 //=========================//
169 // Generator Configuration //
170 //=========================//
172 //AliGenerator* gener = CreateGenerator();
174 std::cout << "VAR_GENERATOR settings " << std::endl;
175 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
176 gSystem->AddIncludePath("-I$ALICE_ROOT/EVGEN");
177 gSystem->AddIncludePath("-I$ALICE_ROOT/STEER/STEER");
178 gROOT->LoadMacro("VAR_GENERATOR.C+");
179 AliGenerator* gener = VAR_GENERATOR();
181 TString slibs = gSystem->GetLibraries();
182 TObjArray* olibs = slibs.Tokenize(" ");
185 std::cout << "List of libraries=" << std::endl;
186 while ( ( s = static_cast<TObjString*>(next())) )
188 std::cout << s->String().Data() << std::endl;
192 gener->SetOrigin(0., 0., 0.); // Taken from OCDB
194 Float_t sigmax = 0.0025;
195 Float_t sigmay = 0.0029;
197 gener->SetSigma(sigmax, sigmay, 0.); // Sigma in (X,Y,Z) (cm) on IP position, sigmaz taken from OCDB
198 gener->SetVertexSmear(kPerEvent);
219 //=================== Alice BODY parameters =============================
220 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
224 //=================== MAG parameters ============================
225 // --- Start with Magnet since detector layouts may be depending ---
226 // --- on the selected Magnet dimensions ---
227 AliMAG *MAG = new AliMAG("MAG", "Magnet");
232 //=================== ABSO parameters ============================
233 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
238 //=================== DIPO parameters ============================
240 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
245 //=================== HALL parameters ============================
247 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
252 //=================== FRAME parameters ============================
254 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
260 //=================== SHIL parameters ============================
262 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
267 //=================== PIPE parameters ============================
269 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
274 //=================== ITS parameters ============================
276 AliITS *ITS = new AliITSv11("ITS","ITS v11");
281 //=================== ZDC parameters ============================
283 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
284 ZDC->SetSpectatorsTrack();
285 ZDC->SetLumiLength(0.);
290 //=================== FMD parameters ============================
292 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
297 //=================== MUON parameters ===========================
298 // New MUONv1 version (geometry defined via builders)
299 AliMUON *MUON = new AliMUONv1("MUON", "default");
300 MUON->SetTriggerEffCells(1);
301 MUON->SetTriggerResponseV1(2);
306 //=================== T0 parameters ============================
307 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
312 //=================== ACORDE parameters ============================
314 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");