Working on the electron cut
[u/mrichter/AliRoot.git] / prod / LHC09a11 / Config.C
CommitLineData
1619a4d3 1// Config file MUON + ITS (for vertex) for PDC06\r
2// Tuned for p+p min biais and quarkonia production (AliGenMUONCocktailpp)\r
3// Remember to define the directory and option\r
4// gAlice->SetConfigFunction("Config('$HOME','box');");\r
5// april 3rd: added L3 magnet \r
6\r
7enum Run_t\r
8{\r
9\r
10 ppMBias, pptrg1mu, pptrg2mu, pptrg2muPolA, pptrg2muPolB, pptrg2muPolC, pptrg2muSecret, kRunMax\r
11 \r
12};\r
13\r
14const char* runName[] = {\r
15 "ppMBias", "pptrg1mu", "pptrg2mu", "pptrg2muPolA", "pptrg2muPolB", "pptrg2muPolC", "pptrg2muSecret" \r
16};\r
17\r
18static Run_t srun = ppMBias;\r
19static Int_t sseed = 12345;\r
20\r
21void Config()\r
22{\r
23 \r
24 // Get settings from environment variables\r
25 ProcessEnvironmentVars();\r
26\r
27 //=====================================================================\r
28 // Libraries required by geant321\r
29 gSystem->Load("liblhapdf.so"); // Parton density functions\r
30 gSystem->Load("libpythia6.so"); // Pythia\r
31 gSystem->Load("libgeant321.so");\r
32 gSystem->Load("libEG");\r
33 gSystem->Load("libEGPythia6");\r
34 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations\r
35 \r
36 new TGeant3TGeo("C++ Interface to Geant3");\r
37 \r
38 // Create the output file \r
39 AliRunLoader* rl=0x0;\r
40 rl = AliRunLoader::Open(\r
41 "galice.root", AliConfig::GetDefaultEventFolderName(), "recreate");\r
42 if (rl == 0x0) {\r
43 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");\r
44 return;\r
45 }\r
46 rl->SetCompressionLevel(2);\r
47 rl->SetNumberOfEventsPerFile(500);\r
48 gAlice->SetRunLoader(rl);\r
49\r
50 //=======================================================================\r
51 // Set External decayer\r
52 TVirtualMCDecayer *decayer = new AliDecayerPythia();\r
53 decayer->SetForceDecay(kAll);\r
54 decayer->Init();\r
55 gMC->SetExternalDecayer(decayer);\r
56\r
57 //=======================================================================\r
58 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******\r
59 gMC->SetProcess("DCAY",1);\r
60 gMC->SetProcess("PAIR",1);\r
61 gMC->SetProcess("COMP",1);\r
62 gMC->SetProcess("PHOT",1);\r
63 gMC->SetProcess("PFIS",0);\r
64 gMC->SetProcess("DRAY",0);\r
65 gMC->SetProcess("ANNI",1);\r
66 gMC->SetProcess("BREM",1);\r
67 gMC->SetProcess("MUNU",1);\r
68 gMC->SetProcess("CKOV",1);\r
69 gMC->SetProcess("HADR",1);\r
70 gMC->SetProcess("LOSS",2);\r
71 gMC->SetProcess("MULS",1);\r
72 gMC->SetProcess("RAYL",1);\r
73\r
74 Float_t cut = 1.e-3; // 1MeV cut by default\r
75 Float_t tofmax = 1.e10;\r
76\r
77 gMC->SetCut("CUTGAM", cut);\r
78 gMC->SetCut("CUTELE", cut);\r
79 gMC->SetCut("CUTNEU", cut);\r
80 gMC->SetCut("CUTHAD", cut);\r
81 gMC->SetCut("CUTMUO", cut);\r
82 gMC->SetCut("BCUTE", cut); \r
83 gMC->SetCut("BCUTM", cut); \r
84 gMC->SetCut("DCUTE", cut); \r
85 gMC->SetCut("DCUTM", cut); \r
86 gMC->SetCut("PPCUTM", cut);\r
87 gMC->SetCut("TOFMAX", tofmax); \r
88 //\r
89 //=======================================================================\r
90 // ************* STEERING parameters FOR ALICE SIMULATION **************\r
91 // Chamber positions\r
92 // From AliMUONConstants class we get :\r
93 // Position Z (along beam) of the chambers (in cm) \r
94 // (from AliMUONConstants class): \r
95 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5, \r
96 // 1416.5, 1443.5, 1610, 1625., 1710., 1725. \r
97 // Internal Radius (in cm) \r
98 // 36.4, 46.2, 66.0, 80., 80., 100., 100. \r
99 // External Radius (in cm)\r
100 // 183., 245., 395., 560., 563., 850., 900. \r
101 //=======================================================================\r
102\r
103 // The internal generator, for minimum bias\r
104 \r
105 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();\r
106 gener->SetPtRange(0.,1000.);\r
107 gener->SetYRange(-4.,-2.4);\r
108 gener->SetPhiRange(0., 360.);\r
109 gener->SetOrigin(0.,0.,0.); \r
110 gener->SetSigma(0.,0.,5.3);\r
111 gener->SetVertexSmear(kPerEvent);\r
112\r
113 // Special generator trigger conditions, etc.\r
114\r
115 switch(srun) {\r
116 case pptrg1mu:\r
117 {\r
118 gener->SetMuonMultiplicity(1); \r
119 gener->SetMuonPtCut(0.5);\r
120 gener->SetMuonThetaRange(171.,178.); \r
121 }\r
122 break;\r
123 case pptrg2mu:\r
124 {\r
125 gener->SetMuonMultiplicity(2); \r
126 gener->SetMuonPtCut(0.5);\r
127 gener->SetMuonThetaRange(171.,178.); \r
128 }\r
129 break;\r
130 case pptrg2muPolA:\r
131 {\r
132 gener->SetMuonMultiplicity(2); \r
133 gener->SetMuonPtCut(0.5);\r
134 gener->SetMuonThetaRange(171.,178.); \r
135 gener->SetResPolarization(0.3,0.3,0.,1.,0.,"kColSop");\r
136 }\r
137 break;\r
138 case pptrg2muPolB:\r
139 {\r
140 gener->SetMuonMultiplicity(2); \r
141 gener->SetMuonPtCut(0.5);\r
142 gener->SetMuonThetaRange(171.,178.); \r
143 gener->SetResPolarization(-0.3,-0.3,0.,1.,0.,"kColSop");\r
144 }\r
145 break;\r
146 case pptrg2muPolC:\r
147 {\r
148 gener->SetMuonMultiplicity(2); \r
149 gener->SetMuonPtCut(0.5);\r
150 gener->SetMuonThetaRange(171.,178.); \r
151 gener->SetResPolarization(0.,0.,0.,1.,0.,"kColSop");\r
152 }\r
153 break;\r
154 case pptrg2muSecret:\r
155 {\r
156 gener->SetMuonMultiplicity(2); \r
157 gener->SetMuonPtCut(0.5);\r
158 gener->SetMuonThetaRange(171.,178.); \r
159 gener->SetCMSEnergy(10);\r
160 gener->SetSigmaReaction(0.0695);\r
161 gener->SetSigmaJPsi(27.4e-6);\r
162 gener->SetSigmaPsiP(6.039e-6);\r
163 gener->SetSigmaUpsilon(0.855e-6);\r
164 gener->SetSigmaUpsilonP(0.218e-6);\r
165 gener->SetSigmaUpsilonPP(0.122e-6);\r
166 gener->SetSigmaCCbar(4.5e-3);\r
167 gener->SetSigmaBBbar(0.33e-3);\r
168 gener->SetSigmaSilent();\r
169 }\r
170 break;\r
171 default: break;\r
172 }\r
173\r
174 gener->CreateCocktail();\r
175\r
176 // The external generator\r
177\r
178 AliGenPythia *pythia = new AliGenPythia(1);\r
179 pythia->SetProcess(kPyMb);\r
180 pythia->SetStrucFunc(kCTEQ5L);\r
181 pythia->SetEnergyCMS(10000.);\r
182 Decay_t dt = gener->GetDecayModePythia();\r
183 pythia->SetForceDecay(dt);\r
184 pythia->SetPtRange(0.,1000.);\r
185 pythia->SetYRange(-8.,8.);\r
186 pythia->SetPhiRange(0.,360.);\r
187 pythia->SetPtHard(2.76,-1.0);\r
188 pythia->SwitchHFOff();\r
189 pythia->Init();\r
190\r
191 gener->AddGenerator(pythia,"Pythia",1);\r
192 gener->Init();\r
193 \r
194 //============================================================= \r
195 // Field (L3 0.5 T) outside dimuon spectrometer\r
4642ac4b 196 AliMagF *field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG);\r
1619a4d3 197 TGeoGlobalMagField::Instance()->SetField(field);\r
198\r
199 Int_t iITS = 1;\r
200 Int_t iFMD = 1;\r
201 Int_t iVZERO = 1;\r
202 Int_t iZDC = 0;\r
203 Int_t iT0 = 0;\r
204\r
205 rl->CdGAFile();\r
206\r
207 //=================== Alice BODY parameters =============================\r
208 AliBODY *BODY = new AliBODY("BODY","Alice envelop");\r
209 //=================== ABSO parameters ============================\r
210 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");\r
211 //=================== DIPO parameters ============================\r
212 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");\r
213 //================== HALL parameters ============================\r
214 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");\r
215 //================== The L3 Magnet ==============================\r
216 AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");\r
217 //=================== PIPE parameters ============================\r
218 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");\r
219 //=================== SHIL parameters ============================\r
220 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");\r
221 //=================== ITS parameters =============================\r
222 if(iITS) {\r
223 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");\r
224 }\r
225 //=================== FMD parameters =============================\r
226 if(iFMD) {\r
227 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");\r
228 }\r
229 //=================== VZERO parameters =============================\r
230 if (iVZERO) {\r
231 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");\r
232 }\r
233 if (iZDC){\r
234 //=================== ZDC parameters ============================\r
235 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");\r
236 }\r
237 if (iT0) {\r
238 //=================== T0 parameters ============================\r
239 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");\r
240 }\r
241\r
242\r
243 //=================== MUON Subsystem ===========================\r
244 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;\r
245\r
246 AliMUON *MUON = new AliMUONv1("MUON","default");\r
247}\r
248\r
249Float_t EtaToTheta(Float_t arg){\r
250 return (180./TMath::Pi())*2.*atan(exp(-arg));\r
251}\r
252\r
253void ProcessEnvironmentVars()\r
254{\r
255 // Run type\r
256 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {\r
257 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {\r
258 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), runName[iRun])==0) {\r
259 srun = (Run_t)iRun;\r
260 cout<<"Run type set to "<<runName[iRun]<<endl;\r
261 }\r
262 }\r
263 }\r
264}\r