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>
33 #include <TVirtualMC.h>
35 #include "AliMUONv3.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"
49 //___________________________________________
50 AliMUONv3::AliMUONv3()
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),
69 fTrackMomentum(), fTrackPosition()
72 // By default include all stations
73 fStations = new Int_t[5];
74 for (Int_t i=0; i<5; i++) fStations[i] = 1;
76 AliMUONFactory factory;
77 factory.Build(this, title);
79 fStepManagerVersionOld = kFALSE;
81 fStepMaxInActiveGas = 0.6;
83 fStepSum = new Float_t [AliMUONConstants::NCh()];
84 fDestepSum = new Float_t [AliMUONConstants::NCh()];
85 for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
89 // Ratio of particle mean eloss with respect MIP's Khalil Boudjemline, sep 2003, PhD.Thesis and Particle Data Book
90 fElossRatio = new TF1("ElossRatio","[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x",0.5,5.);
91 fElossRatio->SetParameter(0,1.02138);
92 fElossRatio->SetParameter(1,-9.54149e-02);
93 fElossRatio->SetParameter(2,+7.83433e-02);
94 fElossRatio->SetParameter(3,-9.98208e-03);
95 fElossRatio->SetParameter(4,+3.83279e-04);
97 // Angle effect in tracking chambers at theta =10 degres as a function of ElossRatio (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) (in micrometers)
98 fAngleEffect10 = new TF1("AngleEffect10","[0]+[1]*x+[2]*x*x",0.5,3.0);
99 fAngleEffect10->SetParameter(0, 1.90691e+02);
100 fAngleEffect10->SetParameter(1,-6.62258e+01);
101 fAngleEffect10->SetParameter(2,+1.28247e+01);
102 // Angle effect: Normalisation form theta=10 degres to theta between 0 and 10 (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis)
103 // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
104 fAngleEffectNorma = new TF1("AngleEffectNorma","[0]+[1]*x+[2]*x*x+[3]*x*x*x",0.0,10.0);
105 fAngleEffectNorma->SetParameter(0,4.148);
106 fAngleEffectNorma->SetParameter(1,-6.809e-01);
107 fAngleEffectNorma->SetParameter(2,5.151e-02);
108 fAngleEffectNorma->SetParameter(3,-1.490e-03);
111 //_____________________________________________________________________________
112 AliMUONv3::AliMUONv3(const AliMUONv3& right)
115 // copy constructor (not implemented)
117 Fatal("AliMUONv3", "Copy constructor not provided.");
120 //_____________________________________________________________________________
121 AliMUONv3& AliMUONv3::operator=(const AliMUONv3& right)
123 // assignement operator (not implemented)
125 // check assignement to self
126 if (this == &right) return *this;
128 Fatal("operator =", "Assignement operator not provided.");
133 //___________________________________________
134 void AliMUONv3::CreateGeometry()
137 // Note: all chambers have the same structure, which could be
138 // easily parameterised. This was intentionally not done in order
139 // to give a starting point for the implementation of the actual
140 // design of each station.
141 Int_t *idtmed = fIdtmed->GetArray()-1099;
143 // Distance between Stations
147 // Float_t pgpar[10];
148 Float_t zpos1, zpos2, zfpos;
149 // Outer excess and inner recess for mother volume radius
150 // with respect to ROuter and RInner
151 Float_t dframep=.001; // Value for station 3 should be 6 ...
152 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
153 // Float_t dframep1=.001;
154 Float_t dframep1 = 11.0;
155 // Bool_t frameCrosses=kFALSE;
156 Bool_t frameCrosses=kTRUE;
159 // Float_t dframez=0.9;
160 // Half of the total thickness of frame crosses (including DAlu)
161 // for each chamber in stations 1 and 2:
162 // 3% of X0 of composite material,
163 // but taken as Aluminium here, with same thickness in number of X0
164 Float_t dframez = 3. * 8.9 / 100;
169 // Rotation matrices in the x-y plane
172 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
174 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
176 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
178 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
180 Float_t phi=2*TMath::Pi()/12/2;
183 // pointer to the current chamber
184 // pointer to the current chamber
185 Int_t idAlu1=idtmed[1103]; // medium 4
186 Int_t idAlu2=idtmed[1104]; // medium 5
187 // Int_t idAlu1=idtmed[1100];
188 // Int_t idAlu2=idtmed[1100];
189 Int_t idAir=idtmed[1100]; // medium 1
190 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
191 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
194 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
198 //********************************************************************
200 //********************************************************************
202 // indices 1 and 2 for first and second chambers in the station
203 // iChamber (first chamber) kept for other quanties than Z,
204 // assumed to be the same in both chambers
205 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
206 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
207 zpos1=iChamber1->Z();
208 zpos2=iChamber2->Z();
209 dstation = TMath::Abs(zpos2 - zpos1);
210 // DGas decreased from standard one (0.5)
211 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
212 // DAlu increased from standard one (3% of X0),
213 // because more electronics with smaller pads
214 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
215 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
219 tpar[0] = iChamber->RInner()-dframep;
220 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
221 tpar[2] = dstation/5;
223 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
224 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
225 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
226 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
227 // // Aluminium frames
229 // pgpar[0] = 360/12/2;
233 // pgpar[4] = -dframez/2;
234 // pgpar[5] = iChamber->ROuter();
235 // pgpar[6] = pgpar[5]+dframep1;
236 // pgpar[7] = +dframez/2;
237 // pgpar[8] = pgpar[5];
238 // pgpar[9] = pgpar[6];
239 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
240 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
241 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
242 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
243 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
244 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
247 // tpar[0]= iChamber->RInner()-dframep1;
248 // tpar[1]= iChamber->RInner();
249 // tpar[2]= dframez/2;
250 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
251 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
253 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
254 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
255 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
256 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
261 // security for inside mother volume
262 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
263 * TMath::Cos(TMath::ASin(dframep1 /
264 (iChamber->ROuter() - iChamber->RInner())))
266 bpar[1] = dframep1/2;
267 // total thickness will be (4 * bpar[2]) for each chamber,
268 // which has to be equal to (2 * dframez) - DAlu
269 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
270 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
271 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
273 gMC->Gspos("S01B",1,"S01M", -iChamber->RInner()-bpar[0] , 0, zfpos,
274 idrotm[1100],"ONLY");
275 gMC->Gspos("S01B",2,"S01M", iChamber->RInner()+bpar[0] , 0, zfpos,
276 idrotm[1100],"ONLY");
277 gMC->Gspos("S01B",3,"S01M", 0, -iChamber->RInner()-bpar[0] , zfpos,
278 idrotm[1101],"ONLY");
279 gMC->Gspos("S01B",4,"S01M", 0, iChamber->RInner()+bpar[0] , zfpos,
280 idrotm[1101],"ONLY");
281 gMC->Gspos("S01B",5,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
282 idrotm[1100],"ONLY");
283 gMC->Gspos("S01B",6,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
284 idrotm[1100],"ONLY");
285 gMC->Gspos("S01B",7,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
286 idrotm[1101],"ONLY");
287 gMC->Gspos("S01B",8,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
288 idrotm[1101],"ONLY");
290 gMC->Gspos("S02B",1,"S02M", -iChamber->RInner()-bpar[0] , 0, zfpos,
291 idrotm[1100],"ONLY");
292 gMC->Gspos("S02B",2,"S02M", iChamber->RInner()+bpar[0] , 0, zfpos,
293 idrotm[1100],"ONLY");
294 gMC->Gspos("S02B",3,"S02M", 0, -iChamber->RInner()-bpar[0] , zfpos,
295 idrotm[1101],"ONLY");
296 gMC->Gspos("S02B",4,"S02M", 0, iChamber->RInner()+bpar[0] , zfpos,
297 idrotm[1101],"ONLY");
298 gMC->Gspos("S02B",5,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
299 idrotm[1100],"ONLY");
300 gMC->Gspos("S02B",6,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
301 idrotm[1100],"ONLY");
302 gMC->Gspos("S02B",7,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
303 idrotm[1101],"ONLY");
304 gMC->Gspos("S02B",8,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
305 idrotm[1101],"ONLY");
308 // Chamber Material represented by Alu sheet
309 tpar[0]= iChamber->RInner();
310 tpar[1]= iChamber->ROuter();
311 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
312 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
313 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
314 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
315 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
318 // tpar[2] = iChamber->DGas();
319 tpar[2] = iChamber->DGas()/2;
320 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
321 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
322 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
323 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
325 // Frame Crosses to be placed inside gas
326 // NONE: chambers are sensitive everywhere
327 // if (frameCrosses) {
329 // dr = (iChamber->ROuter() - iChamber->RInner());
330 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
331 // bpar[1] = dframep1/2;
332 // bpar[2] = iChamber->DGas()/2;
333 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
334 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
336 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
337 // idrotm[1100],"ONLY");
338 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
339 // idrotm[1100],"ONLY");
340 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
341 // idrotm[1101],"ONLY");
342 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
343 // idrotm[1101],"ONLY");
345 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
346 // idrotm[1100],"ONLY");
347 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
348 // idrotm[1100],"ONLY");
349 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
350 // idrotm[1101],"ONLY");
351 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
352 // idrotm[1101],"ONLY");
357 //********************************************************************
359 //********************************************************************
360 // indices 1 and 2 for first and second chambers in the station
361 // iChamber (first chamber) kept for other quanties than Z,
362 // assumed to be the same in both chambers
363 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
364 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
365 zpos1=iChamber1->Z();
366 zpos2=iChamber2->Z();
367 dstation = TMath::Abs(zpos2 - zpos1);
368 // DGas and DAlu not changed from standard values
369 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
373 tpar[0] = iChamber->RInner()-dframep;
374 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
375 tpar[2] = dstation/5;
377 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
378 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
379 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
380 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
381 gMC->Gsbool("S03M", "L3DO");
382 gMC->Gsbool("S03M", "L3O1");
383 gMC->Gsbool("S03M", "L3O2");
384 gMC->Gsbool("S04M", "L3DO");
385 gMC->Gsbool("S04M", "L3O1");
386 gMC->Gsbool("S04M", "L3O2");
388 // // Aluminium frames
390 // pgpar[0] = 360/12/2;
394 // pgpar[4] = -dframez/2;
395 // pgpar[5] = iChamber->ROuter();
396 // pgpar[6] = pgpar[5]+dframep;
397 // pgpar[7] = +dframez/2;
398 // pgpar[8] = pgpar[5];
399 // pgpar[9] = pgpar[6];
400 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
401 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
402 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
403 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
404 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
405 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
408 // tpar[0]= iChamber->RInner()-dframep;
409 // tpar[1]= iChamber->RInner();
410 // tpar[2]= dframez/2;
411 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
412 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
414 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
415 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
416 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
417 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
422 // security for inside mother volume
423 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
424 * TMath::Cos(TMath::ASin(dframep1 /
425 (iChamber->ROuter() - iChamber->RInner())))
427 bpar[1] = dframep1/2;
428 // total thickness will be (4 * bpar[2]) for each chamber,
429 // which has to be equal to (2 * dframez) - DAlu
430 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
431 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
432 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
434 gMC->Gspos("S03B",1,"S03M", -iChamber->RInner()-bpar[0] , 0, zfpos,
435 idrotm[1100],"ONLY");
436 gMC->Gspos("S03B",2,"S03M", +iChamber->RInner()+bpar[0] , 0, zfpos,
437 idrotm[1100],"ONLY");
438 gMC->Gspos("S03B",3,"S03M", 0, -iChamber->RInner()-bpar[0] , zfpos,
439 idrotm[1101],"ONLY");
440 gMC->Gspos("S03B",4,"S03M", 0, +iChamber->RInner()+bpar[0] , zfpos,
441 idrotm[1101],"ONLY");
442 gMC->Gspos("S03B",5,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
443 idrotm[1100],"ONLY");
444 gMC->Gspos("S03B",6,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
445 idrotm[1100],"ONLY");
446 gMC->Gspos("S03B",7,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
447 idrotm[1101],"ONLY");
448 gMC->Gspos("S03B",8,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
449 idrotm[1101],"ONLY");
451 gMC->Gspos("S04B",1,"S04M", -iChamber->RInner()-bpar[0] , 0, zfpos,
452 idrotm[1100],"ONLY");
453 gMC->Gspos("S04B",2,"S04M", +iChamber->RInner()+bpar[0] , 0, zfpos,
454 idrotm[1100],"ONLY");
455 gMC->Gspos("S04B",3,"S04M", 0, -iChamber->RInner()-bpar[0] , zfpos,
456 idrotm[1101],"ONLY");
457 gMC->Gspos("S04B",4,"S04M", 0, +iChamber->RInner()+bpar[0] , zfpos,
458 idrotm[1101],"ONLY");
459 gMC->Gspos("S04B",5,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
460 idrotm[1100],"ONLY");
461 gMC->Gspos("S04B",6,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
462 idrotm[1100],"ONLY");
463 gMC->Gspos("S04B",7,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
464 idrotm[1101],"ONLY");
465 gMC->Gspos("S04B",8,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
466 idrotm[1101],"ONLY");
469 // Chamber Material represented by Alu sheet
470 tpar[0]= iChamber->RInner();
471 tpar[1]= iChamber->ROuter();
472 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
473 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
474 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
475 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
476 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
479 // tpar[2] = iChamber->DGas();
480 tpar[2] = iChamber->DGas()/2;
481 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
482 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
483 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
484 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
486 // Frame Crosses to be placed inside gas
487 // NONE: chambers are sensitive everywhere
488 // if (frameCrosses) {
490 // dr = (iChamber->ROuter() - iChamber->RInner());
491 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
492 // bpar[1] = dframep1/2;
493 // bpar[2] = iChamber->DGas()/2;
494 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
495 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
497 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
498 // idrotm[1100],"ONLY");
499 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
500 // idrotm[1100],"ONLY");
501 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
502 // idrotm[1101],"ONLY");
503 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
504 // idrotm[1101],"ONLY");
506 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
507 // idrotm[1100],"ONLY");
508 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
509 // idrotm[1100],"ONLY");
510 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
511 // idrotm[1101],"ONLY");
512 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
513 // idrotm[1101],"ONLY");
516 // define the id of tracking media:
517 Int_t idCopper = idtmed[1110];
518 Int_t idGlass = idtmed[1111];
519 Int_t idCarbon = idtmed[1112];
520 Int_t idRoha = idtmed[1113];
522 // sensitive area: 40*40 cm**2
523 const Float_t ksensLength = 40.;
524 const Float_t ksensHeight = 40.;
525 const Float_t ksensWidth = 0.5; // according to TDR fig 2.120
526 const Int_t ksensMaterial = idGas;
527 const Float_t kyOverlap = 1.5;
529 // PCB dimensions in cm; width: 30 mum copper
530 const Float_t kpcbLength = ksensLength;
531 const Float_t kpcbHeight = 60.;
532 const Float_t kpcbWidth = 0.003;
533 const Int_t kpcbMaterial= idCopper;
535 // Insulating material: 200 mum glass fiber glued to pcb
536 const Float_t kinsuLength = kpcbLength;
537 const Float_t kinsuHeight = kpcbHeight;
538 const Float_t kinsuWidth = 0.020;
539 const Int_t kinsuMaterial = idGlass;
541 // Carbon fiber panels: 200mum carbon/epoxy skin
542 const Float_t kpanelLength = ksensLength;
543 const Float_t kpanelHeight = ksensHeight;
544 const Float_t kpanelWidth = 0.020;
545 const Int_t kpanelMaterial = idCarbon;
547 // rohacell between the two carbon panels
548 const Float_t krohaLength = ksensLength;
549 const Float_t krohaHeight = ksensHeight;
550 const Float_t krohaWidth = 0.5;
551 const Int_t krohaMaterial = idRoha;
553 // Frame around the slat: 2 sticks along length,2 along height
554 // H: the horizontal ones
555 const Float_t khFrameLength = kpcbLength;
556 const Float_t khFrameHeight = 1.5;
557 const Float_t khFrameWidth = ksensWidth;
558 const Int_t khFrameMaterial = idGlass;
560 // V: the vertical ones
561 const Float_t kvFrameLength = 4.0;
562 const Float_t kvFrameHeight = ksensHeight + khFrameHeight;
563 const Float_t kvFrameWidth = ksensWidth;
564 const Int_t kvFrameMaterial = idGlass;
566 // B: the horizontal border filled with rohacell
567 const Float_t kbFrameLength = khFrameLength;
568 const Float_t kbFrameHeight = (kpcbHeight - ksensHeight)/2. - khFrameHeight;
569 const Float_t kbFrameWidth = khFrameWidth;
570 const Int_t kbFrameMaterial = idRoha;
572 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
573 const Float_t knulocLength = 2.5;
574 const Float_t knulocHeight = 7.5;
575 const Float_t knulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
576 const Int_t knulocMaterial = idCopper;
578 const Float_t kslatHeight = kpcbHeight;
579 const Float_t kslatWidth = ksensWidth + 2.*(kpcbWidth + kinsuWidth +
580 2.* kpanelWidth + krohaWidth);
581 const Int_t kslatMaterial = idAir;
582 const Float_t kdSlatLength = kvFrameLength; // border on left and right
587 // the panel volume contains the rohacell
589 Float_t twidth = 2 * kpanelWidth + krohaWidth;
590 Float_t panelpar[3] = { kpanelLength/2., kpanelHeight/2., twidth/2. };
591 Float_t rohapar[3] = { krohaLength/2., krohaHeight/2., krohaWidth/2. };
593 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
595 twidth = 2*(kinsuWidth + kpcbWidth) + ksensWidth;
596 Float_t insupar[3] = { kinsuLength/2., kinsuHeight/2., twidth/2. };
597 twidth -= 2 * kinsuWidth;
598 Float_t pcbpar[3] = { kpcbLength/2., kpcbHeight/2., twidth/2. };
599 Float_t senspar[3] = { ksensLength/2., ksensHeight/2., ksensWidth/2. };
600 Float_t theight = 2*khFrameHeight + ksensHeight;
601 Float_t hFramepar[3]={khFrameLength/2., theight/2., khFrameWidth/2.};
602 Float_t bFramepar[3]={kbFrameLength/2., kbFrameHeight/2., kbFrameWidth/2.};
603 Float_t vFramepar[3]={kvFrameLength/2., kvFrameHeight/2., kvFrameWidth/2.};
604 Float_t nulocpar[3]={knulocLength/2., knulocHeight/2., knulocWidth/2.};
606 Float_t xxmax = (kbFrameLength - knulocLength)/2.;
611 //********************************************************************
613 //********************************************************************
614 // indices 1 and 2 for first and second chambers in the station
615 // iChamber (first chamber) kept for other quanties than Z,
616 // assumed to be the same in both chambers
617 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
618 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
619 zpos1=iChamber1->Z();
620 zpos2=iChamber2->Z();
621 dstation = TMath::Abs(zpos2 - zpos1);
625 tpar[0] = iChamber->RInner()-dframep;
626 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
627 tpar[2] = dstation/5;
629 const char *slats5Mother = "S05M";
630 const char *slats6Mother = "S06M";
634 if (gAlice->GetModule("DIPO")) {
638 zoffs5 = TMath::Abs(zpos1);
639 zoffs6 = TMath::Abs(zpos2);
643 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
644 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
645 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
646 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
649 // volumes for slat geometry (xx=5,..,10 chamber id):
650 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
651 // SxxG --> Sensitive volume (gas)
652 // SxxP --> PCB (copper)
653 // SxxI --> Insulator (vetronite)
654 // SxxC --> Carbon panel
656 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
657 // SB5x --> Volumes for the 35 cm long PCB
658 // slat dimensions: slat is a MOTHER volume!!! made of air
660 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
662 Float_t tlength = 35.;
663 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
664 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
665 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
666 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
667 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
668 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
669 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
671 const Int_t knSlats3 = 5; // number of slats per quadrant
672 const Int_t knPCB3[knSlats3] = {3,3,4,3,2}; // n PCB per slat
673 const Float_t kxpos3[knSlats3] = {31., 40., 0., 0., 0.};
674 Float_t slatLength3[knSlats3];
676 // create and position the slat (mother) volumes
683 for (i = 0; i<knSlats3; i++){
684 slatLength3[i] = kpcbLength * knPCB3[i] + 2. * kdSlatLength;
685 xSlat3 = slatLength3[i]/2. - kvFrameLength/2. + kxpos3[i];
686 if (i==1 || i==0) slatLength3[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
687 Float_t ySlat31 = ksensHeight * i - kyOverlap * i;
688 Float_t ySlat32 = -ksensHeight * i + kyOverlap * i;
689 spar[0] = slatLength3[i]/2.;
690 spar[1] = kslatHeight/2.;
691 spar[2] = kslatWidth/2. * 1.01;
692 // take away 5 cm from the first slat in chamber 5
694 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
695 spar2[0] = spar[0]-5./2.;
696 xSlat32 = xSlat3 - 5/2.;
704 Float_t dzCh3=spar[2] * 1.01;
705 // zSlat to be checked (odd downstream or upstream?)
706 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
708 if (gAlice->GetModule("DIPO")) {zSlat*=-1.;}
710 sprintf(volNam5,"S05%d",i);
711 gMC->Gsvolu(volNam5,"BOX",kslatMaterial,spar2,3);
712 gMC->Gspos(volNam5, i*4+1,slats5Mother, -xSlat32, ySlat31, zoffs5-zSlat-2.*dzCh3, 0, "ONLY");
713 gMC->Gspos(volNam5, i*4+2,slats5Mother, +xSlat32, ySlat31, zoffs5-zSlat+2.*dzCh3, 0, "ONLY");
716 gMC->Gspos(volNam5, i*4+3,slats5Mother,-xSlat32, ySlat32, zoffs5-zSlat-2.*dzCh3, 0, "ONLY");
717 gMC->Gspos(volNam5, i*4+4,slats5Mother,+xSlat32, ySlat32, zoffs5-zSlat+2.*dzCh3, 0, "ONLY");
719 sprintf(volNam6,"S06%d",i);
720 gMC->Gsvolu(volNam6,"BOX",kslatMaterial,spar,3);
721 gMC->Gspos(volNam6, i*4+1,slats6Mother,-xSlat3, ySlat31, zoffs6-zSlat-2.*dzCh3, 0, "ONLY");
722 gMC->Gspos(volNam6, i*4+2,slats6Mother,+xSlat3, ySlat31, zoffs6-zSlat+2.*dzCh3, 0, "ONLY");
724 gMC->Gspos(volNam6, i*4+3,slats6Mother,-xSlat3, ySlat32, zoffs6-zSlat-2.*dzCh3, 0, "ONLY");
725 gMC->Gspos(volNam6, i*4+4,slats6Mother,+xSlat3, ySlat32, zoffs6-zSlat+2.*dzCh3, 0, "ONLY");
729 // create the panel volume
731 gMC->Gsvolu("S05C","BOX",kpanelMaterial,panelpar,3);
732 gMC->Gsvolu("SB5C","BOX",kpanelMaterial,panelpar2,3);
733 gMC->Gsvolu("S06C","BOX",kpanelMaterial,panelpar,3);
735 // create the rohacell volume
737 gMC->Gsvolu("S05R","BOX",krohaMaterial,rohapar,3);
738 gMC->Gsvolu("SB5R","BOX",krohaMaterial,rohapar2,3);
739 gMC->Gsvolu("S06R","BOX",krohaMaterial,rohapar,3);
741 // create the insulating material volume
743 gMC->Gsvolu("S05I","BOX",kinsuMaterial,insupar,3);
744 gMC->Gsvolu("SB5I","BOX",kinsuMaterial,insupar2,3);
745 gMC->Gsvolu("S06I","BOX",kinsuMaterial,insupar,3);
747 // create the PCB volume
749 gMC->Gsvolu("S05P","BOX",kpcbMaterial,pcbpar,3);
750 gMC->Gsvolu("SB5P","BOX",kpcbMaterial,pcbpar2,3);
751 gMC->Gsvolu("S06P","BOX",kpcbMaterial,pcbpar,3);
753 // create the sensitive volumes,
754 gMC->Gsvolu("S05G","BOX",ksensMaterial,dum,0);
755 gMC->Gsvolu("S06G","BOX",ksensMaterial,dum,0);
758 // create the vertical frame volume
760 gMC->Gsvolu("S05V","BOX",kvFrameMaterial,vFramepar,3);
761 gMC->Gsvolu("S06V","BOX",kvFrameMaterial,vFramepar,3);
763 // create the horizontal frame volume
765 gMC->Gsvolu("S05H","BOX",khFrameMaterial,hFramepar,3);
766 gMC->Gsvolu("SB5H","BOX",khFrameMaterial,hFramepar2,3);
767 gMC->Gsvolu("S06H","BOX",khFrameMaterial,hFramepar,3);
769 // create the horizontal border volume
771 gMC->Gsvolu("S05B","BOX",kbFrameMaterial,bFramepar,3);
772 gMC->Gsvolu("SB5B","BOX",kbFrameMaterial,bFramepar2,3);
773 gMC->Gsvolu("S06B","BOX",kbFrameMaterial,bFramepar,3);
776 for (i = 0; i<knSlats3; i++){
777 sprintf(volNam5,"S05%d",i);
778 sprintf(volNam6,"S06%d",i);
779 Float_t xvFrame = (slatLength3[i] - kvFrameLength)/2.;
780 Float_t xvFrame2 = xvFrame;
781 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
782 // position the vertical frames
784 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
785 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
786 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
787 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
789 // position the panels and the insulating material
790 for (j=0; j<knPCB3[i]; j++){
792 Float_t xx = ksensLength * (-knPCB3[i]/2.+j+.5);
793 Float_t xx2 = xx + 5/2.;
795 Float_t zPanel = spar[2] - panelpar[2];
796 if ( (i==1 || i==2) && j == knPCB3[i]-1) { // 1 pcb is shortened by 5cm
797 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
798 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
799 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
801 else if ( (i==1 || i==2) && j < knPCB3[i]-1) {
802 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
803 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
804 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
807 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
808 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
809 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
811 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
812 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
813 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
817 // position the rohacell volume inside the panel volume
818 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
819 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
820 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
822 // position the PCB volume inside the insulating material volume
823 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
824 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
825 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
826 // position the horizontal frame volume inside the PCB volume
827 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
828 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
829 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
830 // position the sensitive volume inside the horizontal frame volume
831 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
832 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
833 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
834 // position the border volumes inside the PCB volume
835 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
836 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
837 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
838 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
839 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
840 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
841 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
843 // create the NULOC volume and position it in the horizontal frame
845 gMC->Gsvolu("S05N","BOX",knulocMaterial,nulocpar,3);
846 gMC->Gsvolu("S06N","BOX",knulocMaterial,nulocpar,3);
848 Float_t xxmax2 = xxmax - 5./2.;
849 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
851 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
852 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., kbFrameWidth/4., 0, "ONLY");
853 if (xx > -xxmax2 && xx< xxmax2) {
854 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
855 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., kbFrameWidth/4., 0, "ONLY");
857 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
858 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., kbFrameWidth/4., 0, "ONLY");
861 // position the volumes approximating the circular section of the pipe
862 Float_t yoffs = ksensHeight/2. - kyOverlap;
863 Float_t epsilon = 0.001;
866 Double_t dydiv= ksensHeight/ndiv;
867 Double_t ydiv = yoffs -dydiv;
871 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
872 if (gAlice->GetModule("DIPO")) {z1*=-1.;}
873 for (Int_t idiv=0;idiv<ndiv; idiv++){
876 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
877 divpar[0] = (kpcbLength-xdiv)/2.;
878 divpar[1] = dydiv/2. - epsilon;
879 divpar[2] = ksensWidth/2.;
880 Float_t xvol=(kpcbLength+xdiv)/2.+1.999;
881 Float_t yvol=ydiv + dydiv/2.;
882 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
883 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother,-xvol, yvol, zoffs5-z1-z2, 0, "ONLY",divpar,3);
884 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother,-xvol, yvol, zoffs6-z1-z2, 0, "ONLY",divpar,3);
885 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother,-xvol,-yvol, zoffs5-z1-z2, 0, "ONLY",divpar,3);
886 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother,-xvol,-yvol, zoffs6-z1-z2, 0, "ONLY",divpar,3);
887 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,+xvol, yvol, zoffs5-z1+z2, 0, "ONLY",divpar,3);
888 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,+xvol, yvol, zoffs6-z1+z2, 0, "ONLY",divpar,3);
889 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,+xvol,-yvol, zoffs5-z1+z2, 0, "ONLY",divpar,3);
890 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,+xvol,-yvol, zoffs6-z1+z2, 0, "ONLY",divpar,3);
896 //********************************************************************
898 //********************************************************************
899 // indices 1 and 2 for first and second chambers in the station
900 // iChamber (first chamber) kept for other quanties than Z,
901 // assumed to be the same in both chambers
902 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
903 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
904 zpos1=iChamber1->Z();
905 zpos2=iChamber2->Z();
906 dstation = TMath::Abs(zpos2 - zpos1);
907 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
911 tpar[0] = iChamber->RInner()-dframep;
912 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
913 tpar[2] = dstation/4;
915 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
916 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
917 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
918 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
921 const Int_t knSlats4 = 6; // number of slats per quadrant
922 const Int_t knPCB4[knSlats4] = {4,4,5,5,4,3}; // n PCB per slat
923 const Float_t kxpos4[knSlats4] = {38.5, 40., 0., 0., 0., 0.};
924 Float_t slatLength4[knSlats4];
926 // create and position the slat (mother) volumes
933 for (i = 0; i<knSlats4; i++){
934 slatLength4[i] = kpcbLength * knPCB4[i] + 2. * kdSlatLength;
935 xSlat4 = slatLength4[i]/2. - kvFrameLength/2. + kxpos4[i];
936 if (i==1) slatLength4[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
937 ySlat4 = ksensHeight * i - kyOverlap *i;
939 spar[0] = slatLength4[i]/2.;
940 spar[1] = kslatHeight/2.;
941 spar[2] = kslatWidth/2.*1.01;
942 Float_t dzCh4=spar[2]*1.01;
943 // zSlat to be checked (odd downstream or upstream?)
944 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
945 sprintf(volNam7,"S07%d",i);
946 gMC->Gsvolu(volNam7,"BOX",kslatMaterial,spar,3);
947 gMC->Gspos(volNam7, i*4+1,"S07M",-xSlat4, ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
948 gMC->Gspos(volNam7, i*4+2,"S07M",+xSlat4, ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
950 gMC->Gspos(volNam7, i*4+3,"S07M",-xSlat4,-ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
951 gMC->Gspos(volNam7, i*4+4,"S07M",+xSlat4,-ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
953 sprintf(volNam8,"S08%d",i);
954 gMC->Gsvolu(volNam8,"BOX",kslatMaterial,spar,3);
955 gMC->Gspos(volNam8, i*4+1,"S08M",-xSlat4, ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
956 gMC->Gspos(volNam8, i*4+2,"S08M",+xSlat4, ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
958 gMC->Gspos(volNam8, i*4+3,"S08M",-xSlat4,-ySlat4, -zSlat-2.*dzCh4, 0, "ONLY");
959 gMC->Gspos(volNam8, i*4+4,"S08M",+xSlat4,-ySlat4, -zSlat+2.*dzCh4, 0, "ONLY");
964 // create the panel volume
966 gMC->Gsvolu("S07C","BOX",kpanelMaterial,panelpar,3);
967 gMC->Gsvolu("S08C","BOX",kpanelMaterial,panelpar,3);
969 // create the rohacell volume
971 gMC->Gsvolu("S07R","BOX",krohaMaterial,rohapar,3);
972 gMC->Gsvolu("S08R","BOX",krohaMaterial,rohapar,3);
974 // create the insulating material volume
976 gMC->Gsvolu("S07I","BOX",kinsuMaterial,insupar,3);
977 gMC->Gsvolu("S08I","BOX",kinsuMaterial,insupar,3);
979 // create the PCB volume
981 gMC->Gsvolu("S07P","BOX",kpcbMaterial,pcbpar,3);
982 gMC->Gsvolu("S08P","BOX",kpcbMaterial,pcbpar,3);
984 // create the sensitive volumes,
986 gMC->Gsvolu("S07G","BOX",ksensMaterial,dum,0);
987 gMC->Gsvolu("S08G","BOX",ksensMaterial,dum,0);
989 // create the vertical frame volume
991 gMC->Gsvolu("S07V","BOX",kvFrameMaterial,vFramepar,3);
992 gMC->Gsvolu("S08V","BOX",kvFrameMaterial,vFramepar,3);
994 // create the horizontal frame volume
996 gMC->Gsvolu("S07H","BOX",khFrameMaterial,hFramepar,3);
997 gMC->Gsvolu("S08H","BOX",khFrameMaterial,hFramepar,3);
999 // create the horizontal border volume
1001 gMC->Gsvolu("S07B","BOX",kbFrameMaterial,bFramepar,3);
1002 gMC->Gsvolu("S08B","BOX",kbFrameMaterial,bFramepar,3);
1005 for (i = 0; i<knSlats4; i++){
1006 sprintf(volNam7,"S07%d",i);
1007 sprintf(volNam8,"S08%d",i);
1008 Float_t xvFrame = (slatLength4[i] - kvFrameLength)/2.;
1009 // position the vertical frames
1011 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
1012 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
1013 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
1014 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
1016 // position the panels and the insulating material
1017 for (j=0; j<knPCB4[i]; j++){
1019 Float_t xx = ksensLength * (-knPCB4[i]/2.+j+.5);
1021 Float_t zPanel = spar[2] - panelpar[2];
1022 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1023 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1024 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1025 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1027 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1028 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1032 // position the rohacell volume inside the panel volume
1033 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1034 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1036 // position the PCB volume inside the insulating material volume
1037 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1038 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1039 // position the horizontal frame volume inside the PCB volume
1040 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1041 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1042 // position the sensitive volume inside the horizontal frame volume
1043 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1044 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
1045 // position the border volumes inside the PCB volume
1046 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
1047 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1048 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1049 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1050 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1052 // create the NULOC volume and position it in the horizontal frame
1054 gMC->Gsvolu("S07N","BOX",knulocMaterial,nulocpar,3);
1055 gMC->Gsvolu("S08N","BOX",knulocMaterial,nulocpar,3);
1057 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
1059 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1060 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1061 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1062 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1065 // position the volumes approximating the circular section of the pipe
1066 Float_t yoffs = ksensHeight/2. - kyOverlap;
1067 Float_t epsilon = 0.001;
1070 Double_t dydiv= ksensHeight/ndiv;
1071 Double_t ydiv = yoffs -dydiv;
1075 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1076 for (Int_t idiv=0;idiv<ndiv; idiv++){
1079 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1080 divpar[0] = (kpcbLength-xdiv)/2.;
1081 divpar[1] = dydiv/2. - epsilon;
1082 divpar[2] = ksensWidth/2.;
1083 Float_t xvol=(kpcbLength+xdiv)/2.+1.999;
1084 Float_t yvol=ydiv + dydiv/2.;
1085 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1086 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1087 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1088 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1089 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M", xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1090 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M", xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1091 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M", xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1092 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M", xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1104 //********************************************************************
1106 //********************************************************************
1107 // indices 1 and 2 for first and second chambers in the station
1108 // iChamber (first chamber) kept for other quanties than Z,
1109 // assumed to be the same in both chambers
1110 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1111 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1112 zpos1=iChamber1->Z();
1113 zpos2=iChamber2->Z();
1114 dstation = TMath::Abs(zpos2 - zpos1);
1115 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1119 tpar[0] = iChamber->RInner()-dframep;
1120 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1121 tpar[2] = dstation/5.;
1123 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1124 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1125 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1126 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1129 const Int_t knSlats5 = 7; // number of slats per quadrant
1130 const Int_t knPCB5[knSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1131 const Float_t kxpos5[knSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1132 Float_t slatLength5[knSlats5];
1138 for (i = 0; i<knSlats5; i++){
1139 slatLength5[i] = kpcbLength * knPCB5[i] + 2. * kdSlatLength;
1140 xSlat5 = slatLength5[i]/2. - kvFrameLength/2. +kxpos5[i];
1141 if (i==1 || i==0) slatLength5[i] -= 2. *kdSlatLength; // frame out in PCB with circular border
1142 ySlat5 = ksensHeight * i - kyOverlap * i;
1143 spar[0] = slatLength5[i]/2.;
1144 spar[1] = kslatHeight/2.;
1145 spar[2] = kslatWidth/2. * 1.01;
1146 Float_t dzCh5=spar[2]*1.01;
1147 // zSlat to be checked (odd downstream or upstream?)
1148 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1149 sprintf(volNam9,"S09%d",i);
1150 gMC->Gsvolu(volNam9,"BOX",kslatMaterial,spar,3);
1151 gMC->Gspos(volNam9, i*4+1,"S09M",-xSlat5, ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1152 gMC->Gspos(volNam9, i*4+2,"S09M",+xSlat5, ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1154 gMC->Gspos(volNam9, i*4+3,"S09M",-xSlat5,-ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1155 gMC->Gspos(volNam9, i*4+4,"S09M",+xSlat5,-ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1157 sprintf(volNam10,"S10%d",i);
1158 gMC->Gsvolu(volNam10,"BOX",kslatMaterial,spar,3);
1159 gMC->Gspos(volNam10, i*4+1,"S10M",-xSlat5, ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1160 gMC->Gspos(volNam10, i*4+2,"S10M",+xSlat5, ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1162 gMC->Gspos(volNam10, i*4+3,"S10M",-xSlat5,-ySlat5, -zSlat-2.*dzCh5, 0, "ONLY");
1163 gMC->Gspos(volNam10, i*4+4,"S10M",+xSlat5,-ySlat5, -zSlat+2.*dzCh5, 0, "ONLY");
1167 // create the panel volume
1169 gMC->Gsvolu("S09C","BOX",kpanelMaterial,panelpar,3);
1170 gMC->Gsvolu("S10C","BOX",kpanelMaterial,panelpar,3);
1172 // create the rohacell volume
1174 gMC->Gsvolu("S09R","BOX",krohaMaterial,rohapar,3);
1175 gMC->Gsvolu("S10R","BOX",krohaMaterial,rohapar,3);
1177 // create the insulating material volume
1179 gMC->Gsvolu("S09I","BOX",kinsuMaterial,insupar,3);
1180 gMC->Gsvolu("S10I","BOX",kinsuMaterial,insupar,3);
1182 // create the PCB volume
1184 gMC->Gsvolu("S09P","BOX",kpcbMaterial,pcbpar,3);
1185 gMC->Gsvolu("S10P","BOX",kpcbMaterial,pcbpar,3);
1187 // create the sensitive volumes,
1189 gMC->Gsvolu("S09G","BOX",ksensMaterial,dum,0);
1190 gMC->Gsvolu("S10G","BOX",ksensMaterial,dum,0);
1192 // create the vertical frame volume
1194 gMC->Gsvolu("S09V","BOX",kvFrameMaterial,vFramepar,3);
1195 gMC->Gsvolu("S10V","BOX",kvFrameMaterial,vFramepar,3);
1197 // create the horizontal frame volume
1199 gMC->Gsvolu("S09H","BOX",khFrameMaterial,hFramepar,3);
1200 gMC->Gsvolu("S10H","BOX",khFrameMaterial,hFramepar,3);
1202 // create the horizontal border volume
1204 gMC->Gsvolu("S09B","BOX",kbFrameMaterial,bFramepar,3);
1205 gMC->Gsvolu("S10B","BOX",kbFrameMaterial,bFramepar,3);
1208 for (i = 0; i<knSlats5; i++){
1209 sprintf(volNam9,"S09%d",i);
1210 sprintf(volNam10,"S10%d",i);
1211 Float_t xvFrame = (slatLength5[i] - kvFrameLength)/2.;
1212 // position the vertical frames
1214 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1215 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1216 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1217 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1220 // position the panels and the insulating material
1221 for (j=0; j<knPCB5[i]; j++){
1223 Float_t xx = ksensLength * (-knPCB5[i]/2.+j+.5);
1225 Float_t zPanel = spar[2] - panelpar[2];
1226 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1227 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1228 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1229 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1231 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1232 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1236 // position the rohacell volume inside the panel volume
1237 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1238 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1240 // position the PCB volume inside the insulating material volume
1241 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1242 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1243 // position the horizontal frame volume inside the PCB volume
1244 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1245 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1246 // position the sensitive volume inside the horizontal frame volume
1247 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1248 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1249 // position the border volumes inside the PCB volume
1250 Float_t yborder = ( kpcbHeight - kbFrameHeight ) / 2.;
1251 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1252 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1253 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1254 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1256 // create the NULOC volume and position it in the horizontal frame
1258 gMC->Gsvolu("S09N","BOX",knulocMaterial,nulocpar,3);
1259 gMC->Gsvolu("S10N","BOX",knulocMaterial,nulocpar,3);
1261 for (xx = -xxmax; xx<=xxmax; xx+=2*knulocLength) {
1263 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1264 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1265 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kbFrameWidth/4., 0, "ONLY");
1266 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kbFrameWidth/4., 0, "ONLY");
1268 // position the volumes approximating the circular section of the pipe
1269 Float_t yoffs = ksensHeight/2. - kyOverlap;
1270 Float_t epsilon = 0.001;
1273 Double_t dydiv= ksensHeight/ndiv;
1274 Double_t ydiv = yoffs -dydiv;
1276 // for (Int_t islat=0; islat<knSlats3; islat++) imax += knPCB3[islat];
1279 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1280 for (Int_t idiv=0;idiv<ndiv; idiv++){
1283 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1284 divpar[0] = (kpcbLength-xdiv)/2.;
1285 divpar[1] = dydiv/2. - epsilon;
1286 divpar[2] = ksensWidth/2.;
1287 Float_t xvol=(kpcbLength+xdiv)/2. + 1.999;
1288 Float_t yvol=ydiv + dydiv/2.;
1289 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1290 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", -xvol, yvol, -z1-z2, 0, "ONLY",divpar,3);
1291 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1292 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", -xvol,-yvol, -z1-z2, 0, "ONLY",divpar,3);
1293 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M", +xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1294 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M", +xvol, yvol, -z1+z2, 0, "ONLY",divpar,3);
1295 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M", +xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1296 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M", +xvol,-yvol, -z1+z2, 0, "ONLY",divpar,3);
1301 //********************************************************************
1303 //********************************************************************
1305 zpos1 and zpos2 are the middle of the first and second
1306 planes of station 1 (+1m for second station):
1307 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
1308 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
1309 zposxm and zposxp= middles of gaz gaps within a detection plane
1310 rem: the total thickness accounts for 1 mm of al on both
1311 side of the RPCs (see zpos1 and zpos2)
1314 // vertical gap between right and left chambers (kDXZERO*2=4cm)
1315 const Float_t kDXZERO=2.;
1316 // main distances for chamber definition in first plane/first station
1317 const Float_t kXMIN=34.;
1318 const Float_t kXMED=51.;
1319 const Float_t kXMAX=272.;
1320 // kXMAX will become 255. in real life. segmentation to be updated accordingly
1321 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
1322 const Float_t kYMIN=34.;
1323 const Float_t kYMAX=51.;
1324 // inner/outer radius of flange between beam shield. and chambers (1/station)
1325 const Float_t kRMIN[2]={50.,50.};
1326 const Float_t kRMAX[2]={64.,68.};
1327 // z position of the middle of the gas gap in mother vol
1328 const Float_t kZm=-3.6;
1329 const Float_t kZp=+3.6;
1331 iChamber1 = (AliMUONChamber*) (*fChambers)[10];
1332 zpos1 = iChamber1->Z();
1334 // ratio of zpos1m/zpos1p and inverse for first plane
1335 Float_t zmp=(zpos1+3.6)/(zpos1-3.6);
1338 Int_t icount=0; // chamber counter (0 1 2 3)
1340 for (Int_t istation=0; istation<2; istation++) { // loop on stations
1341 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
1343 Int_t iVolNum=1; // counter Volume Number
1344 icount = Int_t(iplane*TMath::Power(2,0))+
1345 Int_t(istation*TMath::Power(2,1));
1348 sprintf(volPlane,"SM%d%d",istation+1,iplane+1);
1350 iChamber = (AliMUONChamber*) (*fChambers)[10+icount];
1351 Float_t zpos = iChamber->Z();
1354 tpar[0] = iChamber->RInner();
1355 tpar[1] = iChamber->ROuter();
1357 gMC->Gsvolu(volPlane,"TUBE",idAir,tpar,3);
1359 // Flange between beam shielding and RPC
1360 tpar[0]= kRMIN[istation];
1361 tpar[1]= kRMAX[istation];
1365 sprintf(volFlange,"SF%dA",icount+1);
1366 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); //Al
1367 gMC->Gspos(volFlange,1,volPlane,0.,0.,0.,0,"MANY");
1370 Float_t zRatio = zpos / zpos1;
1372 // chamber prototype
1377 char volAlu[5]; // Alu
1378 char volBak[5]; // Bakelite
1379 char volGaz[5]; // Gas streamer
1381 sprintf(volAlu,"SC%dA",icount+1);
1382 sprintf(volBak,"SB%dA",icount+1);
1383 sprintf(volGaz,"SG%dA",icount+1);
1385 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
1386 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
1387 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
1393 Float_t xA=(kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
1398 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
1400 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
1403 tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
1404 tpar[1] = kYMIN*zRatio;
1406 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xA,yAm,-kZm,0,"ONLY",tpar,3);
1407 gMC->Gsposp(volAlu,iVolNum++,volPlane, xA,yAp,-kZp,0,"ONLY",tpar,3);
1408 gMC->Gsbool(volAlu,volFlange);
1411 Float_t tpar1save=tpar[1];
1412 Float_t y1msave=yAm;
1413 Float_t y1psave=yAp;
1415 tpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
1416 tpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
1418 Float_t xB=(kDXZERO+kXMIN)*zRatio+tpar[0];
1419 Float_t yBp=(y1msave+tpar1save)*zpm+tpar[1];
1420 Float_t yBm=(y1psave+tpar1save)*zmp+tpar[1];
1422 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xB, yBp,-kZp,0,"ONLY",tpar,3);
1423 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB, yBm,-kZm,0,"ONLY",tpar,3);
1424 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xB,-yBp,-kZp,0,"ONLY",tpar,3);
1425 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB,-yBm,-kZm,0,"ONLY",tpar,3);
1427 // chamber type C (note : same Z than type B)
1432 tpar[0] = (kXMAX/2)*zRatio;
1433 tpar[1] = (kYMAX/2)*zRatio;
1435 Float_t xC=kDXZERO*zRatio+tpar[0];
1436 Float_t yCp=(y1psave+tpar1save)*1.+tpar[1];
1437 Float_t yCm=(y1msave+tpar1save)*1.+tpar[1];
1439 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC, yCp,-kZp,0,"ONLY",tpar,3);
1440 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC, yCm,-kZm,0,"ONLY",tpar,3);
1441 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC,-yCp,-kZp,0,"ONLY",tpar,3);
1442 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC,-yCm,-kZm,0,"ONLY",tpar,3);
1444 // chamber type D, E and F (same size)
1449 tpar[0] = (kXMAX/2.)*zRatio;
1450 tpar[1] = kYMIN*zRatio;
1452 Float_t xD=kDXZERO*zRatio+tpar[0];
1453 Float_t yDp=(y1msave+tpar1save)*zpm+tpar[1];
1454 Float_t yDm=(y1psave+tpar1save)*zmp+tpar[1];
1456 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yDm,-kZm,0,"ONLY",tpar,3);
1457 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yDp,-kZp,0,"ONLY",tpar,3);
1458 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yDm,-kZm,0,"ONLY",tpar,3);
1459 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yDp,-kZp,0,"ONLY",tpar,3);
1464 Float_t yEp=(y1msave+tpar1save)*zpm+tpar[1];
1465 Float_t yEm=(y1psave+tpar1save)*zmp+tpar[1];
1467 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yEp,-kZp,0,"ONLY",tpar,3);
1468 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yEm,-kZm,0,"ONLY",tpar,3);
1469 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yEp,-kZp,0,"ONLY",tpar,3);
1470 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yEm,-kZm,0,"ONLY",tpar,3);
1475 Float_t yFp=(y1msave+tpar1save)*zpm+tpar[1];
1476 Float_t yFm=(y1psave+tpar1save)*zmp+tpar[1];
1478 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD, yFm,-kZm,0,"ONLY",tpar,3);
1479 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yFp,-kZp,0,"ONLY",tpar,3);
1480 gMC->Gsposp(volAlu,iVolNum++,volPlane, -xD,-yFm,-kZm,0,"ONLY",tpar,3);
1481 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yFp,-kZp,0,"ONLY",tpar,3);
1483 // Positioning plane in ALICE
1484 gMC->Gspos(volPlane,1,"ALIC",0.,0.,zpos,0,"ONLY");
1486 } // end loop on detection planes
1487 } // end loop on stations
1492 //___________________________________________
1493 void AliMUONv3::CreateMaterials()
1495 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1497 // Ar-CO2 gas (80%+20%)
1498 Float_t ag1[3] = { 39.95,12.01,16. };
1499 Float_t zg1[3] = { 18.,6.,8. };
1500 Float_t wg1[3] = { .8,.0667,.13333 };
1501 Float_t dg1 = .001821;
1503 // Ar-buthane-freon gas -- trigger chambers
1504 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1505 Float_t ztr1[4] = { 18.,6.,1.,9. };
1506 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1507 Float_t dtr1 = .002599;
1510 Float_t agas[3] = { 39.95,12.01,16. };
1511 Float_t zgas[3] = { 18.,6.,8. };
1512 Float_t wgas[3] = { .74,.086684,.173316 };
1513 Float_t dgas = .0018327;
1515 // Ar-Isobutane gas (80%+20%) -- tracking
1516 Float_t ag[3] = { 39.95,12.01,1.01 };
1517 Float_t zg[3] = { 18.,6.,1. };
1518 Float_t wg[3] = { .8,.057,.143 };
1519 Float_t dg = .0019596;
1521 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1522 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1523 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1524 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1525 Float_t dtrig = .0031463;
1529 Float_t abak[3] = {12.01 , 1.01 , 16.};
1530 Float_t zbak[3] = {6. , 1. , 8.};
1531 Float_t wbak[3] = {6. , 6. , 1.};
1534 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1536 Int_t iSXFLD = gAlice->Field()->Integ();
1537 Float_t sXMGMX = gAlice->Field()->Max();
1539 // --- Define the various materials for GEANT ---
1540 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1541 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1542 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1543 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1544 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1545 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1546 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1547 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1548 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1549 // materials for slat:
1550 // Sensitive area: gas (already defined)
1552 // insulating material and frame: vetronite
1553 // walls: carbon, rohacell, carbon
1554 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1555 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1556 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1557 Float_t dglass=1.74;
1559 // rohacell: C9 H13 N1 O2
1560 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1561 Float_t zrohac[4] = { 6., 1., 7., 8.};
1562 Float_t wrohac[4] = { 9., 13., 1., 2.};
1563 Float_t drohac = 0.03;
1565 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1566 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1567 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1568 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1571 epsil = .001; // Tracking precision,
1572 stemax = -1.; // Maximum displacement for multiple scat
1573 tmaxfd = -20.; // Maximum angle due to field deflection
1574 deemax = -.3; // Maximum fractional energy loss, DLS
1578 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1582 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1583 fMaxDestepAlu, epsil, stmin);
1584 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1585 fMaxDestepAlu, epsil, stmin);
1589 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1590 fMaxDestepGas, epsil, stmin);
1592 // Ar-Isobuthane-Forane-SF6 gas
1594 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1596 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1597 fMaxDestepAlu, epsil, stmin);
1599 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1600 fMaxDestepAlu, epsil, stmin);
1601 // tracking media for slats: check the parameters!!
1602 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1603 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1604 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1605 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1606 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1607 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1608 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1609 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1612 //___________________________________________
1614 void AliMUONv3::Init()
1617 // Initialize Tracking Chambers
1620 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
1622 for (i=0; i<AliMUONConstants::NCh(); i++) {
1623 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1627 // Set the chamber (sensitive region) GEANT identifier
1628 ((AliMUONChamber*)(*fChambers)[0])->GetGeometry()->SetSensitiveVolume("S01G");
1629 ((AliMUONChamber*)(*fChambers)[1])->GetGeometry()->SetSensitiveVolume("S02G");
1631 ((AliMUONChamber*)(*fChambers)[2])->GetGeometry()->SetSensitiveVolume("S03G");
1632 ((AliMUONChamber*)(*fChambers)[3])->GetGeometry()->SetSensitiveVolume("S04G");
1634 ((AliMUONChamber*)(*fChambers)[4])->GetGeometry()->SetSensitiveVolume("S05G");
1635 ((AliMUONChamber*)(*fChambers)[5])->GetGeometry()->SetSensitiveVolume("S06G");
1637 ((AliMUONChamber*)(*fChambers)[6])->GetGeometry()->SetSensitiveVolume("S07G");
1638 ((AliMUONChamber*)(*fChambers)[7])->GetGeometry()->SetSensitiveVolume("S08G");
1640 ((AliMUONChamber*)(*fChambers)[8])->GetGeometry()->SetSensitiveVolume("S09G");
1641 ((AliMUONChamber*)(*fChambers)[9])->GetGeometry()->SetSensitiveVolume("S10G");
1643 ((AliMUONChamber*)(*fChambers)[10])->GetGeometry()->SetSensitiveVolume("SG1A");
1644 ((AliMUONChamber*)(*fChambers)[11])->GetGeometry()->SetSensitiveVolume("SG2A");
1645 ((AliMUONChamber*)(*fChambers)[12])->GetGeometry()->SetSensitiveVolume("SG3A");
1646 ((AliMUONChamber*)(*fChambers)[13])->GetGeometry()->SetSensitiveVolume("SG4A");
1648 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
1651 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
1652 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1653 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1655 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
1660 //_______________________________________________________________________________
1661 Int_t AliMUONv3::GetChamberId(Int_t volId) const
1663 // Check if the volume with specified volId is a sensitive volume (gas)
1664 // of some chamber and returns the chamber number;
1665 // if not sensitive volume - return 0.
1668 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
1669 if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i;
1673 //_______________________________________________________________________________
1674 void AliMUONv3::StepManager()
1676 // Stepmanager for the chambers
1678 if (fStepManagerVersionOld) {
1683 // Only charged tracks
1684 if( !(gMC->TrackCharge()) ) return;
1685 // Only charged tracks
1687 // Only gas gap inside chamber
1688 // Tag chambers and record hits when track enters
1693 const Float_t kBig = 1.e10;
1695 id=gMC->CurrentVolID(copy);
1696 iChamber = GetChamberId(id);
1697 idvol=GetChamberId(id)-1;
1699 if (idvol == -1) return;
1701 if( gMC->IsTrackEntering() ) {
1702 Float_t theta = fTrackMomentum.Theta();
1703 if ((TMath::Pi()-theta)*kRaddeg>=15.) gMC->SetMaxStep(fStepMaxInActiveGas); // We use Pi-theta because z is negative
1706 // if (GetDebug()) {
1707 // Float_t z = ( (AliMUONChamber*)(*fChambers)[idvol])->Z() ;
1708 // Info("StepManager Step","Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber, z);
1710 // Particule id and mass,
1711 Int_t ipart = gMC->TrackPid();
1712 Float_t mass = gMC->TrackMass();
1714 fDestepSum[idvol]+=gMC->Edep();
1715 // Get current particle id (ipart), track position (pos) and momentum (mom)
1716 if ( fStepSum[idvol]==0.0 ) gMC->TrackMomentum(fTrackMomentum);
1717 fStepSum[idvol]+=gMC->TrackStep();
1719 // if (GetDebug()) {
1720 // Info("StepManager Step","iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
1721 // iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg, mass, fStepSum[idvol], gMC->Edep());
1722 // Info("StepManager Step","Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), fTrackMomentum.Z()) ;
1723 // gMC->TrackPosition(fTrackPosition);
1724 // Info("StepManager Step","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1727 // Track left chamber or StepSum larger than fStepMaxInActiveGas
1728 if ( gMC->IsTrackExiting() ||
1729 gMC->IsTrackStop() ||
1730 gMC->IsTrackDisappeared()||
1731 (fStepSum[idvol]>fStepMaxInActiveGas) ) {
1733 if ( gMC->IsTrackExiting() ||
1734 gMC->IsTrackStop() ||
1735 gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
1737 gMC->TrackPosition(fTrackPosition);
1738 Float_t theta = fTrackMomentum.Theta();
1739 Float_t phi = fTrackMomentum.Phi();
1741 TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
1742 fStepSum[idvol]/2.*sin(theta)*sin(phi),
1743 fStepSum[idvol]/2.*cos(theta),0.0 );
1745 // Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1747 // Info("StepManager Exit ","Track backToWire %f %f %f",backToWire.X(),backToWire.Y(),backToWire.Z()) ;
1748 fTrackPosition-=backToWire;
1750 //-------------- Angle effect
1751 // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
1753 Float_t betaxGamma = fTrackMomentum.P()/mass;// pc/mc2
1754 Float_t sigmaEffect10degrees;
1755 Float_t sigmaEffectThetadegrees;
1756 Float_t eLossParticleELossMip;
1757 Float_t yAngleEffect=0.;
1758 Float_t thetawires = TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
1762 if ( (betaxGamma >3.2) && (thetawires*kRaddeg<=15.) ) {
1763 betaxGamma=TMath::Log(betaxGamma);
1764 eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
1765 // 10 degrees is a reference for a model (arbitrary)
1766 sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
1767 // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
1768 sigmaEffectThetadegrees = sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg); // For 5mm gap
1769 if ( (iChamber==1) || (iChamber==2) )
1770 sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
1771 yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
1775 // One hit per chamber
1776 GetMUONData()->AddHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), iChamber, ipart,
1777 fTrackPosition.X(), fTrackPosition.Y()+yAngleEffect, fTrackPosition.Z(), 0.0,
1778 fTrackMomentum.P(),theta, phi, fStepSum[idvol], fDestepSum[idvol],
1779 fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z());
1781 // Info("StepManager Exit","Particle exiting from chamber %d",iChamber);
1782 // Info("StepManager Exit","StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]);
1783 // Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
1785 fStepSum[idvol] =0; // Reset for the next event
1786 fDestepSum[idvol]=0; // Reset for the next event
1790 //__________________________________________
1791 void AliMUONv3::StepManagerOld()
1793 // Old Stepmanager for the chambers
1796 static Int_t vol[2];
1801 Float_t destep, step;
1803 static Float_t sstep;
1804 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1805 const Float_t kBig = 1.e10;
1806 static Float_t hits[15];
1808 TClonesArray &lhits = *fHits;
1812 // Only charged tracks
1813 if( !(gMC->TrackCharge()) ) return;
1815 // Only gas gap inside chamber
1816 // Tag chambers and record hits when track enters
1817 id=gMC->CurrentVolID(copy);
1818 vol[0] = GetChamberId(id);
1821 if (idvol == -1) return;
1824 // Get current particle id (ipart), track position (pos) and momentum (mom)
1825 gMC->TrackPosition(pos);
1826 gMC->TrackMomentum(mom);
1828 ipart = gMC->TrackPid();
1831 // momentum loss and steplength in last step
1832 destep = gMC->Edep();
1833 step = gMC->TrackStep();
1834 // cout<<"------------"<<step<<endl;
1836 // record hits when track enters ...
1837 if( gMC->IsTrackEntering()) {
1839 gMC->SetMaxStep(fMaxStepGas);
1840 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1841 Double_t rt = TMath::Sqrt(tc);
1842 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1843 Double_t tx = mom[0]/pmom;
1844 Double_t ty = mom[1]/pmom;
1845 Double_t tz = mom[2]/pmom;
1846 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
1849 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1850 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1851 hits[0] = Float_t(ipart); // Geant3 particle type
1852 hits[1] = pos[0]+s*tx; // X-position for hit
1853 hits[2] = pos[1]+s*ty; // Y-position for hit
1854 hits[3] = pos[2]+s*tz; // Z-position for hit
1855 hits[4] = theta; // theta angle of incidence
1856 hits[5] = phi; // phi angle of incidence
1857 hits[8] = 0;//PadHits does not exist anymore (Float_t) fNPadHits; // first padhit
1858 hits[9] = -1; // last pad hit
1859 hits[10] = mom[3]; // hit momentum P
1860 hits[11] = mom[0]; // Px
1861 hits[12] = mom[1]; // Py
1862 hits[13] = mom[2]; // Pz
1863 tof=gMC->TrackTime();
1864 hits[14] = tof; // Time of flight
1872 Chamber(idvol).ChargeCorrelationInit();
1873 // Only if not trigger chamber
1875 // printf("---------------------------\n");
1876 // printf(">>>> Y = %f \n",hits[2]);
1877 // printf("---------------------------\n");
1881 // if(idvol < AliMUONConstants::NTrackingCh()) {
1883 // // Initialize hit position (cursor) in the segmentation model
1884 // ((AliMUONChamber*) (*fChambers)[idvol])
1885 // ->SigGenInit(pos[0], pos[1], pos[2]);
1887 // //geant3->Gpcxyz();
1888 // //printf("In the Trigger Chamber #%d\n",idvol-9);
1894 // cout<<sstep<<endl;
1897 // Calculate the charge induced on a pad (disintegration) in case
1899 // Mip left chamber ...
1900 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1901 gMC->SetMaxStep(kBig);
1906 Float_t localPos[3];
1907 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1908 gMC->Gmtod(globalPos,localPos,1);
1910 if(idvol < AliMUONConstants::NTrackingCh()) {
1911 // tracking chambers
1912 x0 = 0.5*(xhit+pos[0]);
1913 y0 = 0.5*(yhit+pos[1]);
1914 z0 = 0.5*(zhit+pos[2]);
1923 // if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
1926 hits[6] = tlength; // track length
1927 hits[7] = eloss2; // de/dx energy loss
1930 // if (fNPadHits > (Int_t)hits[8]) {
1931 // hits[8] = hits[8]+1;
1932 // hits[9] = 0: // PadHits does not exist anymore (Float_t) fNPadHits;
1937 new(lhits[fNhits++])
1938 AliMUONHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
1941 // Check additional signal generation conditions
1942 // defined by the segmentation
1943 // model (boundary crossing conditions)
1944 // only for tracking chambers
1946 ((idvol < AliMUONConstants::NTrackingCh()) &&
1947 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
1949 ((AliMUONChamber*) (*fChambers)[idvol])
1950 ->SigGenInit(pos[0], pos[1], pos[2]);
1952 Float_t localPos[3];
1953 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1954 gMC->Gmtod(globalPos,localPos,1);
1958 // if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1959 // MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
1966 // nothing special happened, add up energy loss