]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/ConfigTestSuite.C
Bug in choise of RawFitter version corrected
[u/mrichter/AliRoot.git] / PHOS / ConfigTestSuite.C
1 #include <TPDGCode.h>
2
3 static Int_t    eventsPerRun = 100;
4 enum PprGeo_t 
5 {
6     kHoles, kNoHoles
7 };
8 static PprGeo_t geo = kHoles;
9
10 void Config()
11 {
12     // 7-DEC-2000 09:00
13     // Switch on Transition Radiation simulation. 6/12/00 18:00
14     // iZDC=1  7/12/00 09:00
15     // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
16     // Theta range given through pseudorapidity limits 22/6/2001
17
18     // Set Random Number seed
19     // AliLoader::SetDebug(5) ; 
20     gRandom->SetSeed(12345);
21
22
23    // libraries required by geant321
24     gSystem->Load("libgeant321");
25
26     new     TGeant3("C++ Interface to Geant3");
27
28     if (!gSystem->Getenv("CONFIG_FILE"))
29     {
30         cout<<"Config.C: Creating Run Loader ..."<<endl;
31         AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
32                                               "recreate");
33         if (rl == 0x0)
34          {
35            gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
36            return;
37          }
38         rl->SetCompressionLevel(2);
39         rl->SetNumberOfEventsPerFile(1000);
40         gAlice->SetRunLoader(rl);
41     }
42
43     TGeant3 *geant3 = (TGeant3 *) gMC;
44
45     //
46     // Set External decayer
47     TVirtualMCDecayer *decayer = new AliDecayerPythia();
48
49     decayer->SetForceDecay(kAll);
50     decayer->Init();
51     gMC->SetExternalDecayer(decayer);
52     //
53     //
54     //=======================================================================
55     // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
56     geant3->SetTRIG(1);         //Number of events to be processed 
57     geant3->SetSWIT(4, 10);
58     geant3->SetDEBU(0, 0, 1);
59     //geant3->SetSWIT(2,2);
60     geant3->SetDCAY(1);
61     geant3->SetPAIR(1);
62     geant3->SetCOMP(1);
63     geant3->SetPHOT(1);
64     geant3->SetPFIS(0);
65     geant3->SetDRAY(0);
66     geant3->SetANNI(1);
67     geant3->SetBREM(1);
68     geant3->SetMUNU(1);
69     geant3->SetCKOV(1);
70     geant3->SetHADR(1);         //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
71     geant3->SetLOSS(2);
72     geant3->SetMULS(1);
73     geant3->SetRAYL(1);
74     geant3->SetAUTO(1);         //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
75     geant3->SetABAN(0);         //Restore 3.16 behaviour for abandoned tracks
76     geant3->SetOPTI(2);         //Select optimisation level for GEANT geometry searches (0,1,2)
77     geant3->SetERAN(5.e-7);
78
79     Float_t cut = 1.e-3;        // 1MeV cut by default
80     Float_t tofmax = 1.e10;
81
82     //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
83     geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
84                     tofmax);
85     //
86     //=======================================================================
87     // ************* STEERING parameters FOR ALICE SIMULATION **************
88     // --- Specify event type to be tracked through the ALICE setup
89     // --- All positions are in cm, angles in degrees, and P and E in GeV
90     if (gSystem->Getenv("CONFIG_NPARTICLES"))
91     {
92         int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
93     } else
94     {
95         int     nParticles = 10;
96     }
97  //    AliGenCocktail *gener = new AliGenCocktail();
98 //     gener->SetPhiRange(220, 320);
99 //     // Set pseudorapidity range from -8 to 8.
100 //     Float_t thmin = EtaToTheta(0.12);   // theta min. <---> eta max
101 //     Float_t thmax = EtaToTheta(-0.12);  // theta max. <---> eta min 
102 //     gener->SetThetaRange(thmin,thmax);
103 //     gener->SetOrigin(0, 0, 0);  //vertex position
104 //     gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
105
106 //     AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
107 //     hijingparam->SetMomentumRange(0.2, 999);
108 //     gener->AddGenerator(hijingparam,"HIJING PARAM",1);
109
110 //     AliGenBox *genbox = new AliGenBox(nParticles);
111 //     genbox->SetPart(kGamma);
112 //     genbox->SetPtRange(0.3, 10.00);
113 //     gener->AddGenerator(genbox,"GENBOX GAMMA for PHOS",1);
114 //     gener->Init();
115
116     AliGenBox *gener = new AliGenBox(1);
117     gener->SetMomentumRange(10,11.);
118     gener->SetPhiRange(270.5,270.7);
119     gener->SetThetaRange(90.5,90.7);
120
121     gener->SetOrigin(0,0,0);        //vertex position
122     gener->SetSigma(0,0,0);         //Sigma in (X,Y,Z) (cm) on IP position
123     gener->SetPart(kGamma);
124     gener->Init();
125  
126     // 
127     // Activate this line if you want the vertex smearing to happen
128     // track by track
129     //
130     //gener->SetVertexSmear(perTrack); 
131     // Field (L3 0.4 T)
132     TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
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  =  1;
143     Int_t   iPIPE  =  0;
144     Int_t   iPMD   =  0;
145     Int_t   iHMPID  =  0;
146     Int_t   iSHIL  =  0;
147     Int_t   iT0 =  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 =  0;
153     Int_t   iACORDE   =  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 (iHMPID)
323     {
324         //=================== HMPID parameters ===========================
325         AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
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 HMPID
349             TRD->SetHMPIDhole();
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 (iT0)
386     {
387         //=================== T0 parameters ============================
388         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
389     }
390
391     if (iEMCAL)
392     {
393         //=================== EMCAL parameters ============================
394         AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
395     }
396
397      if (iACORDE)
398     {
399         //=================== ACORDE parameters ============================
400         AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
401     }
402
403      if (iVZERO)
404     {
405         //=================== ACORDE 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 }