Trigger on particle and antiparticle separately.
[u/mrichter/AliRoot.git] / macros / ConfigHBT.C
CommitLineData
48c42d52 1// One can use the configuration macro in compiled mode by
2// root [0] gSystem->Load("libgeant321");
3// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
4// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
5// root [0] .x grun.C(1,"ConfigHBT.C++")
6
7#if !defined(__CINT__) || defined(__MAKECINT__)
8#include <Riostream.h>
9#include <TRandom.h>
10#include <TSystem.h>
11#include <TVirtualMC.h>
12#include <TGeant3.h>
13#include "STEER/AliRunLoader.h"
14#include "STEER/AliRun.h"
15#include "STEER/AliConfig.h"
16#include "PYTHIA6/AliDecayerPythia.h"
17#include "EVGEN/AliGenCocktailAfterBurner.h"
18#include "TMEVSIM/AliMevSimConfig.h"
19#include "TMEVSIM/AliMevSimParticle.h"
20#include "TMEVSIM/AliGenMevSim.h"
21#include "THbtp/AliGenHBTprocessor.h"
22#include "STRUCT/AliBODY.h"
23#include "STRUCT/AliMAG.h"
24#include "STRUCT/AliABSOv0.h"
25#include "STRUCT/AliDIPOv2.h"
26#include "STRUCT/AliHALL.h"
27#include "STRUCT/AliFRAMEv2.h"
28#include "STRUCT/AliSHILv2.h"
29#include "STRUCT/AliPIPEv0.h"
e1cd8da1 30#include "ITS/AliITSvPPRasymmFMD.h"
48c42d52 31#include "TPC/AliTPCv2.h"
2253ef47 32#include "TOF/AliTOFv4T0.h"
48c42d52 33#include "RICH/AliRICHv1.h"
34#include "ZDC/AliZDCv1.h"
35#include "TRD/AliTRDv1.h"
36#include "FMD/AliFMDv1.h"
37#include "MUON/AliMUONv1.h"
38#include "PHOS/AliPHOSv1.h"
39#include "PMD/AliPMDv1.h"
40#include "START/AliSTARTv1.h"
4920e63e 41#include "EMCAL/AliEMCALv2.h"
48c42d52 42#include "CRT/AliCRTv1.h"
48c42d52 43#endif
44
66d04b38 45void Config()
46{
66d04b38 47 // Set Random Number seed
48 // gRandom->SetSeed(12345);
49
2f03a4ed 50 // libraries required by geant321
51#if defined(__CINT__)
52 gSystem->Load("libgeant321");
53#endif
54
b0470150 55 new TGeant3TGeo("C++ Interface to Geant3");
66d04b38 56
48c42d52 57 cout<<"Config.C: Creating Run Loader ..."<<endl;
f5a857b2 58 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
88cb7938 59 "recreate");
48c42d52 60 if (rl == 0x0)
61 {
62 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
63 return;
64 }
65 rl->SetCompressionLevel(2);
66 rl->SetNumberOfEventsPerFile(6);
67 gAlice->SetRunLoader(rl);
66d04b38 68
69 //
70 // Set External decayer
71 AliDecayer *decayer = new AliDecayerPythia();
72
73 decayer->SetForceDecay(kAll);
74 decayer->Init();
75 gMC->SetExternalDecayer(decayer);
76 //
66d04b38 77 //=======================================================================
6a3df6c9 78 // ************* STEERING parameters FOR ALICE SIMULATION **************
79 // --- Specify event type to be tracked through the ALICE setup
80 // --- All positions are in cm, angles in degrees, and P and E in GeV
81
82
83
84 gMC->SetProcess("DCAY",1);
85 gMC->SetProcess("PAIR",1);
86 gMC->SetProcess("COMP",1);
87 gMC->SetProcess("PHOT",1);
88 gMC->SetProcess("PFIS",0);
89 gMC->SetProcess("DRAY",0);
90 gMC->SetProcess("ANNI",1);
91 gMC->SetProcess("BREM",1);
92 gMC->SetProcess("MUNU",1);
93 gMC->SetProcess("CKOV",1);
94 gMC->SetProcess("HADR",1);
95 gMC->SetProcess("LOSS",2);
96 gMC->SetProcess("MULS",1);
97 gMC->SetProcess("RAYL",1);
66d04b38 98
99 Float_t cut = 1.e-3; // 1MeV cut by default
100 Float_t tofmax = 1.e10;
101
6a3df6c9 102 gMC->SetCut("CUTGAM", cut);
103 gMC->SetCut("CUTELE", cut);
104 gMC->SetCut("CUTNEU", cut);
105 gMC->SetCut("CUTHAD", cut);
106 gMC->SetCut("CUTMUO", cut);
107 gMC->SetCut("BCUTE", cut);
108 gMC->SetCut("BCUTM", cut);
109 gMC->SetCut("DCUTE", cut);
110 gMC->SetCut("DCUTM", cut);
111 gMC->SetCut("PPCUTM", cut);
112 gMC->SetCut("TOFMAX", tofmax);
113
114
66d04b38 115 if (gSystem->Getenv("CONFIG_NPARTICLES"))
116 {
117 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
118 } else
119 {
120 int nParticles = 10000;
121 }
66d04b38 122
123 /*********************************************************************************/
124 /*********************************************************************************/
125 /***************** G E N E R A T O R S *********************************/
126
127 /** C O C K T A I L W I T H A F T E R B U R N E R S A F T E R W A R D S **/
128 /***************** (WRAPPER GENERATOR) *********************************/
129
130
131
99f4b63d 132 AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
66d04b38 133 gener->SetPhiRange(0, 360);
99f4b63d 134 gener->SetThetaRange(40., 140.);
66d04b38 135 gener->SetOrigin(0, 0, 0); //vertex position
136 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
137
138 /***************** HIJING PARAMETRIZATION ********************************/
139
99f4b63d 140 //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
141 //g2->SetMomentumRange(0, 999);
66d04b38 142
143 /***************** G E N B O X ***********************************/
144
99f4b63d 145 // AliGenBox *g1 = new AliGenBox(5);
146 // g1->SetMomentumRange(0, 3);
66d04b38 147 // g1->SetOrigin(0,0,0); //vertex position
148 // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
149 // g1->SetPart(310); //K0short(310), Lambda(3122)
150
151
152 /***************** M E V S I M ********************************/
66d04b38 153
154 AliMevSimConfig *c = new AliMevSimConfig(1);
155 c->SetRectPlane(1); // reaction plane control, model 4
99f4b63d 156 c->SetGrid(80,80);
157
66d04b38 158 AliGenMevSim *g3 = new AliGenMevSim(c);
99f4b63d 159 g3->SetPtRange(0.001, 3);
160 g3->SetMomentumRange(0.1, 3);
161
66d04b38 162 g3->SetTrackingFlag(1);
163 g3->SetOrigin(0.0, 0.0, 0.0);
164 g3->SetSigma(0.0, 0.0, 0.0);
99f4b63d 165 //g3->SetEtaCutRange(-4,4);
66d04b38 166
88cb7938 167 AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
168 AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
66d04b38 169 //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
170 //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
171 //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
172 //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
173
66d04b38 174 g3->AddParticleType(piPlus);
175 g3->AddParticleType(piMinus);
176 //g3->AddParticleType(KPlus);
177 //g3->AddParticleType(KMinus);
178 //g3->AddParticleType(protonPlus);
179 //g3->AddParticleType(protonMinus);
180
99f4b63d 181
66d04b38 182 /***************** H B T P R O C E S S O R ********************************/
183
184 AliGenHBTprocessor *hbtp = new AliGenHBTprocessor();
185 hbtp->SetRefControl(2);
186 hbtp->SetSwitch1D(1);
187 hbtp->SetSwitch3D(1);
88cb7938 188 hbtp->SetSwitchCoulomb(1);
66d04b38 189 hbtp->SetSwitchCoherence(0);
88cb7938 190 hbtp->SetSwitchFermiBose(-1);
99f4b63d 191 hbtp->SetDeltap(0.1);
66d04b38 192 hbtp->SetDelChi(0.1);
99f4b63d 193 hbtp->SetLambda(0.5);
194 hbtp->SetQ0(8.0);
195 hbtp->SetR0(8.0);
196 hbtp->SetRParallel(8.0);
197 hbtp->SetR1d(8.0);
198 hbtp->SetRSide(8.0);
199 hbtp->SetRLong(8.0);
200 hbtp->SetROut(8.0);
66d04b38 201 hbtp->SetPtRange(0.1,0.98);
202 hbtp->SetPIDs(211,-211); //pi+ pi-
203 hbtp->SetSwitchType(3); // fit both the like and unlike pair correl
88cb7938 204 hbtp->SetMaxIterations(300);
66d04b38 205 /***********************************************************************************/
206
99f4b63d 207 // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
66d04b38 208 // gener->AddGenerator(g1,"BOX (K0short)",1);
209 gener->AddGenerator(g3,"MEVSIM",1);
210
211 gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1);
212
213 gener->Init();
214 //
215 // Activate this line if you want the vertex smearing to happen
216 // track by track
217 //
218 //gener->SetVertexSmear(perTrack);
219
220 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
99f4b63d 221// gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field)
222 //Last number indicates the scale factor
66d04b38 223
224 Int_t iABSO = 1;
b9d0a01d 225 Int_t iCRT = 0;
66d04b38 226 Int_t iDIPO = 1;
227 Int_t iFMD = 0;
228 Int_t iFRAME = 1;
229 Int_t iHALL = 1;
230 Int_t iITS = 1;
231 Int_t iMAG = 1;
232 Int_t iMUON = 0;
233 Int_t iPHOS = 0;
234 Int_t iPIPE = 1;
235 Int_t iPMD = 0;
236 Int_t iRICH = 0;
237 Int_t iSHIL = 1;
238 Int_t iSTART = 0;
239 Int_t iTOF = 0;
240 Int_t iTPC = 1;
241 Int_t iTRD = 0;
242 Int_t iZDC = 0;
9757d28c 243 Int_t iEMCAL = 0;
66d04b38 244
245 //=================== Alice BODY parameters =============================
246 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
247
248
249 if (iMAG)
250 {
251 //=================== MAG parameters ============================
252 // --- Start with Magnet since detector layouts may be depending ---
253 // --- on the selected Magnet dimensions ---
254 AliMAG *MAG = new AliMAG("MAG", "Magnet");
255 }
256
257
258 if (iABSO)
259 {
260 //=================== ABSO parameters ============================
261 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
262 }
263
264 if (iDIPO)
265 {
266 //=================== DIPO parameters ============================
267
268 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
269 }
270
271 if (iHALL)
272 {
273 //=================== HALL parameters ============================
274
275 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
276 }
277
278
279 if (iFRAME)
280 {
281 //=================== FRAME parameters ============================
282
283 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
284
285 }
286
287 if (iSHIL)
288 {
289 //=================== SHIL parameters ============================
290
e0559846 291 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding");
66d04b38 292 }
293
294
295 if (iPIPE)
296 {
297 //=================== PIPE parameters ============================
298
299 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
300 }
301
302 if(iITS) {
303
304//=================== ITS parameters ============================
305 //
306 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
307 // almost all other detectors. This involves the fact that the ITS geometry
308 // still has several options to be followed in parallel in order to determine
309 // the best set-up which minimizes the induced background. All the geometries
310 // available to date are described in the following. Read carefully the comments
311 // and use the default version (the only one uncommented) unless you are making
312 // comparisons and you know what you are doing. In this case just uncomment the
313 // ITS geometry you want to use and run Aliroot.
314 //
315 // Detailed geometries:
316 //
317 //
318 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
319 //
320 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
321 //
e1cd8da1 322 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
323 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
324 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
99f4b63d 325 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
326 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
327 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
328 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
329 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
66d04b38 330 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
331 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
332 //
333 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
334 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
335 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
336 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
337 //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300]
338 //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300]
339 //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300]
340 //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300]
341 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
342 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
343 //
344 //
345 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
346 // for reconstruction !):
347 //
348 //
349 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
350 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
351 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
352 //
353 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
354 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
355 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
356 //
357 //
358 //
359 // Geant3 <-> EUCLID conversion
360 // ============================
361 //
362 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
363 // media to two ASCII files (called by default ITSgeometry.euc and
364 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
365 // The default (=0) means that you dont want to use this facility.
366 //
367 ITS->SetEUCLID(0);
368 }
369
370
371 if (iTPC)
372 {
26ca4b4a 373 //============================ TPC parameters ===================
66d04b38 374 AliTPC *TPC = new AliTPCv2("TPC", "Default");
66d04b38 375 }
376
377 if (iTOF)
378 {
379 //=================== TOF parameters ============================
2253ef47 380 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
66d04b38 381 }
382
383 if (iRICH)
384 {
385 //=================== RICH parameters ===========================
386 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
387
388 }
389
390
391 if (iZDC)
392 {
393 //=================== ZDC parameters ============================
394
395 AliZDC *ZDC = new AliZDCv1("ZDC", "normal ZDC");
396 }
397
b9d0a01d 398 if (iCRT)
66d04b38 399 {
b9d0a01d 400 //=================== CRT parameters ============================
66d04b38 401
b9d0a01d 402 AliCRT *CRT = new AliCRTv1("CRT", "normal CRT");
66d04b38 403 }
404
405 if (iTRD)
406 {
407 //=================== TRD parameters ============================
408
409 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
410
411 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
412 TRD->SetGasMix(1);
413
414 // With hole in front of PHOS
415 TRD->SetPHOShole();
416 // With hole in front of RICH
417 TRD->SetRICHhole();
418 // Switch on TR
419 AliTRDsim *TRDsim = TRD->CreateTR();
420 }
421
422 if (iFMD)
423 {
424 //=================== FMD parameters ============================
425
426 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
427 }
428
429 if (iMUON)
430 {
431 //=================== MUON parameters ===========================
432
433 AliMUON *MUON = new AliMUONv1("MUON", "default");
434 }
435 //=================== PHOS parameters ===========================
436
437 if (iPHOS)
438 {
439 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
440 }
441
442
443 if (iPMD)
444 {
445 //=================== PMD parameters ============================
446
447 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
448
449 PMD->SetPAR(1., 1., 0.8, 0.02);
450 PMD->SetIN(6., 18., -580., 27., 27.);
451 PMD->SetGEO(0.0, 0.2, 4.);
452 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
453
454 }
9757d28c 455 if (iEMCAL && !iRICH)
456 {
457 //=================== EMCAL parameters ============================
4920e63e 458 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH");
9757d28c 459 }
66d04b38 460
461 if (iSTART)
462 {
463 //=================== START parameters ============================
464 AliSTART *START = new AliSTARTv1("START", "START Detector");
465 }
466
467
468}