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