9e23b054 |
1 | const static Int_t iRICH = 0;//0-1-3 |
2 | const static Bool_t IsRichUp=kTRUE; |
3 | const static Int_t kEventsPerFile=50; |
4c1f23a0 |
4 | |
9e23b054 |
5 | enum EGenTypes {kGun0,kGun1,kGun7,kPP7}; |
6 | const static EGenTypes kGen=kGun0; |
4c1f23a0 |
7 | |
8 | Int_t iPIPE = 0;//central before RICH |
9 | Int_t iITS = 0; |
10 | Int_t iTPC = 0; |
11 | Int_t iTRD = 0; |
12 | Int_t iTOF = 0; |
13 | Int_t iFRAME = 0; |
14 | |
15 | Int_t iMAG = 0;//central after RICH |
16 | Int_t iCRT = 0; |
17 | Int_t iHALL = 0; |
18 | |
19 | Int_t iPHOS = 0; |
20 | |
21 | Int_t iSTART = 0;//forward |
22 | Int_t iFMD = 0; |
23 | Int_t iSHIL = 0; |
24 | Int_t iABSO = 1; |
25 | Int_t iPMD = 0; |
26 | Int_t iDIPO = 0; |
27 | Int_t iEMCAL = 0; |
28 | Int_t iVZERO = 0; |
29 | Int_t iMUON = 0; |
30 | Int_t iZDC = 0; |
31 | |
32 | AliRICH *gRICH; |
33 | |
34 | void Config() |
35 | { |
36 | ::Info("kir","Start RICH VERSION %i debug %i",iRICH,gAlice->GetDebug()); |
37 | |
38 | int n,pid,chamber; |
39 | double p; |
40 | Geant3(); File(); Decayer(); Field(); Other(); |
9e23b054 |
41 | |
42 | |
43 | if(IsRichUp) AliRICHParam::AngleRot(0); |
4c1f23a0 |
44 | AliRICH *pRICH; |
45 | switch(iRICH){ |
46 | case 0: |
47 | gRICH=new AliRICHv0("RICH","coarse RICH for material budget"); |
48 | break; |
49 | case 1: |
50 | gRICH=new AliRICHv1("RICH","detailed RICH for full simulation"); |
51 | break; |
52 | case 3: |
53 | gRICH=new AliRICHv3("RICH","old parametrised RICH with rotation"); |
54 | break; |
55 | } |
4c1f23a0 |
56 | switch(kGen){ |
57 | case kPP7: Pythia7(pid=kPiPlus,p=4); break; |
58 | case kGun7: Gun7(pid=kPiPlus,p=4); break; |
59 | case kGun1: Gun1(n=1,pid=kPiPlus,p=4,chamber=4); break; |
9e23b054 |
60 | case kGun0: Gun1(n=1,pid=kNeutron,p=4,chamber=4); break; |
4c1f23a0 |
61 | default: Fatal("Config","No generator"); break; |
62 | } |
63 | ::Info("kir","Stop."); |
64 | }//void Config() |
65 | |
66 | void Gun1(Int_t iNprim,Int_t iPID,Double_t p,Int_t iChamber) |
67 | { |
9e23b054 |
68 | Double_t theta=gRICH->C(iChamber)->ThetaD(); |
69 | Double_t phi =gRICH->C(iChamber)->PhiD(); |
70 | theta-=2; |
71 | ::Info("kir-Gun1","%i primarie(s) of %i PID with p=%f GeV at (%f,%f)",iNprim,iPID,p,theta,phi); |
4c1f23a0 |
72 | |
73 | AliGenFixed *pGen=new AliGenFixed(iNprim); |
74 | pGen->SetMomentum(p); |
9e23b054 |
75 | pGen->SetPhiRange(phi); |
76 | pGen->SetThetaRange(theta); |
4c1f23a0 |
77 | pGen->SetOrigin(0,0,0); |
78 | pGen->SetPart(iPID); |
79 | pGen->Init(); |
80 | }//Gun() |
81 | |
82 | void Para() |
83 | { |
84 | Int_t iNprim=85700; |
85 | ::Info("kir-Para","%i primaries",iNprim); |
86 | |
87 | AliGenHIJINGpara *pGen=new AliGenHIJINGpara(iNprim); |
88 | pGen->SetMomentumRange(0,999); //GeV |
89 | pGen->SetPhiRange(0,360); //degree |
90 | pGen->SetThetaRange(Eta2Theta(8),Eta2Theta(-8)); //degree |
91 | pGen->SetOrigin(0,0,0); //IP, cm |
92 | pGen->SetSigma(0,0,0); //IP sigma, cm |
93 | pGen->Init(); |
94 | } |
95 | |
96 | |
97 | void Gun7(Int_t iPID,Double_t p) |
98 | { |
99 | ::Info("kir-Gun7","7 primaries of %i PID with p=%f GeV",iPID,p); |
100 | AliGenCocktail *pCocktail=new AliGenCocktail(); |
101 | for(int i=1;i<=7;i++){ |
102 | AliGenFixed *pFixed=new AliGenFixed(1); |
103 | pFixed->SetMomentum(p); |
104 | pFixed->SetPhiRange(gRICH->C(i)->PhiD()); |
105 | pFixed->SetThetaRange(gRICH->C(i)->ThetaD()+2); |
106 | pFixed->SetOrigin(0,0,0); |
107 | pFixed->SetPart(iPID); |
108 | pCocktail->AddGenerator(pFixed,Form("Fixed %i",i),1); |
109 | } |
110 | pCocktail->Init(); |
111 | } |
112 | |
113 | void Pythia7(Int_t iPID,Double_t p) |
114 | { |
115 | ::Info("kir-Pythia","7 primaries of %i PID with p=%f GeV plus Pythia",iPID,p); |
116 | AliGenCocktail *pCocktail=new AliGenCocktail(); |
117 | for(int i=1;i<=7;i++){ |
118 | AliGenFixed *pFixed=new AliGenFixed(1); |
119 | pFixed->SetMomentum(p); |
120 | pFixed->SetPhiRange(gRICH->C(i)->PhiD()); |
121 | pFixed->SetThetaRange(gRICH->C(i)->ThetaD()+2); |
122 | pFixed->SetOrigin(0,0,0); |
123 | pFixed->SetPart(iPID); |
124 | pCocktail->AddGenerator(pFixed,Form("Fixed %i",i),1); |
125 | } |
126 | |
127 | AliGenPythia *pPythia = new AliGenPythia(-1); |
128 | pPythia->SetMomentumRange(0,999999); |
129 | pPythia->SetPhiRange(0,360); |
130 | pPythia->SetThetaRange(0., 180.); |
131 | pPythia->SetYRange(-12,12); |
132 | pPythia->SetPtRange(0,1000); |
133 | pPythia->SetStrucFunc(kCTEQ4L); |
134 | pPythia->SetProcess(kPyMb); |
135 | pPythia->SetEnergyCMS(14000.); |
136 | |
137 | pCocktail->AddGenerator(pPythia,"Pythia",1); |
138 | pCocktail->Init(); |
139 | } |
140 | |
141 | |
142 | |
143 | void Scan() |
144 | { |
145 | } |
146 | |
147 | |
148 | void File() |
149 | { |
150 | ::Info("kir-File","Create galice.root, %i events per file",kEventsPerFile); |
151 | |
152 | AliRunLoader *pRL = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"recreate"); |
153 | if(!pRL) |
154 | Fatal("my/AliceConfig.C::File","Can not instatiate the Run Loader"); |
155 | |
156 | pRL->SetCompressionLevel(2); |
157 | pRL->SetNumberOfEventsPerFile(kEventsPerFile); |
158 | gAlice->SetRunLoader(pRL); |
159 | } |
160 | |
161 | void Geant3() |
162 | { |
163 | ::Info("kir-Geant3","Initialize the actual MC code."); |
164 | |
165 | gSystem->Load("libgeant321.so"); |
166 | new TGeant3("C++ Interface to Geant"); |
167 | }//void Geant3() |
168 | |
169 | void Decayer() |
170 | { |
171 | ::Info("kir-Decayer","Initialise external decayer."); |
172 | TVirtualMCDecayer *pDecayer = new AliDecayerPythia(); |
173 | pDecayer->SetForceDecay(kAll); |
174 | pDecayer->Init(); |
175 | gMC->SetExternalDecayer(pDecayer); |
176 | |
177 | gMC->SetProcess("DCAY",1); |
178 | gMC->SetProcess("PAIR",1); |
179 | gMC->SetProcess("COMP",1); |
180 | gMC->SetProcess("PHOT",1); |
181 | gMC->SetProcess("PFIS",0); |
182 | gMC->SetProcess("DRAY",0); |
183 | gMC->SetProcess("ANNI",1); |
184 | gMC->SetProcess("BREM",1); |
185 | gMC->SetProcess("MUNU",1); |
186 | gMC->SetProcess("CKOV",1); |
187 | gMC->SetProcess("HADR",1); |
188 | gMC->SetProcess("LOSS",2); |
189 | gMC->SetProcess("MULS",1); |
190 | gMC->SetProcess("RAYL",1); |
191 | |
192 | Float_t cut = 1.e-3; // 1MeV cut by default |
193 | Float_t tofmax = 1.e10; |
194 | |
195 | gMC->SetCut("CUTGAM", cut); |
196 | gMC->SetCut("CUTELE", cut); |
197 | gMC->SetCut("CUTNEU", cut); |
198 | gMC->SetCut("CUTHAD", cut); |
199 | gMC->SetCut("CUTMUO", cut); |
200 | gMC->SetCut("BCUTE", cut); |
201 | gMC->SetCut("BCUTM", cut); |
202 | gMC->SetCut("DCUTE", cut); |
203 | gMC->SetCut("DCUTM", cut); |
204 | gMC->SetCut("PPCUTM", cut); |
205 | gMC->SetCut("TOFMAX", tofmax); |
206 | } |
207 | |
208 | void Field() |
209 | { |
210 | ::Info("kir-Field","Set default magnetic field L3 0.4T."); |
211 | //AliMagFMaps* pField = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1); |
212 | gAlice->SetField(); |
213 | } |
214 | |
215 | void Other() |
216 | { |
217 | ::Info("kir-Other","Init all other detectors"); |
218 | AliBODY *BODY = new AliBODY("BODY", "Alice envelop"); |
219 | |
220 | if(iMAG){ |
221 | new AliMAG("MAG", "Magnet"); |
222 | } |
223 | |
224 | if(iABSO){ |
225 | new AliABSOv0("ABSO", "Muon Absorber"); |
226 | } |
227 | |
228 | if(iDIPO){ |
229 | new AliDIPOv2("DIPO", "Dipole version 2"); |
230 | } |
231 | |
232 | if(iHALL){ |
233 | new AliHALL("HALL", "Alice Hall"); |
234 | } |
235 | |
236 | if(iFRAME){ |
237 | AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame"); |
238 | FRAME->SetHoles(1); |
239 | } |
240 | |
241 | if(iSHIL){ |
242 | new AliSHILv2("SHIL", "Shielding Version 2"); |
243 | } |
244 | |
245 | if(iPIPE){ |
246 | AliPIPEv0("PIPE", "Beam Pipe"); |
247 | } |
248 | |
249 | if(iITS){ |
250 | AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services"); |
251 | ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
252 | ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
253 | ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300] |
254 | ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300] |
255 | ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300] |
256 | ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300] |
257 | ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out |
258 | ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
259 | ITS->SetEUCLID(0); |
260 | } |
261 | |
262 | if(iTPC){ |
263 | AliTPC *TPC = new AliTPCv2("TPC", "Default"); |
264 | TPC->SetSecAU(-1); |
265 | TPC->SetSecAL(-1); |
266 | } |
267 | |
268 | if(iTOF){ |
269 | new AliTOFv2FHoles("TOF", "TOF with Holes"); |
270 | } |
271 | |
272 | if(iZDC){ |
273 | new AliZDCv2("ZDC", "normal ZDC"); |
274 | } |
275 | |
276 | if(iTRD){ |
277 | AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator"); |
278 | TRD->SetGasMix(1); |
279 | TRD->SetPHOShole(); |
280 | TRD->SetRICHhole(); |
281 | AliTRDsim *TRDsim = TRD->CreateTR(); |
282 | } |
283 | |
284 | if(iFMD){ |
285 | AliFMD *FMD = new AliFMDv1("FMD", "normal FMD"); |
286 | FMD->SetRingsSi1(256); |
287 | FMD->SetRingsSi2(128); |
288 | FMD->SetSectorsSi1(20); |
289 | FMD->SetSectorsSi2(40); |
290 | } |
291 | |
292 | if(iMUON){ |
293 | new AliMUONv1("MUON", "default"); |
294 | } |
295 | if(iPHOS){ |
296 | new AliPHOSv1("PHOS", "IHEP"); |
297 | } |
298 | |
299 | if(iPMD){ |
300 | new AliPMDv1("PMD", "normal PMD"); |
301 | } |
302 | |
303 | if(iSTART){ |
304 | new AliSTARTv1("START", "START Detector"); |
305 | } |
306 | |
307 | if(iEMCAL){ |
308 | new AliEMCALv1("EMCAL", "EMCALArch1a"); |
309 | } |
310 | |
311 | if(iCRT){ |
312 | new AliCRTv0("CRT", "normal ACORDE"); |
313 | } |
314 | |
315 | if(iVZERO){ |
316 | new AliVZEROv2("VZERO", "normal VZERO"); |
317 | } |
318 | |
319 | ::Info("kir-Other","Stop."); |
320 | }//Other() |
321 | |
322 | Float_t Eta2Theta(Float_t arg) |
323 | { |
324 | return (180./TMath::Pi())*2.*atan(exp(-arg)); |
325 | } |
326 | |