]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muondep/AccEffTemplates/Config.C
modified ranges for Phi exclusion cuts in order to be able to go accross 2Pi
[u/mrichter/AliRoot.git] / PWG / muondep / AccEffTemplates / Config.C
1 //
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...
6
7 #if !defined(__CINT__) || defined(__MAKECINT__)
8 #include <Riostream.h>
9 #include <TRandom.h>
10 #include <TDatime.h>
11 #include <TSystem.h>
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"
45 #endif
46
47
48 //--- Functions ---
49 class AliGenPythia;
50
51 void Config()
52 {
53   // Libraries required by geant321
54 #if defined(__CINT__)
55   gSystem->Load("VAR_LHAPDF");      // Parton density functions
56   gSystem->Load("libEGPythia6");   // TGenerator interface
57   if ( TString("VAR_GENERATOR").Contains("pythia6",TString::kIgnoreCase) )
58   {
59     std::cout << "Setting up Pythia6 required env. variables" << std::endl;
60     VAR_PYTHIA6_INCLUDES
61     VAR_PYTHIA6_SETENV
62   }
63   else  gSystem->Load("libpythia6");     // Pythia 6.2 (for decayer)
64   gSystem->Load("libAliPythia6");  // ALICE specific implementations
65   gSystem->Load("libgeant321");
66
67   if ( TString("VAR_GENERATOR").Contains("pythia8",TString::kIgnoreCase) )
68   {
69     std::cout << "Setting up Pythia8 required libraries and env. variables" << std::endl;
70     gSystem->Load("libpythia8");
71     gSystem->Load("libAliPythia8");
72     VAR_PYTHIA8_INCLUDES
73     VAR_PYTHIA8_SETENV
74   }
75
76 #endif
77
78   
79   new TGeant3TGeo("C++ Interface to Geant3");
80
81   //=======================================================================
82   //  Create the output file
83
84    
85   AliRunLoader* rl=0x0;
86
87   cout<<"Config.C: Creating Run Loader ..."<<endl;
88   rl = AliRunLoader::Open("galice.root",
89                           AliConfig::GetDefaultEventFolderName(),
90                           "recreate");
91   if (rl == 0x0)
92     {
93       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
94       return;
95     }
96   rl->SetCompressionLevel(2);
97   rl->SetNumberOfEventsPerFile(5000);
98   gAlice->SetRunLoader(rl);
99   
100   if ( TString("VAR_TRIGGER_CONFIGURATION").Length() > 0 )
101   {
102     AliSimulation::Instance()->SetTriggerConfig("VAR_TRIGGER_CONFIGURATION");
103     cout<<"Trigger configuration is set to VAR_TRIGGER_CONFIGURATION" << std::endl;
104   }
105   
106   //
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
111
112
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);
127
128     Float_t cut = 1.e-3;        // 1MeV cut by default
129     Float_t tofmax = 1.e10;
130
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); 
142
143   //======================//
144   // Set External decayer //
145   //======================//
146   TVirtualMCDecayer* decayer = new AliDecayerPythia;
147   
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);
159   }
160    */
161   
162   decayer->SetForceDecay(kAll);
163   decayer->Init();
164   gMC->SetExternalDecayer(decayer);
165
166   //=========================//
167   // Generator Configuration //
168   //=========================//
169
170   //AliGenerator* gener = CreateGenerator();
171
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();
178   
179   TString slibs = gSystem->GetLibraries();
180   TObjArray* olibs = slibs.Tokenize(" ");
181   TObjString* s;
182   TIter next(olibs);
183   std::cout << "List of libraries=" << std::endl;
184   while ( ( s = static_cast<TObjString*>(next())) )
185   {
186     std::cout << s->String().Data() << std::endl;
187   }
188   
189
190   gener->SetOrigin(0., 0., 0.); // Taken from OCDB
191
192   Float_t sigmax = 0.0025;
193   Float_t sigmay = 0.0029;
194   
195   gener->SetSigma(sigmax, sigmay, 0.);      // Sigma in (X,Y,Z) (cm) on IP position, sigmaz taken from OCDB
196   gener->SetVertexSmear(kPerEvent);
197   gener->Init();
198   
199   gener->Print();
200     
201   rl->CdGAFile();
202   
203   Int_t iABSO  = 1;
204   Int_t iDIPO  = 1;
205   Int_t iFMD   = 1;
206   Int_t iFRAME = 1;
207   Int_t iHALL  = 1;
208   Int_t iITS   = 1;
209   Int_t iMAG   = 1;
210   Int_t iMUON  = 1;
211   Int_t iPIPE  = 1;
212   Int_t iSHIL  = 1;
213   Int_t iT0    = 1;
214   Int_t iVZERO = 1;
215   Int_t iZDC   = 0;
216
217     //=================== Alice BODY parameters =============================
218     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
219
220     if (iMAG)
221     {
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");
226     }
227
228     if (iABSO)
229     {
230         //=================== ABSO parameters ============================
231         AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
232     }
233
234     if (iDIPO)
235     {
236         //=================== DIPO parameters ============================
237
238         AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
239     }
240
241     if (iHALL)
242     {
243         //=================== HALL parameters ============================
244
245         AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
246     }
247
248     if (iFRAME)
249     {
250         //=================== FRAME parameters ============================
251
252         AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
253         FRAME->SetHoles(1);
254     }
255
256     if (iSHIL)
257     {
258         //=================== SHIL parameters ============================
259
260         AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
261     }
262
263     if (iPIPE)
264     {
265         //=================== PIPE parameters ============================
266
267         AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
268     }
269  
270     if (iITS)
271     {
272         //=================== ITS parameters ============================
273
274         AliITS *ITS  = new AliITSv11("ITS","ITS v11");
275     }
276
277     if (iZDC)
278     {
279         //=================== ZDC parameters ============================
280         
281       AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
282       ZDC->SetSpectatorsTrack();
283       ZDC->SetLumiLength(0.);
284     }
285
286     if (iFMD)
287     {
288         //=================== FMD parameters ============================
289
290         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
291     }
292
293     if (iMUON)
294     {
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);
300     }
301
302     if (iT0)
303     {
304         //=================== T0 parameters ============================
305         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
306     }
307
308      if (iVZERO)
309     {
310         //=================== ACORDE parameters ============================
311
312         AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
313     }
314 }