]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/ConfigHBT.C
Parameters for track finding in AliITStrackerSA added to AliITSRecoParam (F. PRino)
[u/mrichter/AliRoot.git] / macros / ConfigHBT.C
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 <TPDGCode.h>
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"
25 #include "STRUCT/AliABSOv3.h"
26 #include "STRUCT/AliDIPOv3.h"
27 #include "STRUCT/AliHALLv3.h"
28 #include "STRUCT/AliFRAMEv2.h"
29 #include "STRUCT/AliSHILv3.h"
30 #include "STRUCT/AliPIPEv3.h"
31 #include "ITS/AliITSv11Hybrid.h"
32 #include "TPC/AliTPCv2.h"
33 #include "TOF/AliTOFv6T0.h"
34 #include "HMPID/AliHMPIDv3.h"
35 #include "ZDC/AliZDCv3.h"
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"
41 #include "T0/AliT0v1.h"
42 #include "EMCAL/AliEMCALv2.h"
43 #include "ACORDE/AliACORDEv1.h"
44 #endif
45
46 enum PprGeo_t
47   {
48     kHoles, kNoHoles
49   };
50
51 static PprGeo_t geo = kHoles;
52
53 void Config()
54 {
55     // Set Random Number seed
56     // gRandom->SetSeed(12345);
57
58    // libraries required by geant321
59 #if defined(__CINT__)
60     gSystem->Load("libgeant321");
61 #endif
62
63     new     TGeant3TGeo("C++ Interface to Geant3");
64
65     if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
66       AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
67       AliCDBManager::Instance()->SetRun(0);
68     }
69
70     cout<<"Config.C: Creating Run Loader ..."<<endl;
71     AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
72                                               "recreate");
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);
81     // gAlice->SetGeometryFromFile("geometry.root");
82     // gAlice->SetGeometryFromCDB();
83
84     // Set the trigger configuration
85     gAlice->SetTriggerDescriptor("Pb-Pb");
86     cout<<"Trigger configuration is set to  Pb-Pb"<<endl;
87
88     //
89     // Set External decayer
90     AliDecayer *decayer = new AliDecayerPythia();
91
92     decayer->SetForceDecay(kAll);
93     decayer->Init();
94     gMC->SetExternalDecayer(decayer);
95     //
96     //=======================================================================
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);
117
118     Float_t cut = 1.e-3;        // 1MeV cut by default
119     Float_t tofmax = 1.e10;
120
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
134     if (gSystem->Getenv("CONFIG_NPARTICLES"))
135     {
136         int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
137     } else
138     {
139         int     nParticles = 10000;
140     }
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     
151     AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
152     gener->SetPhiRange(0, 360);
153     gener->SetThetaRange(40., 140.);
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     
159     //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
160     //g2->SetMomentumRange(0, 999);
161     
162     /*****************        G E N   B O X       ***********************************/    
163     
164    // AliGenBox *g1 = new AliGenBox(5);
165    // g1->SetMomentumRange(0, 3);
166    // g1->SetOrigin(0,0,0);        //vertex position
167    // g1->SetSigma(0,0,0);         //Sigma in (X,Y,Z) (cm) on IP position
168    // g1->SetPart(kK0Short);        //K0short(310), Lambda(3122)
169    
170
171     /*****************     M E V S I M    ********************************/    
172     
173     AliMevSimConfig *c = new AliMevSimConfig(1);
174     c->SetRectPlane(1);                                 // reaction plane control, model 4
175     c->SetGrid(80,80);
176     
177     AliGenMevSim *g3 = new AliGenMevSim(c);
178     g3->SetPtRange(0.001, 3); 
179     g3->SetMomentumRange(0.1, 3); 
180     
181     g3->SetTrackingFlag(1);
182     g3->SetOrigin(0.0, 0.0, 0.0);
183     g3->SetSigma(0.0, 0.0, 0.0);
184     //g3->SetEtaCutRange(-4,4);       
185  
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);
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  
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     
200     
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);
207     hbtp->SetSwitchCoulomb(1);
208     hbtp->SetSwitchCoherence(0);
209     hbtp->SetSwitchFermiBose(-1);
210     hbtp->SetDeltap(0.1);
211     hbtp->SetDelChi(0.1);
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);
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
223     hbtp->SetMaxIterations(300);
224     /***********************************************************************************/
225     
226    // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
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)
240 //    gAlice->SetField(-999, 2, 2.);  //Specify maximum magnetic field in Tesla (neg. ==> default field)
241      //Last number indicates the scale factor 
242
243     Int_t   iABSO = 1;
244     Int_t   iACORDE = 0;
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;
255     Int_t   iHMPID = 0;
256     Int_t   iSHIL = 1;
257     Int_t   iT0 = 0;
258     Int_t   iTOF = 0;
259     Int_t   iTPC = 1;
260     Int_t   iTRD = 0;
261     Int_t   iZDC = 0;
262     Int_t   iEMCAL = 0;
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 ============================
280         AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
281     }
282
283     if (iDIPO)
284     {
285         //=================== DIPO parameters ============================
286
287         AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
288     }
289
290     if (iHALL)
291     {
292         //=================== HALL parameters ============================
293
294         AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
295     }
296
297
298     if (iFRAME)
299     {
300         //=================== FRAME parameters ============================
301
302         AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
303         if (geo == kHoles) {
304           FRAME->SetHoles(1);
305         } else {
306           FRAME->SetHoles(0);
307         }
308
309     }
310
311     if (iSHIL)
312     {
313         //=================== SHIL parameters ============================
314
315         AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding");
316     }
317
318
319     if (iPIPE)
320     {
321         //=================== PIPE parameters ============================
322
323         AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
324     }
325  
326     if (iITS)
327     {
328         //=================== ITS parameters ============================
329
330         AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
331     }
332   
333
334     if (iTPC)
335     {
336         //============================ TPC parameters ===================
337         AliTPC *TPC = new AliTPCv2("TPC", "Default");
338     }
339
340     if (iTOF)
341     {
342         //=================== TOF parameters ============================
343         AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
344     }
345
346     if (iHMPID)
347     {
348         //=================== HMPID parameters ===========================
349         AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
350
351     }
352
353
354     if (iZDC)
355     {
356         //=================== ZDC parameters ============================
357
358         AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
359     }
360
361     if (iACORDE)
362     {
363         //=================== ACORDE parameters ============================
364
365         AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
366     }
367
368     if (iTRD)
369     {
370         //=================== TRD parameters ============================
371
372         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
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     }
408     if (iEMCAL && !iHMPID)
409     {
410         //=================== EMCAL parameters ============================
411         AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
412     }
413
414     if (iT0)
415     {
416         //=================== T0 parameters ============================
417         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
418     }
419
420
421 }