1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * SigmaEffect_thetadegrees *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpeateose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /////////////////////////////////////////////////////////
19 // Manager and hits classes for set:MUON version 3 //
20 /////////////////////////////////////////////////////////
23 // (AliMUONv1.h 1.11, AliMUONv1.cxx 1.60)
24 // - now replaced with a new one where geometry and materials
25 // are created using new geometry builders
26 // (See ALIMUON*GeometryBuilder classes)
27 // To be removed later
31 #include <TClonesArray.h>
32 #include <TLorentzVector.h>
33 #include <TVirtualMC.h>
34 #include <TParticle.h>
37 #include "AliMUONChamber.h"
38 #include "AliMUONConstants.h"
39 #include "AliMUONFactory.h"
40 #include "AliMUONHit.h"
41 #include "AliMUONTriggerCircuit.h"
42 #include "AliMUONChamberGeometry.h"
43 #include "AliMUONv3.h"
50 //___________________________________________
51 AliMUONv3::AliMUONv3() : AliMUON()
52 ,fTrackMomentum(), fTrackPosition()
57 fStepManagerVersionOld = kFALSE;
59 fStepMaxInActiveGas = 0.6;
64 fAngleEffectNorma= 0x0;
66 //___________________________________________
67 AliMUONv3::AliMUONv3(const char *name, const char *title)
68 : AliMUON(name,title), fTrackMomentum(), fTrackPosition()
71 // By default include all stations
72 fStations = new Int_t[5];
73 for (Int_t i=0; i<5; i++) fStations[i] = 1;
75 AliMUONFactory factory;
76 factory.Build(this, title);
78 fStepManagerVersionOld = kFALSE;
80 fStepMaxInActiveGas = 0.6;
82 fStepSum = new Float_t [AliMUONConstants::NCh()];
83 fDestepSum = new Float_t [AliMUONConstants::NCh()];
84 for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
88 // Ratio of particle mean eloss with respect MIP's Khalil Boudjemline, sep 2003, PhD.Thesis and Particle Data Book
89 fElossRatio = new TF1("ElossRatio","[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x",0.5,5.);
90 fElossRatio->SetParameter(0,1.02138);
91 fElossRatio->SetParameter(1,-9.54149e-02);
92 fElossRatio->SetParameter(2,+7.83433e-02);
93 fElossRatio->SetParameter(3,-9.98208e-03);
94 fElossRatio->SetParameter(4,+3.83279e-04);
96 // Angle effect in tracking chambers at theta =10 degres as a function of ElossRatio (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) (in micrometers)
97 fAngleEffect10 = new TF1("AngleEffect10","[0]+[1]*x+[2]*x*x",0.5,3.0);
98 fAngleEffect10->SetParameter(0, 1.90691e+02);
99 fAngleEffect10->SetParameter(1,-6.62258e+01);
100 fAngleEffect10->SetParameter(2,+1.28247e+01);
101 // Angle effect: Normalisation form theta=10 degres to theta between 0 and 10 (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis)
102 // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
103 fAngleEffectNorma = new TF1("AngleEffectNorma","[0]+[1]*x+[2]*x*x+[3]*x*x*x",0.0,10.0);
104 fAngleEffectNorma->SetParameter(0,4.148);
105 fAngleEffectNorma->SetParameter(1,-6.809e-01);
106 fAngleEffectNorma->SetParameter(2,5.151e-02);
107 fAngleEffectNorma->SetParameter(3,-1.490e-03);
110 //___________________________________________
111 void AliMUONv3::CreateGeometry()
114 // Note: all chambers have the same structure, which could be
115 // easily parameterised. This was intentionally not done in order
116 // to give a starting point for the implementation of the actual
117 // design of each station.
118 Int_t *idtmed = fIdtmed->GetArray()-1099;
120 // Distance between Stations
124 // Float_t pgpar[10];
125 Float_t zpos1, zpos2, zfpos;
126 // Outer excess and inner recess for mother volume radius
127 // with respect to ROuter and RInner
128 Float_t dframep=.001; // Value for station 3 should be 6 ...
129 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
130 // Float_t dframep1=.001;
131 Float_t dframep1 = 11.0;
132 // Bool_t frameCrosses=kFALSE;
133 Bool_t frameCrosses=kTRUE;
136 // Float_t dframez=0.9;
137 // Half of the total thickness of frame crosses (including DAlu)
138 // for each chamber in stations 1 and 2:
139 // 3% of X0 of composite material,
140 // but taken as Aluminium here, with same thickness in number of X0
141 Float_t dframez = 3. * 8.9 / 100;
146 // Rotation matrices in the x-y plane
149 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
151 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
153 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
155 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
157 Float_t phi=2*TMath::Pi()/12/2;
160 // pointer to the current chamber
161 // pointer to the current chamber
162 Int_t idAlu1=idtmed[1103]; // medium 4
163 Int_t idAlu2=idtmed[1104]; // medium 5
164 // Int_t idAlu1=idtmed[1100];
165 // Int_t idAlu2=idtmed[1100];
166 Int_t idAir=idtmed[1100]; // medium 1
167 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
168 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
171 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
175 //********************************************************************
177 //********************************************************************
179 // indices 1 and 2 for first and second chambers in the station
180 // iChamber (first chamber) kept for other quanties than Z,
181 // assumed to be the same in both chambers
182 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
183 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
184 zpos1=iChamber1->Z();
185 zpos2=iChamber2->Z();
186 dstation = TMath::Abs(zpos2 - zpos1);
187 // DGas decreased from standard one (0.5)
188 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
189 // DAlu increased from standard one (3% of X0),
190 // because more electronics with smaller pads
191 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
192 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
196 tpar[0] = iChamber->RInner()-dframep;
197 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
198 tpar[2] = dstation/5;
200 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
201 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
202 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
203 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
204 // // Aluminium frames
206 // pgpar[0] = 360/12/2;
210 // pgpar[4] = -dframez/2;
211 // pgpar[5] = iChamber->ROuter();
212 // pgpar[6] = pgpar[5]+dframep1;
213 // pgpar[7] = +dframez/2;
214 // pgpar[8] = pgpar[5];
215 // pgpar[9] = pgpar[6];
216 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
217 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
218 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
219 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
220 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
221 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
224 // tpar[0]= iChamber->RInner()-dframep1;
225 // tpar[1]= iChamber->RInner();
226 // tpar[2]= dframez/2;
227 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
228 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
230 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
231 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
232 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
233 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
238 // security for inside mother volume
239 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
240 * TMath::Cos(TMath::ASin(dframep1 /
241 (iChamber->ROuter() - iChamber->RInner())))
243 bpar[1] = dframep1/2;
244 // total thickness will be (4 * bpar[2]) for each chamber,
245 // which has to be equal to (2 * dframez) - DAlu
246 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
247 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
248 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
250 gMC->Gspos("S01B",1,"S01M", -iChamber->RInner()-bpar[0] , 0, zfpos,
251 idrotm[1100],"ONLY");
252 gMC->Gspos("S01B",2,"S01M", iChamber->RInner()+bpar[0] , 0, zfpos,
253 idrotm[1100],"ONLY");
254 gMC->Gspos("S01B",3,"S01M", 0, -iChamber->RInner()-bpar[0] , zfpos,
255 idrotm[1101],"ONLY");
256 gMC->Gspos("S01B",4,"S01M", 0, iChamber->RInner()+bpar[0] , zfpos,
257 idrotm[1101],"ONLY");
258 gMC->Gspos("S01B",5,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
259 idrotm[1100],"ONLY");
260 gMC->Gspos("S01B",6,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
261 idrotm[1100],"ONLY");
262 gMC->Gspos("S01B",7,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
263 idrotm[1101],"ONLY");
264 gMC->Gspos("S01B",8,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
265 idrotm[1101],"ONLY");
267 gMC->Gspos("S02B",1,"S02M", -iChamber->RInner()-bpar[0] , 0, zfpos,
268 idrotm[1100],"ONLY");
269 gMC->Gspos("S02B",2,"S02M", iChamber->RInner()+bpar[0] , 0, zfpos,
270 idrotm[1100],"ONLY");
271 gMC->Gspos("S02B",3,"S02M", 0, -iChamber->RInner()-bpar[0] , zfpos,
272 idrotm[1101],"ONLY");
273 gMC->Gspos("S02B",4,"S02M", 0, iChamber->RInner()+bpar[0] , zfpos,
274 idrotm[1101],"ONLY");
275 gMC->Gspos("S02B",5,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
276 idrotm[1100],"ONLY");
277 gMC->Gspos("S02B",6,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
278 idrotm[1100],"ONLY");
279 gMC->Gspos("S02B",7,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
280 idrotm[1101],"ONLY");
281 gMC->Gspos("S02B",8,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
282 idrotm[1101],"ONLY");
285 // Chamber Material represented by Alu sheet
286 tpar[0]= iChamber->RInner();
287 tpar[1]= iChamber->ROuter();
288 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
289 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
290 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
291 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
292 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
295 // tpar[2] = iChamber->DGas();
296 tpar[2] = iChamber->DGas()/2;
297 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
298 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
299 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
300 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
302 // Frame Crosses to be placed inside gas
303 // NONE: chambers are sensitive everywhere
304 // if (frameCrosses) {
306 // dr = (iChamber->ROuter() - iChamber->RInner());
307 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
308 // bpar[1] = dframep1/2;
309 // bpar[2] = iChamber->DGas()/2;
310 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
311 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
313 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
314 // idrotm[1100],"ONLY");
315 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
316 // idrotm[1100],"ONLY");
317 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
318 // idrotm[1101],"ONLY");
319 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
320 // idrotm[1101],"ONLY");
322 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
323 // idrotm[1100],"ONLY");
324 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
325 // idrotm[1100],"ONLY");
326 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
327 // idrotm[1101],"ONLY");
328 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
329 // idrotm[1101],"ONLY");
334 //********************************************************************
336 //********************************************************************
337 // indices 1 and 2 for first and second chambers in the station
338 // iChamber (first chamber) kept for other quanties than Z,
339 // assumed to be the same in both chambers
340 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
341 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
342 zpos1=iChamber1->Z();
343 zpos2=iChamber2->Z();
344 dstation = TMath::Abs(zpos2 - zpos1);
345 // DGas and DAlu not changed from standard values
346 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
350 tpar[0] = iChamber->RInner()-dframep;
351 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
352 tpar[2] = dstation/5;
354 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
355 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
356 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
357 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
358 gMC->Gsbool("S03M", "L3DO");
359 gMC->Gsbool("S03M", "L3O1");
360 gMC->Gsbool("S03M", "L3O2");
361 gMC->Gsbool("S04M", "L3DO");
362 gMC->Gsbool("S04M", "L3O1");
363 gMC->Gsbool("S04M", "L3O2");
365 // // Aluminium frames
367 // pgpar[0] = 360/12/2;
371 // pgpar[4] = -dframez/2;
372 // pgpar[5] = iChamber->ROuter();
373 // pgpar[6] = pgpar[5]+dframep;
374 // pgpar[7] = +dframez/2;
375 // pgpar[8] = pgpar[5];
376 // pgpar[9] = pgpar[6];
377 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
378 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
379 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
380 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
381 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
382 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
385 // tpar[0]= iChamber->RInner()-dframep;
386 // tpar[1]= iChamber->RInner();
387 // tpar[2]= dframez/2;
388 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
389 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
391 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
392 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
393 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
394 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
399 // security for inside mother volume
400 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
401 * TMath::Cos(TMath::ASin(dframep1 /
402 (iChamber->ROuter() - iChamber->RInner())))
404 bpar[1] = dframep1/2;
405 // total thickness will be (4 * bpar[2]) for each chamber,
406 // which has to be equal to (2 * dframez) - DAlu
407 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
408 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
409 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
411 gMC->Gspos("S03B",1,"S03M", -iChamber->RInner()-bpar[0] , 0, zfpos,
412 idrotm[1100],"ONLY");
413 gMC->Gspos("S03B",2,"S03M", +iChamber->RInner()+bpar[0] , 0, zfpos,
414 idrotm[1100],"ONLY");
415 gMC->Gspos("S03B",3,"S03M", 0, -iChamber->RInner()-bpar[0] , zfpos,
416 idrotm[1101],"ONLY");
417 gMC->Gspos("S03B",4,"S03M", 0, +iChamber->RInner()+bpar[0] , zfpos,
418 idrotm[1101],"ONLY");
419 gMC->Gspos("S03B",5,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
420 idrotm[1100],"ONLY");
421 gMC->Gspos("S03B",6,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
422 idrotm[1100],"ONLY");
423 gMC->Gspos("S03B",7,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
424 idrotm[1101],"ONLY");
425 gMC->Gspos("S03B",8,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
426 idrotm[1101],"ONLY");
428 gMC->Gspos("S04B",1,"S04M", -iChamber->RInner()-bpar[0] , 0, zfpos,
429 idrotm[1100],"ONLY");
430 gMC->Gspos("S04B",2,"S04M", +iChamber->RInner()+bpar[0] , 0, zfpos,
431 idrotm[1100],"ONLY");
432 gMC->Gspos("S04B",3,"S04M", 0, -iChamber->RInner()-bpar[0] , zfpos,
433 idrotm[1101],"ONLY");
434 gMC->Gspos("S04B",4,"S04M", 0, +iChamber->RInner()+bpar[0] , zfpos,
435 idrotm[1101],"ONLY");
436 gMC->Gspos("S04B",5,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
437 idrotm[1100],"ONLY");
438 gMC->Gspos("S04B",6,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
439 idrotm[1100],"ONLY");
440 gMC->Gspos("S04B",7,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
441 idrotm[1101],"ONLY");
442 gMC->Gspos("S04B",8,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
443 idrotm[1101],"ONLY");
446 // Chamber Material represented by Alu sheet
447 tpar[0]= iChamber->RInner();
448 tpar[1]= iChamber->ROuter();
449 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
450 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
451 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
452 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
453 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
456 // tpar[2] = iChamber->DGas();
457 tpar[2] = iChamber->DGas()/2;
458 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
459 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
460 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
461 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
463 // Frame Crosses to be placed inside gas
464 // NONE: chambers are sensitive everywhere
465 // if (frameCrosses) {
467 // dr = (iChamber->ROuter() - iChamber->RInner());
468 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
469 // bpar[1] = dframep1/2;
470 // bpar[2] = iChamber->DGas()/2;
471 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
472 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
474 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
475 // idrotm[1100],"ONLY");
476 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
477 // idrotm[1100],"ONLY");
478 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
479 // idrotm[1101],"ONLY");
480 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
481 // idrotm[1101],"ONLY");
483 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
484 // idrotm[1100],"ONLY");
485 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
486 // idrotm[1100],"ONLY");
487 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
488 // idrotm[1101],"ONLY");
489 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
490 // idrotm[1101],"ONLY");
493 // define the id of tracking media:
494 Int_t idCopper = idtmed[1110];
495 Int_t idGlass = idtmed[1111];
496 Int_t idCarbon = idtmed[1112];
497 Int_t idRoha = idtmed[1113];
499 // sensitive area: 40*40 cm**2
500 const Float_t ksensLength = 40.;
501 const Float_t ksensHeight = 40.;
502 const Float_t ksensWidth = 0.5; // according to TDR fig 2.120
503 const Int_t ksensMaterial = idGas;
504 const Float_t kyOverlap = 1.5;
506 // PCB dimensions in cm; width: 30 mum copper
507 const Float_t kpcbLength = ksensLength;
508 const Float_t kpcbHeight = 60.;
509 const Float_t kpcbWidth = 0.003;
510 const Int_t kpcbMaterial= idCopper;
512 // Insulating material: 200 mum glass fiber glued to pcb
513 const Float_t kinsuLength = kpcbLength;
514 const Float_t kinsuHeight = kpcbHeight;
515 const Float_t kinsuWidth = 0.020;
516 const Int_t kinsuMaterial = idGlass;
518 // Carbon fiber panels: 200mum carbon/epoxy skin
519 const Float_t kpanelLength = ksensLength;
520 const Float_t kpanelHeight = ksensHeight;
521 const Float_t kpanelWidth = 0.020;
522 const Int_t kpanelMaterial = idCarbon;
524 // rohacell between the two carbon panels
525 const Float_t krohaLength = ksensLength;
526 const Float_t krohaHeight = ksensHeight;
527 const Float_t krohaWidth = 0.5;
528 const Int_t krohaMaterial = idRoha;
530 // Frame around the slat: 2 sticks along length,2 along height
531 // H: the horizontal ones
532 const Float_t khFrameLength = kpcbLength;
533 const Float_t khFrameHeight = 1.5;
534 const Float_t khFrameWidth = ksensWidth;
535 const Int_t khFrameMaterial = idGlass;
537 // V: the vertical ones
538 const Float_t kvFrameLength = 4.0;
539 const Float_t kvFrameHeight = ksensHeight + khFrameHeight;
540 const Float_t kvFrameWidth = ksensWidth;
541 const Int_t kvFrameMaterial = idGlass;
543 // B: the horizontal border filled with rohacell
544 const Float_t kbFrameLength = khFrameLength;
545 const Float_t kbFrameHeight = (kpcbHeight - ksensHeight)/2. - khFrameHeight;
546 const Float_t kbFrameWidth = khFrameWidth;
547 const Int_t kbFrameMaterial = idRoha;
549 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
550 const Float_t knulocLength = 2.5;
551 const Float_t knulocHeight = 7.5;
552 const Float_t knulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
553 const Int_t knulocMaterial = idCopper;
555 const Float_t kslatHeight = kpcbHeight;
556 const Float_t kslatWidth = ksensWidth + 2.*(kpcbWidth + kinsuWidth +
557 2.* kpanelWidth + krohaWidth);
558 const Int_t kslatMaterial = idAir;
559 const Float_t kdSlatLength = kvFrameLength; // border on left and right
564 // the panel volume contains the rohacell
566 Float_t twidth = 2 * kpanelWidth + krohaWidth;
567 Float_t panelpar[3] = { kpanelLength/2., kpanelHeight/2., twidth/2. };
568 Float_t rohapar[3] = { krohaLength/2., krohaHeight/2., krohaWidth/2. };
570 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
572 twidth = 2*(kinsuWidth + kpcbWidth) + ksensWidth;
573 Float_t insupar[3] = { kinsuLength/2., kinsuHeight/2., twidth/2. };
574 twidth -= 2 * kinsuWidth;
575 Float_t pcbpar[3] = { kpcbLength/2., kpcbHeight/2., twidth/2. };
576 Float_t senspar[3] = { ksensLength/2., ksensHeight/2., ksensWidth/2. };
577 Float_t theight = 2*khFrameHeight + ksensHeight;
578 Float_t hFramepar[3]={khFrameLength/2., theight/2., khFrameWidth/2.};
579 Float_t bFramepar[3]={kbFrameLength/2., kbFrameHeight/2., kbFrameWidth/2.};
580 Float_t vFramepar[3]={kvFrameLength/2., kvFrameHeight/2., kvFrameWidth/2.};
581 Float_t nulocpar[3]={knulocLength/2., knulocHeight/2., knulocWidth/2.};
583 Float_t xxmax = (kbFrameLength - knulocLength)/2.;
588 //********************************************************************
590 //********************************************************************
591 // indices 1 and 2 for first and second chambers in the station
592 // iChamber (first chamber) kept for other quanties than Z,
593 // assumed to be the same in both chambers
594 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
595 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
596 zpos1=iChamber1->Z();
597 zpos2=iChamber2->Z();
598 dstation = TMath::Abs(zpos2 - zpos1);
602 tpar[0] = iChamber->RInner()-dframep;
603 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
604 tpar[2] = dstation/5;
606 char *slats5Mother = "S05M";
607 char *slats6Mother = "S06M";
611 if (gAlice->GetModule("DIPO")) {
615 zoffs5 = TMath::Abs(zpos1);
616 zoffs6 = TMath::Abs(zpos2);
620 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
621 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
622 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
623 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
626 // volumes for slat geometry (xx=5,..,10 chamber id):
627 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
628 // SxxG --> Sensitive volume (gas)
629 // SxxP --> PCB (copper)
630 // SxxI --> Insulator (vetronite)
631 // SxxC --> Carbon panel
633 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
634 // SB5x --> Volumes for the 35 cm long PCB
635 // slat dimensions: slat is a MOTHER volume!!! made of air
637 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
639 Float_t tlength = 35.;
640 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
641 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
642 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
643 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
644 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
645 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
646 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
648 const Int_t knSlats3 = 5; // number of slats per quadrant
649 const Int_t knPCB3[knSlats3] = {3,3,4,3,2}; // n PCB per slat
650 const Float_t kxpos3[knSlats3] = {31., 40., 0., 0., 0.};
651 Float_t slatLength3[knSlats3];
653 // create and position the slat (mother) volumes
660 for (i = 0; i<knSlats3; i++){
661 slatLength3[i] = kpcbLength * knPCB3[i] + 2. * kdSlatLength;
662 xSlat3 = slatLength3[i]/2. - kvFrameLength/2. + kxpos3[i];
663 if (i==1 || i==0) slatLength3[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
664 Float_t ySlat31 = ksensHeight * i - kyOverlap * i;
665 Float_t ySlat32 = -ksensHeight * i + kyOverlap * i;
666 spar[0] = slatLength3[i]/2.;
667 spar[1] = kslatHeight/2.;
668 spar[2] = kslatWidth/2. * 1.01;
669 // take away 5 cm from the first slat in chamber 5
671 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
672 spar2[0] = spar[0]-5./2.;
673 xSlat32 = xSlat3 - 5/2.;
681 Float_t dzCh3=spar[2] * 1.01;
682 // zSlat to be checked (odd downstream or upstream?)
683 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
685 if (gAlice->GetModule("DIPO")) {zSlat*=-1.;}
687 sprintf(volNam5,"S05%d",i);
688 gMC->Gsvolu(volNam5,"BOX",kslatMaterial,spar2,3);
689 gMC->Gspos(volNam5, i*4+1,slats5Mother, -xSlat32, ySlat31, zoffs5-zSlat-2.*dzCh3, 0, "ONLY");
690 gMC->Gspos(volNam5, i*4+2,slats5Mother, +xSlat32, ySlat31, zoffs5-zSlat+2.*dzCh3, 0, "ONLY");
693 gMC->Gspos(volNam5, i*4+3,slats5Mother,-xSlat32, ySlat32, zoffs5-zSlat-2.*dzCh3, 0, "ONLY");
694 gMC->Gspos(volNam5, i*4+4,slats5Mother,+xSlat32, ySlat32, zoffs5-zSlat+2.*dzCh3, 0, "ONLY");
696 sprintf(volNam6,"S06%d",i);
697 gMC->Gsvolu(volNam6,"BOX",kslatMaterial,spar,3);
698 gMC->Gspos(volNam6, i*4+1,slats6Mother,-xSlat3, ySlat31, zoffs6-zSlat-2.*dzCh3, 0, "ONLY");
699 gMC->Gspos(volNam6, i*4+2,slats6Mother,+xSlat3, ySlat31, zoffs6-zSlat+2.*dzCh3, 0, "ONLY");
701 gMC->Gspos(volNam6, i*4+3,slats6Mother,-xSlat3, ySlat32, zoffs6-zSlat-2.*dzCh3, 0, "ONLY");
702 gMC->Gspos(volNam6, i*4+4,slats6Mother,+xSlat3, ySlat32, zoffs6-zSlat+2.*dzCh3, 0, "ONLY");
706 // create the panel volume
708 gMC->Gsvolu("S05C","BOX",kpanelMaterial,panelpar,3);
709 gMC->Gsvolu("SB5C","BOX",kpanelMaterial,panelpar2,3);
710 gMC->Gsvolu("S06C","BOX",kpanelMaterial,panelpar,3);
712 // create the rohacell volume
714 gMC->Gsvolu("S05R","BOX",krohaMaterial,rohapar,3);
715 gMC->Gsvolu("SB5R","BOX",krohaMaterial,rohapar2,3);
716 gMC->Gsvolu("S06R","BOX",krohaMaterial,rohapar,3);
718 // create the insulating material volume
720 gMC->Gsvolu("S05I","BOX",kinsuMaterial,insupar,3);
721 gMC->Gsvolu("SB5I","BOX",kinsuMaterial,insupar2,3);
722 gMC->Gsvolu("S06I","BOX",kinsuMaterial,insupar,3);
724 // create the PCB volume
726 gMC->Gsvolu("S05P","BOX",kpcbMaterial,pcbpar,3);
727 gMC->Gsvolu("SB5P","BOX",kpcbMaterial,pcbpar2,3);
728 gMC->Gsvolu("S06P","BOX",kpcbMaterial,pcbpar,3);
730 // create the sensitive volumes,
731 gMC->Gsvolu("S05G","BOX",ksensMaterial,dum,0);
732 gMC->Gsvolu("S06G","BOX",ksensMaterial,dum,0);
735 // create the vertical frame volume
737 gMC->Gsvolu("S05V","BOX",kvFrameMaterial,vFramepar,3);
738 gMC->Gsvolu("S06V","BOX",kvFrameMaterial,vFramepar,3);
740 // create the horizontal frame volume
742 gMC->Gsvolu("S05H","BOX",khFrameMaterial,hFramepar,3);
743 gMC->Gsvolu("SB5H","BOX",khFrameMaterial,hFramepar2,3);
744 gMC->Gsvolu("S06H","BOX",khFrameMaterial,hFramepar,3);
746 // create the horizontal border volume
748 gMC->Gsvolu("S05B","BOX",kbFrameMaterial,bFramepar,3);
749 gMC->Gsvolu("SB5B","BOX",kbFrameMaterial,bFramepar2,3);
750 gMC->Gsvolu("S06B","BOX",kbFrameMaterial,bFramepar,3);
753 for (i = 0; i<knSlats3; i++){
754 sprintf(volNam5,"S05%d",i);
755 sprintf(volNam6,"S06%d",i);
756 Float_t xvFrame = (slatLength3[i] - kvFrameLength)/2.;
757 Float_t xvFrame2 = xvFrame;
758 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
759 // position the vertical frames
761 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
762 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
763 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
764 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
766 // position the panels and the insulating material
767 for (j=0; j<knPCB3[i]; j++){
769 Float_t xx = ksensLength * (-knPCB3[i]/2.+j+.5);
770 Float_t xx2 = xx + 5/2.;
772 Float_t zPanel = spar[2] - panelpar[2];
773 if ( (i==1 || i==2) && j == knPCB3[i]-1) { // 1 pcb is shortened by 5cm
774 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
775 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
776 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
778 else if ( (i==1 || i==2) && j < knPCB3[i]-1) {
779 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
780 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
781 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
784 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
785 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
786 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
788 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
789 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
790 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
794 // position the rohacell volume inside the panel volume
795 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
796 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
797 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
799 // position the PCB volume inside the insulating material volume
800 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
801 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
802 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
803 // position the horizontal frame volume inside the PCB volume
804 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
805 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
806 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
807 // position the sensitive volume inside the horizontal frame volume
808 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
809 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
810 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
811 // position the border volumes inside the PCB volume
812 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
813 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
814 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
815 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
816 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
817 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
818 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
820 // create the NULOC volume and position it in the horizontal frame
822 gMC->Gsvolu("S05N","BOX",knulocMaterial,nulocpar,3);
823 gMC->Gsvolu("S06N","BOX",knulocMaterial,nulocpar,3);
825 Float_t xxmax2 = xxmax - 5./2.;
826 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
828 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
829 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., kbFrameWidth/4., 0, "ONLY");
830 if (xx > -xxmax2 && xx< xxmax2) {
831 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
832 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., kbFrameWidth/4., 0, "ONLY");
834 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
835 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., kbFrameWidth/4., 0, "ONLY");
838 // position the volumes approximating the circular section of the pipe
839 Float_t yoffs = ksensHeight/2. - kyOverlap;
840 Float_t epsilon = 0.001;
843 Double_t dydiv= ksensHeight/ndiv;
844 Double_t ydiv = yoffs -dydiv;
848 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
849 if (gAlice->GetModule("DIPO")) {z1*=-1.;}
850 for (Int_t idiv=0;idiv<ndiv; idiv++){
853 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
854 divpar[0] = (kpcbLength-xdiv)/2.;
855 divpar[1] = dydiv/2. - epsilon;
856 divpar[2] = ksensWidth/2.;
857 Float_t xvol=(kpcbLength+xdiv)/2.+1.999;
858 Float_t yvol=ydiv + dydiv/2.;
859 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
860 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother,-xvol, yvol, zoffs5-z1-z2, 0, "ONLY",divpar,3);
861 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother,-xvol, yvol, zoffs6-z1-z2, 0, "ONLY",divpar,3);
862 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother,-xvol,-yvol, zoffs5-z1-z2, 0, "ONLY",divpar,3);
863 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother,-xvol,-yvol, zoffs6-z1-z2, 0, "ONLY",divpar,3);
864 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,+xvol, yvol, zoffs5-z1+z2, 0, "ONLY",divpar,3);
865 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,+xvol, yvol, zoffs6-z1+z2, 0, "ONLY",divpar,3);
866 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,+xvol,-yvol, zoffs5-z1+z2, 0, "ONLY",divpar,3);
867 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,+xvol,-yvol, zoffs6-z1+z2, 0, "ONLY",divpar,3);
873 //********************************************************************
875 //********************************************************************
876 // indices 1 and 2 for first and second chambers in the station
877 // iChamber (first chamber) kept for other quanties than Z,
878 // assumed to be the same in both chambers
879 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
880 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
881 zpos1=iChamber1->Z();
882 zpos2=iChamber2->Z();
883 dstation = TMath::Abs(zpos2 - zpos1);
884 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
888 tpar[0] = iChamber->RInner()-dframep;
889 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
890 tpar[2] = dstation/4;
892 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
893 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
894 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
895 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
898 const Int_t knSlats4 = 6; // number of slats per quadrant
899 const Int_t knPCB4[knSlats4] = {4,4,5,5,4,3}; // n PCB per slat
900 const Float_t kxpos4[knSlats4] = {38.5, 40., 0., 0., 0., 0.};
901 Float_t slatLength4[knSlats4];
903 // create and position the slat (mother) volumes
910 for (i = 0; i<knSlats4; i++){
911 slatLength4[i] = kpcbLength * knPCB4[i] + 2. * kdSlatLength;
912 xSlat4 = slatLength4[i]/2. - kvFrameLength/2. + kxpos4[i];
913 if (i==1) slatLength4[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
914 ySlat4 = ksensHeight * i - kyOverlap *i;
916 spar[0] = slatLength4[i]/2.;
917 spar[1] = kslatHeight/2.;
918 spar[2] = kslatWidth/2.*1.01;
919 Float_t dzCh4=spar[2]*1.01;
920 // zSlat to be checked (odd downstream or upstream?)
921 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
922 sprintf(volNam7,"S07%d",i);
923 gMC->Gsvolu(volNam7,"BOX",kslatMaterial,spar,3);
924 gMC->Gspos(volNam7, i*4+1,"S07M",-xSlat4, ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
925 gMC->Gspos(volNam7, i*4+2,"S07M",+xSlat4, ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
927 gMC->Gspos(volNam7, i*4+3,"S07M",-xSlat4,-ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
928 gMC->Gspos(volNam7, i*4+4,"S07M",+xSlat4,-ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
930 sprintf(volNam8,"S08%d",i);
931 gMC->Gsvolu(volNam8,"BOX",kslatMaterial,spar,3);
932 gMC->Gspos(volNam8, i*4+1,"S08M",-xSlat4, ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
933 gMC->Gspos(volNam8, i*4+2,"S08M",+xSlat4, ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
935 gMC->Gspos(volNam8, i*4+3,"S08M",-xSlat4,-ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
936 gMC->Gspos(volNam8, i*4+4,"S08M",+xSlat4,-ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
941 // create the panel volume
943 gMC->Gsvolu("S07C","BOX",kpanelMaterial,panelpar,3);
944 gMC->Gsvolu("S08C","BOX",kpanelMaterial,panelpar,3);
946 // create the rohacell volume
948 gMC->Gsvolu("S07R","BOX",krohaMaterial,rohapar,3);
949 gMC->Gsvolu("S08R","BOX",krohaMaterial,rohapar,3);
951 // create the insulating material volume
953 gMC->Gsvolu("S07I","BOX",kinsuMaterial,insupar,3);
954 gMC->Gsvolu("S08I","BOX",kinsuMaterial,insupar,3);
956 // create the PCB volume
958 gMC->Gsvolu("S07P","BOX",kpcbMaterial,pcbpar,3);
959 gMC->Gsvolu("S08P","BOX",kpcbMaterial,pcbpar,3);
961 // create the sensitive volumes,
963 gMC->Gsvolu("S07G","BOX",ksensMaterial,dum,0);
964 gMC->Gsvolu("S08G","BOX",ksensMaterial,dum,0);
966 // create the vertical frame volume
968 gMC->Gsvolu("S07V","BOX",kvFrameMaterial,vFramepar,3);
969 gMC->Gsvolu("S08V","BOX",kvFrameMaterial,vFramepar,3);
971 // create the horizontal frame volume
973 gMC->Gsvolu("S07H","BOX",khFrameMaterial,hFramepar,3);
974 gMC->Gsvolu("S08H","BOX",khFrameMaterial,hFramepar,3);
976 // create the horizontal border volume
978 gMC->Gsvolu("S07B","BOX",kbFrameMaterial,bFramepar,3);
979 gMC->Gsvolu("S08B","BOX",kbFrameMaterial,bFramepar,3);
982 for (i = 0; i<knSlats4; i++){
983 sprintf(volNam7,"S07%d",i);
984 sprintf(volNam8,"S08%d",i);
985 Float_t xvFrame = (slatLength4[i] - kvFrameLength)/2.;
986 // position the vertical frames
988 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
989 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
990 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
991 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
993 // position the panels and the insulating material
994 for (j=0; j<knPCB4[i]; j++){
996 Float_t xx = ksensLength * (-knPCB4[i]/2.+j+.5);
998 Float_t zPanel = spar[2] - panelpar[2];
999 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1000 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1001 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1002 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1004 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1005 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1009 // position the rohacell volume inside the panel volume
1010 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1011 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1013 // position the PCB volume inside the insulating material volume
1014 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1015 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1016 // position the horizontal frame volume inside the PCB volume
1017 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1018 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1019 // position the sensitive volume inside the horizontal frame volume
1020 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1021 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
1022 // position the border volumes inside the PCB volume
1023 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
1024 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1025 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1026 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1027 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1029 // create the NULOC volume and position it in the horizontal frame
1031 gMC->Gsvolu("S07N","BOX",knulocMaterial,nulocpar,3);
1032 gMC->Gsvolu("S08N","BOX",knulocMaterial,nulocpar,3);
1034 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
1036 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1037 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1038 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1039 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1042 // position the volumes approximating the circular section of the pipe
1043 Float_t yoffs = ksensHeight/2. - kyOverlap;
1044 Float_t epsilon = 0.001;
1047 Double_t dydiv= ksensHeight/ndiv;
1048 Double_t ydiv = yoffs -dydiv;
1052 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1053 for (Int_t idiv=0;idiv<ndiv; idiv++){
1056 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1057 divpar[0] = (kpcbLength-xdiv)/2.;
1058 divpar[1] = dydiv/2. - epsilon;
1059 divpar[2] = ksensWidth/2.;
1060 Float_t xvol=(kpcbLength+xdiv)/2.+1.999;
1061 Float_t yvol=ydiv + dydiv/2.;
1062 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1063 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1064 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1065 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1066 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M", xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1067 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M", xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1068 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M", xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1069 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M", xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1081 //********************************************************************
1083 //********************************************************************
1084 // indices 1 and 2 for first and second chambers in the station
1085 // iChamber (first chamber) kept for other quanties than Z,
1086 // assumed to be the same in both chambers
1087 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1088 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1089 zpos1=iChamber1->Z();
1090 zpos2=iChamber2->Z();
1091 dstation = TMath::Abs(zpos2 - zpos1);
1092 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1096 tpar[0] = iChamber->RInner()-dframep;
1097 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1098 tpar[2] = dstation/5.;
1100 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1101 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1102 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1103 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1106 const Int_t knSlats5 = 7; // number of slats per quadrant
1107 const Int_t knPCB5[knSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1108 const Float_t kxpos5[knSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1109 Float_t slatLength5[knSlats5];
1115 for (i = 0; i<knSlats5; i++){
1116 slatLength5[i] = kpcbLength * knPCB5[i] + 2. * kdSlatLength;
1117 xSlat5 = slatLength5[i]/2. - kvFrameLength/2. +kxpos5[i];
1118 if (i==1 || i==0) slatLength5[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
1119 ySlat5 = ksensHeight * i - kyOverlap * i;
1120 spar[0] = slatLength5[i]/2.;
1121 spar[1] = kslatHeight/2.;
1122 spar[2] = kslatWidth/2. * 1.01;
1123 Float_t dzCh5=spar[2]*1.01;
1124 // zSlat to be checked (odd downstream or upstream?)
1125 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1126 sprintf(volNam9,"S09%d",i);
1127 gMC->Gsvolu(volNam9,"BOX",kslatMaterial,spar,3);
1128 gMC->Gspos(volNam9, i*4+1,"S09M",-xSlat5, ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1129 gMC->Gspos(volNam9, i*4+2,"S09M",+xSlat5, ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1131 gMC->Gspos(volNam9, i*4+3,"S09M",-xSlat5,-ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1132 gMC->Gspos(volNam9, i*4+4,"S09M",+xSlat5,-ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1134 sprintf(volNam10,"S10%d",i);
1135 gMC->Gsvolu(volNam10,"BOX",kslatMaterial,spar,3);
1136 gMC->Gspos(volNam10, i*4+1,"S10M",-xSlat5, ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1137 gMC->Gspos(volNam10, i*4+2,"S10M",+xSlat5, ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1139 gMC->Gspos(volNam10, i*4+3,"S10M",-xSlat5,-ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1140 gMC->Gspos(volNam10, i*4+4,"S10M",+xSlat5,-ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1144 // create the panel volume
1146 gMC->Gsvolu("S09C","BOX",kpanelMaterial,panelpar,3);
1147 gMC->Gsvolu("S10C","BOX",kpanelMaterial,panelpar,3);
1149 // create the rohacell volume
1151 gMC->Gsvolu("S09R","BOX",krohaMaterial,rohapar,3);
1152 gMC->Gsvolu("S10R","BOX",krohaMaterial,rohapar,3);
1154 // create the insulating material volume
1156 gMC->Gsvolu("S09I","BOX",kinsuMaterial,insupar,3);
1157 gMC->Gsvolu("S10I","BOX",kinsuMaterial,insupar,3);
1159 // create the PCB volume
1161 gMC->Gsvolu("S09P","BOX",kpcbMaterial,pcbpar,3);
1162 gMC->Gsvolu("S10P","BOX",kpcbMaterial,pcbpar,3);
1164 // create the sensitive volumes,
1166 gMC->Gsvolu("S09G","BOX",ksensMaterial,dum,0);
1167 gMC->Gsvolu("S10G","BOX",ksensMaterial,dum,0);
1169 // create the vertical frame volume
1171 gMC->Gsvolu("S09V","BOX",kvFrameMaterial,vFramepar,3);
1172 gMC->Gsvolu("S10V","BOX",kvFrameMaterial,vFramepar,3);
1174 // create the horizontal frame volume
1176 gMC->Gsvolu("S09H","BOX",khFrameMaterial,hFramepar,3);
1177 gMC->Gsvolu("S10H","BOX",khFrameMaterial,hFramepar,3);
1179 // create the horizontal border volume
1181 gMC->Gsvolu("S09B","BOX",kbFrameMaterial,bFramepar,3);
1182 gMC->Gsvolu("S10B","BOX",kbFrameMaterial,bFramepar,3);
1185 for (i = 0; i<knSlats5; i++){
1186 sprintf(volNam9,"S09%d",i);
1187 sprintf(volNam10,"S10%d",i);
1188 Float_t xvFrame = (slatLength5[i] - kvFrameLength)/2.;
1189 // position the vertical frames
1191 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1192 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1193 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1194 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1197 // position the panels and the insulating material
1198 for (j=0; j<knPCB5[i]; j++){
1200 Float_t xx = ksensLength * (-knPCB5[i]/2.+j+.5);
1202 Float_t zPanel = spar[2] - panelpar[2];
1203 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1204 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1205 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1206 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1208 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1209 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1213 // position the rohacell volume inside the panel volume
1214 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1215 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1217 // position the PCB volume inside the insulating material volume
1218 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1219 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1220 // position the horizontal frame volume inside the PCB volume
1221 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1222 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1223 // position the sensitive volume inside the horizontal frame volume
1224 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1225 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1226 // position the border volumes inside the PCB volume
1227 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
1228 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1229 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1230 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1231 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1233 // create the NULOC volume and position it in the horizontal frame
1235 gMC->Gsvolu("S09N","BOX",knulocMaterial,nulocpar,3);
1236 gMC->Gsvolu("S10N","BOX",knulocMaterial,nulocpar,3);
1238 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
1240 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1241 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1242 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1243 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1245 // position the volumes approximating the circular section of the pipe
1246 Float_t yoffs = ksensHeight/2. - kyOverlap;
1247 Float_t epsilon = 0.001;
1250 Double_t dydiv= ksensHeight/ndiv;
1251 Double_t ydiv = yoffs -dydiv;
1253 // for (Int_t islat=0; islat<knSlats3; islat++) imax += knPCB3[islat];
1256 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1257 for (Int_t idiv=0;idiv<ndiv; idiv++){
1260 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1261 divpar[0] = (kpcbLength-xdiv)/2.;
1262 divpar[1] = dydiv/2. - epsilon;
1263 divpar[2] = ksensWidth/2.;
1264 Float_t xvol=(kpcbLength+xdiv)/2. + 1.999;
1265 Float_t yvol=ydiv + dydiv/2.;
1266 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1267 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1268 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1269 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1270 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M", +xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1271 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M", +xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1272 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M", +xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1273 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M", +xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1278 //********************************************************************
1280 //********************************************************************
1282 zpos1 and zpos2 are the middle of the first and second
1283 planes of station 1 (+1m for second station):
1284 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
1285 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
1286 zposxm and zposxp= middles of gaz gaps within a detection plane
1287 rem: the total thickness accounts for 1 mm of al on both
1288 side of the RPCs (see zpos1 and zpos2)
1291 // vertical gap between right and left chambers (kDXZERO*2=4cm)
1292 const Float_t kDXZERO=2.;
1293 // main distances for chamber definition in first plane/first station
1294 const Float_t kXMIN=34.;
1295 const Float_t kXMED=51.;
1296 const Float_t kXMAX=272.;
1297 // kXMAX will become 255. in real life. segmentation to be updated accordingly
1298 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
1299 const Float_t kYMIN=34.;
1300 const Float_t kYMAX=51.;
1301 // inner/outer radius of flange between beam shield. and chambers (1/station)
1302 const Float_t kRMIN[2]={50.,50.};
1303 const Float_t kRMAX[2]={64.,68.};
1304 // z position of the middle of the gas gap in mother vol
1305 const Float_t kZm=-3.6;
1306 const Float_t kZp=+3.6;
1308 iChamber1 = (AliMUONChamber*) (*fChambers)[10];
1309 zpos1 = iChamber1->Z();
1311 // ratio of zpos1m/zpos1p and inverse for first plane
1312 Float_t zmp=(zpos1+3.6)/(zpos1-3.6);
1315 Int_t icount=0; // chamber counter (0 1 2 3)
1317 for (Int_t istation=0; istation<2; istation++) { // loop on stations
1318 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
1320 Int_t iVolNum=1; // counter Volume Number
1321 icount = Int_t(iplane*TMath::Power(2,0))+
1322 Int_t(istation*TMath::Power(2,1));
1325 sprintf(volPlane,"SM%d%d",istation+1,iplane+1);
1327 iChamber = (AliMUONChamber*) (*fChambers)[10+icount];
1328 Float_t zpos = iChamber->Z();
1331 tpar[0] = iChamber->RInner();
1332 tpar[1] = iChamber->ROuter();
1334 gMC->Gsvolu(volPlane,"TUBE",idAir,tpar,3);
1336 // Flange between beam shielding and RPC
1337 tpar[0]= kRMIN[istation];
1338 tpar[1]= kRMAX[istation];
1342 sprintf(volFlange,"SF%dA",icount+1);
1343 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); //Al
1344 gMC->Gspos(volFlange,1,volPlane,0.,0.,0.,0,"MANY");
1347 Float_t zRatio = zpos / zpos1;
1349 // chamber prototype
1354 char volAlu[5]; // Alu
1355 char volBak[5]; // Bakelite
1356 char volGaz[5]; // Gas streamer
1358 sprintf(volAlu,"SC%dA",icount+1);
1359 sprintf(volBak,"SB%dA",icount+1);
1360 sprintf(volGaz,"SG%dA",icount+1);
1362 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
1363 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
1364 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
1370 Float_t xA=(kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
1375 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
1377 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
1380 tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
1381 tpar[1] = kYMIN*zRatio;
1383 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xA,yAm,-kZm,0,"ONLY",tpar,3);
1384 gMC->Gsposp(volAlu,iVolNum++,volPlane, xA,yAp,-kZp,0,"ONLY",tpar,3);
1385 gMC->Gsbool(volAlu,volFlange);
1388 Float_t tpar1save=tpar[1];
1389 Float_t y1msave=yAm;
1390 Float_t y1psave=yAp;
1392 tpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
1393 tpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
1395 Float_t xB=(kDXZERO+kXMIN)*zRatio+tpar[0];
1396 Float_t yBp=(y1msave+tpar1save)*zpm+tpar[1];
1397 Float_t yBm=(y1psave+tpar1save)*zmp+tpar[1];
1399 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xB, yBp,-kZp,0,"ONLY",tpar,3);
1400 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB, yBm,-kZm,0,"ONLY",tpar,3);
1401 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xB,-yBp,-kZp,0,"ONLY",tpar,3);
1402 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB,-yBm,-kZm,0,"ONLY",tpar,3);
1404 // chamber type C (note : same Z than type B)
1409 tpar[0] = (kXMAX/2)*zRatio;
1410 tpar[1] = (kYMAX/2)*zRatio;
1412 Float_t xC=kDXZERO*zRatio+tpar[0];
1413 Float_t yCp=(y1psave+tpar1save)*1.+tpar[1];
1414 Float_t yCm=(y1msave+tpar1save)*1.+tpar[1];
1416 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC, yCp,-kZp,0,"ONLY",tpar,3);
1417 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC, yCm,-kZm,0,"ONLY",tpar,3);
1418 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC,-yCp,-kZp,0,"ONLY",tpar,3);
1419 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC,-yCm,-kZm,0,"ONLY",tpar,3);
1421 // chamber type D, E and F (same size)
1426 tpar[0] = (kXMAX/2.)*zRatio;
1427 tpar[1] = kYMIN*zRatio;
1429 Float_t xD=kDXZERO*zRatio+tpar[0];
1430 Float_t yDp=(y1msave+tpar1save)*zpm+tpar[1];
1431 Float_t yDm=(y1psave+tpar1save)*zmp+tpar[1];
1433 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yDm,-kZm,0,"ONLY",tpar,3);
1434 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yDp,-kZp,0,"ONLY",tpar,3);
1435 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yDm,-kZm,0,"ONLY",tpar,3);
1436 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yDp,-kZp,0,"ONLY",tpar,3);
1441 Float_t yEp=(y1msave+tpar1save)*zpm+tpar[1];
1442 Float_t yEm=(y1psave+tpar1save)*zmp+tpar[1];
1444 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yEp,-kZp,0,"ONLY",tpar,3);
1445 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yEm,-kZm,0,"ONLY",tpar,3);
1446 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yEp,-kZp,0,"ONLY",tpar,3);
1447 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yEm,-kZm,0,"ONLY",tpar,3);
1452 Float_t yFp=(y1msave+tpar1save)*zpm+tpar[1];
1453 Float_t yFm=(y1psave+tpar1save)*zmp+tpar[1];
1455 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yFm,-kZm,0,"ONLY",tpar,3);
1456 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yFp,-kZp,0,"ONLY",tpar,3);
1457 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yFm,-kZm,0,"ONLY",tpar,3);
1458 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yFp,-kZp,0,"ONLY",tpar,3);
1460 // Positioning plane in ALICE
1461 gMC->Gspos(volPlane,1,"ALIC",0.,0.,zpos,0,"ONLY");
1463 } // end loop on detection planes
1464 } // end loop on stations
1469 //___________________________________________
1470 void AliMUONv3::CreateMaterials()
1472 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1474 // Ar-CO2 gas (80%+20%)
1475 Float_t ag1[3] = { 39.95,12.01,16. };
1476 Float_t zg1[3] = { 18.,6.,8. };
1477 Float_t wg1[3] = { .8,.0667,.13333 };
1478 Float_t dg1 = .001821;
1480 // Ar-buthane-freon gas -- trigger chambers
1481 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1482 Float_t ztr1[4] = { 18.,6.,1.,9. };
1483 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1484 Float_t dtr1 = .002599;
1487 Float_t agas[3] = { 39.95,12.01,16. };
1488 Float_t zgas[3] = { 18.,6.,8. };
1489 Float_t wgas[3] = { .74,.086684,.173316 };
1490 Float_t dgas = .0018327;
1492 // Ar-Isobutane gas (80%+20%) -- tracking
1493 Float_t ag[3] = { 39.95,12.01,1.01 };
1494 Float_t zg[3] = { 18.,6.,1. };
1495 Float_t wg[3] = { .8,.057,.143 };
1496 Float_t dg = .0019596;
1498 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1499 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1500 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1501 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1502 Float_t dtrig = .0031463;
1506 Float_t abak[3] = {12.01 , 1.01 , 16.};
1507 Float_t zbak[3] = {6. , 1. , 8.};
1508 Float_t wbak[3] = {6. , 6. , 1.};
1511 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1513 Int_t iSXFLD = gAlice->Field()->Integ();
1514 Float_t sXMGMX = gAlice->Field()->Max();
1516 // --- Define the various materials for GEANT ---
1517 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1518 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1519 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1520 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1521 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1522 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1523 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1524 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1525 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1526 // materials for slat:
1527 // Sensitive area: gas (already defined)
1529 // insulating material and frame: vetronite
1530 // walls: carbon, rohacell, carbon
1531 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1532 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1533 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1534 Float_t dglass=1.74;
1536 // rohacell: C9 H13 N1 O2
1537 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1538 Float_t zrohac[4] = { 6., 1., 7., 8.};
1539 Float_t wrohac[4] = { 9., 13., 1., 2.};
1540 Float_t drohac = 0.03;
1542 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1543 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1544 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1545 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1548 epsil = .001; // Tracking precision,
1549 stemax = -1.; // Maximum displacement for multiple scat
1550 tmaxfd = -20.; // Maximum angle due to field deflection
1551 deemax = -.3; // Maximum fractional energy loss, DLS
1555 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1559 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1560 fMaxDestepAlu, epsil, stmin);
1561 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1562 fMaxDestepAlu, epsil, stmin);
1566 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1567 fMaxDestepGas, epsil, stmin);
1569 // Ar-Isobuthane-Forane-SF6 gas
1571 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1573 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1574 fMaxDestepAlu, epsil, stmin);
1576 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1577 fMaxDestepAlu, epsil, stmin);
1578 // tracking media for slats: check the parameters!!
1579 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1580 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1581 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1582 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1583 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1584 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1585 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1586 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1589 //___________________________________________
1591 void AliMUONv3::Init()
1594 // Initialize Tracking Chambers
1597 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
1599 for (i=0; i<AliMUONConstants::NCh(); i++) {
1600 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1604 // Set the chamber (sensitive region) GEANT identifier
1605 ((AliMUONChamber*)(*fChambers)[0])->GetGeometry()->SetSensitiveVolume("S01G");
1606 ((AliMUONChamber*)(*fChambers)[1])->GetGeometry()->SetSensitiveVolume("S02G");
1608 ((AliMUONChamber*)(*fChambers)[2])->GetGeometry()->SetSensitiveVolume("S03G");
1609 ((AliMUONChamber*)(*fChambers)[3])->GetGeometry()->SetSensitiveVolume("S04G");
1611 ((AliMUONChamber*)(*fChambers)[4])->GetGeometry()->SetSensitiveVolume("S05G");
1612 ((AliMUONChamber*)(*fChambers)[5])->GetGeometry()->SetSensitiveVolume("S06G");
1614 ((AliMUONChamber*)(*fChambers)[6])->GetGeometry()->SetSensitiveVolume("S07G");
1615 ((AliMUONChamber*)(*fChambers)[7])->GetGeometry()->SetSensitiveVolume("S08G");
1617 ((AliMUONChamber*)(*fChambers)[8])->GetGeometry()->SetSensitiveVolume("S09G");
1618 ((AliMUONChamber*)(*fChambers)[9])->GetGeometry()->SetSensitiveVolume("S10G");
1620 ((AliMUONChamber*)(*fChambers)[10])->GetGeometry()->SetSensitiveVolume("SG1A");
1621 ((AliMUONChamber*)(*fChambers)[11])->GetGeometry()->SetSensitiveVolume("SG2A");
1622 ((AliMUONChamber*)(*fChambers)[12])->GetGeometry()->SetSensitiveVolume("SG3A");
1623 ((AliMUONChamber*)(*fChambers)[13])->GetGeometry()->SetSensitiveVolume("SG4A");
1625 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
1628 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
1629 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1630 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1632 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
1637 //_______________________________________________________________________________
1638 Int_t AliMUONv3::GetChamberId(Int_t volId) const
1640 // Check if the volume with specified volId is a sensitive volume (gas)
1641 // of some chamber and returns the chamber number;
1642 // if not sensitive volume - return 0.
1645 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
1646 if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i;
1650 //_______________________________________________________________________________
1651 void AliMUONv3::StepManager()
1653 // Stepmanager for the chambers
1655 if (fStepManagerVersionOld) {
1660 // Only charged tracks
1661 if( !(gMC->TrackCharge()) ) return;
1662 // Only charged tracks
1664 // Only gas gap inside chamber
1665 // Tag chambers and record hits when track enters
1670 const Float_t kBig = 1.e10;
1672 id=gMC->CurrentVolID(copy);
1673 iChamber = GetChamberId(id);
1674 idvol=GetChamberId(id)-1;
1676 if (idvol == -1) return;
1678 if( gMC->IsTrackEntering() ) {
1679 Float_t theta = fTrackMomentum.Theta();
1680 if ((TMath::Pi()-theta)*kRaddeg>=15.) gMC->SetMaxStep(fStepMaxInActiveGas); // We use Pi-theta because z is negative
1683 // if (GetDebug()) {
1684 // Float_t z = ( (AliMUONChamber*)(*fChambers)[idvol])->Z() ;
1685 // Info("StepManager Step","Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber, z);
1687 // Particule id and mass,
1688 Int_t ipart = gMC->TrackPid();
1689 Float_t mass = gMC->TrackMass();
1691 fDestepSum[idvol]+=gMC->Edep();
1692 // Get current particle id (ipart), track position (pos) and momentum (mom)
1693 if ( fStepSum[idvol]==0.0 ) gMC->TrackMomentum(fTrackMomentum);
1694 fStepSum[idvol]+=gMC->TrackStep();
1696 // if (GetDebug()) {
1697 // Info("StepManager Step","iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
1698 // iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg, mass, fStepSum[idvol], gMC->Edep());
1699 // Info("StepManager Step","Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), fTrackMomentum.Z()) ;
1700 // gMC->TrackPosition(fTrackPosition);
1701 // Info("StepManager Step","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1704 // Track left chamber or StepSum larger than fStepMaxInActiveGas
1705 if ( gMC->IsTrackExiting() ||
1706 gMC->IsTrackStop() ||
1707 gMC->IsTrackDisappeared()||
1708 (fStepSum[idvol]>fStepMaxInActiveGas) ) {
1710 if ( gMC->IsTrackExiting() ||
1711 gMC->IsTrackStop() ||
1712 gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
1714 gMC->TrackPosition(fTrackPosition);
1715 Float_t theta = fTrackMomentum.Theta();
1716 Float_t phi = fTrackMomentum.Phi();
1718 TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
1719 fStepSum[idvol]/2.*sin(theta)*sin(phi),
1720 fStepSum[idvol]/2.*cos(theta),0.0 );
1722 // Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1724 // Info("StepManager Exit ","Track backToWire %f %f %f",backToWire.X(),backToWire.Y(),backToWire.Z()) ;
1725 fTrackPosition-=backToWire;
1727 //-------------- Angle effect
1728 // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
1730 Float_t BetaxGamma = fTrackMomentum.P()/mass;// pc/mc2
1731 Float_t sigmaEffect10degrees;
1732 Float_t sigmaEffectThetadegrees;
1733 Float_t eLossParticleELossMip;
1734 Float_t yAngleEffect=0.;
1735 Float_t thetawires = TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
1739 if ( (BetaxGamma >3.2) && (thetawires*kRaddeg<=15.) ) {
1740 BetaxGamma=TMath::Log(BetaxGamma);
1741 eLossParticleELossMip = fElossRatio->Eval(BetaxGamma);
1742 // 10 degrees is a reference for a model (arbitrary)
1743 sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
1744 // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
1745 sigmaEffectThetadegrees = sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg); // For 5mm gap
1746 if ( (iChamber==1) || (iChamber==2) )
1747 sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
1748 yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
1752 // One hit per chamber
1753 GetMUONData()->AddHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), iChamber, ipart,
1754 fTrackPosition.X(), fTrackPosition.Y()+yAngleEffect, fTrackPosition.Z(), 0.0,
1755 fTrackMomentum.P(),theta, phi, fStepSum[idvol], fDestepSum[idvol],
1756 fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z());
1758 // Info("StepManager Exit","Particle exiting from chamber %d",iChamber);
1759 // Info("StepManager Exit","StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]);
1760 // Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1762 fStepSum[idvol] =0; // Reset for the next event
1763 fDestepSum[idvol]=0; // Reset for the next event
1767 //__________________________________________
1768 void AliMUONv3::StepManagerOld()
1770 // Old Stepmanager for the chambers
1773 static Int_t vol[2];
1778 Float_t destep, step;
1780 static Float_t sstep;
1781 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1782 const Float_t kBig = 1.e10;
1783 static Float_t hits[15];
1785 TClonesArray &lhits = *fHits;
1789 // Only charged tracks
1790 if( !(gMC->TrackCharge()) ) return;
1792 // Only gas gap inside chamber
1793 // Tag chambers and record hits when track enters
1794 id=gMC->CurrentVolID(copy);
1795 vol[0] = GetChamberId(id);
1798 if (idvol == -1) return;
1801 // Get current particle id (ipart), track position (pos) and momentum (mom)
1802 gMC->TrackPosition(pos);
1803 gMC->TrackMomentum(mom);
1805 ipart = gMC->TrackPid();
1808 // momentum loss and steplength in last step
1809 destep = gMC->Edep();
1810 step = gMC->TrackStep();
1811 // cout<<"------------"<<step<<endl;
1813 // record hits when track enters ...
1814 if( gMC->IsTrackEntering()) {
1816 gMC->SetMaxStep(fMaxStepGas);
1817 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1818 Double_t rt = TMath::Sqrt(tc);
1819 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1820 Double_t tx = mom[0]/pmom;
1821 Double_t ty = mom[1]/pmom;
1822 Double_t tz = mom[2]/pmom;
1823 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
1826 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1827 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1828 hits[0] = Float_t(ipart); // Geant3 particle type
1829 hits[1] = pos[0]+s*tx; // X-position for hit
1830 hits[2] = pos[1]+s*ty; // Y-position for hit
1831 hits[3] = pos[2]+s*tz; // Z-position for hit
1832 hits[4] = theta; // theta angle of incidence
1833 hits[5] = phi; // phi angle of incidence
1834 hits[8] = 0;//PadHits does not exist anymore (Float_t) fNPadHits; // first padhit
1835 hits[9] = -1; // last pad hit
1836 hits[10] = mom[3]; // hit momentum P
1837 hits[11] = mom[0]; // Px
1838 hits[12] = mom[1]; // Py
1839 hits[13] = mom[2]; // Pz
1840 tof=gMC->TrackTime();
1841 hits[14] = tof; // Time of flight
1849 Chamber(idvol).ChargeCorrelationInit();
1850 // Only if not trigger chamber
1852 // printf("---------------------------\n");
1853 // printf(">>>> Y = %f \n",hits[2]);
1854 // printf("---------------------------\n");
1858 // if(idvol < AliMUONConstants::NTrackingCh()) {
1860 // // Initialize hit position (cursor) in the segmentation model
1861 // ((AliMUONChamber*) (*fChambers)[idvol])
1862 // ->SigGenInit(pos[0], pos[1], pos[2]);
1864 // //geant3->Gpcxyz();
1865 // //printf("In the Trigger Chamber #%d\n",idvol-9);
1871 // cout<<sstep<<endl;
1874 // Calculate the charge induced on a pad (disintegration) in case
1876 // Mip left chamber ...
1877 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1878 gMC->SetMaxStep(kBig);
1883 Float_t localPos[3];
1884 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1885 gMC->Gmtod(globalPos,localPos,1);
1887 if(idvol < AliMUONConstants::NTrackingCh()) {
1888 // tracking chambers
1889 x0 = 0.5*(xhit+pos[0]);
1890 y0 = 0.5*(yhit+pos[1]);
1891 z0 = 0.5*(zhit+pos[2]);
1900 // if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
1903 hits[6] = tlength; // track length
1904 hits[7] = eloss2; // de/dx energy loss
1907 // if (fNPadHits > (Int_t)hits[8]) {
1908 // hits[8] = hits[8]+1;
1909 // hits[9] = 0: // PadHits does not exist anymore (Float_t) fNPadHits;
1914 new(lhits[fNhits++])
1915 AliMUONHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1918 // Check additional signal generation conditions
1919 // defined by the segmentation
1920 // model (boundary crossing conditions)
1921 // only for tracking chambers
1923 ((idvol < AliMUONConstants::NTrackingCh()) &&
1924 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
1926 ((AliMUONChamber*) (*fChambers)[idvol])
1927 ->SigGenInit(pos[0], pos[1], pos[2]);
1929 Float_t localPos[3];
1930 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1931 gMC->Gmtod(globalPos,localPos,1);
1935 // if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1936 // MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
1943 // nothing special happened, add up energy loss