]> git.uio.no Git - u/mrichter/AliRoot.git/blame - macros/Config_PDC06_MUON.C
Possibilty to load the geometry either from an external root file or from CDB (Raffaele)
[u/mrichter/AliRoot.git] / macros / Config_PDC06_MUON.C
CommitLineData
dfd0f589 1// Config file MUON + ITS (for vertex) for PDC06
2// Tuned for p+p min biais and quarkonia production (AliGenMUONCocktailpp)
3// Remember to define the directory and option
4// gAlice->SetConfigFunction("Config('$HOME','box');");
e1f732d4 5// april 3rd: added L3 magnet
dfd0f589 6
e1f732d4 7void Config(char directory[100]="", char option[6]="trg1mu")
dfd0f589 8{
9
10 static Int_t sseed = 0; // Set 0 to use the current time
11
12 //=====================================================================
13 // Libraries required by geant321
14 gSystem->Load("libgeant321.so");
15 new TGeant3TGeo("C++ Interface to Geant3");
16 //=======================================================================
17
458041af 18 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
19 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
20 AliCDBManager::Instance()->SetRun(0);
21 }
22
dfd0f589 23 // Set Random Number seed
24 gRandom->SetSeed(sseed);
25
26 // Create the output file
27 Text_t filename[100];
28 sprintf(filename,"%sgalice.root",directory);
29
30 AliRunLoader* rl=0x0;
31 rl = AliRunLoader::Open(
32 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
33 if (rl == 0x0) {
34 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
35 return;
36 }
37 rl->SetCompressionLevel(2);
e1f732d4 38 rl->SetNumberOfEventsPerFile(1000);
dfd0f589 39 gAlice->SetRunLoader(rl);
458041af 40 // gAlice->SetGeometryFromFile("geometry.root");
41 // gAlice->SetGeometryFromCDB();
dfd0f589 42
6521ae06 43 //=======================================================================
44 // Set the trigger configuration
45 gAlice->SetTriggerDescriptor("p-p");
46 cout<<"Trigger configuration is set to p-p"<<endl;
47
dfd0f589 48 //=======================================================================
49 // Set External decayer
50 TVirtualMCDecayer *decayer = new AliDecayerPythia();
51 decayer->SetForceDecay(kAll);
52 decayer->Init();
53 gMC->SetExternalDecayer(decayer);
54
55 //=======================================================================
56 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
57 gMC->SetProcess("DCAY",1);
58 gMC->SetProcess("PAIR",1);
59 gMC->SetProcess("COMP",1);
60 gMC->SetProcess("PHOT",1);
61 gMC->SetProcess("PFIS",0);
62 gMC->SetProcess("DRAY",0);
63 gMC->SetProcess("ANNI",1);
64 gMC->SetProcess("BREM",1);
65 gMC->SetProcess("MUNU",1);
66 gMC->SetProcess("CKOV",1);
67 gMC->SetProcess("HADR",1);
68 gMC->SetProcess("LOSS",2);
69 gMC->SetProcess("MULS",1);
70 gMC->SetProcess("RAYL",1);
71
72 Float_t cut = 1.e-3; // 1MeV cut by default
73 Float_t tofmax = 1.e10;
74
75 gMC->SetCut("CUTGAM", cut);
76 gMC->SetCut("CUTELE", cut);
77 gMC->SetCut("CUTNEU", cut);
78 gMC->SetCut("CUTHAD", cut);
79 gMC->SetCut("CUTMUO", cut);
80 gMC->SetCut("BCUTE", cut);
81 gMC->SetCut("BCUTM", cut);
82 gMC->SetCut("DCUTE", cut);
83 gMC->SetCut("DCUTM", cut);
84 gMC->SetCut("PPCUTM", cut);
85 gMC->SetCut("TOFMAX", tofmax);
86 //
87 //=======================================================================
88 // ************* STEERING parameters FOR ALICE SIMULATION **************
89 // Chamber positions
90 // From AliMUONConstants class we get :
91 // Position Z (along beam) of the chambers (in cm)
92 // (from AliMUONConstants class):
93 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
94 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
95 // Internal Radius (in cm)
96 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
97 // External Radius (in cm)
98 // 183., 245., 395., 560., 563., 850., 900.
99 //=======================================================================
100
101 if (!strcmp(option,"trg2mu")) {
102 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
103 gener->SetPtRange(0.,100.);
104 gener->SetYRange(-4.,-2.4);
e1f732d4 105 gener->SetPhiRange(0.,360.);
dfd0f589 106 gener->SetMuonMultiplicity(2);
e1f732d4 107 gener->SetMuonPtCut(0.5);
dfd0f589 108 gener->SetMuonThetaRange(171.,178.);
109 gener->SetOrigin(0.,0.,0.);
110 gener->SetSigma(0.,0.,5.);
111 gener->SetVertexSmear(kPerEvent);
112 gener->Init();
113 }
114
115 if (!strcmp(option,"trg1mu")) {
116 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
117 gener->SetPtRange(0.,100.);
118 gener->SetYRange(-4.,-2.4);
e1f732d4 119 gener->SetPhiRange(0.,360.);
dfd0f589 120 gener->SetMuonMultiplicity(1);
e1f732d4 121 gener->SetMuonPtCut(0.5);
dfd0f589 122 gener->SetMuonThetaRange(171.,178.);
123 gener->SetOrigin(0.,0.,0.);
124 gener->SetSigma(0.,0.,5.);
125 gener->SetVertexSmear(kPerEvent);
126 gener->Init();
127 }
128 //=============================================================
e1f732d4 129 // Field (L3 0.5 T) outside dimuon spectrometer
130 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
f3cba114 131 field->SetL3ConstField(0); // Using const. field in the barrel
dfd0f589 132 gAlice->SetField(field);
133
e1f732d4 134 Int_t iITS = 1;
135 Int_t iZDC = 1;
136 Int_t iFMD = 1;
137 Int_t iPHOS = 1;
138 Int_t iPMD = 1;
ababa197 139 Int_t iT0 = 1;
e1f732d4 140 Int_t iVZERO = 1;
141
dfd0f589 142 rl->CdGAFile();
143
144 //=================== Alice BODY parameters =============================
145 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
146 //=================== ABSO parameters ============================
96fb3353 147 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
dfd0f589 148 //=================== DIPO parameters ============================
96fb3353 149 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
dfd0f589 150 //================== HALL parameters ============================
96fb3353 151 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
dfd0f589 152 //================== The L3 Magnet ==============================
153 AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");
154 //=================== PIPE parameters ============================
96fb3353 155 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
dfd0f589 156 //=================== SHIL parameters ============================
96fb3353 157 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
dfd0f589 158 //=================== ITS parameters =============================
159 if(iITS) {
160 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
161 }
e1f732d4 162 //=================== ZDC parameters =============================
163 if(iZDC) {
164 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
165 }
166 //=================== FMD parameters =============================
167 if(iFMD) {
168 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
169 }
170 //=================== PHOS parameters =============================
171 if(iPHOS) {
172 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
173 }
174 //=================== PMD parameters =============================
175 if(iPMD) {
176 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
177 }
ababa197 178 //=================== T0 parameters =============================
179 if (iT0) {
180 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
e1f732d4 181 }
182 //=================== VZERO parameters =============================
183 if (iVZERO) {
184 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
185 }
dfd0f589 186
187 //=================== MUON Subsystem ===========================
188 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
189
190 // With the following compactor, what you get (in case you wonder...) is :
191 //
192 // - "FactoryV4", that is all stations using new segmentations/mapping
193 // - "sdigitizer:AliMUONSDigitizerV2", performing decalibration
194 // - "digitizer:NewDigitizerOldTrigger" <=> digitizer=AliMUONDigitizerV3,
195 // using the "old" trigger code, performing calibration
196 //
197 AliMUON *MUON = new AliMUONv1("MUON");
198}
199
200Float_t EtaToTheta(Float_t arg){
201 return (180./TMath::Pi())*2.*atan(exp(-arg));
202}