1 /////////////////////////////////////////////////////////
2 // Manager and hits classes for set:MUON version 0 //
3 /////////////////////////////////////////////////////////
13 #include "AliCallf77.h"
18 extern "C" void type_of_call trig(float (*)[4], float (*)[4], int& iflag);
22 //___________________________________________
23 AliMUONv0::AliMUONv0() : AliMUON()
28 //___________________________________________
29 AliMUONv0::AliMUONv0(const char *name, const char *title)
33 // z-Positions of Chambers
34 const Float_t zch[7]={511., 686., 971., 1245., 1445., 1610, 1710.};
37 const Float_t dmi[7]={ 35., 47., 67., 86., 100., 96., 101.96};
40 const Float_t dma[7]={183., 245., 346., 442., 513., 824., 874.};
44 fChambers = new TObjArray(14);
46 for (Int_t i=0; i<7; i++) {
47 for (Int_t j=0; j< 2; j++) {
50 // Default Parameters for Muon Tracking Stations
53 (*fChambers)[k] = new AliMUONchamber();
54 AliMUONchamber* chamber = (AliMUONchamber*) (*fChambers)[k];
56 chamber->SetZPOS(zch[i]);
58 chamber->InitGeo(zch[i]);
59 chamber->frMin=dmi[i]/2.;
60 chamber->frMax=dma[i]/2.;
70 //___________________________________________
71 void AliMUONv0::Trigger(Float_t (*x)[4], Float_t (*y)[4], Int_t& iflag)
76 //___________________________________________
77 void AliMUONv0::CreateGeometry()
79 Int_t *idtmed = fIdtmed->GetArray()-1099;
81 // Note: all chambers have the same structure, which could be
82 // easily parameterised. This was intentionally not done in order
83 // to give a starting point for the implementation of the actual
84 // design of each station.
86 // Distance between Stations
87 const Float_t dstation = 8.;
91 Float_t tspar[5], pgpar[10];
92 Float_t zpos1, zpos2, zfpos;
97 // Rotation matrices in the x-y plane
100 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
102 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
104 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
106 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
108 Float_t phi=2*TMath::Pi()/12/2;
111 // pointer to the current chamber
112 AliMUONchamber *iChamber;
113 //********************************************************************
115 //********************************************************************
117 iChamber=(AliMUONchamber*) (*fChambers)[0];
118 zpos1=iChamber->ZPosition()-dstation/2;
119 zpos2=zpos1+dstation;
120 zfpos=-(iChamber->fdGas+dframez)/2;
124 tpar[0] = iChamber->frMin-dframep;
125 tpar[1] = (iChamber->frMax+dframep)/TMath::Cos(phi);
126 tpar[2] = dstation/2;
128 gMC->Gsvolu("C01M", "TUBE", idtmed[1100], tpar, 3);
129 gMC->Gsvolu("C02M", "TUBE", idtmed[1100], tpar, 3);
130 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
131 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
138 pgpar[4] = -dframez/2;
139 pgpar[5] = iChamber->frMax;
140 pgpar[6] = pgpar[5]+dframep;
141 pgpar[7] = +dframez/2;
144 gMC->Gsvolu("C01O", "PGON", idtmed[1103], pgpar, 10);
145 gMC->Gsvolu("C02O", "PGON", idtmed[1103], pgpar, 10);
146 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
147 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
148 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
149 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
152 tpar[0]= iChamber->frMin-dframep;
153 tpar[1]= iChamber->frMin;
155 gMC->Gsvolu("C01I", "TUBE", idtmed[1103], tpar, 3);
156 gMC->Gsvolu("C02I", "TUBE", idtmed[1103], tpar, 3);
158 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
159 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
160 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
161 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
164 bpar[0] = (iChamber->frMax - iChamber->frMin)/2;
167 gMC->Gsvolu("C01B", "BOX", idtmed[1103], bpar, 3);
168 gMC->Gsvolu("C02B", "BOX", idtmed[1103], bpar, 3);
170 gMC->Gspos("C01B",1,"C01M", +iChamber->frMin+bpar[0] , 0,-zfpos,
171 idrotm[1100],"ONLY");
172 gMC->Gspos("C01B",2,"C01M", -iChamber->frMin-bpar[0] , 0,-zfpos,
173 idrotm[1100],"ONLY");
174 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
175 idrotm[1101],"ONLY");
176 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
177 idrotm[1101],"ONLY");
178 gMC->Gspos("C01B",5,"C01M", +iChamber->frMin+bpar[0] , 0,+zfpos,
179 idrotm[1100],"ONLY");
180 gMC->Gspos("C01B",6,"C01M", -iChamber->frMin-bpar[0] , 0,+zfpos,
181 idrotm[1100],"ONLY");
182 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
183 idrotm[1101],"ONLY");
184 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
185 idrotm[1101],"ONLY");
187 gMC->Gspos("C02B",1,"C02M", +iChamber->frMin+bpar[0] , 0,-zfpos,
188 idrotm[1100],"ONLY");
189 gMC->Gspos("C02B",2,"C02M", -iChamber->frMin-bpar[0] , 0,-zfpos,
190 idrotm[1100],"ONLY");
191 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
192 idrotm[1101],"ONLY");
193 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
194 idrotm[1101],"ONLY");
195 gMC->Gspos("C02B",5,"C02M", +iChamber->frMin+bpar[0] , 0,+zfpos,
196 idrotm[1100],"ONLY");
197 gMC->Gspos("C02B",6,"C02M", -iChamber->frMin-bpar[0] , 0,+zfpos,
198 idrotm[1100],"ONLY");
199 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
200 idrotm[1101],"ONLY");
201 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
202 idrotm[1101],"ONLY");
205 // Chamber Material represented by Alu sheet
206 tpar[0]= iChamber->frMin+dframep*2;
207 tpar[1]= iChamber->frMax-dframep*2;
208 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
209 gMC->Gsvolu("C01A", "TUBE", idtmed[1103], tpar, 3);
210 gMC->Gsvolu("C02A", "TUBE", idtmed[1103], tpar, 3);
211 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
212 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
215 // tpar[2] = iChamber->fdGas;
216 tpar[2] = iChamber->fdGas/2;
217 gMC->Gsvolu("C01G", "TUBE", idtmed[1105], tpar, 3);
218 gMC->Gsvolu("C02G", "TUBE", idtmed[1105], tpar, 3);
219 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
220 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
222 // Frame Crosses to be placed inside gas
223 dr = (iChamber->frMax - iChamber->frMin);
224 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
226 bpar[2] = iChamber->fdGas/2;
227 gMC->Gsvolu("C01F", "BOX", idtmed[1103], bpar, 3);
228 gMC->Gsvolu("C02F", "BOX", idtmed[1103], bpar, 3);
230 gMC->Gspos("C01F",1,"C01G", +iChamber->frMin+bpar[0] , 0, 0,
231 idrotm[1100],"ONLY");
232 gMC->Gspos("C01F",2,"C01G", -iChamber->frMin-bpar[0] , 0, 0,
233 idrotm[1100],"ONLY");
234 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->frMin+bpar[0] , 0,
235 idrotm[1101],"ONLY");
236 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->frMin-bpar[0] , 0,
237 idrotm[1101],"ONLY");
239 gMC->Gspos("C02F",1,"C02G", +iChamber->frMin+bpar[0] , 0, 0,
240 idrotm[1100],"ONLY");
241 gMC->Gspos("C02F",2,"C02G", -iChamber->frMin-bpar[0] , 0, 0,
242 idrotm[1100],"ONLY");
243 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->frMin+bpar[0] , 0,
244 idrotm[1101],"ONLY");
245 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->frMin-bpar[0] , 0,
246 idrotm[1101],"ONLY");
249 //********************************************************************
251 //********************************************************************
252 iChamber=(AliMUONchamber*) (*fChambers)[2];
253 zpos1=iChamber->ZPosition()-dstation/2;
254 zpos2=zpos1+dstation;
255 zfpos=-(iChamber->fdGas+dframez)/2;
259 tpar[0] = iChamber->frMin-dframep;
260 tpar[1] = (iChamber->frMax+dframep)/TMath::Cos(phi);
261 tpar[2] = dstation/2;
263 gMC->Gsvolu("C03M", "TUBE", idtmed[1100], tpar, 3);
264 gMC->Gsvolu("C04M", "TUBE", idtmed[1100], tpar, 3);
265 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
266 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
273 pgpar[4] = -dframez/2;
274 pgpar[5] = iChamber->frMax;
275 pgpar[6] = pgpar[5]+dframep;
276 pgpar[7] = +dframez/2;
279 gMC->Gsvolu("C03O", "PGON", idtmed[1103], pgpar, 10);
280 gMC->Gsvolu("C04O", "PGON", idtmed[1103], pgpar, 10);
281 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
282 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
283 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
284 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
287 tpar[0]= iChamber->frMin-dframep;
288 tpar[1]= iChamber->frMin;
290 gMC->Gsvolu("C03I", "TUBE", idtmed[1103], tpar, 3);
291 gMC->Gsvolu("C04I", "TUBE", idtmed[1103], tpar, 3);
293 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
294 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
295 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
296 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
299 bpar[0] = (iChamber->frMax - iChamber->frMin)/2;
302 gMC->Gsvolu("C03B", "BOX", idtmed[1103], bpar, 3);
303 gMC->Gsvolu("C04B", "BOX", idtmed[1103], bpar, 3);
305 gMC->Gspos("C03B",1,"C03M", +iChamber->frMin+bpar[0] , 0,-zfpos,
306 idrotm[1100],"ONLY");
307 gMC->Gspos("C03B",2,"C03M", -iChamber->frMin-bpar[0] , 0,-zfpos,
308 idrotm[1100],"ONLY");
309 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
310 idrotm[1101],"ONLY");
311 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
312 idrotm[1101],"ONLY");
313 gMC->Gspos("C03B",5,"C03M", +iChamber->frMin+bpar[0] , 0,+zfpos,
314 idrotm[1100],"ONLY");
315 gMC->Gspos("C03B",6,"C03M", -iChamber->frMin-bpar[0] , 0,+zfpos,
316 idrotm[1100],"ONLY");
317 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
318 idrotm[1101],"ONLY");
319 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
320 idrotm[1101],"ONLY");
322 gMC->Gspos("C04B",1,"C04M", +iChamber->frMin+bpar[0] , 0,-zfpos,
323 idrotm[1100],"ONLY");
324 gMC->Gspos("C04B",2,"C04M", -iChamber->frMin-bpar[0] , 0,-zfpos,
325 idrotm[1100],"ONLY");
326 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
327 idrotm[1101],"ONLY");
328 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
329 idrotm[1101],"ONLY");
330 gMC->Gspos("C04B",5,"C04M", +iChamber->frMin+bpar[0] , 0,+zfpos,
331 idrotm[1100],"ONLY");
332 gMC->Gspos("C04B",6,"C04M", -iChamber->frMin-bpar[0] , 0,+zfpos,
333 idrotm[1100],"ONLY");
334 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
335 idrotm[1101],"ONLY");
336 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
337 idrotm[1101],"ONLY");
340 // Chamber Material represented by Alu sheet
341 tpar[0]= iChamber->frMin+dframep*2;
342 tpar[1]= iChamber->frMax-dframep*2;
343 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
344 gMC->Gsvolu("C03A", "TUBE", idtmed[1103], tpar, 3);
345 gMC->Gsvolu("C04A", "TUBE", idtmed[1103], tpar, 3);
346 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
347 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
350 // tpar[2] = iChamber->fdGas;
351 tpar[2] = iChamber->fdGas/2;
352 gMC->Gsvolu("C03G", "TUBE", idtmed[1105], tpar, 3);
353 gMC->Gsvolu("C04G", "TUBE", idtmed[1105], tpar, 3);
354 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
355 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
357 // Frame Crosses to be placed inside gas
358 dr = (iChamber->frMax - iChamber->frMin);
359 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
361 bpar[2] = iChamber->fdGas/2;
362 gMC->Gsvolu("C03F", "BOX", idtmed[1103], bpar, 3);
363 gMC->Gsvolu("C04F", "BOX", idtmed[1103], bpar, 3);
365 gMC->Gspos("C03F",1,"C03G", +iChamber->frMin+bpar[0] , 0, 0,
366 idrotm[1100],"ONLY");
367 gMC->Gspos("C03F",2,"C03G", -iChamber->frMin-bpar[0] , 0, 0,
368 idrotm[1100],"ONLY");
369 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->frMin+bpar[0] , 0,
370 idrotm[1101],"ONLY");
371 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->frMin-bpar[0] , 0,
372 idrotm[1101],"ONLY");
374 gMC->Gspos("C04F",1,"C04G", +iChamber->frMin+bpar[0] , 0, 0,
375 idrotm[1100],"ONLY");
376 gMC->Gspos("C04F",2,"C04G", -iChamber->frMin-bpar[0] , 0, 0,
377 idrotm[1100],"ONLY");
378 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->frMin+bpar[0] , 0,
379 idrotm[1101],"ONLY");
380 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->frMin-bpar[0] , 0,
381 idrotm[1101],"ONLY");
383 //********************************************************************
385 //********************************************************************
387 iChamber=(AliMUONchamber*) (*fChambers)[4];
388 zpos1=iChamber->ZPosition(); // 975-13.75
389 zpos2=zpos1 // +dstation;
393 tpar[0] = iChamber->frMin;
394 tpar[1]= TMath::Sqrt(iChamber->frMax*iChamber->frMax + dframep*dframep) ;
397 gMC->Gsvolu("C05M", "TUBE", idtmed[1100], tpar, 3);
398 gMC->Gsvolu("C06M", "TUBE", idtmed[1100], tpar, 3);
399 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
400 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
402 // Mother volume for one quadrant
403 tspar[0]= iChamber->frMin;
404 tspar[1]= TMath::Sqrt(iChamber->frMax*iChamber->frMax + dframep*dframep) ;
405 tspar[2]= // dframez;
407 tspar[3] = 0.-TMath::ATan2(dframep,iChamber->frMin)*180/kPI;
408 tspar[4] = 90.+TMath::ATan2(dframep,iChamber->frMin)*180/kPI;
409 gMC->Gsvolu("C05Q", "TUBS", idtmed[1100], tspar, 5);
410 gMC->Gsvolu("C06Q", "TUBS", idtmed[1100], tspar, 5);
411 // Position the four quadrants
412 gMC->Gspos("C05Q",1,"C05M", 0., 0., 5.325, idrotm[1100], "ONLY");
413 gMC->Gspos("C05Q",2,"C05M", 0., 0.,-5.325, idrotm[1101], "ONLY");
414 gMC->Gspos("C05Q",3,"C05M", 0., 0., 5.325, idrotm[1102], "ONLY");
415 gMC->Gspos("C05Q",4,"C05M", 0., 0.,-5.325, idrotm[1103], "ONLY");
417 gMC->Gspos("C06Q",1,"C06M", 0., 0., 5.325, idrotm[1100], "ONLY");
418 gMC->Gspos("C06Q",2,"C06M", 0., 0.,-5.325, idrotm[1101], "ONLY");
419 gMC->Gspos("C06Q",3,"C06M", 0., 0., 5.325, idrotm[1102], "ONLY");
420 gMC->Gspos("C06Q",4,"C06M", 0., 0.,-5.325, idrotm[1103], "ONLY");
423 tspar[0]= iChamber->frMax-dframep*2;
424 tspar[1]= iChamber->frMax;
427 gMC->Gsvolu("C05O", "TUBS", idtmed[1100], tspar, 5);
428 gMC->Gsvolu("C06O", "TUBS", idtmed[1100], tspar, 5);
429 gMC->Gspos("C05O",1,"C05Q", 0.,0.,0., 0,"ONLY");
430 gMC->Gspos("C06O",1,"C06Q", 0.,0.,0., 0,"ONLY");
433 tspar[0]= iChamber->frMin;
434 tspar[1]= iChamber->frMin+dframep*2;
435 gMC->Gsvolu("C05I", "TUBS", idtmed[1100], tspar, 5);
436 gMC->Gsvolu("C06I", "TUBS", idtmed[1100], tspar, 5);
437 gMC->Gspos("C05I",1,"C05Q", 0.,0.,0., 0,"ONLY");
438 gMC->Gspos("C06I",1,"C06Q", 0.,0.,0., 0,"ONLY");
440 // Boundary half frame
441 bpar[0] = (iChamber->frMax - iChamber->frMin)/2;
444 gMC->Gsvolu("C05B", "BOX", idtmed[1103], bpar, 3);
445 gMC->Gsvolu("C06B", "BOX", idtmed[1103], bpar, 3);
447 gMC->Gspos("C05B",1,"C05Q", iChamber->frMin+bpar[0] ,-bpar[1],0., idrotm[1100],"ONLY");
448 gMC->Gspos("C05B",2,"C05Q", -bpar[1],iChamber->frMin+bpar[0] ,0., idrotm[1101],"ONLY");
449 gMC->Gspos("C06B",1,"C06Q", iChamber->frMin+bpar[0] ,-bpar[1],0., idrotm[1100],"ONLY");
450 gMC->Gspos("C06B",2,"C06Q", -bpar[1],iChamber->frMin+bpar[0] ,0., idrotm[1101],"ONLY");
452 // Boundary second half frame (should not overlapp with sensitive surface, nor frames)
453 // Effective inner radius due to circle effect
455 (iChamber->frMin+2*dframep)*(iChamber->frMin+2*dframep) - dframep*dframep );
456 bpar[0] = (iChamber->frMax - 2*dframep - rMin ) /2;
457 bpar[2] = (5.325- (0.055 + 0.325)) / 2;
458 gMC->Gsvolu("C05H", "BOX", idtmed[1103], bpar, 3);
459 gMC->Gsvolu("C06H", "BOX", idtmed[1103], bpar, 3);
461 gMC->Gspos("C05H",1,"C05Q", rMin+bpar[0],bpar[1], 0.055+0.325+bpar[2] , idrotm[1100],"ONLY");
462 gMC->Gspos("C05H",2,"C05Q", rMin+bpar[0],bpar[1],-(0.055+0.325+bpar[2]), idrotm[1100],"ONLY");
463 gMC->Gspos("C05H",3,"C05Q", bpar[1],rMin+bpar[0], 0.055+0.325+bpar[2] , idrotm[1101],"ONLY");
464 gMC->Gspos("C05H",4,"C05Q", bpar[1],rMin+bpar[0],-(0.055+0.325+bpar[2]), idrotm[1101],"ONLY");
465 gMC->Gspos("C06H",1,"C06Q", rMin+bpar[0],bpar[1], 0.055+0.325+bpar[2] , idrotm[1100],"ONLY");
466 gMC->Gspos("C06H",2,"C06Q", rMin+bpar[0],bpar[1],-(0.055+0.325+bpar[2]), idrotm[1100],"ONLY");
467 gMC->Gspos("C06H",3,"C06Q", bpar[1],rMin+bpar[0], 0.055+0.325+bpar[2] , idrotm[1101],"ONLY");
468 gMC->Gspos("C06H",4,"C06Q", bpar[1],rMin+bpar[0],-(0.055+0.325+bpar[2]), idrotm[1101],"ONLY");
470 // Chamber Material represented by Alu sheet
471 // tspar[2] = (iChamber->fdAlu)+(iChamber->fdGas);
472 tspar[0]= iChamber->frMin+dframep*2;
473 tspar[1]= iChamber->frMax-dframep*2;
474 tspar[2] = 0.055 + 0.325;
475 gMC->Gsvolu("C05A", "TUBS", idtmed[1103], tspar, 5);
476 gMC->Gsvolu("C06A", "TUBS", idtmed[1103], tspar, 5);
477 gMC->Gspos("C05A", 1, "C05Q", 0., 0., 0., 0, "ONLY");
478 gMC->Gspos("C06A", 1, "C06Q", 0., 0., 0., 0, "ONLY");
481 // tpar[2] = iChamber->fdGas;
483 gMC->Gsvolu("C05G", "TUBS", idtmed[1105], tspar, 5);
484 gMC->Gsvolu("C06G", "TUBS", idtmed[1105], tspar, 5);
485 gMC->Gspos("C05G", 1, "C05A", 0., 0., 0., 0, "ONLY");
486 gMC->Gspos("C06G", 1, "C06A", 0., 0., 0., 0, "ONLY");
488 // Overwrite sensitive volume with ALU
489 // Overwrite Gaz volume
491 gMC->Gsvolu("C05Z", "BOX", idtmed[1103], bpar, 3);
492 gMC->Gsvolu("C06Z", "BOX", idtmed[1103], bpar, 3);
493 gMC->Gspos("C05Z",1,"C05G", rMin+bpar[0] ,bpar[1],0., idrotm[1100],"ONLY");
494 gMC->Gspos("C05Z",2,"C05G", bpar[1], rMin+bpar[0] ,0., idrotm[1101],"ONLY");
495 gMC->Gspos("C06Z",1,"C06G", rMin+bpar[0] ,bpar[1],0., idrotm[1100],"ONLY");
496 gMC->Gspos("C06Z",2,"C06G", bpar[1], rMin+bpar[0] ,0., idrotm[1101],"ONLY");
498 //********************************************************************
500 //********************************************************************
501 iChamber=(AliMUONchamber*) (*fChambers)[6];
502 zpos1=iChamber->ZPosition()-dstation/2;
503 zpos2=zpos1+dstation;
504 zfpos=-(iChamber->fdGas+dframez)/2;
508 tpar[0] = iChamber->frMin-dframep;
509 tpar[1] = (iChamber->frMax+dframep)/TMath::Cos(phi);
510 tpar[2] = dstation/2;
512 gMC->Gsvolu("C07M", "TUBE", idtmed[1100], tpar, 3);
513 gMC->Gsvolu("C08M", "TUBE", idtmed[1100], tpar, 3);
514 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
515 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
522 pgpar[4] = -dframez/2;
523 pgpar[5] = iChamber->frMax;
524 pgpar[6] = pgpar[5]+dframep;
525 pgpar[7] = +dframez/2;
528 gMC->Gsvolu("C07O", "PGON", idtmed[1103], pgpar, 10);
529 gMC->Gsvolu("C08O", "PGON", idtmed[1103], pgpar, 10);
530 gMC->Gspos("C07O",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
531 gMC->Gspos("C07O",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
532 gMC->Gspos("C08O",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
533 gMC->Gspos("C08O",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
536 tpar[0]= iChamber->frMin-dframep;
537 tpar[1]= iChamber->frMin;
539 gMC->Gsvolu("C07I", "TUBE", idtmed[1103], tpar, 3);
540 gMC->Gsvolu("C08I", "TUBE", idtmed[1103], tpar, 3);
542 gMC->Gspos("C07I",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
543 gMC->Gspos("C07I",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
544 gMC->Gspos("C08I",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
545 gMC->Gspos("C08I",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
548 bpar[0] = (iChamber->frMax - iChamber->frMin)/2;
551 gMC->Gsvolu("C07B", "BOX", idtmed[1103], bpar, 3);
552 gMC->Gsvolu("C08B", "BOX", idtmed[1103], bpar, 3);
554 gMC->Gspos("C07B",1,"C07M", +iChamber->frMin+bpar[0] , 0,-zfpos,
555 idrotm[1100],"ONLY");
556 gMC->Gspos("C07B",2,"C07M", -iChamber->frMin-bpar[0] , 0,-zfpos,
557 idrotm[1100],"ONLY");
558 gMC->Gspos("C07B",3,"C07M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
559 idrotm[1101],"ONLY");
560 gMC->Gspos("C07B",4,"C07M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
561 idrotm[1101],"ONLY");
562 gMC->Gspos("C07B",5,"C07M", +iChamber->frMin+bpar[0] , 0,+zfpos,
563 idrotm[1100],"ONLY");
564 gMC->Gspos("C07B",6,"C07M", -iChamber->frMin-bpar[0] , 0,+zfpos,
565 idrotm[1100],"ONLY");
566 gMC->Gspos("C07B",7,"C07M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
567 idrotm[1101],"ONLY");
568 gMC->Gspos("C07B",8,"C07M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
569 idrotm[1101],"ONLY");
571 gMC->Gspos("C08B",1,"C08M", +iChamber->frMin+bpar[0] , 0,-zfpos,
572 idrotm[1100],"ONLY");
573 gMC->Gspos("C08B",2,"C08M", -iChamber->frMin-bpar[0] , 0,-zfpos,
574 idrotm[1100],"ONLY");
575 gMC->Gspos("C08B",3,"C08M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
576 idrotm[1101],"ONLY");
577 gMC->Gspos("C08B",4,"C08M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
578 idrotm[1101],"ONLY");
579 gMC->Gspos("C08B",5,"C08M", +iChamber->frMin+bpar[0] , 0,+zfpos,
580 idrotm[1100],"ONLY");
581 gMC->Gspos("C08B",6,"C08M", -iChamber->frMin-bpar[0] , 0,+zfpos,
582 idrotm[1100],"ONLY");
583 gMC->Gspos("C08B",7,"C08M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
584 idrotm[1101],"ONLY");
585 gMC->Gspos("C08B",8,"C08M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
586 idrotm[1101],"ONLY");
589 // Chamber Material represented by Alu sheet
590 tpar[0]= iChamber->frMin+dframep*2;
591 tpar[1]= iChamber->frMax-dframep*2;
592 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
593 gMC->Gsvolu("C07A", "TUBE", idtmed[1103], tpar, 3);
594 gMC->Gsvolu("C08A", "TUBE", idtmed[1103], tpar, 3);
595 gMC->Gspos("C07A", 1, "C07M", 0., 0., 0., 0, "ONLY");
596 gMC->Gspos("C08A", 1, "C08M", 0., 0., 0., 0, "ONLY");
599 // tpar[2] = iChamber->fdGas;
600 tpar[2] = iChamber->fdGas/2;
601 gMC->Gsvolu("C07G", "TUBE", idtmed[1105], tpar, 3);
602 gMC->Gsvolu("C08G", "TUBE", idtmed[1105], tpar, 3);
603 gMC->Gspos("C07G", 1, "C07A", 0., 0., 0., 0, "ONLY");
604 gMC->Gspos("C08G", 1, "C08A", 0., 0., 0., 0, "ONLY");
606 // Frame Crosses to be placed inside gas
607 dr = (iChamber->frMax - iChamber->frMin);
608 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
610 bpar[2] = iChamber->fdGas/2;
611 gMC->Gsvolu("C07F", "BOX", idtmed[1103], bpar, 3);
612 gMC->Gsvolu("C08F", "BOX", idtmed[1103], bpar, 3);
614 gMC->Gspos("C07F",1,"C07G", +iChamber->frMin+bpar[0] , 0, 0,
615 idrotm[1100],"ONLY");
616 gMC->Gspos("C07F",2,"C07G", -iChamber->frMin-bpar[0] , 0, 0,
617 idrotm[1100],"ONLY");
618 gMC->Gspos("C07F",3,"C07G", 0, +iChamber->frMin+bpar[0] , 0,
619 idrotm[1101],"ONLY");
620 gMC->Gspos("C07F",4,"C07G", 0, -iChamber->frMin-bpar[0] , 0,
621 idrotm[1101],"ONLY");
623 gMC->Gspos("C08F",1,"C08G", +iChamber->frMin+bpar[0] , 0, 0,
624 idrotm[1100],"ONLY");
625 gMC->Gspos("C08F",2,"C08G", -iChamber->frMin-bpar[0] , 0, 0,
626 idrotm[1100],"ONLY");
627 gMC->Gspos("C08F",3,"C08G", 0, +iChamber->frMin+bpar[0] , 0,
628 idrotm[1101],"ONLY");
629 gMC->Gspos("C08F",4,"C08G", 0, -iChamber->frMin-bpar[0] , 0,
630 idrotm[1101],"ONLY");
632 //********************************************************************
634 //********************************************************************
635 iChamber=(AliMUONchamber*) (*fChambers)[8];
636 zpos1=iChamber->ZPosition()-dstation/2;
637 zpos2=zpos1+dstation;
638 zfpos=-(iChamber->fdGas+dframez)/2;
642 tpar[0] = iChamber->frMin-dframep;
643 tpar[1] = (iChamber->frMax+dframep)/TMath::Cos(phi);
644 tpar[2] = dstation/2;
646 gMC->Gsvolu("C09M", "TUBE", idtmed[1100], tpar, 3);
647 gMC->Gsvolu("C10M", "TUBE", idtmed[1100], tpar, 3);
648 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
649 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
656 pgpar[4] = -dframez/2;
657 pgpar[5] = iChamber->frMax;
658 pgpar[6] = pgpar[5]+dframep;
659 pgpar[7] = +dframez/2;
662 gMC->Gsvolu("C09O", "PGON", idtmed[1103], pgpar, 10);
663 gMC->Gsvolu("C10O", "PGON", idtmed[1103], pgpar, 10);
664 gMC->Gspos("C09O",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
665 gMC->Gspos("C09O",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
666 gMC->Gspos("C10O",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
667 gMC->Gspos("C10O",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
670 tpar[0]= iChamber->frMin-dframep;
671 tpar[1]= iChamber->frMin;
673 gMC->Gsvolu("C09I", "TUBE", idtmed[1103], tpar, 3);
674 gMC->Gsvolu("C10I", "TUBE", idtmed[1103], tpar, 3);
676 gMC->Gspos("C09I",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
677 gMC->Gspos("C09I",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
678 gMC->Gspos("C10I",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
679 gMC->Gspos("C10I",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
682 bpar[0] = (iChamber->frMax - iChamber->frMin)/2;
685 gMC->Gsvolu("C09B", "BOX", idtmed[1103], bpar, 3);
686 gMC->Gsvolu("C10B", "BOX", idtmed[1103], bpar, 3);
688 gMC->Gspos("C09B",1,"C09M", +iChamber->frMin+bpar[0] , 0,-zfpos,
689 idrotm[1100],"ONLY");
690 gMC->Gspos("C09B",2,"C09M", -iChamber->frMin-bpar[0] , 0,-zfpos,
691 idrotm[1100],"ONLY");
692 gMC->Gspos("C09B",3,"C09M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
693 idrotm[1101],"ONLY");
694 gMC->Gspos("C09B",4,"C09M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
695 idrotm[1101],"ONLY");
696 gMC->Gspos("C09B",5,"C09M", +iChamber->frMin+bpar[0] , 0,+zfpos,
697 idrotm[1100],"ONLY");
698 gMC->Gspos("C09B",6,"C09M", -iChamber->frMin-bpar[0] , 0,+zfpos,
699 idrotm[1100],"ONLY");
700 gMC->Gspos("C09B",7,"C09M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
701 idrotm[1101],"ONLY");
702 gMC->Gspos("C09B",8,"C09M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
703 idrotm[1101],"ONLY");
705 gMC->Gspos("C10B",1,"C10M", +iChamber->frMin+bpar[0] , 0,-zfpos,
706 idrotm[1100],"ONLY");
707 gMC->Gspos("C10B",2,"C10M", -iChamber->frMin-bpar[0] , 0,-zfpos,
708 idrotm[1100],"ONLY");
709 gMC->Gspos("C10B",3,"C10M", 0, +iChamber->frMin+bpar[0] ,-zfpos,
710 idrotm[1101],"ONLY");
711 gMC->Gspos("C10B",4,"C10M", 0, -iChamber->frMin-bpar[0] ,-zfpos,
712 idrotm[1101],"ONLY");
713 gMC->Gspos("C10B",5,"C10M", +iChamber->frMin+bpar[0] , 0,+zfpos,
714 idrotm[1100],"ONLY");
715 gMC->Gspos("C10B",6,"C10M", -iChamber->frMin-bpar[0] , 0,+zfpos,
716 idrotm[1100],"ONLY");
717 gMC->Gspos("C10B",7,"C10M", 0, +iChamber->frMin+bpar[0] ,+zfpos,
718 idrotm[1101],"ONLY");
719 gMC->Gspos("C10B",8,"C10M", 0, -iChamber->frMin-bpar[0] ,+zfpos,
720 idrotm[1101],"ONLY");
723 // Chamber Material represented by Alu sheet
724 tpar[0]= iChamber->frMin+dframep*2;
725 tpar[1]= iChamber->frMax-dframep*2;
726 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
727 gMC->Gsvolu("C09A", "TUBE", idtmed[1103], tpar, 3);
728 gMC->Gsvolu("C10A", "TUBE", idtmed[1103], tpar, 3);
729 gMC->Gspos("C09A", 1, "C09M", 0., 0., 0., 0, "ONLY");
730 gMC->Gspos("C10A", 1, "C10M", 0., 0., 0., 0, "ONLY");
733 // tpar[2] = iChamber->fdGas;
734 tpar[2] = iChamber->fdGas/2;
735 gMC->Gsvolu("C09G", "TUBE", idtmed[1105], tpar, 3);
736 gMC->Gsvolu("C10G", "TUBE", idtmed[1105], tpar, 3);
737 gMC->Gspos("C09G", 1, "C09A", 0., 0., 0., 0, "ONLY");
738 gMC->Gspos("C10G", 1, "C10A", 0., 0., 0., 0, "ONLY");
740 // Frame Crosses to be placed inside gas
741 dr = (iChamber->frMax - iChamber->frMin);
742 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
744 bpar[2] = iChamber->fdGas/2;
745 gMC->Gsvolu("C09F", "BOX", idtmed[1103], bpar, 3);
746 gMC->Gsvolu("C10F", "BOX", idtmed[1103], bpar, 3);
748 gMC->Gspos("C09F",1,"C09G", +iChamber->frMin+bpar[0] , 0, 0,
749 idrotm[1100],"ONLY");
750 gMC->Gspos("C09F",2,"C09G", -iChamber->frMin-bpar[0] , 0, 0,
751 idrotm[1100],"ONLY");
752 gMC->Gspos("C09F",3,"C09G", 0, +iChamber->frMin+bpar[0] , 0,
753 idrotm[1101],"ONLY");
754 gMC->Gspos("C09F",4,"C09G", 0, -iChamber->frMin-bpar[0] , 0,
755 idrotm[1101],"ONLY");
757 gMC->Gspos("C10F",1,"C10G", +iChamber->frMin+bpar[0] , 0, 0,
758 idrotm[1100],"ONLY");
759 gMC->Gspos("C10F",2,"C10G", -iChamber->frMin-bpar[0] , 0, 0,
760 idrotm[1100],"ONLY");
761 gMC->Gspos("C10F",3,"C10G", 0, +iChamber->frMin+bpar[0] , 0,
762 idrotm[1101],"ONLY");
763 gMC->Gspos("C10F",4,"C10G", 0, -iChamber->frMin-bpar[0] , 0,
764 idrotm[1101],"ONLY");
766 ///////////////////////////////////////
767 // GEOMETRY FOR THE TRIGGER CHAMBERS //
768 ///////////////////////////////////////
770 // Distance between planes inside each trigger station
771 const Float_t DTPLANES = 15.;
773 // Parameters of the Trigger Chambers
776 const Float_t X_MC1_MIN=38.;
777 const Float_t X_MC1_MED=51.;
778 const Float_t X_MC1_MAX=272.;
779 const Float_t Y_MC1_MIN=34.;
780 const Float_t Y_MC1_MAX=51.;
781 const Float_t R_MIN1=48.;
782 const Float_t R_MAX1=64.;
785 iChamber=(AliMUONchamber*) (*fChambers)[10];
786 zpos1=iChamber->ZPosition();
787 zpos2=zpos1+DTPLANES;
789 // Mother volume definition
790 tpar[0] = iChamber->frMin;
791 tpar[1] = iChamber->frMax;
793 gMC->Gsvolu("CM11", "TUBE", idtmed[1100], tpar, 3);
794 gMC->Gsvolu("CM12", "TUBE", idtmed[1100], tpar, 3);
796 // Definition of the flange between the beam shielding and the RPC
801 gMC->Gsvolu("CF1A", "TUBE", idtmed[1103], tpar, 3); //Al
802 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
803 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
805 // Definition of prototype for chambers in the first plane
811 gMC->Gsvolu("CC1A", "BOX ", idtmed[1103], tpar, 0); //Al
812 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
813 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
819 const Float_t X_MC1A=X_MC1_MED+(X_MC1_MAX-X_MC1_MED)/2.;
820 const Float_t Y_MC1A=0.;
821 const Float_t Z_MC1A=0.;
824 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
826 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
828 tpar[0] = (X_MC1_MAX-X_MC1_MED)/2.;
830 gMC->Gsposp("CC1A", 1, "CM11",X_MC1A,Y_MC1A,Z_MC1A, 0, "ONLY", tpar, 3);
831 gMC->Gsposp("CC1A", 2, "CM11",-X_MC1A,Y_MC1A,Z_MC1A, 0, "ONLY", tpar, 3);
834 tpar[0] = (X_MC1_MAX-X_MC1_MIN)/2.;
835 tpar[1] = (Y_MC1_MAX-Y_MC1_MIN)/2.;
837 const Float_t X_MC1B=X_MC1_MIN+tpar[0];
838 const Float_t Y_MC1B=Y_MC1_MIN+tpar[1];
839 const Float_t Z_MC1B=0.;
841 gMC->Gsposp("CC1A", 3, "CM11",X_MC1B,Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
842 gMC->Gsposp("CC1A", 4, "CM11",-X_MC1B,Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
843 gMC->Gsposp("CC1A", 5, "CM11",X_MC1B,-Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
844 gMC->Gsposp("CC1A", 6, "CM11",-X_MC1B,-Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
847 tpar[0] = X_MC1_MAX/2;
848 tpar[1] = Y_MC1_MAX/2;
850 const Float_t X_MC1C=tpar[0];
851 const Float_t Y_MC1C=Y_MC1_MAX+tpar[1];
852 const Float_t Z_MC1C=0.;
854 gMC->Gsposp("CC1A", 7, "CM11",X_MC1C,Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
855 gMC->Gsposp("CC1A", 8, "CM11",-X_MC1C,Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
856 gMC->Gsposp("CC1A", 9, "CM11",X_MC1C,-Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
857 gMC->Gsposp("CC1A", 10, "CM11",-X_MC1C,-Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
860 tpar[0] = X_MC1_MAX/2.;
863 const Float_t X_MC1D=tpar[0];
864 const Float_t Z_MC1D=0.;
866 Float_t Y_MC1D=4.*Y_MC1_MIN;
867 gMC->Gsposp("CC1A", 11, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
868 gMC->Gsposp("CC1A", 12, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
869 gMC->Gsposp("CC1A", 13, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
870 gMC->Gsposp("CC1A", 14, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
873 gMC->Gsposp("CC1A", 15, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
874 gMC->Gsposp("CC1A", 16, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
875 gMC->Gsposp("CC1A", 17, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
876 gMC->Gsposp("CC1A", 18, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
879 gMC->Gsposp("CC1A", 19, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
880 gMC->Gsposp("CC1A", 20, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
881 gMC->Gsposp("CC1A", 21, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
882 gMC->Gsposp("CC1A", 22, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
884 // Positioning first plane in ALICE
885 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
887 // End of geometry definition for the first plane
889 // Station 1 - plan 2 - same RPCs as plan 1 ==> small non covered area
890 // Y position moved (ratio zpos2/zpos1)
891 const Float_t Z_1S2=zpos2/zpos1;
893 // Definition of prototype for chambers in the second plane
899 gMC->Gsvolu("CC2A", "BOX ", idtmed[1103], tpar, 0); //Al
900 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
901 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
907 const Float_t X_MC2A=X_MC1A;
908 const Float_t Y_MC2A=0.;
909 const Float_t Z_MC2A=0.;
912 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
914 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
916 tpar[0] = (X_MC1_MAX-X_MC1_MED)/2.;
918 gMC->Gsposp("CC2A", 1, "CM12",X_MC2A,Y_MC2A,Z_MC2A, 0, "ONLY", tpar, 3);
919 gMC->Gsposp("CC2A", 2, "CM12",-X_MC2A,Y_MC2A,Z_MC2A, 0, "ONLY", tpar, 3);
922 tpar[0] = (X_MC1_MAX-X_MC1_MIN)/2.;
923 tpar[1] = (Y_MC1_MAX-Y_MC1_MIN)/2.;
925 const Float_t X_MC2B=X_MC1B;
926 const Float_t Y_MC2B=2.*Y_MC1_MIN*Z_1S2-Y_MC1_MIN*1.5+Y_MC1_MAX*0.5;
927 const Float_t Z_MC2B=0.;
929 gMC->Gsposp("CC2A", 3, "CM12",X_MC2B,Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
930 gMC->Gsposp("CC2A", 4, "CM12",-X_MC2B,Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
931 gMC->Gsposp("CC2A", 5, "CM12",X_MC2B,-Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
932 gMC->Gsposp("CC2A", 6, "CM12",-X_MC2B,-Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
935 tpar[0] = X_MC1_MAX/2;
936 tpar[1] = Y_MC1_MAX/2;
938 const Float_t X_MC2C=X_MC1C;
939 const Float_t Y_MC2C=2.*Y_MC1_MIN*Z_1S2-Y_MC1_MIN*2.+Y_MC1_MAX*1.5;
940 const Float_t Z_MC2C=0.;
942 gMC->Gsposp("CC2A", 7, "CM12",X_MC2C,Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
943 gMC->Gsposp("CC2A", 8, "CM12",-X_MC2C,Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
944 gMC->Gsposp("CC2A", 9, "CM12",X_MC2C,-Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
945 gMC->Gsposp("CC2A", 10, "CM12",-X_MC2C,-Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
948 tpar[0] = X_MC1_MAX/2.;
951 const Float_t X_MC2D=X_MC1D;
952 const Float_t Z_MC2D=0.;
954 Float_t Y_MC2D=4.*Y_MC1_MIN*Z_1S2;
955 gMC->Gsposp("CC2A", 11, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
956 gMC->Gsposp("CC2A", 12, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
957 gMC->Gsposp("CC2A", 13, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
958 gMC->Gsposp("CC2A", 14, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
960 Y_MC2D=6.*Y_MC1_MIN*Z_1S2;
961 gMC->Gsposp("CC2A", 15, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
962 gMC->Gsposp("CC2A", 16, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
963 gMC->Gsposp("CC2A", 17, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
964 gMC->Gsposp("CC2A", 18, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
966 Y_MC2D=8.*Y_MC1_MIN*Z_1S2;
967 gMC->Gsposp("CC2A", 19, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
968 gMC->Gsposp("CC2A", 20, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
969 gMC->Gsposp("CC2A", 21, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
970 gMC->Gsposp("CC2A", 22, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
972 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
975 iChamber=(AliMUONchamber*) (*fChambers)[12];
976 Float_t zpos3=iChamber->ZPosition();
977 Float_t zpos4=zpos3+DTPLANES;
979 // Parameters of the Trigger Chambers
981 const Float_t X_MC3_MIN=X_MC1_MIN*zpos3/zpos1;
982 const Float_t X_MC3_MED=X_MC1_MED*zpos3/zpos1;
983 const Float_t X_MC3_MAX=X_MC1_MAX*zpos3/zpos1;
984 const Float_t Y_MC3_MIN=Y_MC1_MIN*zpos3/zpos1;
985 const Float_t Y_MC3_MAX=Y_MC1_MAX*zpos3/zpos1;
986 const Float_t R_MIN3=R_MIN1*zpos3/zpos1;
987 const Float_t R_MAX3=R_MAX1*zpos3/zpos1;
989 // Mother volume definition
990 tpar[0] = iChamber->frMin;
991 tpar[1] = iChamber->frMax;
993 gMC->Gsvolu("CM21", "TUBE", idtmed[1100], tpar, 3);
994 gMC->Gsvolu("CM22", "TUBE", idtmed[1100], tpar, 3);
996 // Definition of the flange between the beam shielding and the RPC
1001 gMC->Gsvolu("CF2A", "TUBE", idtmed[1103], tpar, 3); //Al
1002 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1003 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1005 // Definition of prototype for chambers in the third plane
1011 gMC->Gsvolu("CC3A", "BOX ", idtmed[1103], tpar, 0); //Al
1012 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1013 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1019 const Float_t X_MC3A=X_MC3_MED+(X_MC3_MAX-X_MC3_MED)/2.;
1020 const Float_t Y_MC3A=0.;
1021 const Float_t Z_MC3A=0.;
1024 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1026 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1027 tpar[0] = (X_MC3_MAX-X_MC3_MED)/2.;
1028 tpar[1] = Y_MC3_MIN;
1030 gMC->Gsposp("CC3A", 1, "CM21",X_MC3A,Y_MC3A,Z_MC3A, 0, "ONLY", tpar, 3);
1031 gMC->Gsposp("CC3A", 2, "CM21",-X_MC3A,Y_MC3A,Z_MC3A, 0, "ONLY", tpar, 3);
1034 tpar[0] = (X_MC3_MAX-X_MC3_MIN)/2.;
1035 tpar[1] = (Y_MC3_MAX-Y_MC3_MIN)/2.;
1037 const Float_t X_MC3B=X_MC3_MIN+tpar[0];
1038 const Float_t Y_MC3B=Y_MC3_MIN+tpar[1];
1039 const Float_t Z_MC3B=0.;
1041 gMC->Gsposp("CC3A", 3, "CM21",X_MC3B,Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1042 gMC->Gsposp("CC3A", 4, "CM21",-X_MC3B,Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1043 gMC->Gsposp("CC3A", 5, "CM21",X_MC3B,-Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1044 gMC->Gsposp("CC3A", 6, "CM21",-X_MC3B,-Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1047 tpar[0] = X_MC3_MAX/2.;
1048 tpar[1] = Y_MC3_MAX/2.;
1050 const Float_t X_MC3C=tpar[0];
1051 const Float_t Y_MC3C=Y_MC3_MAX+tpar[1];
1052 const Float_t Z_MC3C=0.;
1054 gMC->Gsposp("CC3A", 7, "CM21",X_MC3C,Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1055 gMC->Gsposp("CC3A", 8, "CM21",-X_MC3C,Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1056 gMC->Gsposp("CC3A", 9, "CM21",X_MC3C,-Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1057 gMC->Gsposp("CC3A", 10, "CM21",-X_MC3C,-Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1060 tpar[0] = X_MC3_MAX/2.;
1061 tpar[1] = Y_MC3_MIN;
1063 const Float_t X_MC3D=tpar[0];
1064 const Float_t Z_MC3D=0.;
1066 Float_t Y_MC3D=4.*Y_MC3_MIN;
1067 gMC->Gsposp("CC3A", 11, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1068 gMC->Gsposp("CC3A", 12, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1069 gMC->Gsposp("CC3A", 13, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1070 gMC->Gsposp("CC3A", 14, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1072 Y_MC3D=6.*Y_MC3_MIN;
1073 gMC->Gsposp("CC3A", 15, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1074 gMC->Gsposp("CC3A", 16, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1075 gMC->Gsposp("CC3A", 17, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1076 gMC->Gsposp("CC3A", 18, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1078 Y_MC3D=8.*Y_MC3_MIN;
1079 gMC->Gsposp("CC3A", 19, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1080 gMC->Gsposp("CC3A", 20, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1081 gMC->Gsposp("CC3A", 21, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1082 gMC->Gsposp("CC3A", 22, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1084 // Positioning third plane in ALICE
1085 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1087 // End of geometry definition for the third plane
1089 // Station 2 - plan 4 - same RPCs as plan 3 ==> small non covered area
1090 // Y position moved (ratio zpos4/zpos3)
1091 const Float_t Z_3S4=zpos4/zpos3;
1093 // Definition of prototype for chambers in the fourth plane
1099 gMC->Gsvolu("CC4A", "BOX ", idtmed[1103], tpar, 0); //Al
1100 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1101 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1107 const Float_t X_MC4A=X_MC3A;
1108 const Float_t Y_MC4A=0.;
1109 const Float_t Z_MC4A=0.;
1112 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1114 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1116 tpar[0] = (X_MC3_MAX-X_MC3_MED)/2.;
1117 tpar[1] = Y_MC3_MIN;
1118 gMC->Gsposp("CC4A", 1, "CM22",X_MC4A,Y_MC4A,Z_MC4A, 0, "ONLY", tpar, 3);
1119 gMC->Gsposp("CC4A", 2, "CM22",-X_MC4A,Y_MC4A,Z_MC4A, 0, "ONLY", tpar, 3);
1122 tpar[0] = (X_MC3_MAX-X_MC3_MIN)/2.;
1123 tpar[1] = (Y_MC3_MAX-Y_MC3_MIN)/2.;
1125 const Float_t X_MC4B=X_MC3B;
1126 const Float_t Y_MC4B=2.*Y_MC3_MIN*Z_3S4-Y_MC3_MIN*1.5+Y_MC3_MAX*0.5;
1127 const Float_t Z_MC4B=0.;
1129 gMC->Gsposp("CC4A", 3, "CM22",X_MC4B,Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1130 gMC->Gsposp("CC4A", 4, "CM22",-X_MC4B,Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1131 gMC->Gsposp("CC4A", 5, "CM22",X_MC4B,-Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1132 gMC->Gsposp("CC4A", 6, "CM22",-X_MC4B,-Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1135 tpar[0] = X_MC3_MAX/2;
1136 tpar[1] = Y_MC3_MAX/2;
1138 const Float_t X_MC4C=X_MC3C;
1139 const Float_t Y_MC4C=2.*Y_MC3_MIN*Z_3S4-Y_MC3_MIN*2.+Y_MC3_MAX*1.5;
1140 const Float_t Z_MC4C=0.;
1142 gMC->Gsposp("CC4A", 7, "CM22",X_MC4C,Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1143 gMC->Gsposp("CC4A", 8, "CM22",-X_MC4C,Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1144 gMC->Gsposp("CC4A", 9, "CM22",X_MC4C,-Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1145 gMC->Gsposp("CC4A", 10, "CM22",-X_MC4C,-Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1148 tpar[0] = X_MC3_MAX/2.;
1149 tpar[1] = Y_MC3_MIN;
1151 const Float_t X_MC4D=X_MC3D;
1152 const Float_t Z_MC4D=0.;
1154 Float_t Y_MC4D=4.*Y_MC3_MIN*Z_3S4;
1155 gMC->Gsposp("CC4A", 11, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1156 gMC->Gsposp("CC4A", 12, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1157 gMC->Gsposp("CC4A", 13, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1158 gMC->Gsposp("CC4A", 14, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1160 Y_MC4D=6.*Y_MC3_MIN*Z_3S4;
1161 gMC->Gsposp("CC4A", 15, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1162 gMC->Gsposp("CC4A", 16, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1163 gMC->Gsposp("CC4A", 17, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1164 gMC->Gsposp("CC4A", 18, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1166 Y_MC4D=8.*Y_MC3_MIN*Z_3S4;
1167 gMC->Gsposp("CC4A", 19, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1168 gMC->Gsposp("CC4A", 20, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1169 gMC->Gsposp("CC4A", 21, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1170 gMC->Gsposp("CC4A", 22, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1172 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1176 //___________________________________________
1177 void AliMUONv0::CreateMaterials()
1179 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1182 Float_t ag1[3] = { 39.95,12.01,16. };
1183 Float_t zg1[3] = { 18.,6.,8. };
1184 Float_t wg1[3] = { .8,.0667,.13333 };
1185 Float_t dg1 = .001821;
1187 // Ar-buthane-freon gas -- trigger chambers
1188 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1189 Float_t ztr1[4] = { 18.,6.,1.,9. };
1190 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1191 Float_t dtr1 = .002599;
1194 Float_t agas[3] = { 39.95,12.01,16. };
1195 Float_t zgas[3] = { 18.,6.,8. };
1196 Float_t wgas[3] = { .74,.086684,.173316 };
1197 Float_t dgas = .0018327;
1199 // Ar-Isobutane gas (80%+20%) -- tracking
1200 Float_t ag[3] = { 39.95,12.01,1.01 };
1201 Float_t zg[3] = { 18.,6.,1. };
1202 Float_t wg[3] = { .8,.057,.143 };
1203 Float_t dg = .0019596;
1205 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1206 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1207 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1208 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1209 Float_t dtrig = .0031463;
1213 Float_t abak[3] = {12.01 , 1.01 , 16.};
1214 Float_t zbak[3] = {6. , 1. , 8.};
1215 Float_t wbak[3] = {6. , 6. , 1.};
1218 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1220 Int_t ISXFLD = gAlice->Field()->Integ();
1221 Float_t SXMGMX = gAlice->Field()->Max();
1223 // --- Define the various materials for GEANT ---
1224 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1225 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1226 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1227 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1228 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1229 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1230 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1231 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1233 epsil = .001; // Tracking precision,
1234 stemax = -1.; // Maximum displacement for multiple scat
1235 tmaxfd = -20.; // Maximum angle due to field deflection
1236 deemax = -.3; // Maximum fractional energy loss, DLS
1240 AliMedium(1, "AIR_CH_US ", 15, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1244 AliMedium(4, "ALU_CH_US ", 9, 0, ISXFLD, SXMGMX, tmaxfd, fMaxStepAlu,
1245 fMaxDestepAlu, epsil, stmin);
1249 AliMedium(6, "AR_CH_US ", 20, 1, ISXFLD, SXMGMX, tmaxfd, fMaxStepGas,
1250 fMaxDestepGas, epsil, stmin);
1252 // Ar-Isobuthane-Forane-SF6 gas
1254 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1256 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, ISXFLD, SXMGMX, tmaxfd, fMaxStepAlu,
1257 fMaxDestepAlu, epsil, stmin);
1261 //___________________________________________
1263 void AliMUONv0::Init()
1265 printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
1268 // Initialize Tracking Chambers
1270 for (Int_t i=0; i<NCH; i++) {
1271 ( (AliMUONchamber*) (*fChambers)[i])->Init();
1274 // Set the chamber (sensitive region) GEANT identifier
1275 ((AliMUONchamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1276 ((AliMUONchamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1277 ((AliMUONchamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1278 ((AliMUONchamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1279 ((AliMUONchamber*)(*fChambers)[4])->SetGid(gMC->VolId("C05G"));
1280 ((AliMUONchamber*)(*fChambers)[5])->SetGid(gMC->VolId("C06G"));
1281 ((AliMUONchamber*)(*fChambers)[6])->SetGid(gMC->VolId("C07G"));
1282 ((AliMUONchamber*)(*fChambers)[7])->SetGid(gMC->VolId("C08G"));
1283 ((AliMUONchamber*)(*fChambers)[8])->SetGid(gMC->VolId("C09G"));
1284 ((AliMUONchamber*)(*fChambers)[9])->SetGid(gMC->VolId("C10G"));
1285 ((AliMUONchamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1286 ((AliMUONchamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1287 ((AliMUONchamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1288 ((AliMUONchamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1290 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1293 //___________________________________________
1294 void AliMUONv0::StepManager()
1298 static Int_t vol[2];
1300 static Float_t hits[10];
1301 Float_t destep, step;
1302 static Float_t eloss, xhit, yhit, tlength;
1303 const Float_t big=1.e10;
1304 TLorentzVector pos, mom;
1306 TClonesArray &lhits = *fHits;
1309 // Set maximum step size for gas
1310 // numed=gMC->GetMedium();
1312 // Only charged tracks
1313 if( !(gMC->TrackCharge()) ) return;
1315 // Only gas gap inside chamber
1316 // Tag chambers and record hits when track enters
1318 id=gMC->CurrentVolID(copy);
1320 for (Int_t i=1; i<=NCH; i++) {
1321 if(id==((AliMUONchamber*)(*fChambers)[i-1])->GetGid()){
1326 if (idvol == -1) return;
1328 // Get current particle id (ipart), track position (pos) and momentum (mom)
1329 gMC->TrackPosition(pos);
1330 gMC->TrackMomentum(mom);
1332 ipart = gMC->TrackPid();
1334 // momentum loss and steplength in last step
1335 destep = gMC->Edep();
1336 step = gMC->TrackStep();
1339 // record hits when track enters ...
1340 if( gMC->IsTrackEntering()) {
1341 gMC->SetMaxStep(fMaxStepGas);
1342 // Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1343 //Double_t rt = TMath::Sqrt(tc);
1344 //theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1345 //phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1346 hits[0] = Float_t(ipart); // Geant3 particle type
1347 hits[1] = pos[0]; // X-position for hit
1348 hits[2] = pos[1]; // Y-position for hit
1349 hits[3] = pos[2]; // Z-position for hit
1350 hits[4] = mom.Theta()*kRaddeg; // theta angle of incidence
1351 hits[5] = mom.Phi()*kRaddeg; // phi angle of incidence
1352 hits[8] = (Float_t) fNclusters; // first padhit
1353 hits[9] = -1; // last pad hit
1354 // phi angle of incidence
1359 // Only if not trigger chamber
1362 // Initialize hit position (cursor) in the segmentation model
1363 ((AliMUONchamber*) (*fChambers)[idvol])
1364 ->SigGenInit(pos[0], pos[1], pos[2]);
1367 //printf("In the Trigger Chamber #%d\n",idvol-9);
1372 // Calculate the charge induced on a pad (disintegration) in case
1374 // Mip left chamber ...
1375 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1376 gMC->SetMaxStep(big);
1380 // Only if not trigger chamber
1382 if (eloss > 0) MakePadHits(xhit,yhit,eloss,idvol);
1387 if (fNclusters > (Int_t)hits[8]) {
1389 hits[9]= (Float_t) fNclusters;
1392 new(lhits[fNhits++])
1393 AliMUONhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1396 // Check additional signal generation conditions
1397 // defined by the segmentation
1398 // model (boundary crossing conditions)
1400 (((AliMUONchamber*) (*fChambers)[idvol])
1401 ->SigGenCond(pos[0], pos[1], pos[2]))
1403 ((AliMUONchamber*) (*fChambers)[idvol])
1404 ->SigGenInit(pos[0], pos[1], pos[2]);
1405 // printf("\n-> MakePadHits, reason special %d",ipart);
1406 if (eloss > 0) MakePadHits(xhit,yhit,eloss,idvol);
1412 // nothing special happened, add up energy loss
1419 //___________________________________________
1420 void AliMUON::MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol)
1423 // Calls the charge disintegration method of the current chamber and adds
1424 // the simulated cluster to the root treee
1427 Float_t newclust[6][500];
1432 // Integrated pulse height on chamber
1438 ((AliMUONchamber*) (*fChambers)[idvol])->DisIntegration(eloss, xhit, yhit, nnew, newclust);
1439 // printf("\n Add new clusters %d %f", nnew, eloss*1.e9);
1444 for (Int_t i=0; i<nnew; i++) {
1445 if (Int_t(newclust[3][i]) > 0) {
1448 clhits[1] = Int_t(newclust[5][i]);
1450 clhits[2] = Int_t(newclust[0][i]);
1452 clhits[3] = Int_t(newclust[1][i]);
1454 clhits[4] = Int_t(newclust[2][i]);
1456 clhits[5] = Int_t(newclust[3][i]);
1457 // Pad: chamber sector
1458 clhits[6] = Int_t(newclust[4][i]);
1463 // printf("\n %d new clusters added", ic);
1466 ClassImp(AliMUONchamber)
1467 AliMUONchamber::AliMUONchamber()
1469 fSegmentation = new TObjArray(2);
1474 void AliMUONchamber::Init()
1477 ((AliMUONsegmentation *) (*fSegmentation)[0])->Init(this);
1479 ((AliMUONsegmentation *) (*fSegmentation)[1])->Init(this);
1484 void AliMUONchamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit,
1485 Int_t& nnew,Float_t newclust[6][500])
1488 // Generates pad hits (simulated cluster)
1489 // using the segmentation and the response model
1492 // Width of the integration area
1494 dx=fResponse->Nsigma()*fResponse->ChwX();
1495 dy=fResponse->Nsigma()*fResponse->ChwY();
1497 // Get pulse height from energy loss
1498 Float_t qtot = fResponse->IntPH(eloss);
1502 Float_t qcheck=0, qp;
1504 for (Int_t i=1; i<=fnsec; i++) {
1506 AliMUONsegmentation * segmentation=(AliMUONsegmentation *) (*fSegmentation)[i-1];
1507 for (segmentation->FirstPad(xhit, yhit, dx, dy);
1508 segmentation->MorePads();
1509 segmentation->NextPad())
1511 qp=fResponse->IntXY(segmentation);
1519 // --- store signal information
1520 newclust[0][nnew]=qtot;
1521 newclust[1][nnew]=segmentation->Ix();
1522 newclust[2][nnew]=segmentation->Iy();
1523 newclust[3][nnew]=qp * qtot;
1524 newclust[4][nnew]=segmentation->ISector();
1525 newclust[5][nnew]=(Float_t) i;
1526 // printf("\n pad hit %d %d %f %f ",nnew,i,newclust[1][nnew],newclust[2][nnew]);
1532 // printf("\n check sum is %f %f %f %f %d",qcheck,qtot,xhit,yhit,fGid);
1533 } // Cathode plane loop
1537 ClassImp(AliMUONsegmentation)
1538 ClassImp(AliMUONresponse)
1539 //___________________________________________
1540 ClassImp(AliMUONsegmentationV0)
1541 void AliMUONsegmentationV0::Init(AliMUONchamber* Chamber)
1543 fNpx=(Int_t) (Chamber->frMax/fDpx+1);
1544 fNpy=(Int_t) (Chamber->frMax/fDpy+1);
1548 Float_t AliMUONsegmentationV0::GetAnod(Float_t xhit)
1550 Float_t wire= (xhit<0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5;
1554 void AliMUONsegmentationV0::SetPADSIZ(Float_t p1, Float_t p2)
1559 void AliMUONsegmentationV0::
1560 GetPadIxy(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
1562 // returns pad coordinates (ix,iy) for given real coordinates (x,y)
1564 ix = (x>0)? Int_t(x/fDpx)+1 : Int_t(x/fDpx)-1;
1565 iy = (y>0)? Int_t(y/fDpy)+1 : Int_t(y/fDpy)-1;
1566 if (iy > fNpy) iy= fNpy;
1567 if (iy < -fNpy) iy=-fNpy;
1568 if (ix > fNpx) ix= fNpx;
1569 if (ix < -fNpx) ix=-fNpx;
1571 void AliMUONsegmentationV0::
1572 GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
1574 // returns real coordinates (x,y) for given pad coordinates (ix,iy)
1576 x = (ix>0) ? Float_t(ix*fDpx)-fDpx/2. : Float_t(ix*fDpx)+fDpx/2.;
1577 y = (iy>0) ? Float_t(iy*fDpy)-fDpy/2. : Float_t(iy*fDpy)+fDpy/2.;
1580 void AliMUONsegmentationV0::
1581 FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy)
1584 // Find the wire position (center of charge distribution)
1585 Float_t x0a=GetAnod(xhit);
1587 // and take fNsigma*sigma around this center
1588 Float_t x01=x0a - dx;
1589 Float_t x02=x0a + dx;
1590 Float_t y01=yhit - dy;
1591 Float_t y02=yhit + dy;
1593 // find the pads over which the charge distributes
1594 GetPadIxy(x01,y01,fixmin,fiymin);
1595 GetPadIxy(x02,y02,fixmax,fiymax);
1596 // printf("\n %f %f %d %d",x02,y02,fixmax,fiymax);
1597 // printf("\n FirstPad called %f %f ", fDpx, fDpy);
1598 // printf("\n Hit Position %f %f",xhit,yhit);
1599 // printf("\n Integration limits: %i %i %i %i",fixmin,fixmax,fiymin,fiymax);
1600 // printf("\n Integration limits: %f %f %f %f \n",x01,x02,y01,y02);
1602 // Set current pad to lower left corner
1605 GetPadCxy(fix,fiy,fx,fy);
1608 void AliMUONsegmentationV0::NextPad()
1611 // Step to next pad in integration region
1612 if (fix != fixmax) {
1614 } else if (fiy != fiymax) {
1618 printf("\n Error: Stepping outside integration region\n ");
1620 GetPadCxy(fix,fiy,fx,fy);
1623 Int_t AliMUONsegmentationV0::MorePads()
1625 // Are there more pads in the integration region
1627 if (fix == fixmax && fiy == fiymax) {
1635 void AliMUONsegmentationV0::SigGenInit(Float_t x,Float_t y,Float_t)
1638 // Initialises pad and wire position during stepping
1641 GetPadIxy(x,y,fixt,fiyt);
1642 fiwt=Int_t(x/fWireD)+1;
1645 Int_t AliMUONsegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t)
1648 // Signal will be generated if particle crosses pad boundary or
1649 // boundary between two wires.
1651 GetPadIxy(x,y,ixt,iyt);
1652 Int_t iwt=Int_t(x/fWireD)+1;
1654 if ((ixt != fixt) || (iyt !=fiyt) || (iwt != fiwt)) {
1660 void AliMUONsegmentationV0::
1661 IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
1669 void AliMUONsegmentationV0::
1670 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[7], Int_t Ylist[7])
1672 *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1;
1673 Ylist[0]=iY-1;Ylist[1]=iY+1;Ylist[2]=Ylist[3]=iY;
1676 void AliMUONsegmentationV0::
1677 FitXY(AliMUONRecCluster* ,TClonesArray* )
1678 // Default : Centre of gravity method
1684 //___________________________________________
1685 ClassImp(AliMUONresponseV0)
1686 Float_t AliMUONresponseV0::IntPH(Float_t eloss)
1688 // Get number of electrons and return charge
1691 nel= Int_t(eloss*1.e9/26.);
1693 if (nel == 0) nel=1;
1694 for (Int_t i=1;i<=nel;i++) {
1695 charge -= fChslope*TMath::Log(gRandom->Rndm());
1699 // -------------------------------------------
1700 Float_t AliMUONresponseV0::IntXY(AliMUONsegmentation * segmentation)
1703 const Float_t invpitch = 1/fPitch;
1705 // Integration limits defined by segmentation model
1707 Float_t xi1, xi2, yi1, yi2;
1708 segmentation->IntegrationLimits(xi1,xi2,yi1,yi2);
1714 // The Mathieson function
1715 Double_t ux1=fSqrtKx3*TMath::TanH(fKx2*xi1);
1716 Double_t ux2=fSqrtKx3*TMath::TanH(fKx2*xi2);
1718 Double_t uy1=fSqrtKy3*TMath::TanH(fKy2*yi1);
1719 Double_t uy2=fSqrtKy3*TMath::TanH(fKy2*yi2);
1722 return Float_t(4.*fKx4*(TMath::ATan(ux2)-TMath::ATan(ux1))*
1723 fKy4*(TMath::ATan(uy2)-TMath::ATan(uy1)));
1726 // -------------------------------------------
1727 ClassImp(AliMUONgeometry)
1728 void AliMUONgeometry::InitGeo(Float_t)