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