AliRoot Core  3dc7879 (3dc7879)
ConfigHPT1.C
Go to the documentation of this file.
1 
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <Riostream.h>
12 #include <TRandom.h>
13 #include <TSystem.h>
14 #include <TVirtualMC.h>
15 #include <TGeant3TGeo.h>
16 #include "STEER/AliRunLoader.h"
17 #include "STEER/AliRun.h"
18 #include "STEER/AliConfig.h"
19 #include "PYTHIA6/AliDecayerPythia.h"
20 #include "EVGEN/AliGenCocktail.h"
21 #include "EVGEN/AliGenHIJINGpara.h"
22 #include "STEER/AliMagF.h"
23 #include "STRUCT/AliBODY.h"
24 #include "STRUCT/AliMAG.h"
25 #include "STRUCT/AliABSOv3.h"
26 #include "STRUCT/AliDIPOv3.h"
27 #include "STRUCT/AliHALLv3.h"
28 #include "STRUCT/AliFRAMEv2.h"
29 #include "STRUCT/AliSHILv3.h"
30 #include "STRUCT/AliPIPEv3.h"
31 #include "ITS/AliITSvPPRasymmFMD.h"
32 #include "TPC/AliTPCv2.h"
33 #include "TOF/AliTOFv6T0.h"
34 #include "HMPID/AliHMPIDv2.h"
35 #include "ZDC/AliZDCv2.h"
36 #include "TRD/AliTRDv1.h"
37 #include "FMD/AliFMDv1.h"
38 #include "MUON/AliMUONv1.h"
39 #include "PHOS/AliPHOSv1.h"
40 #include "PMD/AliPMDv1.h"
41 #include "T0/AliT0v1.h"
42 #include "EMCAL/AliEMCALv2.h"
43 #include "ACORDE/AliACORDEv0.h"
44 #include "VZERO/AliVZEROv7.h"
45 #endif
46 
47 Float_t EtaToTheta(Float_t arg);
48 
49 void Config()
50 {
53 
54  // Set Random Number seed
55  gRandom->SetSeed(0); // Set 0 to use the currecnt time
56  AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
57 
58 
59  // libraries required by geant321
60 #if defined(__CINT__)
61  gSystem->Load("libgeant321");
62 #endif
63 
64  new TGeant3TGeo("C++ Interface to Geant3");
65 
66  if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
67  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
69  }
70 
71  AliRunLoader* rl=0x0;
72 
73  AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
74 
75  rl = AliRunLoader::Open("galice.root",
77  "recreate");
78  if (rl == 0x0)
79  {
80  gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
81  return;
82  }
83  rl->SetCompressionLevel(2);
85  gAlice->SetRunLoader(rl);
86  // gAlice->SetGeometryFromFile("geometry.root");
87  // gAlice->SetGeometryFromCDB();
88 
89  // Set the trigger configuration
91  cout<<"Trigger configuration is set to Pb-Pb"<<endl;
92 
93  //
94  // Set External decayer
95  TVirtualMCDecayer *decayer = new AliDecayerPythia();
96 
97  decayer->SetForceDecay(kAll);
98  decayer->Init();
99  gMC->SetExternalDecayer(decayer);
100  //=======================================================================
101  // ************* STEERING parameters FOR ALICE SIMULATION **************
102  // --- Specify event type to be tracked through the ALICE setup
103  // --- All positions are in cm, angles in degrees, and P and E in GeV
104 
105 
106  gMC->SetProcess("DCAY",1);
107  gMC->SetProcess("PAIR",1);
108  gMC->SetProcess("COMP",1);
109  gMC->SetProcess("PHOT",1);
110  gMC->SetProcess("PFIS",0);
111  gMC->SetProcess("DRAY",0);
112  gMC->SetProcess("ANNI",1);
113  gMC->SetProcess("BREM",1);
114  gMC->SetProcess("MUNU",1);
115  gMC->SetProcess("CKOV",1);
116  gMC->SetProcess("HADR",1);
117  gMC->SetProcess("LOSS",2);
118  gMC->SetProcess("MULS",1);
119  gMC->SetProcess("RAYL",1);
120 
121  Float_t cut = 1.e-3; // 1MeV cut by default
122  Float_t tofmax = 1.e10;
123 
124  gMC->SetCut("CUTGAM", cut);
125  gMC->SetCut("CUTELE", cut);
126  gMC->SetCut("CUTNEU", cut);
127  gMC->SetCut("CUTHAD", cut);
128  gMC->SetCut("CUTMUO", cut);
129  gMC->SetCut("BCUTE", cut);
130  gMC->SetCut("BCUTM", cut);
131  gMC->SetCut("DCUTE", cut);
132  gMC->SetCut("DCUTM", cut);
133  gMC->SetCut("PPCUTM", cut);
134  gMC->SetCut("TOFMAX", tofmax);
135 
136 
137  int nParticles = 100;
138  if (gSystem->Getenv("CONFIG_NPARTICLES"))
139  {
140  nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
141  }
142 
143 
144  AliGenCocktail *gener = new AliGenCocktail();
145  gener->SetPhiRange(0, 360);
146  // Set pseudorapidity range from -8 to 8.
147  Float_t thmin = EtaToTheta(1.2); // theta min. <---> eta max
148  Float_t thmax = EtaToTheta(-1.2); // theta max. <---> eta min
149  gener->SetThetaRange(thmin,thmax);
150  gener->SetOrigin(0, 0, 0); //vertex position
151  gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
152 
153  // AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
154  //hijingparam->SetMomentumRange(0.2, 999);
155  //gener->AddGenerator(hijingparam,"HIJING PARAM",1);
156  //
157  //
158  Int_t nParticles2 =1;
159  // mu
160  AliGenBox *genboxMP = new AliGenBox(nParticles2);
161  genboxMP->SetPart(13);
162  genboxMP->SetPtRange(10, 100.00);
163 
164 
165  gener->AddGenerator(genboxMP,"GENBOX",1);
166 
167  gener->Init();
168 
169 
170 
171  //
172  // Activate this line if you want the vertex smearing to happen
173  // track by track
174  //
175  //gener->SetVertexSmear(perTrack);
176  // Field (L3 0.4 T)
177  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
178 
179  Int_t iABSO = 1;
180  Int_t iDIPO = 1;
181  Int_t iFMD = 0;
182  Int_t iFRAME = 1;
183  Int_t iHALL = 1;
184  Int_t iITS = 1;
185  Int_t iMAG = 1;
186  Int_t iMUON = 0;
187  Int_t iPHOS = 0;
188  Int_t iPIPE = 1;
189  Int_t iPMD = 0;
190  Int_t iHMPID = 0;
191  Int_t iSHIL = 1;
192  Int_t iT0 = 1;
193  Int_t iTOF = 1;
194  Int_t iTPC = 1;
195  Int_t iTRD = 1;
196  Int_t iZDC = 1;
197  Int_t iEMCAL = 0;
198  Int_t iACORDE = 0;
199  Int_t iVZERO = 0;
200  rl->CdGAFile();
201  //=================== Alice BODY parameters =============================
202  AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
203 
204  if (iMAG)
205  {
206  //=================== MAG parameters ============================
207  // --- Start with Magnet since detector layouts may be depending ---
208  // --- on the selected Magnet dimensions ---
209  AliMAG *MAG = new AliMAG("MAG", "Magnet");
210  }
211 
212 
213  if (iABSO)
214  {
215  //=================== ABSO parameters ============================
216  AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
217  }
218 
219  if (iDIPO)
220  {
221  //=================== DIPO parameters ============================
222 
223  AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
224  }
225 
226  if (iHALL)
227  {
228  //=================== HALL parameters ============================
229 
230  AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
231  }
232 
233 
234  if (iFRAME)
235  {
236  //=================== FRAME parameters ============================
237 
238  AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
239  }
240 
241  if (iSHIL)
242  {
243  //=================== SHIL parameters ============================
244 
245  AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
246  }
247 
248 
249  if (iPIPE)
250  {
251  //=================== PIPE parameters ============================
252 
253  AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
254  }
255 
256  if (iITS)
257  {
258  //=================== ITS parameters ============================
259  AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS",
260  "ITS PPR detailed version with asymmetric services");
261  }
262 
263  if (iTPC)
264  {
265  //============================ TPC parameters ===================
266  AliTPC *TPC = new AliTPCv2("TPC", "Default");
267  }
268 
269 
270  if (iTOF) {
271  //=================== TOF parameters ============================
272  AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
273  }
274 
275 
276  if (iHMPID)
277  {
278  //=================== HMPID parameters ===========================
279  AliHMPID *HMPID = new AliHMPIDv2("HMPID", "normal HMPID");
280 
281  }
282 
283 
284  if (iZDC)
285  {
286  //=================== ZDC parameters ============================
287 
288  AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
289  }
290 
291  if (iTRD)
292  {
293  //=================== TRD parameters ============================
294 
295  AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
296  }
297 
298  if (iFMD)
299  {
300  //=================== FMD parameters ============================
301  AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
302  }
303 
304  if (iMUON)
305  {
306  //=================== MUON parameters ===========================
307  // New MUONv1 version (geometry defined via builders)
308  AliMUON *MUON = new AliMUONv1("MUON", "default");
309  }
310  //=================== PHOS parameters ===========================
311 
312  if (iPHOS)
313  {
314  AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
315  }
316 
317 
318  if (iPMD)
319  {
320  //=================== PMD parameters ============================
321  AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
322  }
323 
324  if (iT0)
325  {
326  //=================== T0 parameters ============================
327  AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
328  }
329 
330  if (iEMCAL)
331  {
332  //=================== EMCAL parameters ============================
333  AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
334  }
335 
336  if (iACORDE)
337  {
338  //=================== ACORDE parameters ============================
339  AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
340  }
341 
342  if (iVZERO)
343  {
344  //=================== ACORDE parameters ============================
345  AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
346  }
347 
348  AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
349 
350 }
351 
352 Float_t EtaToTheta(Float_t arg){
353  return (180./TMath::Pi())*2.*atan(exp(-arg));
354 }
void SetRunLoader(AliRunLoader *rloader)
Definition: AliRun.cxx:392
static const TString & GetDefaultEventFolderName()
Definition: AliConfig.h:58
static void Message(UInt_t level, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:929
AliDetector class for MUON subsystem providing simulation data management.
Definition: AliMUON.h:37
Forward Multiplicity Detector based on Silicon wafers. This class is the driver for especially simula...
Definition: AliFMD.h:306
Forward Multiplicity Detector based on Silicon wafers.
Definition: AliFMDv1.h:40
static AliRunLoader * Open(const char *filename="galice.root", const char *eventfoldername=AliConfig::GetDefaultEventFolderName(), Option_t *option="READ")
void SetTriggerConfig(TString conf)
Definition: AliSimulation.h:73
AliDetector class for MUON subsystem which implements functions for simulation.
Definition: AliMUONv1.h:24
void SetCompressionLevel(Int_t cl)
static AliSimulation * Instance()
Definition: AliSimulation.h:38
Float_t EtaToTheta(Float_t arg)
Definition: ConfigHPT1.C:352
AliRun * gAlice
Definition: AliRun.cxx:62
void SetRun(Int_t run)
Base Class for EMCAL description.
Definition: AliEMCAL.h:35
void SetDefaultStorage(const char *dbString)
void Config()
Definition: ConfigHPT1.C:49
void SetNumberOfEventsPerFile(Int_t nevpf)
Definition: AliRunLoader.h:153
TCut cut
Definition: MakeGlobalFit.C:75
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
EMCal simulation manager class v2.
Definition: AliEMCALv2.h:30