]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/ConfigTestSuite.C
Debug printout commented out
[u/mrichter/AliRoot.git] / EMCAL / ConfigTestSuite.C
1 static Int_t    eventsPerRun = 100;
2 enum PprGeo_t 
3 {
4     kHoles, kNoHoles
5 };
6 static PprGeo_t geo = kHoles;
7
8 void Config()
9 {
10     // 7-DEC-2000 09:00
11     // Switch on Transition Radiation simulation. 6/12/00 18:00
12     // iZDC=1  7/12/00 09:00
13     // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
14     // Theta range given through pseudorapidity limits 22/6/2001
15
16     // Set Random Number seed
17     // AliLoader::SetDebug(5) ; 
18     gRandom->SetSeed(12345);
19
20
21    // libraries required by geant321
22     gSystem->Load("libgeant321");
23
24     new     TGeant3("C++ Interface to Geant3");
25
26     if (!gSystem->Getenv("CONFIG_FILE"))
27     {
28         cout<<"Config.C: Creating Run Loader ..."<<endl;
29         AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
30                                               "recreate");
31         if (rl == 0x0)
32          {
33            gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
34            return;
35          }
36         rl->SetCompressionLevel(2);
37         rl->SetNumberOfEventsPerFile(1000);
38         gAlice->SetRunLoader(rl);
39     }
40
41     TGeant3 *geant3 = (TGeant3 *) gMC;
42
43     //
44     // Set External decayer
45     TVirtualMCDecayer *decayer = new AliDecayerPythia();
46
47     decayer->SetForceDecay(kAll);
48     decayer->Init();
49     gMC->SetExternalDecayer(decayer);
50     //
51     //
52     //=======================================================================
53     // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
54     geant3->SetTRIG(1);         //Number of events to be processed 
55     geant3->SetSWIT(4, 10);
56     geant3->SetDEBU(0, 0, 1);
57     //geant3->SetSWIT(2,2);
58     geant3->SetDCAY(1);
59     geant3->SetPAIR(1);
60     geant3->SetCOMP(1);
61     geant3->SetPHOT(1);
62     geant3->SetPFIS(0);
63     geant3->SetDRAY(0);
64     geant3->SetANNI(1);
65     geant3->SetBREM(1);
66     geant3->SetMUNU(1);
67     geant3->SetCKOV(1);
68     geant3->SetHADR(1);         //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
69     geant3->SetLOSS(2);
70     geant3->SetMULS(1);
71     geant3->SetRAYL(1);
72     geant3->SetAUTO(1);         //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
73     geant3->SetABAN(0);         //Restore 3.16 behaviour for abandoned tracks
74     geant3->SetOPTI(2);         //Select optimisation level for GEANT geometry searches (0,1,2)
75     geant3->SetERAN(5.e-7);
76
77     Float_t cut = 1.e-3;        // 1MeV cut by default
78     Float_t tofmax = 1.e10;
79
80     //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
81     geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
82                     tofmax);
83     //
84     //=======================================================================
85     // ************* STEERING parameters FOR ALICE SIMULATION **************
86     // --- Specify event type to be tracked through the ALICE setup
87     // --- All positions are in cm, angles in degrees, and P and E in GeV
88     if (gSystem->Getenv("CONFIG_NPARTICLES"))
89     {
90         int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
91     } else
92     {
93         int     nParticles = 10;
94     }
95  //    AliGenCocktail *gener = new AliGenCocktail();
96 //     gener->SetPhiRange(220, 320);
97 //     // Set pseudorapidity range from -8 to 8.
98 //     Float_t thmin = EtaToTheta(0.12);   // theta min. <---> eta max
99 //     Float_t thmax = EtaToTheta(-0.12);  // theta max. <---> eta min 
100 //     gener->SetThetaRange(thmin,thmax);
101 //     gener->SetOrigin(0, 0, 0);  //vertex position
102 //     gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
103
104 //     AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
105 //     hijingparam->SetMomentumRange(0.2, 999);
106 //     gener->AddGenerator(hijingparam,"HIJING PARAM",1);
107
108 //     AliGenBox *genbox = new AliGenBox(nParticles);
109 //     genbox->SetPart(22);
110 //     genbox->SetPtRange(0.3, 10.00);
111 //     gener->AddGenerator(genbox,"GENBOX GAMMA for PHOS",1);
112 //     gener->Init();
113
114     AliGenBox *gener = new AliGenBox(1);
115     gener->SetMomentumRange(50.,100.);
116     gener->SetPhiRange(60.0,180.0);
117     gener->SetThetaRange(EtaToTheta(-0.7), EtaToTheta(0.7));
118
119     gener->SetOrigin(0,0,0);        //vertex position
120     gener->SetSigma(0,0,0);         //Sigma in (X,Y,Z) (cm) on IP position
121     gener->SetPart(kGamma);
122     gener->Init();
123  
124     // 
125     // Activate this line if you want the vertex smearing to happen
126     // track by track
127     //
128     //gener->SetVertexSmear(perTrack); 
129     // Field (L3 0.4 T)
130     AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
131     gAlice->SetField(field);    
132
133
134     Int_t   iABSO  =  0;
135     Int_t   iDIPO  =  0;
136     Int_t   iFMD   =  0;
137     Int_t   iFRAME =  0;
138     Int_t   iHALL  =  0;
139     Int_t   iITS   =  0;
140     Int_t   iMAG   =  0;
141     Int_t   iMUON  =  0;
142     Int_t   iPHOS  =  0;
143     Int_t   iPIPE  =  0;
144     Int_t   iPMD   =  0;
145     Int_t   iRICH  =  0;
146     Int_t   iSHIL  =  0;
147     Int_t   iSTART =  0;
148     Int_t   iTOF   =  0;
149     Int_t   iTPC   =  0;
150     Int_t   iTRD   =  0;
151     Int_t   iZDC   =  0;
152     Int_t   iEMCAL =  1;
153     Int_t   iCRT   =  0;
154     Int_t   iVZERO =  0;
155     rl->CdGAFile();
156     //=================== Alice BODY parameters =============================
157     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
158
159     if (iMAG)
160     {
161         //=================== MAG parameters ============================
162         // --- Start with Magnet since detector layouts may be depending ---
163         // --- on the selected Magnet dimensions ---
164         AliMAG *MAG = new AliMAG("MAG", "Magnet");
165     }
166
167
168     if (iABSO)
169     {
170         //=================== ABSO parameters ============================
171         AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
172     }
173
174     if (iDIPO)
175     {
176         //=================== DIPO parameters ============================
177
178         AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
179     }
180
181     if (iHALL)
182     {
183         //=================== HALL parameters ============================
184
185         AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
186     }
187
188
189     if (iFRAME)
190     {
191         //=================== FRAME parameters ============================
192
193         AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
194         if (geo == kHoles) {
195             FRAME->SetHoles(1);
196         } else {
197             FRAME->SetHoles(0);
198         }
199     }
200
201     if (iSHIL)
202     {
203         //=================== SHIL parameters ============================
204
205         AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
206     }
207
208
209     if (iPIPE)
210     {
211         //=================== PIPE parameters ============================
212
213         AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
214     }
215  
216     if(iITS) {
217
218     //=================== ITS parameters ============================
219     //
220     // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
221     // almost all other detectors. This involves the fact that the ITS geometry
222     // still has several options to be followed in parallel in order to determine
223     // the best set-up which minimizes the induced background. All the geometries
224     // available to date are described in the following. Read carefully the comments
225     // and use the default version (the only one uncommented) unless you are making
226     // comparisons and you know what you are doing. In this case just uncomment the
227     // ITS geometry you want to use and run Aliroot.
228     //
229     // Detailed geometries:         
230     //
231     //
232     //AliITS *ITS  = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
233     //
234     //AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
235     //
236         AliITSvPPRasymm *ITS  = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
237         ITS->SetMinorVersion(2);                                         // don't touch this parameter if you're not an ITS developer
238         ITS->SetReadDet(kFALSE);                                         // don't touch this parameter if you're not an ITS developer
239     //    ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");  // don't touch this parameter if you're not an ITS developer
240         ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
241         ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
242         ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
243         ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
244         ITS->SetRails(0);            // 1 --> rails in ; 0 --> rails out
245         ITS->SetCoolingFluid(1);   // 1 --> water ; 0 --> freon
246         //
247     //AliITSvPPRsymm *ITS  = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
248     //ITS->SetMinorVersion(2);                                       // don't touch this parameter if you're not an ITS developer
249     //ITS->SetReadDet(kFALSE);                                       // don't touch this parameter if you're not an ITS developer
250     //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
251     //ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
252     //ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
253     //ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
254     //ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
255     //ITS->SetRails(0);              // 1 --> rails in ; 0 --> rails out
256     //ITS->SetCoolingFluid(1);       // 1 --> water ; 0 --> freon
257     //
258     //
259     // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful 
260     // for reconstruction !):
261     //                                                     
262     //
263     //AliITSvPPRcoarseasymm *ITS  = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
264     //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
265     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
266     //
267     //AliITS *ITS  = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
268     //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
269     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
270     //                      
271     //
272     //
273     // Geant3 <-> EUCLID conversion
274     // ============================
275     //
276     // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
277     // media to two ASCII files (called by default ITSgeometry.euc and
278     // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
279     // The default (=0) means that you dont want to use this facility.
280     //
281      ITS->SetEUCLID(0);  
282     }
283
284     if (iTPC)
285     {
286         //============================ TPC parameters ================================
287         // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
288         // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
289         // --- sectors are specified, any value other than that requires at least one 
290         // --- sector (lower or upper)to be specified!
291         // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
292         // ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
293         // --- SecLows - number of lower sectors specified (up to 6)
294         // --- SecUps - number of upper sectors specified (up to 12)
295         // --- Sens - sensitive strips for the Slow Simulator !!!
296         // --- This does NOT work if all S or L-sectors are specified, i.e.
297         // --- if SecAL or SecAU < 0
298         //
299         //
300         //-----------------------------------------------------------------------------
301
302         //  gROOT->LoadMacro("SetTPCParam.C");
303         //  AliTPCParam *param = SetTPCParam();
304         AliTPC *TPC = new AliTPCv2("TPC", "Default");
305
306         // All sectors included 
307         TPC->SetSecAU(-1);
308         TPC->SetSecAL(-1);
309     }
310
311
312     if (iTOF) {
313         if (geo == kHoles) {
314         //=================== TOF parameters ============================
315             AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
316         } else {
317             AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
318         }
319     }
320
321
322     if (iRICH)
323     {
324         //=================== RICH parameters ===========================
325         AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
326
327     }
328
329
330     if (iZDC)
331     {
332         //=================== ZDC parameters ============================
333
334         AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
335     }
336
337     if (iTRD)
338     {
339         //=================== TRD parameters ============================
340
341         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
342
343         // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
344         TRD->SetGasMix(1);
345         if (geo == kHoles) {
346             // With hole in front of PHOS
347             TRD->SetPHOShole();
348             // With hole in front of RICH
349             TRD->SetRICHhole();
350         }
351             // Switch on TR
352             AliTRDsim *TRDsim = TRD->CreateTR();
353     }
354
355     if (iFMD)
356     {
357         //=================== FMD parameters ============================
358         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
359         FMD->SetRingsSi1(256);
360         FMD->SetRingsSi2(128);
361         FMD->SetSectorsSi1(20);
362         FMD->SetSectorsSi2(40);      
363    }
364
365     if (iMUON)
366     {
367         //=================== MUON parameters ===========================
368
369         AliMUON *MUON = new AliMUONv1("MUON", "default");
370     }
371     //=================== PHOS parameters ===========================
372
373     if (iPHOS)
374     {
375         AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
376     }
377
378
379     if (iPMD)
380     {
381         //=================== PMD parameters ============================
382         AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
383     }
384
385     if (iSTART)
386     {
387         //=================== START parameters ============================
388         AliSTART *START = new AliSTARTv1("START", "START Detector");
389     }
390
391     if (iEMCAL)
392     {
393         //=================== EMCAL parameters ============================
394         AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCAL_55_25");
395     }
396
397      if (iCRT)
398     {
399         //=================== CRT parameters ============================
400         AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
401     }
402
403      if (iVZERO)
404     {
405         //=================== CRT parameters ============================
406         AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
407     }
408
409 }
410
411 Float_t EtaToTheta(Float_t arg){
412   return (180./TMath::Pi())*2.*atan(exp(-arg));
413 }