]> git.uio.no Git - u/mrichter/AliRoot.git/blame - macros/ConfigCharmPPR.C
Initialization of data members
[u/mrichter/AliRoot.git] / macros / ConfigCharmPPR.C
CommitLineData
de78d77f 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <Riostream.h>
3#include <TRandom.h>
4#include <TDatime.h>
5#include <TSystem.h>
6#include <TVirtualMC.h>
7#include <TGeant3.h>
8#include "STEER/AliRunLoader.h"
9#include "STEER/AliRun.h"
10#include "STEER/AliConfig.h"
11#include "PYTHIA6/AliDecayerPythia.h"
12#include "PYTHIA6/AliGenPythia.h"
13#include "STEER/AliMagFCM.h"
14#include "STRUCT/AliBODY.h"
15#include "STRUCT/AliMAG.h"
96fb3353 16#include "STRUCT/AliABSOv3.h"
17#include "STRUCT/AliDIPOv3.h"
18#include "STRUCT/AliHALLv3.h"
de78d77f 19#include "STRUCT/AliFRAMEv2.h"
96fb3353 20#include "STRUCT/AliSHILv3.h"
21#include "STRUCT/AliPIPEv3.h"
de78d77f 22#include "ITS/AliITSvPPRasymm.h"
23#include "TPC/AliTPCv2.h"
0d7ef405 24#include "TOF/AliTOFv6T0.h"
55eb2b56 25#include "HMPID/AliHMPIDv2.h"
9d07603a 26#include "ZDC/AliZDCv3.h"
de78d77f 27#include "TRD/AliTRDv1.h"
28#include "FMD/AliFMDv0.h"
29#include "MUON/AliMUONv1.h"
30#include "PHOS/AliPHOSv1.h"
31#include "PMD/AliPMDv1.h"
ababa197 32#include "T0/AliT0v1.h"
b384f8a4 33#include "ACORDE/AliACORDEv1.h"
de78d77f 34#endif
35
6b612c2d 36enum PprGeo_t
37 {
38 kHoles, kNoHoles
39 };
40static PprGeo_t geo = kHoles;
41
f2afc421 42void Config()
43{
44
45 //
46 // Set Random Number seed
47 TDatime dt;
48 UInt_t curtime=dt.Get();
49 UInt_t procid=gSystem->GetPid();
50 UInt_t seed=curtime-procid;
51
de78d77f 52 // gRandom->SetSeed(seed);
53 gRandom->SetSeed(12345);
f2afc421 54 cerr<<"Seed for random number generation= "<<seed<<endl;
55
de78d77f 56 // libraries required by geant321
57#if defined(__CINT__)
58 gSystem->Load("libgeant321");
59#endif
60
b0470150 61 new TGeant3TGeo("C++ Interface to Geant3");
f2afc421 62
458041af 63 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
64 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
65 AliCDBManager::Instance()->SetRun(0);
66 }
67
f2afc421 68 //=======================================================================
69 // Create the output file
70
de78d77f 71 AliRunLoader* rl=0x0;
72
73 cout<<"Config.C: Creating Run Loader ..."<<endl;
74 rl = AliRunLoader::Open("galice.root",
f5a857b2 75 AliConfig::GetDefaultEventFolderName(),
de78d77f 76 "recreate");
77 if (rl == 0x0)
78 {
79 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
80 return;
81 }
82 rl->SetCompressionLevel(2);
83 rl->SetNumberOfEventsPerFile(3);
84 gAlice->SetRunLoader(rl);
458041af 85 // gAlice->SetGeometryFromFile("geometry.root");
86 // gAlice->SetGeometryFromCDB();
de78d77f 87
6521ae06 88 // Set the trigger configuration
89 gAlice->SetTriggerDescriptor("Pb-Pb");
90 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
91
92 //
f2afc421 93 // Set External decayer
94 AliDecayer* decayer = new AliDecayerPythia();
95 decayer->SetForceDecay(kAll);
96 decayer->Init();
97 gMC->SetExternalDecayer(decayer);
98
f2afc421 99
f2afc421 100 //
101 //=======================================================================
102 // ************* STEERING parameters FOR ALICE SIMULATION **************
103 // --- Specify event type to be tracked through the ALICE setup
104 // --- All positions are in cm, angles in degrees, and P and E in GeV
6a3df6c9 105
106
de78d77f 107 gMC->SetProcess("DCAY",1);
108 gMC->SetProcess("PAIR",1);
109 gMC->SetProcess("COMP",1);
110 gMC->SetProcess("PHOT",1);
111 gMC->SetProcess("PFIS",0);
112 gMC->SetProcess("DRAY",0);
113 gMC->SetProcess("ANNI",1);
114 gMC->SetProcess("BREM",1);
115 gMC->SetProcess("MUNU",1);
116 gMC->SetProcess("CKOV",1);
117 gMC->SetProcess("HADR",1);
118 gMC->SetProcess("LOSS",2);
119 gMC->SetProcess("MULS",1);
120 gMC->SetProcess("RAYL",1);
121
122 Float_t cut = 1.e-3; // 1MeV cut by default
123 Float_t tofmax = 1.e10;
124
125 gMC->SetCut("CUTGAM", cut);
126 gMC->SetCut("CUTELE", cut);
127 gMC->SetCut("CUTNEU", cut);
128 gMC->SetCut("CUTHAD", cut);
129 gMC->SetCut("CUTMUO", cut);
130 gMC->SetCut("BCUTE", cut);
131 gMC->SetCut("BCUTM", cut);
132 gMC->SetCut("DCUTE", cut);
133 gMC->SetCut("DCUTM", cut);
134 gMC->SetCut("PPCUTM", cut);
135 gMC->SetCut("TOFMAX", tofmax);
136
6a3df6c9 137
f2afc421 138 // AliGenPythia *gener = new AliGenPythia(ntracks);
139 AliGenPythia *gener = new AliGenPythia(-1);
140
141 gener->SetMomentumRange(0,999);
b86fedbb 142 gener->SetPhiRange(0., 360.);
f2afc421 143 gener->SetThetaRange(0,180);
144 gener->SetYRange(-999,999);
145 //gener->SetPtRange(0,100);
146 gener->SetOrigin(0,0,0); // vertex position
147 //gener->SetVertexSmear(kPerEvent);
148 gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position
149 gener->SetTrackingFlag(0);
150 // gener->SetForceDecay(kHadronicD);
151
152 //
153 // The following settings select the Pythia parameters tuned to agree
154 // with charm NLO calculation for Pb-Pb @ 5.5 TeV with MNR code.
155 //
de78d77f 156 gener->SetProcess(kPyCharmPbPbMNR);
402c423c 157 gener->SetStrucFunc(kCTEQ4L);
f2afc421 158 gener->SetPtHard(2.1,-1.0);
159 gener->SetEnergyCMS(5500.);
160 gener->SetNuclei(208,208); // Pb-Pb collisions
161
162 gener->Init();
163 //
164 // Activate this line if you want the vertex smearing to happen
165 // track by track
166 //
167 //gener->SetVertexSmear(perTrack);
168
169 // Field (L3 0.4 T)
170 AliMagFCM* field = new AliMagFCM(
de78d77f 171 "Map2","$(ALICE_ROOT)/data/field01.dat", 2, 1., 10.);
f2afc421 172 field->SetSolenoidField(4.);
173 gAlice->SetField(field);
174
175 Int_t iABSO=0;
b384f8a4 176 Int_t iACORDE=0;
f2afc421 177 Int_t iDIPO=0;
178 Int_t iFMD=0;
179 Int_t iFRAME=0;
180 Int_t iHALL=0;
181 Int_t iITS=0;
182 Int_t iMAG=0;
183 Int_t iMUON=0;
184 Int_t iPHOS=0;
185 Int_t iPIPE=0;
186 Int_t iPMD=0;
de1857bb 187 Int_t iHMPID=0;
f2afc421 188 Int_t iSHIL=0;
ababa197 189 Int_t iT0=0;
f2afc421 190 Int_t iTOF=0;
191 Int_t iTPC=0;
192 Int_t iTRD=0;
193 Int_t iZDC=0;
194
195 //=================== Alice BODY parameters =============================
196 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
197
198 if(iMAG) {
199 //=================== MAG parameters ============================
200 // --- Start with Magnet since detector layouts may be depending ---
201 // --- on the selected Magnet dimensions ---
202 AliMAG *MAG = new AliMAG("MAG","Magnet");
203 }
204
205
206 if(iABSO) {
207 //=================== ABSO parameters ============================
96fb3353 208 AliABSO *ABSO = new AliABSOv3("ABSO","Muon Absorber");
f2afc421 209 }
210
211 if(iDIPO) {
212 //=================== DIPO parameters ============================
213
96fb3353 214 AliDIPO *DIPO = new AliDIPOv3("DIPO","Dipole version 3");
f2afc421 215 }
216
217 if(iHALL) {
218 //=================== HALL parameters ============================
219
96fb3353 220 AliHALL *HALL = new AliHALLv3("HALL","Alice Hall");
f2afc421 221 }
222
223
224 if(iFRAME) {
225 //=================== FRAME parameters ============================
226
227 AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame");
6b612c2d 228 if (geo == kHoles) {
229 FRAME->SetHoles(1);
230 } else {
231 FRAME->SetHoles(0);
232 }
f2afc421 233
234 }
235
236 if(iSHIL) {
237 //=================== SHIL parameters ============================
238
96fb3353 239 AliSHIL *SHIL = new AliSHILv3("SHIL","Shielding");
f2afc421 240 }
241
242
243 if(iPIPE) {
244 //=================== PIPE parameters ============================
245
96fb3353 246 AliPIPE *PIPE = new AliPIPEv3("PIPE","Beam Pipe");
f2afc421 247 }
248
249
e89fa83b 250 if (iITS)
251 {
252 //=================== ITS parameters ============================
253
f2afc421 254 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
f2afc421 255 }
256
257
258 if(iTPC) {
26ca4b4a 259 //============================ TPC parameters ===================
f2afc421 260 AliTPC *TPC = new AliTPCv2("TPC","Default");
f2afc421 261 }
262
263
264 if(iTOF) {
265 //=================== TOF parameters ============================
0d7ef405 266 AliTOF *TOF = new AliTOFv6T0("TOF","normal TOF");
f2afc421 267 }
268
de1857bb 269 if(iHMPID) {
270 //=================== HMPID parameters ===========================
55eb2b56 271 AliHMPID *HMPID = new AliHMPIDv2("HMPID","normal HMPID");
f2afc421 272
273 }
274
275
276 if(iZDC) {
277 //=================== ZDC parameters ============================
278
9d07603a 279 AliZDC *ZDC = new AliZDCv3("ZDC","normal ZDC");
f2afc421 280 }
281
b384f8a4 282 if(iACORDE) {
283 //=================== ACORDE parameters ============================
f2afc421 284
b384f8a4 285 AliACORDE *ACORDE = new AliACORDEv1("ACORDE","normal ACORDE");
f2afc421 286 }
287
288 if(iTRD) {
289 //=================== TRD parameters ============================
290
291 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
f2afc421 292 }
293
294 if(iFMD) {
295 //=================== FMD parameters ============================
296
297 AliFMD *FMD = new AliFMDv0("FMD","normal FMD");
298 }
299
300 if(iMUON) {
301 //=================== MUON parameters ===========================
302 AliMUON *MUON = new AliMUONv1("MUON","default");
303 }
304
305 //=================== PHOS parameters ===========================
306
307 if(iPHOS) {
308 AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
309 }
310
311
b384f8a4 312 //=================== ACORDE parameters ===========================
b9d0a01d 313
b384f8a4 314 if(iACORDE) {
315 AliACORDE *ACORDE = new AliACORDEv1("ACORDE","Normal ACORDEGPS2");
b9d0a01d 316 }
317
318
f2afc421 319 if(iPMD) {
320 //=================== PMD parameters ============================
321
322 AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
323 PMD->SetPAR(1., 1., 0.8, 0.02);
324 PMD->SetIN(6., 18., -580., 27., 27.);
325 PMD->SetGEO(0.0, 0.2, 4.);
326 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
327
328 }
329
ababa197 330 if(iT0) {
331 //=================== T0 parameters ============================
332 AliT0 *T0 = new AliT0v1("T0","T0 Detector");
f2afc421 333 }
334
335
336}