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