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