]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/testITSU/Config.C
Removed obsolete scripts
[u/mrichter/AliRoot.git] / ITS / UPGRADE / testITSU / Config.C
1 /// One can use the configuration macro in compiled mode by
2 // root [0] gSystem->Load("libgeant321");
3 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
4 //                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
5 // root [0] .x grun.C(1,"Config.C++"
6
7 #if !defined(__CINT__) || defined(__MAKECINT__)
8 #include <Riostream.h>
9 #include <TPDGCode.h>
10 #include <TRandom.h>
11 #include <TSystem.h>
12 #include <TVirtualMC.h>
13 #include <TGeant3TGeo.h>
14 #include "STEER/AliRunLoader.h"
15 #include "STEER/AliRun.h"
16 #include "STEER/AliConfig.h"
17 #include "PYTHIA6/AliDecayerPythia.h"
18 #include "EVGEN/AliGenCocktail.h"
19 #include "EVGEN/AliGenHIJINGpara.h"
20 #include "EVGEN/AliGenFixed.h"
21 #include "EVGEN/AliGenBox.h"
22 #include "STEER/AliMagWrapCheb.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 "STRUCT/AliPIPEupgrade.h"
32 #include "ITS/AliITSv11.h"
33 #include "ITS/UPGRADE/AliITSUv11.h"
34 #include "TPC/AliTPCv2.h"
35 #include "TOF/AliTOFv6T0.h"
36 #include "HMPID/AliHMPIDv3.h"
37 #include "ZDC/AliZDCv3.h"
38 #include "TRD/AliTRDv1.h"
39 #include "TRD/AliTRDgeometry.h"
40 #include "FMD/AliFMDv1.h"
41 #include "MUON/AliMUONv1.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PMD/AliPMDv1.h"
44 #include "T0/AliT0v1.h"
45 #include "EMCAL/AliEMCALv2.h"
46 #include "ACORDE/AliACORDEv1.h"
47 #include "VZERO/AliVZEROv7.h"
48 #include <TVirtualMagField.h>
49 #endif
50
51 Int_t generatorFlag = 0;
52
53 /* $Id: Config.C 47147 2011-02-07 11:46:44Z amastros $ */
54 enum PprTrigConf_t
55 {
56   kDefaultPPTrig, kDefaultPbPbTrig
57 };
58
59 const char * pprTrigConfName[] = {
60   "p-p","Pb-Pb"
61 };
62
63 Float_t EtaToTheta(Float_t arg);
64
65 static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration
66
67 void Config()
68 {
69   // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
70   // Theta range given through pseudorapidity limits 22/6/2001
71
72   // Set Random Number seed
73   gRandom->SetSeed(0); // Set 0 to use the currecnt time
74
75
76   // libraries required by geant321
77 #if defined(__CINT__)
78   gSystem->Load("liblhapdf");
79   gSystem->Load("libEGPythia6");
80   gSystem->Load("libpythia6");
81   gSystem->Load("libAliPythia6");
82   gSystem->Load("libgeant321");
83   gSystem->Load("libhijing");   
84   gSystem->Load("libTHijing");
85 #endif
86   gSystem->Load("libITSUpgradeBase.so");
87   gSystem->Load("libITSUpgradeSim.so");
88
89
90   new     TGeant3TGeo("C++ Interface to Geant3");
91
92   AliRunLoader* rl=0x0;
93
94
95   rl = AliRunLoader::Open("galice.root",
96                           AliConfig::GetDefaultEventFolderName(),
97                           "recreate");
98   if (rl == 0x0)
99     {
100       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
101       return;
102     }
103   rl->SetCompressionLevel(2);
104   rl->SetNumberOfEventsPerFile(2000);
105   gAlice->SetRunLoader(rl);
106
107   // Set the trigger configuration
108   // gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
109   //cout<<"Trigger configuration is set to  "<<pprTrigConfName[strig]<<endl;
110   AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
111   cout<<"Trigger configuration is set to  pprTrigConfName[strig] "<<endl;
112
113   //
114   // Set External decayer
115   TVirtualMCDecayer *decayer = new AliDecayerPythia();
116
117   decayer->SetForceDecay(kAll);
118   decayer->Init();
119   gMC->SetExternalDecayer(decayer);
120   //=======================================================================
121   // ************* STEERING parameters FOR ALICE SIMULATION **************
122   // --- Specify event type to be tracked through the ALICE setup
123   // --- All positions are in cm, angles in degrees, and P and E in GeV
124
125
126   gMC->SetProcess("DCAY",1);
127   gMC->SetProcess("PAIR",1);
128   gMC->SetProcess("COMP",1);
129   gMC->SetProcess("PHOT",1);
130   gMC->SetProcess("PFIS",0);
131   gMC->SetProcess("DRAY",0);
132   gMC->SetProcess("ANNI",1);
133   gMC->SetProcess("BREM",1);
134   gMC->SetProcess("MUNU",1);
135   gMC->SetProcess("CKOV",1);
136   gMC->SetProcess("HADR",0);
137   gMC->SetProcess("LOSS",2);
138   gMC->SetProcess("MULS",1);
139   gMC->SetProcess("RAYL",1);
140
141   Float_t cut = 1.e-3;        // 1MeV cut by default
142   Float_t tofmax = 1.e10;
143
144   gMC->SetCut("CUTGAM", cut);
145   gMC->SetCut("CUTELE", cut);
146   gMC->SetCut("CUTNEU", cut);
147   gMC->SetCut("CUTHAD", cut);
148   gMC->SetCut("CUTMUO", cut);
149   gMC->SetCut("BCUTE",  cut); 
150   gMC->SetCut("BCUTM",  cut); 
151   gMC->SetCut("DCUTE",  cut); 
152   gMC->SetCut("DCUTM",  cut); 
153   gMC->SetCut("PPCUTM", cut);
154   gMC->SetCut("TOFMAX", tofmax); 
155
156   // Special generation for Valgrind tests
157   // Each detector is fired by few particles selected 
158   // to cover specific cases
159
160
161   // The cocktail itself
162   
163   if (generatorFlag==0) {
164     // Fast generator with parametrized pi,kaon,proton distributions
165     
166     int     nParticles = 30;//14022;
167     AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
168     gener->SetMomentumRange(0.1, 10.);
169     gener->SetPhiRange(0., 360.);
170     Float_t thmin = EtaToTheta(2.5);   // theta min. <---> eta max
171     Float_t thmax = EtaToTheta(-2.5);  // theta max. <---> eta min
172     gener->SetThetaRange(thmin,thmax);
173     gener->SetOrigin(0, 0, 0);  //vertex position
174     gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
175     gener->Init();
176     
177   } else if (generatorFlag==1) {
178     
179     // Pure HiJing generator adapted to ~2000dNdy at highest energy
180     
181     AliGenHijing *generHijing = new AliGenHijing(-1);
182     generHijing->SetEnergyCMS(5500.); // GeV
183     generHijing->SetImpactParameterRange(0,2);
184     generHijing->SetReferenceFrame("CMS");
185     generHijing->SetProjectile("A", 208, 82);
186     generHijing->SetTarget    ("A", 208, 82);
187     generHijing->KeepFullEvent();
188     generHijing->SetJetQuenching(1);
189     generHijing->SetShadowing(1);
190     generHijing->SetSpectators(0);
191     generHijing->SetSelectAll(0);
192     generHijing->SetPtHardMin(4.5);
193     
194     AliGenerator*  gener = generHijing;
195     gener->SetSigma(0, 0, 6);      // Sigma in (X,Y,Z) (cm) on IP position
196     gener->SetVertexSmear(kPerEvent);
197     gener->Init();
198       
199   }
200
201   // 
202   // Activate this line if you want the vertex smearing to happen
203   // track by track
204   //
205   //VertexSmear_t perTrack;
206   //gener->SetVertexSmear(perTrack); 
207   // Field (L3 0.5 T)
208   //AliMagF* field = new AliMagF("map","map",2, -1.,1., 15, AliMagF::k5kGUniform);
209   //TGeoGlobalMagField::Instance()->SetField(field);
210   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
211
212   Int_t   iABSO  =  0;
213   Int_t   iDIPO  =  0;
214   Int_t   iFMD   =  0;
215   Int_t   iFRAME =  0;
216   Int_t   iHALL  =  0;
217   Int_t   iITS   =  1;
218   Int_t   iMAG   =  0;
219   Int_t   iMUON  =  0;
220   Int_t   iPHOS  =  0;
221   Int_t   iPIPE  =  1;
222   Int_t   iPMD   =  0;
223   Int_t   iHMPID =  0;
224   Int_t   iSHIL  =  0;
225   Int_t   iT0    =  0;
226   Int_t   iTOF   =  0;
227   Int_t   iTPC   =  0;
228   Int_t   iTRD   =  0;
229   Int_t   iZDC   =  0;
230   Int_t   iEMCAL =  0;
231   Int_t   iACORDE=  0;
232   Int_t   iVZERO =  0;
233   rl->CdGAFile();
234   //=================== Alice BODY parameters =============================
235   AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
236
237   if (iMAG)
238     {
239       //=================== MAG parameters ============================
240       // --- Start with Magnet since detector layouts may be depending ---
241       // --- on the selected Magnet dimensions ---
242       AliMAG *MAG = new AliMAG("MAG", "Magnet");
243     }
244
245
246   if (iABSO)
247     {
248       //=================== ABSO parameters ============================
249       AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
250     }
251
252   if (iDIPO)
253     {
254       //=================== DIPO parameters ============================
255
256       AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
257     }
258
259   if (iHALL)
260     {
261       //=================== HALL parameters ============================
262
263       AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
264     }
265
266
267   if (iFRAME)
268     {
269       //=================== FRAME parameters ============================
270
271       AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
272       FRAME->SetHoles(1);
273     }
274
275   if (iSHIL)
276     {
277       //=================== SHIL parameters ============================
278
279       AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
280     }
281
282
283   if (iPIPE)
284     {
285       //=================== PIPE parameters ============================
286
287       AliPIPE *PIPE = new AliPIPEupgrade("PIPE", "Beam Pipe",0,1.8,0.08,40.0);
288       //AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
289     }
290  
291   if (iITS)
292     {
293       //=================== ITS parameters ============================
294       //
295       // create segmentations:
296       AliITSUSegmentationPix* seg0 = new AliITSUSegmentationPix(0,    // segID (0:9)
297                                                                 5,    // chips per module
298                                                                 1500, // ncols (total for module)
299                                                                 750,  //835,  // nrows
300                                                                 20.e-4,  // default row pitch in cm
301                                                                 20.e-4,  // default col pitch in cm
302                                                                 300.e-4  // sensor thickness in cm
303                                                                 );    // see AliITSUSegmentationPix.h for extra options
304       seg0->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
305       AliITSUSegmentationPix* seg1 = new AliITSUSegmentationPix(1,    // segID (0:9)
306                                                                 5*2,    // chips per module
307                                                                 1500, // ncols (total for module)
308                                                                 750*2,//835,  // nrows
309                                                                 20.e-4,  // default row pitch in cm
310                                                                 20.e-4,  // default col pitch in cm
311                                                                 300.e-4  // sensor thickness in cm
312                                                                 );    // see AliITSUSegmentationPix.h for extra options
313       seg1->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
314       AliITSUSegmentationPix* seg2 = new AliITSUSegmentationPix(2,    // segID (0:9)
315                                                                 5*2,    // chips per module
316                                                                 1500, // ncols (total for module)
317                                                                 750*2,//835,  // nrows
318                                                                 20.e-4,  // default row pitch in cm
319                                                                 20.e-4,  // default col pitch in cm
320                                                                 300.e-4   // sensor thickness in cm
321                                                                 );    // see AliITSUSegmentationPix.h for extra options
322       seg2->Store(AliITSUGeomTGeo::GetITSsegmentationFileName());
323       //
324       int nmod,nlad; // modules per ladded, n ladders
325       // sum of insensitive boarder around module (in cm)
326       Float_t deadX = 0.1;  // on each side
327       Float_t deadZ = 0.01; // on each side
328       double tilt = 10.;     double thickLr = 0.05;
329       //      virtual void   DefineLayerTurbo(const Int_t nlay, const Double_t r,  const Double_t zlen, const Int_t nladd,   const Int_t nmod, const Double_t width,
330       //                                  const Double_t tilt,   const Double_t lthick = 0.,    const Double_t dthick = 0.,   const UInt_t detType=0);
331       AliITSUv11 *ITS  = new AliITSUv11("ITS Upgrade",7);
332       nmod = 9;
333       nlad = 12;
334       ITS->DefineLayerTurbo(0, 2.2,  nmod*(seg0->Dz()+deadZ*2), nlad, nmod, seg0->Dx()+deadX*2, tilt, thickLr, seg0->Dy(), seg0->GetDetTypeID());
335       nmod = 9;
336       nlad = 16;
337       ITS->DefineLayerTurbo(1, 2.8,  nmod*(seg0->Dz()+deadZ*2), nlad, nmod, seg0->Dx()+deadX*2, tilt, thickLr, seg0->Dy(), seg0->GetDetTypeID());
338       nmod = 9;
339       nlad = 20;
340       ITS->DefineLayerTurbo(2, 3.6,  nmod*(seg0->Dz()+deadZ*2), nlad, nmod, seg0->Dx()+deadX*2, tilt, thickLr, seg0->Dy(), seg0->GetDetTypeID());
341       nmod = 29;
342       nlad = 48;
343       ITS->DefineLayerTurbo(3, 20.0, nmod*(seg1->Dz()+deadZ*2), nlad, nmod, seg1->Dx()+deadX*2, tilt, thickLr, seg1->Dy(), seg1->GetDetTypeID());
344       nmod = 29;
345       nlad = 48;
346       ITS->DefineLayerTurbo(4, 22.0, nmod*(seg1->Dz()+deadZ*2), nlad, nmod, seg1->Dx()+deadX*2, tilt, thickLr, seg1->Dy(), seg1->GetDetTypeID());
347       nmod = 50;
348       nlad = 94;
349       ITS->DefineLayerTurbo(5, 40.0, nmod*(seg2->Dz()+deadZ*2), nlad, nmod, seg2->Dx()+deadX*2, tilt, thickLr, seg2->Dy(), seg2->GetDetTypeID()); //41 creates ovl!
350       nmod = 50;
351       nlad = 94;
352       ITS->DefineLayerTurbo(6, 43.0, nmod*(seg2->Dz()+deadZ*2), nlad, nmod, seg2->Dx()+deadX*2, tilt, thickLr, seg2->Dy(), seg2->GetDetTypeID()); 
353       //
354
355     }
356  
357
358   if (iTPC)
359     {
360       //============================ TPC parameters ===================
361       AliTPC *TPC = new AliTPCv2("TPC", "Default");
362     }
363
364
365   if (iTOF) {
366     //=================== TOF parameters ============================
367     AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
368   }
369
370
371   if (iHMPID)
372     {
373       //=================== HMPID parameters ===========================
374       AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
375
376     }
377
378
379   if (iZDC)
380     {
381       //=================== ZDC parameters ============================
382
383       AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
384     }
385
386   if (iTRD)
387     {
388       //=================== TRD parameters ============================
389
390       AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
391       AliTRDgeometry *geoTRD = TRD->GetGeometry();
392       // Partial geometry: modules at 2,3,4,6,11,12,14,15
393       // starting at 6h in positive direction
394       geoTRD->SetSMstatus(0,0);
395       geoTRD->SetSMstatus(1,0);
396       geoTRD->SetSMstatus(5,0);
397       geoTRD->SetSMstatus(7,0);
398       geoTRD->SetSMstatus(8,0);
399       geoTRD->SetSMstatus(9,0);
400       geoTRD->SetSMstatus(10,0);
401       geoTRD->SetSMstatus(13,0);
402       geoTRD->SetSMstatus(16,0);
403       geoTRD->SetSMstatus(17,0);
404     }
405
406   if (iFMD)
407     {
408       //=================== FMD parameters ============================
409       AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
410     }
411
412   if (iMUON)
413     {
414       //=================== MUON parameters ===========================
415       // New MUONv1 version (geometry defined via builders)
416       AliMUON *MUON = new AliMUONv1("MUON","default");
417     }
418   //=================== PHOS parameters ===========================
419
420   if (iPHOS)
421     {
422       AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
423     }
424
425
426   if (iPMD)
427     {
428       //=================== PMD parameters ============================
429       AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
430     }
431
432   if (iT0)
433     {
434       //=================== T0 parameters ============================
435       AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
436     }
437
438   if (iEMCAL)
439     {
440       //=================== EMCAL parameters ============================
441       AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
442     }
443
444   if (iACORDE)
445     {
446       //=================== ACORDE parameters ============================
447       AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
448     }
449
450   if (iVZERO)
451     {
452       //=================== VZERO parameters ============================
453       AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
454     }
455
456
457 }
458
459 Float_t EtaToTheta(Float_t arg){
460   return (180./TMath::Pi())*2.*atan(exp(-arg));
461 }