]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/macros/Config_pileup.C
Update master to aliroot
[u/mrichter/AliRoot.git] / ITS / UPGRADE / macros / Config_pileup.C
CommitLineData
abe39e23 1//
2// A Config.C for ITSU pileup studies in pp.
3// ( based of the Config.C from $ALICE_ROOT/test/pileup/ )
4//
5
6#if !defined(__CINT__) || defined(__MAKECINT__)
7#include <Riostream.h>
8#include <TPDGCode.h>
9#include <TRandom.h>
10#include <TSystem.h>
11#include <TVirtualMC.h>
12#include <TGeoManager.h>
13#include <TGeoGlobalMagField.h>
14
15#include "../geant3/TGeant3/TGeant3TGeo.h"
16
17#include "AliMagF.h"
18#include "STEER/STEER/AliRunLoader.h"
19#include "STEER/STEER/AliRun.h"
20#include "STEER/STEER/AliConfig.h"
21#include "PYTHIA6/AliDecayerPythia.h"
22#include "EVGEN/AliGenCocktail.h"
23#include "EVGEN/AliGenHIJINGpara.h"
24#include "EVGEN/AliGenFixed.h"
25#include "EVGEN/AliGenBox.h"
26#include "EVGEN/AliGenPileup.h"
27#include "PYTHIA6/AliGenPythia.h"
28#include "STRUCT/AliBODY.h"
29#include "STRUCT/AliMAG.h"
30#include "STRUCT/AliABSOv3.h"
31#include "STRUCT/AliDIPOv3.h"
32#include "STRUCT/AliHALLv3.h"
33#include "STRUCT/AliFRAMEv2.h"
34#include "STRUCT/AliSHILv3.h"
35#include "STRUCT/AliPIPEv3.h"
36#include "STRUCT/AliPIPEupgrade.h"
37#include "ITS/AliITSv11.h"
38#include "ITS/UPGRADE/AliITSUv1.h"
39#include "TPC/Sim/AliTPCv2.h"
40#include "TOF/AliTOFv6T0.h"
41#include "HMPID/AliHMPIDv3.h"
42#include "ZDC/AliZDCv3.h"
43#include "TRD/AliTRDv1.h"
44#include "TRD/AliTRDgeometry.h"
45#include "FMD/AliFMDv1.h"
46#include "MUON/AliMUONv1.h"
47#include "PHOS/AliPHOSv1.h"
48#include "PMD/AliPMDv1.h"
49#include "T0/AliT0v1.h"
50#include "EMCAL/AliEMCALv2.h"
51#include "ACORDE/AliACORDEv1.h"
52#include "VZERO/AliVZEROv7.h"
53#endif
54
55static Float_t energy = 14000; // energy in CMS
56
57AliGenerator* MbPythia(Float_t energy)
58{
59//
60// Pythia
61 AliGenPythia* pythia = new AliGenPythia(-1);
62 pythia->SetMomentumRange(0, 999999.);
63 pythia->SetThetaRange(0., 180.);
64 pythia->SetYRange(-1.5,1.5);
65 pythia->SetPtRange(0,1000.);
66 pythia->SetProcess(kPyMb);
67 pythia->SetEnergyCMS(energy);
68 pythia->SetProjectile("p", 1, 1);
69 pythia->SetTarget("p", 1, 1);
70
71 return pythia;
72}
73
74void Config()
75{
76 // Set Random Number seed
77 gRandom->SetSeed(1); // Set 0 to use the currecnt time
78
79
80 // libraries required by geant321
81#if defined(__CINT__)
82 gSystem->Load("liblhapdf");
83 gSystem->Load("libEGPythia6");
84 gSystem->Load("libpythia6");
85 gSystem->Load("libAliPythia6");
86 gSystem->Load("libgeant321");
87 gSystem->Load("libhijing");
88 gSystem->Load("libTHijing");
89#endif
4070f709 90 gSystem->Load("libITSUpgradeBase");
91 gSystem->Load("libITSUpgradeSim");
abe39e23 92
93
94 new TGeant3TGeo("C++ Interface to Geant3");
95
96 AliRunLoader* rl=0x0;
97
98
99 rl = AliRunLoader::Open("galice.root",
100 AliConfig::GetDefaultEventFolderName(),
101 "recreate");
102 if (rl == 0x0)
103 {
104 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
105 return;
106 }
107 rl->SetCompressionLevel(2);
108 rl->SetNumberOfEventsPerFile(2000);
109 gAlice->SetRunLoader(rl);
110
111 //
112 // Set External decayer
113 TVirtualMCDecayer *decayer = new AliDecayerPythia();
114
115 decayer->SetForceDecay(kAll);
116 decayer->Init();
117 gMC->SetExternalDecayer(decayer);
118 //=======================================================================
119 // ************* STEERING parameters FOR ALICE SIMULATION **************
120 // --- Specify event type to be tracked through the ALICE setup
121 // --- All positions are in cm, angles in degrees, and P and E in GeV
122
123
124 gMC->SetProcess("DCAY",1);
125 gMC->SetProcess("PAIR",1);
126 gMC->SetProcess("COMP",1);
127 gMC->SetProcess("PHOT",1);
128 gMC->SetProcess("PFIS",0);
129 gMC->SetProcess("DRAY",0);
130 gMC->SetProcess("ANNI",1);
131 gMC->SetProcess("BREM",1);
132 gMC->SetProcess("MUNU",1);
133 gMC->SetProcess("CKOV",1);
134 gMC->SetProcess("HADR",0);
135 gMC->SetProcess("LOSS",2);
136 gMC->SetProcess("MULS",1);
137 gMC->SetProcess("RAYL",1);
138
139 Float_t cut = 1.e-3; // 1MeV cut by default
140 Float_t tofmax = 1.e10;
141
142 gMC->SetCut("CUTGAM", cut);
143 gMC->SetCut("CUTELE", cut);
144 gMC->SetCut("CUTNEU", cut);
145 gMC->SetCut("CUTHAD", cut);
146 gMC->SetCut("CUTMUO", cut);
147 gMC->SetCut("BCUTE", cut);
148 gMC->SetCut("BCUTM", cut);
149 gMC->SetCut("DCUTE", cut);
150 gMC->SetCut("DCUTM", cut);
151 gMC->SetCut("PPCUTM", cut);
152 gMC->SetCut("TOFMAX", tofmax);
153
154// *********************** Pile up generation *********************
155 // Minimum bias Pythia with pileup
156 AliGenPileup *gener = new AliGenPileup();
157 AliGenerator* pyth = MbPythia(energy);
158
159 // Set the pileup interaction generator
160 // The second argument is the pileup rate
161 // in terms of event rate per bunch crossing
162 gener->SetGenerator(pyth,0.05);
163 // Set the beam time structure
164 // Details on the syntax in STEER/AliTriggerBCMask
165 gener->SetBCMask("1782(1H1L)"); // Full LHC
166
167 // Generate the trigger interaction
168 gener->GenerateTrigInteraction(kTRUE);
169
170 //Set the ITS integration time
171 gener->SetPileUpTimeWindow(30e-6);
172
173 // PRIMARY VERTEX
174 //
175 //gener->SetOrigin(0., 0., 0.); // vertex position
176 //
177 //
178 // Size of the interaction diamond
179 // Longitudinal
180 Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
181 //
182 // Transverse
183 Float_t betast = 10; // beta* [m]
184 Float_t eps = 3.75e-6; // emittance [m]
185 Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
186 Float_t sigmaxy = TMath::Sqrt(eps*betast/gamma)/TMath::Sqrt(2.)*100.; // [cm]
187 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
188
189 gener->SetSigma(sigmaxy, sigmaxy, sigmaz);// Sigma (cm) of the IP position
190 gener->SetCutVertexZ(3.); // Truncate at 3 sigma
191 gener->SetVertexSmear(kPerEvent);
192
193 gener->Init();
194
195// *********************** End of the pile up generation *********************
196
197 //
198 // Activate this line if you want the vertex smearing to happen
199 // track by track
200 //
201 //VertexSmear_t perTrack;
202 //gener->SetVertexSmear(perTrack);
203 // Field (L3 0.5 T)
204 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
205
206 Int_t iABSO = 0;
207 Int_t iDIPO = 0;
208 Int_t iFMD = 0;
209 Int_t iFRAME = 0;
210 Int_t iHALL = 0;
211 Int_t iITS = 1;
212 Int_t iMAG = 0;
213 Int_t iMUON = 0;
214 Int_t iPHOS = 0;
215 Int_t iPIPE = 1;
216 Int_t iPMD = 0;
217 Int_t iHMPID = 0;
218 Int_t iSHIL = 0;
219 Int_t iT0 = 0;
220 Int_t iTOF = 0;
221 Int_t iTPC = 0;
222 Int_t iTRD = 0;
223 Int_t iZDC = 0;
224 Int_t iEMCAL = 0;
225 Int_t iACORDE= 0;
226 Int_t iVZERO = 0;
227 rl->CdGAFile();
228 //=================== Alice BODY parameters =============================
229 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
230
231 if (iMAG)
232 {
233 //=================== MAG parameters ============================
234 // --- Start with Magnet since detector layouts may be depending ---
235 // --- on the selected Magnet dimensions ---
236 AliMAG *MAG = new AliMAG("MAG", "Magnet");
237 }
238
239
240 if (iABSO)
241 {
242 //=================== ABSO parameters ============================
243 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
244 }
245
246 if (iDIPO)
247 {
248 //=================== DIPO parameters ============================
249
250 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
251 }
252
253 if (iHALL)
254 {
255 //=================== HALL parameters ============================
256
257 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
258 }
259
260
261 if (iFRAME)
262 {
263 //=================== FRAME parameters ============================
264
265 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
266 FRAME->SetHoles(1);
267 }
268
269 if (iSHIL)
270 {
271 //=================== SHIL parameters ============================
272
273 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
274 }
275
276
277 if (iPIPE)
278 {
279 //=================== PIPE parameters ============================
280
281 AliPIPE *PIPE = new AliPIPEupgrade("PIPE", "Beam Pipe");
282 //AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
283 }
284
285 if (iITS)
286 {
287 //=================== ITS parameters ============================
288// gROOT->ProcessLine(".x CreateITSU.C");
289 gROOT->ProcessLine(".x CreateITSUv1.C");
290// gROOT->ProcessLine(".x CreateITSUv0.C");
291// gROOT->ProcessLine(".x CreateITSU_MS.C");
292 // CreateITSU();
293
294 }
295
296 if (iTPC)
297 {
298 //============================ TPC parameters ===================
299 AliTPC *TPC = new AliTPCv2("TPC", "Default");
300 }
301
302
303 if (iTOF) {
304 //=================== TOF parameters ============================
305 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
306 }
307
308
309 if (iHMPID)
310 {
311 //=================== HMPID parameters ===========================
312 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
313
314 }
315
316
317 if (iZDC)
318 {
319 //=================== ZDC parameters ============================
320
321 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
322 }
323
324 if (iTRD)
325 {
326 //=================== TRD parameters ============================
327
328 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
329 AliTRDgeometry *geoTRD = TRD->GetGeometry();
330 // Partial geometry: modules at 2,3,4,6,11,12,14,15
331 // starting at 6h in positive direction
332 geoTRD->SetSMstatus(0,0);
333 geoTRD->SetSMstatus(1,0);
334 geoTRD->SetSMstatus(5,0);
335 geoTRD->SetSMstatus(7,0);
336 geoTRD->SetSMstatus(8,0);
337 geoTRD->SetSMstatus(9,0);
338 geoTRD->SetSMstatus(10,0);
339 geoTRD->SetSMstatus(13,0);
340 geoTRD->SetSMstatus(16,0);
341 geoTRD->SetSMstatus(17,0);
342 }
343
344 if (iFMD)
345 {
346 //=================== FMD parameters ============================
347 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
348 }
349
350 if (iMUON)
351 {
352 //=================== MUON parameters ===========================
353 // New MUONv1 version (geometry defined via builders)
354 AliMUON *MUON = new AliMUONv1("MUON","default");
355 }
356 //=================== PHOS parameters ===========================
357
358 if (iPHOS)
359 {
360 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
361 }
362
363
364 if (iPMD)
365 {
366 //=================== PMD parameters ============================
367 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
368 }
369
370 if (iT0)
371 {
372 //=================== T0 parameters ============================
373 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
374 }
375
376 if (iEMCAL)
377 {
378 //=================== EMCAL parameters ============================
379 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
380 }
381
382 if (iACORDE)
383 {
384 //=================== ACORDE parameters ============================
385 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
386 }
387
388 if (iVZERO)
389 {
390 //=================== VZERO parameters ============================
391 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
392 }
393
394
395}
396
397