Using EMCAL_COMPLETE by default (Jennifer)
[u/mrichter/AliRoot.git] / ZDC / ConfigGenZDC.C
CommitLineData
8bca48db 1enum PprMag_t
2{k2kG, k4kG, k5kG};
3
4static PprMag_t smag = k2kG; // k2kG->L3 field 0.2T
5//static PprMag_t smag = k4kG; // k4kG->L3 field 0.4T
6//static PprMag_t smag = k5kG; // k5kG->L3 field 0.5T
a5abc835 7
8Float_t EtaToTheta(Float_t arg);
9static Int_t eventsPerRun = 100;
8bca48db 10
a5abc835 11enum PprGeo_t
8bca48db 12{kHoles, kNoHoles};
13static PprGeo_t sgeo = kHoles;
a5abc835 14
15void Config()
16{
17 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
18 // Theta range given through pseudorapidity limits 22/6/2001
19
20 // Set Random Number seed
8bca48db 21 gRandom->SetSeed(9956646); // Set 0 to use the current time
a5abc835 22 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
23
24
25 // libraries required by geant321
26#if defined(__CINT__)
27 gSystem->Load("libgeant321");
28#endif
29
30 new TGeant3("C++ Interface to Geant3");
31
32 AliRunLoader* rl=0x0;
33
34 cout<<"Config.C: Creating Run Loader ..."<<endl;
35 rl = AliRunLoader::Open("galice.root",
f5a857b2 36 AliConfig::GetDefaultEventFolderName(),
a5abc835 37 "recreate");
8bca48db 38 if (rl == 0x0){
a5abc835 39 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
40 return;
8bca48db 41 }
a5abc835 42 rl->SetCompressionLevel(2);
43 rl->SetNumberOfEventsPerFile(3);
44 gAlice->SetRunLoader(rl);
8bca48db 45 //gAlice->SetDebug(1);
a5abc835 46
47 //
48 // Set External decayer
8bca48db 49 AliDecayer *decayer = new AliDecayerPythia();
a5abc835 50
51 decayer->SetForceDecay(kAll);
52 decayer->Init();
53 gMC->SetExternalDecayer(decayer);
54 //=======================================================================
55 // ************* STEERING parameters FOR ALICE SIMULATION **************
56 // --- Specify event type to be tracked through the ALICE setup
57 // --- All positions are in cm, angles in degrees, and P and E in GeV
8bca48db 58 //
59 ((TGeant3*)gMC)->SetDEBU(1, 2, 1);
a5abc835 60 ((TGeant3*)gMC)->SetSWIT(4,10);
61 ((TGeant3*)gMC)->SetSWIT(2,2);
8bca48db 62 ((TGeant3*)gMC)->SetSWIT(2,1); // to draw tracks
a5abc835 63
64 gMC->SetProcess("DCAY",1);
65 gMC->SetProcess("PAIR",1);
66 gMC->SetProcess("COMP",1);
67 gMC->SetProcess("PHOT",1);
68 gMC->SetProcess("PFIS",0);
69 gMC->SetProcess("DRAY",0);
70 gMC->SetProcess("ANNI",1);
71 gMC->SetProcess("BREM",1);
72 gMC->SetProcess("MUNU",1);
73 gMC->SetProcess("CKOV",1);
74 //gMC->SetProcess("HADR",1);
8bca48db 75 gMC->SetProcess("HADR",0); // If option NoShower() is switched on
a5abc835 76 gMC->SetProcess("LOSS",2);
77 gMC->SetProcess("MULS",1);
78 gMC->SetProcess("RAYL",1);
79
80 Float_t cut = 1.e-3; // 1MeV cut by default
81 Float_t tofmax = 1.e10;
82
83 gMC->SetCut("CUTGAM", cut);
84 gMC->SetCut("CUTELE", cut);
85 gMC->SetCut("CUTNEU", cut);
86 gMC->SetCut("CUTHAD", cut);
87 gMC->SetCut("CUTMUO", cut);
88 gMC->SetCut("BCUTE", cut);
89 gMC->SetCut("BCUTM", cut);
90 gMC->SetCut("DCUTE", cut);
91 gMC->SetCut("DCUTM", cut);
92 gMC->SetCut("PPCUTM", cut);
93 gMC->SetCut("TOFMAX", tofmax);
94
95
96 int nParticles = 100;
97 if (gSystem->Getenv("CONFIG_NPARTICLES"))
98 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
99
100
101 // #### AliGenZDC generation ######################################
102 AliGenZDC *gener = new AliGenZDC();
8bca48db 103 gener->SetOrigin(0, 0, 0); // vertex position
a5abc835 104 //gener->SetParticle(kNeutron);
105 gener->SetParticle(kProton);
106 gener->SetMomentum(2760.);
107 gener->SetDirection(0.,0.,0.,-1.);
8bca48db 108 gener->SetFermi(1); // Fermi momentum
109 //gener->SetDiv(0.,0.,2); // Divergence and crossing angle
110 gener->SetDiv(0.000032,0.0001,2); // Divergence and crossing angle
111 gener->SetDebug(2);
a5abc835 112 //
113 gener->SetTrackingFlag(1);
114 gener->Init();
115
116 //
117 // Activate this line if you want the vertex smearing to happen
118 // track by track
119 //
120 //gener->SetVertexSmear(perTrack);
8bca48db 121 // Magnetic field
122 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
123 field->SetL3ConstField(0); //Using const. field in the barrel
124 rl->CdGAFile();
a5abc835 125 gAlice->SetField(field);
126
127 Int_t iABSO = 1;
128 Int_t iDIPO = 1;
129 Int_t iFMD = 0;
130 Int_t iFRAME = 0;
131 Int_t iHALL = 0;
132 Int_t iITS = 0;
8bca48db 133 Int_t iMAG = 1;
a5abc835 134 Int_t iMUON = 0;
135 Int_t iPHOS = 0;
136 Int_t iPIPE = 1;
137 Int_t iPMD = 0;
f4b3bbb7 138 Int_t iHMPID = 0;
a5abc835 139 Int_t iSHIL = 1;
ababa197 140 Int_t iT0 = 0;
a5abc835 141 Int_t iTOF = 0;
142 Int_t iTPC = 0;
143 Int_t iTRD = 0;
144 Int_t iZDC = 1;
145 Int_t iEMCAL = 0;
b384f8a4 146 Int_t iACORDE = 0;
a5abc835 147 Int_t iVZERO = 0;
8bca48db 148
a5abc835 149 //=================== Alice BODY parameters =============================
150 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
151
8bca48db 152
a5abc835 153 if (iMAG)
154 {
155 //=================== MAG parameters ============================
156 // --- Start with Magnet since detector layouts may be depending ---
157 // --- on the selected Magnet dimensions ---
158 AliMAG *MAG = new AliMAG("MAG", "Magnet");
159 }
160
161
162 if (iABSO)
163 {
164 //=================== ABSO parameters ============================
165 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
166 }
167
168 if (iDIPO)
169 {
170 //=================== DIPO parameters ============================
171
172 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
173 }
174
175 if (iHALL)
176 {
177 //=================== HALL parameters ============================
178
179 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
180 }
181
182
183 if (iFRAME)
184 {
185 //=================== FRAME parameters ============================
186
187 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
8bca48db 188 if (sgeo == kHoles) {
a5abc835 189 FRAME->SetHoles(1);
190 } else {
191 FRAME->SetHoles(0);
192 }
193 }
194
195 if (iSHIL)
196 {
197 //=================== SHIL parameters ============================
198
199 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
200 }
201
202
203 if (iPIPE)
204 {
205 //=================== PIPE parameters ============================
206
207 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
208 }
209
210 if(iITS) {
211
212 //=================== ITS parameters ============================
213 //
214 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
215 // almost all other detectors. This involves the fact that the ITS geometry
216 // still has several options to be followed in parallel in order to determine
217 // the best set-up which minimizes the induced background. All the geometries
218 // available to date are described in the following. Read carefully the comments
219 // and use the default version (the only one uncommented) unless you are making
220 // comparisons and you know what you are doing. In this case just uncomment the
221 // ITS geometry you want to use and run Aliroot.
222 //
223 // Detailed geometries:
224 //
225 //
8bca48db 226 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
227 //
228 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
a5abc835 229 //
8bca48db 230 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
a5abc835 231 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
232 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
8bca48db 233 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
a5abc835 234 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
235 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
236 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
237 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
8bca48db 238 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
239 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
a5abc835 240
a5abc835 241 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
242 // for reconstruction !):
243 //
244 //
245 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
246 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
247 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
248 //
249 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
250 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
251 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
252 //
253 //
254 //
255 // Geant3 <-> EUCLID conversion
256 // ============================
257 //
258 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
259 // media to two ASCII files (called by default ITSgeometry.euc and
260 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
261 // The default (=0) means that you dont want to use this facility.
262 //
8bca48db 263 ITS->SetEUCLID(0);
a5abc835 264 }
265
266 if (iTPC)
267 {
268 //============================ TPC parameters ================================
269 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
270 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
271 // --- sectors are specified, any value other than that requires at least one
272 // --- sector (lower or upper)to be specified!
273 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
274 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
275 // --- SecLows - number of lower sectors specified (up to 6)
276 // --- SecUps - number of upper sectors specified (up to 12)
277 // --- Sens - sensitive strips for the Slow Simulator !!!
278 // --- This does NOT work if all S or L-sectors are specified, i.e.
279 // --- if SecAL or SecAU < 0
280 //
281 //
282 //-----------------------------------------------------------------------------
283
284 // gROOT->LoadMacro("SetTPCParam.C");
285 // AliTPCParam *param = SetTPCParam();
286 AliTPC *TPC = new AliTPCv2("TPC", "Default");
287
288 // All sectors included
a5abc835 289 TPC->SetSecAL(-1);
8bca48db 290 TPC->SetSecAU(-1);
291
a5abc835 292 }
293
294
295 if (iTOF) {
a5abc835 296 //=================== TOF parameters ============================
8bca48db 297 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
a5abc835 298 }
299
300
f4b3bbb7 301 if (iHMPID)
a5abc835 302 {
f4b3bbb7 303 //=================== HMPID parameters ===========================
304 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
a5abc835 305
306 }
307
308
309 if (iZDC)
310 {
311 //=================== ZDC parameters ============================
312
313 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
314 ZDC->NoShower();
315 }
316
317 if (iTRD)
318 {
319 //=================== TRD parameters ============================
320
321 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
322
323 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
324 TRD->SetGasMix(1);
8bca48db 325 if (sgeo == kHoles) {
a5abc835 326 // With hole in front of PHOS
327 TRD->SetPHOShole();
f4b3bbb7 328 // With hole in front of HMPID
329 TRD->SetHMPIDhole();
a5abc835 330 }
331 // Switch on TR
332 AliTRDsim *TRDsim = TRD->CreateTR();
333 }
334
335 if (iFMD)
336 {
337 //=================== FMD parameters ============================
338 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
339 }
340
341 if (iMUON)
342 {
343 //=================== MUON parameters ===========================
344
345 AliMUON *MUON = new AliMUONv1("MUON", "default");
8bca48db 346 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
347 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
348 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
349 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
a5abc835 350 }
351 //=================== PHOS parameters ===========================
352
353 if (iPHOS)
354 {
355 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
356 }
357
358
359 if (iPMD)
360 {
361 //=================== PMD parameters ============================
362 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
363 }
364
ababa197 365 if (iT0)
a5abc835 366 {
ababa197 367 //=================== T0 parameters ============================
368 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
a5abc835 369 }
370
371 if (iEMCAL)
372 {
373 //=================== EMCAL parameters ============================
8224b11d 374 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
a5abc835 375 }
376
b384f8a4 377 if (iACORDE)
a5abc835 378 {
b384f8a4 379 //=================== ACORDE parameters ============================
380 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
a5abc835 381 }
382
383 if (iVZERO)
384 {
b384f8a4 385 //=================== ACORDE parameters ============================
a5abc835 386 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
387 }
388
389 cout << "End of Config.C" << endl;
390
391}
392
393Float_t EtaToTheta(Float_t arg){
394 return (180./TMath::Pi())*2.*atan(exp(-arg));
395}