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