Additional protection (Ivana)
[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>
9bb2665f 9#include <TPDGCode.h>
48c42d52 10#include <TRandom.h>
11#include <TSystem.h>
12#include <TVirtualMC.h>
13#include <TGeant3.h>
14#include "STEER/AliRunLoader.h"
15#include "STEER/AliRun.h"
16#include "STEER/AliConfig.h"
17#include "PYTHIA6/AliDecayerPythia.h"
18#include "EVGEN/AliGenCocktailAfterBurner.h"
19#include "TMEVSIM/AliMevSimConfig.h"
20#include "TMEVSIM/AliMevSimParticle.h"
21#include "TMEVSIM/AliGenMevSim.h"
22#include "THbtp/AliGenHBTprocessor.h"
23#include "STRUCT/AliBODY.h"
24#include "STRUCT/AliMAG.h"
96fb3353 25#include "STRUCT/AliABSOv3.h"
26#include "STRUCT/AliDIPOv3.h"
27#include "STRUCT/AliHALLv3.h"
48c42d52 28#include "STRUCT/AliFRAMEv2.h"
96fb3353 29#include "STRUCT/AliSHILv3.h"
30#include "STRUCT/AliPIPEv3.h"
e1cd8da1 31#include "ITS/AliITSvPPRasymmFMD.h"
48c42d52 32#include "TPC/AliTPCv2.h"
0d7ef405 33#include "TOF/AliTOFv6T0.h"
55eb2b56 34#include "HMPID/AliHMPIDv2.h"
9d07603a 35#include "ZDC/AliZDCv3.h"
48c42d52 36#include "TRD/AliTRDv1.h"
37#include "FMD/AliFMDv1.h"
38#include "MUON/AliMUONv1.h"
39#include "PHOS/AliPHOSv1.h"
40#include "PMD/AliPMDv1.h"
ababa197 41#include "T0/AliT0v1.h"
4920e63e 42#include "EMCAL/AliEMCALv2.h"
b384f8a4 43#include "ACORDE/AliACORDEv1.h"
48c42d52 44#endif
45
6b612c2d 46enum PprGeo_t
47 {
48 kHoles, kNoHoles
49 };
50
51static PprGeo_t geo = kHoles;
52
66d04b38 53void Config()
54{
66d04b38 55 // Set Random Number seed
56 // gRandom->SetSeed(12345);
57
2f03a4ed 58 // libraries required by geant321
59#if defined(__CINT__)
60 gSystem->Load("libgeant321");
61#endif
62
b0470150 63 new TGeant3TGeo("C++ Interface to Geant3");
66d04b38 64
458041af 65 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
66 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
67 AliCDBManager::Instance()->SetRun(0);
68 }
69
48c42d52 70 cout<<"Config.C: Creating Run Loader ..."<<endl;
f5a857b2 71 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
88cb7938 72 "recreate");
48c42d52 73 if (rl == 0x0)
74 {
75 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
76 return;
77 }
78 rl->SetCompressionLevel(2);
79 rl->SetNumberOfEventsPerFile(6);
80 gAlice->SetRunLoader(rl);
458041af 81 // gAlice->SetGeometryFromFile("geometry.root");
82 // gAlice->SetGeometryFromCDB();
66d04b38 83
6521ae06 84 // Set the trigger configuration
85 gAlice->SetTriggerDescriptor("Pb-Pb");
86 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
87
66d04b38 88 //
89 // Set External decayer
90 AliDecayer *decayer = new AliDecayerPythia();
91
92 decayer->SetForceDecay(kAll);
93 decayer->Init();
94 gMC->SetExternalDecayer(decayer);
95 //
66d04b38 96 //=======================================================================
6a3df6c9 97 // ************* STEERING parameters FOR ALICE SIMULATION **************
98 // --- Specify event type to be tracked through the ALICE setup
99 // --- All positions are in cm, angles in degrees, and P and E in GeV
100
101
102
103 gMC->SetProcess("DCAY",1);
104 gMC->SetProcess("PAIR",1);
105 gMC->SetProcess("COMP",1);
106 gMC->SetProcess("PHOT",1);
107 gMC->SetProcess("PFIS",0);
108 gMC->SetProcess("DRAY",0);
109 gMC->SetProcess("ANNI",1);
110 gMC->SetProcess("BREM",1);
111 gMC->SetProcess("MUNU",1);
112 gMC->SetProcess("CKOV",1);
113 gMC->SetProcess("HADR",1);
114 gMC->SetProcess("LOSS",2);
115 gMC->SetProcess("MULS",1);
116 gMC->SetProcess("RAYL",1);
66d04b38 117
118 Float_t cut = 1.e-3; // 1MeV cut by default
119 Float_t tofmax = 1.e10;
120
6a3df6c9 121 gMC->SetCut("CUTGAM", cut);
122 gMC->SetCut("CUTELE", cut);
123 gMC->SetCut("CUTNEU", cut);
124 gMC->SetCut("CUTHAD", cut);
125 gMC->SetCut("CUTMUO", cut);
126 gMC->SetCut("BCUTE", cut);
127 gMC->SetCut("BCUTM", cut);
128 gMC->SetCut("DCUTE", cut);
129 gMC->SetCut("DCUTM", cut);
130 gMC->SetCut("PPCUTM", cut);
131 gMC->SetCut("TOFMAX", tofmax);
132
133
66d04b38 134 if (gSystem->Getenv("CONFIG_NPARTICLES"))
135 {
136 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
137 } else
138 {
139 int nParticles = 10000;
140 }
66d04b38 141
142 /*********************************************************************************/
143 /*********************************************************************************/
144 /***************** G E N E R A T O R S *********************************/
145
146 /** 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 **/
147 /***************** (WRAPPER GENERATOR) *********************************/
148
149
150
99f4b63d 151 AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
66d04b38 152 gener->SetPhiRange(0, 360);
99f4b63d 153 gener->SetThetaRange(40., 140.);
66d04b38 154 gener->SetOrigin(0, 0, 0); //vertex position
155 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
156
157 /***************** HIJING PARAMETRIZATION ********************************/
158
99f4b63d 159 //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
160 //g2->SetMomentumRange(0, 999);
66d04b38 161
162 /***************** G E N B O X ***********************************/
163
99f4b63d 164 // AliGenBox *g1 = new AliGenBox(5);
165 // g1->SetMomentumRange(0, 3);
66d04b38 166 // g1->SetOrigin(0,0,0); //vertex position
167 // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
9bb2665f 168 // g1->SetPart(kK0Short); //K0short(310), Lambda(3122)
66d04b38 169
170
171 /***************** M E V S I M ********************************/
66d04b38 172
173 AliMevSimConfig *c = new AliMevSimConfig(1);
174 c->SetRectPlane(1); // reaction plane control, model 4
99f4b63d 175 c->SetGrid(80,80);
176
66d04b38 177 AliGenMevSim *g3 = new AliGenMevSim(c);
99f4b63d 178 g3->SetPtRange(0.001, 3);
179 g3->SetMomentumRange(0.1, 3);
180
66d04b38 181 g3->SetTrackingFlag(1);
182 g3->SetOrigin(0.0, 0.0, 0.0);
183 g3->SetSigma(0.0, 0.0, 0.0);
99f4b63d 184 //g3->SetEtaCutRange(-4,4);
66d04b38 185
88cb7938 186 AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
187 AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
66d04b38 188 //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
189 //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
190 //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
191 //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
192
66d04b38 193 g3->AddParticleType(piPlus);
194 g3->AddParticleType(piMinus);
195 //g3->AddParticleType(KPlus);
196 //g3->AddParticleType(KMinus);
197 //g3->AddParticleType(protonPlus);
198 //g3->AddParticleType(protonMinus);
199
99f4b63d 200
66d04b38 201 /***************** H B T P R O C E S S O R ********************************/
202
203 AliGenHBTprocessor *hbtp = new AliGenHBTprocessor();
204 hbtp->SetRefControl(2);
205 hbtp->SetSwitch1D(1);
206 hbtp->SetSwitch3D(1);
88cb7938 207 hbtp->SetSwitchCoulomb(1);
66d04b38 208 hbtp->SetSwitchCoherence(0);
88cb7938 209 hbtp->SetSwitchFermiBose(-1);
99f4b63d 210 hbtp->SetDeltap(0.1);
66d04b38 211 hbtp->SetDelChi(0.1);
99f4b63d 212 hbtp->SetLambda(0.5);
213 hbtp->SetQ0(8.0);
214 hbtp->SetR0(8.0);
215 hbtp->SetRParallel(8.0);
216 hbtp->SetR1d(8.0);
217 hbtp->SetRSide(8.0);
218 hbtp->SetRLong(8.0);
219 hbtp->SetROut(8.0);
66d04b38 220 hbtp->SetPtRange(0.1,0.98);
221 hbtp->SetPIDs(211,-211); //pi+ pi-
222 hbtp->SetSwitchType(3); // fit both the like and unlike pair correl
88cb7938 223 hbtp->SetMaxIterations(300);
66d04b38 224 /***********************************************************************************/
225
99f4b63d 226 // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
66d04b38 227 // gener->AddGenerator(g1,"BOX (K0short)",1);
228 gener->AddGenerator(g3,"MEVSIM",1);
229
230 gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1);
231
232 gener->Init();
233 //
234 // Activate this line if you want the vertex smearing to happen
235 // track by track
236 //
237 //gener->SetVertexSmear(perTrack);
238
239 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
99f4b63d 240// gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field)
241 //Last number indicates the scale factor
66d04b38 242
243 Int_t iABSO = 1;
b384f8a4 244 Int_t iACORDE = 0;
66d04b38 245 Int_t iDIPO = 1;
246 Int_t iFMD = 0;
247 Int_t iFRAME = 1;
248 Int_t iHALL = 1;
249 Int_t iITS = 1;
250 Int_t iMAG = 1;
251 Int_t iMUON = 0;
252 Int_t iPHOS = 0;
253 Int_t iPIPE = 1;
254 Int_t iPMD = 0;
de1857bb 255 Int_t iHMPID = 0;
66d04b38 256 Int_t iSHIL = 1;
ababa197 257 Int_t iT0 = 0;
66d04b38 258 Int_t iTOF = 0;
259 Int_t iTPC = 1;
260 Int_t iTRD = 0;
261 Int_t iZDC = 0;
9757d28c 262 Int_t iEMCAL = 0;
66d04b38 263
264 //=================== Alice BODY parameters =============================
265 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
266
267
268 if (iMAG)
269 {
270 //=================== MAG parameters ============================
271 // --- Start with Magnet since detector layouts may be depending ---
272 // --- on the selected Magnet dimensions ---
273 AliMAG *MAG = new AliMAG("MAG", "Magnet");
274 }
275
276
277 if (iABSO)
278 {
279 //=================== ABSO parameters ============================
96fb3353 280 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
66d04b38 281 }
282
283 if (iDIPO)
284 {
285 //=================== DIPO parameters ============================
286
96fb3353 287 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
66d04b38 288 }
289
290 if (iHALL)
291 {
292 //=================== HALL parameters ============================
293
96fb3353 294 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
66d04b38 295 }
296
297
298 if (iFRAME)
299 {
300 //=================== FRAME parameters ============================
301
302 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
6b612c2d 303 if (geo == kHoles) {
304 FRAME->SetHoles(1);
305 } else {
306 FRAME->SetHoles(0);
307 }
66d04b38 308
309 }
310
311 if (iSHIL)
312 {
313 //=================== SHIL parameters ============================
314
96fb3353 315 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding");
66d04b38 316 }
317
318
319 if (iPIPE)
320 {
321 //=================== PIPE parameters ============================
322
96fb3353 323 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
66d04b38 324 }
325
e89fa83b 326 if (iITS)
327 {
328 //=================== ITS parameters ============================
66d04b38 329
e89fa83b 330 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
331 }
66d04b38 332
333
334 if (iTPC)
335 {
26ca4b4a 336 //============================ TPC parameters ===================
66d04b38 337 AliTPC *TPC = new AliTPCv2("TPC", "Default");
66d04b38 338 }
339
340 if (iTOF)
341 {
342 //=================== TOF parameters ============================
0d7ef405 343 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
66d04b38 344 }
345
de1857bb 346 if (iHMPID)
66d04b38 347 {
de1857bb 348 //=================== HMPID parameters ===========================
55eb2b56 349 AliHMPID *HMPID = new AliHMPIDv2("HMPID", "normal HMPID");
66d04b38 350
351 }
352
353
354 if (iZDC)
355 {
356 //=================== ZDC parameters ============================
357
9d07603a 358 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
66d04b38 359 }
360
b384f8a4 361 if (iACORDE)
66d04b38 362 {
b384f8a4 363 //=================== ACORDE parameters ============================
66d04b38 364
b384f8a4 365 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
66d04b38 366 }
367
368 if (iTRD)
369 {
370 //=================== TRD parameters ============================
371
372 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
66d04b38 373 }
374
375 if (iFMD)
376 {
377 //=================== FMD parameters ============================
378
379 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
380 }
381
382 if (iMUON)
383 {
384 //=================== MUON parameters ===========================
385
386 AliMUON *MUON = new AliMUONv1("MUON", "default");
387 }
388 //=================== PHOS parameters ===========================
389
390 if (iPHOS)
391 {
392 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
393 }
394
395
396 if (iPMD)
397 {
398 //=================== PMD parameters ============================
399
400 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
401
402 PMD->SetPAR(1., 1., 0.8, 0.02);
403 PMD->SetIN(6., 18., -580., 27., 27.);
404 PMD->SetGEO(0.0, 0.2, 4.);
405 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
406
407 }
de1857bb 408 if (iEMCAL && !iHMPID)
9757d28c 409 {
410 //=================== EMCAL parameters ============================
0588179e 411 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
9757d28c 412 }
66d04b38 413
ababa197 414 if (iT0)
66d04b38 415 {
ababa197 416 //=================== T0 parameters ============================
417 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
66d04b38 418 }
419
420
421}