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