]> git.uio.no Git - u/mrichter/AliRoot.git/blame - macros/g4ConfigCommon.C
Include cstdlib (gcc 4.3.0)
[u/mrichter/AliRoot.git] / macros / g4ConfigCommon.C
CommitLineData
1fccbbe0 1// $Id$
2//
3// AliRoot Configuration for running aliroot with Monte Carlo.
4// Called from g4Config.C
5
913c1adf 6Float_t EtaToTheta(Float_t arg);
9ac91a91 7static Int_t eventsPerRun = 50;
1fccbbe0 8
9ac91a91 9void ConfigCommon()
1fccbbe0 10{
11 // =============================
12 // Root file
13 // =============================
14
15 // Create the output file
913c1adf 16 AliRunLoader* rl = 0;
17 rl = AliRunLoader::Open("galice.root",
f5a857b2 18 AliConfig::GetDefaultEventFolderName(),
913c1adf 19 "recreate");
20 if (!rl) {
21 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
22 return;
23 }
24 rl->SetCompressionLevel(2);
25 rl->SetNumberOfEventsPerFile(3);
26 gAlice->SetRunLoader(rl);
9ac91a91 27// gAlice->SetRootGeometry();
28// gAlice->SetGeometryFileName("geometry.root");
29
30 // Set the trigger configuration
31 gAlice->SetTriggerDescriptor("Pb-Pb");
32 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
33
34 // Set Random Number seed
35 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
36 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
37 int nParticles = 500;
38 if (gSystem->Getenv("CONFIG_NPARTICLES"))
39 {
40 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
41 }
1fccbbe0 42
9ac91a91 43///*
44 AliGenCocktail *gener = new AliGenCocktail();
45 gener->SetPhiRange(0, 360);
46 // Set pseudorapidity range from -8 to 8.
47 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
48 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
49 gener->SetThetaRange(thmin,thmax);
50 gener->SetOrigin(0, 0, 0); //vertex position
51 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
52
53 AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
54 hijingparam->SetMomentumRange(0.2, 999);
55 gener->AddGenerator(hijingparam,"HIJING PARAM",1);
56 gener->Init();
57
58 //
59 // Activate this line if you want the vertex smearing to happen
60 // track by track
61 //
62 //gener->SetVertexSmear(perTrack);
1fccbbe0 63
64 // =============================
65 // Magnetic field
66 // =============================
67
9ac91a91 68 // Field (L3 0.4 T)
69 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
70 gAlice->SetField(field);
71
72 Int_t iABSO = 1;
73 Int_t iDIPO = 1;
74 Int_t iFMD = 1;
75 Int_t iFRAME = 1;
76 Int_t iHALL = 1;
77 Int_t iITS = 1;
78 Int_t iMAG = 1;
79 Int_t iMUON = 1;
80 Int_t iPHOS = 1;
81 Int_t iPIPE = 1;
82 Int_t iPMD = 1;
83 Int_t iHMPID = 1;
84 Int_t iSHIL = 1;
85 Int_t iT0 = 1;
86 Int_t iTOF = 1;
87 Int_t iTPC = 1;
88 Int_t iTRD = 1;
89 Int_t iZDC = 1;
90 Int_t iEMCAL = 1;
91 Int_t iACORDE = 0;
92 Int_t iVZERO = 1;
93
94 rl->CdGAFile();
1fccbbe0 95 //=================== Alice BODY parameters =============================
96 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
97
1fccbbe0 98 if (iMAG)
99 {
100 //=================== MAG parameters ============================
101 // --- Start with Magnet since detector layouts may be depending ---
102 // --- on the selected Magnet dimensions ---
103 AliMAG *MAG = new AliMAG("MAG", "Magnet");
104 }
105
106
107 if (iABSO)
108 {
109 //=================== ABSO parameters ============================
9ac91a91 110 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
1fccbbe0 111 }
112
113 if (iDIPO)
114 {
115 //=================== DIPO parameters ============================
116
9ac91a91 117 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
1fccbbe0 118 }
119
120 if (iHALL)
121 {
122 //=================== HALL parameters ============================
123
9ac91a91 124 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
1fccbbe0 125 }
126
127
128 if (iFRAME)
129 {
130 //=================== FRAME parameters ============================
131
132 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
1fccbbe0 133 }
134
135 if (iSHIL)
136 {
137 //=================== SHIL parameters ============================
138
9ac91a91 139 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
1fccbbe0 140 }
141
142
143 if (iPIPE)
144 {
145 //=================== PIPE parameters ============================
146
9ac91a91 147 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
1fccbbe0 148 }
149
9ac91a91 150 if(iITS) {
151
152 //=================== ITS parameters ============================
153 //
154 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
155 // almost all other detectors. This involves the fact that the ITS geometry
156 // still has several options to be followed in parallel in order to determine
157 // the best set-up which minimizes the induced background. All the geometries
158 // available to date are described in the following. Read carefully the comments
159 // and use the default version (the only one uncommented) unless you are making
160 // comparisons and you know what you are doing. In this case just uncomment the
161 // ITS geometry you want to use and run Aliroot.
162 //
163 // Detailed geometries:
164 //
165 //
166 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
167 //
168 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
169 //
170 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
913c1adf 171 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
9e8b3f5f 172 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
9ac91a91 173 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
913c1adf 174 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
175 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
1c7d79a4 176 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
177 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
9ac91a91 178 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
179 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
180
181 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
182 // for reconstruction !):
183 //
184 //
185 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
186 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
187 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
188 //
189 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
190 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
191 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
192 //
193 //
194 //
195 // Geant3 <-> EUCLID conversion
196 // ============================
197 //
198 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
199 // media to two ASCII files (called by default ITSgeometry.euc and
200 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
201 // The default (=0) means that you dont want to use this facility.
202 //
203 ITS->SetEUCLID(0);
204 }
1fccbbe0 205
206 if (iTPC)
207 {
26ca4b4a 208 //============================ TPC parameters ===================
1fccbbe0 209 AliTPC *TPC = new AliTPCv2("TPC", "Default");
1fccbbe0 210 }
211
9ac91a91 212
213 if (iTOF) {
1fccbbe0 214 //=================== TOF parameters ============================
0d7ef405 215 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
9ac91a91 216 // Partial geometry: modules at 2,3,4,6,7,11,12,14,15,16
217 // starting at 6h in positive direction
218 // Int_t TOFSectors[18]={-1,-1,0,0,0,-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0};
219 // Partial geometry: modules at 1,2,6,7,9,10,11,12,15,16,17
220 // (ALICE numbering convention)
221 Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};
222 TOF->SetTOFSectors(TOFSectors);
1fccbbe0 223 }
224
9ac91a91 225
de1857bb 226 if (iHMPID)
1fccbbe0 227 {
de1857bb 228 //=================== HMPID parameters ===========================
55eb2b56 229 AliHMPID *HMPID = new AliHMPIDv2("HMPID", "normal HMPID");
9ac91a91 230
1fccbbe0 231 }
232
233
234 if (iZDC)
235 {
236 //=================== ZDC parameters ============================
237
9d07603a 238 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
1fccbbe0 239 }
240
241 if (iTRD)
242 {
243 //=================== TRD parameters ============================
244
245 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
1fccbbe0 246 }
247
248 if (iFMD)
249 {
250 //=================== FMD parameters ============================
9ac91a91 251 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
252 }
1fccbbe0 253
254 if (iMUON)
255 {
256 //=================== MUON parameters ===========================
9ac91a91 257 // New MUONv1 version (geometry defined via builders)
1fccbbe0 258 AliMUON *MUON = new AliMUONv1("MUON", "default");
259 }
260 //=================== PHOS parameters ===========================
261
262 if (iPHOS)
263 {
9cc36300 264 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
1fccbbe0 265 }
266
267
268 if (iPMD)
269 {
270 //=================== PMD parameters ============================
271 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
272 }
273
ababa197 274 if (iT0)
1fccbbe0 275 {
ababa197 276 //=================== T0 parameters ============================
277 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
1fccbbe0 278 }
279
280 if (iEMCAL)
281 {
282 //=================== EMCAL parameters ============================
0588179e 283 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
1fccbbe0 284 }
285
9ac91a91 286 if (iACORDE)
1fccbbe0 287 {
b384f8a4 288 //=================== ACORDE parameters ============================
b384f8a4 289 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
1fccbbe0 290 }
291
9ac91a91 292 if (iVZERO)
1fccbbe0 293 {
b384f8a4 294 //=================== ACORDE parameters ============================
4a2f6442 295 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
1fccbbe0 296 }
297
9ac91a91 298 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
67d736ee 299
1fccbbe0 300}
301
302Float_t EtaToTheta(Float_t arg){
303 return (180./TMath::Pi())*2.*atan(exp(-arg));
304}