1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
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 0 //
20 /////////////////////////////////////////////////////////
22 #include <Riostream.h>
23 #include <TClonesArray.h>
24 #include <TLorentzVector.h>
28 #include <TVirtualMC.h>
30 #include "AliCallf77.h"
32 #include "AliMUONChamber.h"
33 #include "AliMUONConstants.h"
34 #include "AliMUONFactory.h"
35 #include "AliMUONHit.h"
36 #include "AliMUONPadHit.h"
37 #include "AliMUONTriggerCircuit.h"
38 #include "AliMUONv1.h"
44 //___________________________________________
45 AliMUONv1::AliMUONv1() : AliMUON()
50 fStepManagerVersionOld = kFALSE;
51 fStepMaxInActiveGas = 0.6;
55 //___________________________________________
56 AliMUONv1::AliMUONv1(const char *name, const char *title)
60 // By default include all stations
61 fStations = new Int_t[5];
62 for (Int_t i=0; i<5; i++) fStations[i] = 1;
64 AliMUONFactory factory;
65 factory.Build(this, title);
67 fStepManagerVersionOld = kFALSE;
68 fStepMaxInActiveGas = 0.6;
71 //___________________________________________
72 void AliMUONv1::CreateGeometry()
75 // Note: all chambers have the same structure, which could be
76 // easily parameterised. This was intentionally not done in order
77 // to give a starting point for the implementation of the actual
78 // design of each station.
79 Int_t *idtmed = fIdtmed->GetArray()-1099;
81 // Distance between Stations
86 Float_t zpos1, zpos2, zfpos;
87 // Outer excess and inner recess for mother volume radius
88 // with respect to ROuter and RInner
89 Float_t dframep=.001; // Value for station 3 should be 6 ...
90 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
91 // Float_t dframep1=.001;
92 Float_t dframep1 = 11.0;
93 // Bool_t frameCrosses=kFALSE;
94 Bool_t frameCrosses=kTRUE;
97 // Float_t dframez=0.9;
98 // Half of the total thickness of frame crosses (including DAlu)
99 // for each chamber in stations 1 and 2:
100 // 3% of X0 of composite material,
101 // but taken as Aluminium here, with same thickness in number of X0
102 Float_t dframez = 3. * 8.9 / 100;
107 // Rotation matrices in the x-y plane
110 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
112 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
114 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
116 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
118 Float_t phi=2*TMath::Pi()/12/2;
121 // pointer to the current chamber
122 // pointer to the current chamber
123 Int_t idAlu1=idtmed[1103]; // medium 4
124 Int_t idAlu2=idtmed[1104]; // medium 5
125 // Int_t idAlu1=idtmed[1100];
126 // Int_t idAlu2=idtmed[1100];
127 Int_t idAir=idtmed[1100]; // medium 1
128 // Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
129 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
132 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
136 //********************************************************************
138 //********************************************************************
140 // indices 1 and 2 for first and second chambers in the station
141 // iChamber (first chamber) kept for other quanties than Z,
142 // assumed to be the same in both chambers
143 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
144 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
145 zpos1=iChamber1->Z();
146 zpos2=iChamber2->Z();
147 dstation = zpos2 - zpos1;
148 // DGas decreased from standard one (0.5)
149 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
150 // DAlu increased from standard one (3% of X0),
151 // because more electronics with smaller pads
152 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
153 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
157 tpar[0] = iChamber->RInner()-dframep;
158 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
159 tpar[2] = dstation/5;
161 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
162 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
163 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
164 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
165 // // Aluminium frames
167 // pgpar[0] = 360/12/2;
171 // pgpar[4] = -dframez/2;
172 // pgpar[5] = iChamber->ROuter();
173 // pgpar[6] = pgpar[5]+dframep1;
174 // pgpar[7] = +dframez/2;
175 // pgpar[8] = pgpar[5];
176 // pgpar[9] = pgpar[6];
177 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
178 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
179 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
180 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
181 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
182 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
185 // tpar[0]= iChamber->RInner()-dframep1;
186 // tpar[1]= iChamber->RInner();
187 // tpar[2]= dframez/2;
188 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
189 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
191 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
192 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
193 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
194 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
199 // security for inside mother volume
200 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
201 * TMath::Cos(TMath::ASin(dframep1 /
202 (iChamber->ROuter() - iChamber->RInner())))
204 bpar[1] = dframep1/2;
205 // total thickness will be (4 * bpar[2]) for each chamber,
206 // which has to be equal to (2 * dframez) - DAlu
207 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
208 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
209 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
211 gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
212 idrotm[1100],"ONLY");
213 gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
214 idrotm[1100],"ONLY");
215 gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
216 idrotm[1101],"ONLY");
217 gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
218 idrotm[1101],"ONLY");
219 gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
220 idrotm[1100],"ONLY");
221 gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
222 idrotm[1100],"ONLY");
223 gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
224 idrotm[1101],"ONLY");
225 gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
226 idrotm[1101],"ONLY");
228 gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
229 idrotm[1100],"ONLY");
230 gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
231 idrotm[1100],"ONLY");
232 gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
233 idrotm[1101],"ONLY");
234 gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
235 idrotm[1101],"ONLY");
236 gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
237 idrotm[1100],"ONLY");
238 gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
239 idrotm[1100],"ONLY");
240 gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
241 idrotm[1101],"ONLY");
242 gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
243 idrotm[1101],"ONLY");
246 // Chamber Material represented by Alu sheet
247 tpar[0]= iChamber->RInner();
248 tpar[1]= iChamber->ROuter();
249 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
250 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
251 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
252 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
253 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
256 // tpar[2] = iChamber->DGas();
257 tpar[2] = iChamber->DGas()/2;
258 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
259 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
260 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
261 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
263 // Frame Crosses to be placed inside gas
264 // NONE: chambers are sensitive everywhere
265 // if (frameCrosses) {
267 // dr = (iChamber->ROuter() - iChamber->RInner());
268 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
269 // bpar[1] = dframep1/2;
270 // bpar[2] = iChamber->DGas()/2;
271 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
272 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
274 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
275 // idrotm[1100],"ONLY");
276 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
277 // idrotm[1100],"ONLY");
278 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
279 // idrotm[1101],"ONLY");
280 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
281 // idrotm[1101],"ONLY");
283 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
284 // idrotm[1100],"ONLY");
285 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
286 // idrotm[1100],"ONLY");
287 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
288 // idrotm[1101],"ONLY");
289 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
290 // idrotm[1101],"ONLY");
295 //********************************************************************
297 //********************************************************************
298 // indices 1 and 2 for first and second chambers in the station
299 // iChamber (first chamber) kept for other quanties than Z,
300 // assumed to be the same in both chambers
301 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
302 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
303 zpos1=iChamber1->Z();
304 zpos2=iChamber2->Z();
305 dstation = zpos2 - zpos1;
306 // DGas and DAlu not changed from standard values
307 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
311 tpar[0] = iChamber->RInner()-dframep;
312 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
313 tpar[2] = dstation/5;
315 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
316 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
317 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
318 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
319 gMC->Gsbool("S03M", "L3DO");
320 gMC->Gsbool("S03M", "L3O1");
321 gMC->Gsbool("S03M", "L3O2");
322 gMC->Gsbool("S04M", "L3DO");
323 gMC->Gsbool("S04M", "L3O1");
324 gMC->Gsbool("S04M", "L3O2");
326 // // Aluminium frames
328 // pgpar[0] = 360/12/2;
332 // pgpar[4] = -dframez/2;
333 // pgpar[5] = iChamber->ROuter();
334 // pgpar[6] = pgpar[5]+dframep;
335 // pgpar[7] = +dframez/2;
336 // pgpar[8] = pgpar[5];
337 // pgpar[9] = pgpar[6];
338 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
339 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
340 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
341 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
342 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
343 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
346 // tpar[0]= iChamber->RInner()-dframep;
347 // tpar[1]= iChamber->RInner();
348 // tpar[2]= dframez/2;
349 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
350 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
352 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
353 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
354 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
355 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
360 // security for inside mother volume
361 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
362 * TMath::Cos(TMath::ASin(dframep1 /
363 (iChamber->ROuter() - iChamber->RInner())))
365 bpar[1] = dframep1/2;
366 // total thickness will be (4 * bpar[2]) for each chamber,
367 // which has to be equal to (2 * dframez) - DAlu
368 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
369 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
370 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
372 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
373 idrotm[1100],"ONLY");
374 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
375 idrotm[1100],"ONLY");
376 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
377 idrotm[1101],"ONLY");
378 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
379 idrotm[1101],"ONLY");
380 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
381 idrotm[1100],"ONLY");
382 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
383 idrotm[1100],"ONLY");
384 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
385 idrotm[1101],"ONLY");
386 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
387 idrotm[1101],"ONLY");
389 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
390 idrotm[1100],"ONLY");
391 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
392 idrotm[1100],"ONLY");
393 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
394 idrotm[1101],"ONLY");
395 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
396 idrotm[1101],"ONLY");
397 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
398 idrotm[1100],"ONLY");
399 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
400 idrotm[1100],"ONLY");
401 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
402 idrotm[1101],"ONLY");
403 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
404 idrotm[1101],"ONLY");
407 // Chamber Material represented by Alu sheet
408 tpar[0]= iChamber->RInner();
409 tpar[1]= iChamber->ROuter();
410 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
411 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
412 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
413 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
414 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
417 // tpar[2] = iChamber->DGas();
418 tpar[2] = iChamber->DGas()/2;
419 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
420 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
421 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
422 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
424 // Frame Crosses to be placed inside gas
425 // NONE: chambers are sensitive everywhere
426 // if (frameCrosses) {
428 // dr = (iChamber->ROuter() - iChamber->RInner());
429 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
430 // bpar[1] = dframep1/2;
431 // bpar[2] = iChamber->DGas()/2;
432 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
433 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
435 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
436 // idrotm[1100],"ONLY");
437 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
438 // idrotm[1100],"ONLY");
439 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
440 // idrotm[1101],"ONLY");
441 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
442 // idrotm[1101],"ONLY");
444 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
445 // idrotm[1100],"ONLY");
446 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
447 // idrotm[1100],"ONLY");
448 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
449 // idrotm[1101],"ONLY");
450 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
451 // idrotm[1101],"ONLY");
454 // define the id of tracking media:
455 Int_t idCopper = idtmed[1110];
456 Int_t idGlass = idtmed[1111];
457 Int_t idCarbon = idtmed[1112];
458 Int_t idRoha = idtmed[1113];
460 // sensitive area: 40*40 cm**2
461 const Float_t sensLength = 40.;
462 const Float_t sensHeight = 40.;
463 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
464 const Int_t sensMaterial = idGas;
465 const Float_t yOverlap = 1.5;
467 // PCB dimensions in cm; width: 30 mum copper
468 const Float_t pcbLength = sensLength;
469 const Float_t pcbHeight = 60.;
470 const Float_t pcbWidth = 0.003;
471 const Int_t pcbMaterial = idCopper;
473 // Insulating material: 200 mum glass fiber glued to pcb
474 const Float_t insuLength = pcbLength;
475 const Float_t insuHeight = pcbHeight;
476 const Float_t insuWidth = 0.020;
477 const Int_t insuMaterial = idGlass;
479 // Carbon fiber panels: 200mum carbon/epoxy skin
480 const Float_t panelLength = sensLength;
481 const Float_t panelHeight = sensHeight;
482 const Float_t panelWidth = 0.020;
483 const Int_t panelMaterial = idCarbon;
485 // rohacell between the two carbon panels
486 const Float_t rohaLength = sensLength;
487 const Float_t rohaHeight = sensHeight;
488 const Float_t rohaWidth = 0.5;
489 const Int_t rohaMaterial = idRoha;
491 // Frame around the slat: 2 sticks along length,2 along height
492 // H: the horizontal ones
493 const Float_t hFrameLength = pcbLength;
494 const Float_t hFrameHeight = 1.5;
495 const Float_t hFrameWidth = sensWidth;
496 const Int_t hFrameMaterial = idGlass;
498 // V: the vertical ones
499 const Float_t vFrameLength = 4.0;
500 const Float_t vFrameHeight = sensHeight + hFrameHeight;
501 const Float_t vFrameWidth = sensWidth;
502 const Int_t vFrameMaterial = idGlass;
504 // B: the horizontal border filled with rohacell
505 const Float_t bFrameLength = hFrameLength;
506 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
507 const Float_t bFrameWidth = hFrameWidth;
508 const Int_t bFrameMaterial = idRoha;
510 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
511 const Float_t nulocLength = 2.5;
512 const Float_t nulocHeight = 7.5;
513 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
514 const Int_t nulocMaterial = idCopper;
516 const Float_t slatHeight = pcbHeight;
517 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
518 2.* panelWidth + rohaWidth);
519 const Int_t slatMaterial = idAir;
520 const Float_t dSlatLength = vFrameLength; // border on left and right
525 // the panel volume contains the rohacell
527 Float_t twidth = 2 * panelWidth + rohaWidth;
528 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
529 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
531 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
533 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
534 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
535 twidth -= 2 * insuWidth;
536 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
537 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
538 Float_t theight = 2*hFrameHeight + sensHeight;
539 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
540 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
541 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
542 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
544 Float_t xxmax = (bFrameLength - nulocLength)/2.;
549 //********************************************************************
551 //********************************************************************
552 // indices 1 and 2 for first and second chambers in the station
553 // iChamber (first chamber) kept for other quanties than Z,
554 // assumed to be the same in both chambers
555 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
556 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
557 zpos1=iChamber1->Z();
558 zpos2=iChamber2->Z();
559 dstation = zpos2 - zpos1;
561 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
564 tpar[0] = iChamber->RInner()-dframep;
565 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
566 tpar[2] = dstation/5;
568 char *slats5Mother = "S05M";
569 char *slats6Mother = "S06M";
573 if (gAlice->GetModule("DIPO")) {
581 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
582 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
583 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
584 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
587 // volumes for slat geometry (xx=5,..,10 chamber id):
588 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
589 // SxxG --> Sensitive volume (gas)
590 // SxxP --> PCB (copper)
591 // SxxI --> Insulator (vetronite)
592 // SxxC --> Carbon panel
594 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
595 // SB5x --> Volumes for the 35 cm long PCB
596 // slat dimensions: slat is a MOTHER volume!!! made of air
598 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
600 Float_t tlength = 35.;
601 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
602 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
603 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
604 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
605 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
606 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
607 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
609 const Int_t nSlats3 = 5; // number of slats per quadrant
610 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
611 const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
612 Float_t slatLength3[nSlats3];
614 // create and position the slat (mother) volumes
621 for (i = 0; i<nSlats3; i++){
622 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
623 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
624 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
625 Float_t ySlat31 = sensHeight * i - yOverlap * i;
626 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
627 spar[0] = slatLength3[i]/2.;
628 spar[1] = slatHeight/2.;
629 spar[2] = slatWidth/2. * 1.01;
630 // take away 5 cm from the first slat in chamber 5
632 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
633 spar2[0] = spar[0]-5./2.;
634 xSlat32 = xSlat3 - 5/2.;
642 Float_t dzCh3=spar[2] * 1.01;
643 // zSlat to be checked (odd downstream or upstream?)
644 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
645 sprintf(volNam5,"S05%d",i);
646 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
647 gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
648 gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
651 gMC->Gspos(volNam5, i*4+3,slats5Mother, xSlat32, ySlat32, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
652 gMC->Gspos(volNam5, i*4+4,slats5Mother,-xSlat32, ySlat32, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
654 sprintf(volNam6,"S06%d",i);
655 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
656 gMC->Gspos(volNam6, i*4+1,slats6Mother, xSlat3, ySlat31, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
657 gMC->Gspos(volNam6, i*4+2,slats6Mother,-xSlat3, ySlat31, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
659 gMC->Gspos(volNam6, i*4+3,slats6Mother, xSlat3, ySlat32, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
660 gMC->Gspos(volNam6, i*4+4,slats6Mother,-xSlat3, ySlat32, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
664 // create the panel volume
666 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
667 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
668 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
670 // create the rohacell volume
672 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
673 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
674 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
676 // create the insulating material volume
678 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
679 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
680 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
682 // create the PCB volume
684 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
685 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
686 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
688 // create the sensitive volumes,
689 gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
690 gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
693 // create the vertical frame volume
695 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
696 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
698 // create the horizontal frame volume
700 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
701 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
702 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
704 // create the horizontal border volume
706 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
707 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
708 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
711 for (i = 0; i<nSlats3; i++){
712 sprintf(volNam5,"S05%d",i);
713 sprintf(volNam6,"S06%d",i);
714 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
715 Float_t xvFrame2 = xvFrame;
716 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
717 // position the vertical frames
719 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
720 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
721 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
722 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
724 // position the panels and the insulating material
725 for (j=0; j<nPCB3[i]; j++){
727 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
728 Float_t xx2 = xx + 5/2.;
730 Float_t zPanel = spar[2] - panelpar[2];
731 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
732 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
733 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
734 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
736 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
737 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
738 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
739 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
742 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
743 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
744 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
746 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
747 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
748 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
752 // position the rohacell volume inside the panel volume
753 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
754 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
755 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
757 // position the PCB volume inside the insulating material volume
758 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
759 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
760 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
761 // position the horizontal frame volume inside the PCB volume
762 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
763 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
764 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
765 // position the sensitive volume inside the horizontal frame volume
766 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
767 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
768 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
769 // position the border volumes inside the PCB volume
770 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
771 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
772 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
773 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
774 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
775 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
776 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
778 // create the NULOC volume and position it in the horizontal frame
780 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
781 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
783 Float_t xxmax2 = xxmax - 5./2.;
784 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
786 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
787 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
788 if (xx > -xxmax2 && xx< xxmax2) {
789 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
790 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
792 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
793 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
796 // position the volumes approximating the circular section of the pipe
797 Float_t yoffs = sensHeight/2. - yOverlap;
798 Float_t epsilon = 0.001;
801 Double_t dydiv= sensHeight/ndiv;
802 Double_t ydiv = yoffs -dydiv;
806 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
807 for (Int_t idiv=0;idiv<ndiv; idiv++){
810 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
811 divpar[0] = (pcbLength-xdiv)/2.;
812 divpar[1] = dydiv/2. - epsilon;
813 divpar[2] = sensWidth/2.;
814 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
815 Float_t yvol=ydiv + dydiv/2.;
816 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
817 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother, xvol, yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
818 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother, xvol, yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
819 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother, xvol,-yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
820 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother, xvol,-yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
821 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,-xvol, yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
822 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,-xvol, yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
823 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,-xvol,-yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
824 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,-xvol,-yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
830 //********************************************************************
832 //********************************************************************
833 // indices 1 and 2 for first and second chambers in the station
834 // iChamber (first chamber) kept for other quanties than Z,
835 // assumed to be the same in both chambers
836 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
837 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
838 zpos1=iChamber1->Z();
839 zpos2=iChamber2->Z();
840 dstation = zpos2 - zpos1;
841 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
845 tpar[0] = iChamber->RInner()-dframep;
846 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
847 tpar[2] = dstation/4;
849 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
850 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
851 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
852 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
855 const Int_t nSlats4 = 6; // number of slats per quadrant
856 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
857 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
858 Float_t slatLength4[nSlats4];
860 // create and position the slat (mother) volumes
867 for (i = 0; i<nSlats4; i++){
868 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
869 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
870 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
871 ySlat4 = sensHeight * i - yOverlap *i;
873 spar[0] = slatLength4[i]/2.;
874 spar[1] = slatHeight/2.;
875 spar[2] = slatWidth/2.*1.01;
876 Float_t dzCh4=spar[2]*1.01;
877 // zSlat to be checked (odd downstream or upstream?)
878 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
879 sprintf(volNam7,"S07%d",i);
880 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
881 gMC->Gspos(volNam7, i*4+1,"S07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
882 gMC->Gspos(volNam7, i*4+2,"S07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
884 gMC->Gspos(volNam7, i*4+3,"S07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
885 gMC->Gspos(volNam7, i*4+4,"S07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
887 sprintf(volNam8,"S08%d",i);
888 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
889 gMC->Gspos(volNam8, i*4+1,"S08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
890 gMC->Gspos(volNam8, i*4+2,"S08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
892 gMC->Gspos(volNam8, i*4+3,"S08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
893 gMC->Gspos(volNam8, i*4+4,"S08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
898 // create the panel volume
900 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
901 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
903 // create the rohacell volume
905 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
906 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
908 // create the insulating material volume
910 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
911 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
913 // create the PCB volume
915 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
916 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
918 // create the sensitive volumes,
920 gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
921 gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
923 // create the vertical frame volume
925 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
926 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
928 // create the horizontal frame volume
930 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
931 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
933 // create the horizontal border volume
935 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
936 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
939 for (i = 0; i<nSlats4; i++){
940 sprintf(volNam7,"S07%d",i);
941 sprintf(volNam8,"S08%d",i);
942 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
943 // position the vertical frames
945 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
946 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
947 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
948 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
950 // position the panels and the insulating material
951 for (j=0; j<nPCB4[i]; j++){
953 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
955 Float_t zPanel = spar[2] - panelpar[2];
956 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
957 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
958 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
959 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
961 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
962 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
966 // position the rohacell volume inside the panel volume
967 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
968 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
970 // position the PCB volume inside the insulating material volume
971 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
972 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
973 // position the horizontal frame volume inside the PCB volume
974 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
975 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
976 // position the sensitive volume inside the horizontal frame volume
977 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
978 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
979 // position the border volumes inside the PCB volume
980 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
981 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
982 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
983 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
984 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
986 // create the NULOC volume and position it in the horizontal frame
988 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
989 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
991 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
993 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
994 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
995 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
996 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
999 // position the volumes approximating the circular section of the pipe
1000 Float_t yoffs = sensHeight/2. - yOverlap;
1001 Float_t epsilon = 0.001;
1004 Double_t dydiv= sensHeight/ndiv;
1005 Double_t ydiv = yoffs -dydiv;
1009 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1010 for (Int_t idiv=0;idiv<ndiv; idiv++){
1013 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1014 divpar[0] = (pcbLength-xdiv)/2.;
1015 divpar[1] = dydiv/2. - epsilon;
1016 divpar[2] = sensWidth/2.;
1017 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
1018 Float_t yvol=ydiv + dydiv/2.;
1019 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1020 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1021 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1022 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1023 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1024 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1025 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1026 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1038 //********************************************************************
1040 //********************************************************************
1041 // indices 1 and 2 for first and second chambers in the station
1042 // iChamber (first chamber) kept for other quanties than Z,
1043 // assumed to be the same in both chambers
1044 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1045 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1046 zpos1=iChamber1->Z();
1047 zpos2=iChamber2->Z();
1048 dstation = zpos2 - zpos1;
1049 // zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
1053 tpar[0] = iChamber->RInner()-dframep;
1054 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
1055 tpar[2] = dstation/5.;
1057 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1058 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1059 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1060 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1063 const Int_t nSlats5 = 7; // number of slats per quadrant
1064 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1065 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
1066 Float_t slatLength5[nSlats5];
1072 for (i = 0; i<nSlats5; i++){
1073 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
1074 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1075 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
1076 ySlat5 = sensHeight * i - yOverlap * i;
1077 spar[0] = slatLength5[i]/2.;
1078 spar[1] = slatHeight/2.;
1079 spar[2] = slatWidth/2. * 1.01;
1080 Float_t dzCh5=spar[2]*1.01;
1081 // zSlat to be checked (odd downstream or upstream?)
1082 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
1083 sprintf(volNam9,"S09%d",i);
1084 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
1085 gMC->Gspos(volNam9, i*4+1,"S09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1086 gMC->Gspos(volNam9, i*4+2,"S09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1088 gMC->Gspos(volNam9, i*4+3,"S09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1089 gMC->Gspos(volNam9, i*4+4,"S09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1091 sprintf(volNam10,"S10%d",i);
1092 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
1093 gMC->Gspos(volNam10, i*4+1,"S10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1094 gMC->Gspos(volNam10, i*4+2,"S10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1096 gMC->Gspos(volNam10, i*4+3,"S10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1097 gMC->Gspos(volNam10, i*4+4,"S10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
1101 // create the panel volume
1103 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1104 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
1106 // create the rohacell volume
1108 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1109 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
1111 // create the insulating material volume
1113 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1114 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1116 // create the PCB volume
1118 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1119 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1121 // create the sensitive volumes,
1123 gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
1124 gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
1126 // create the vertical frame volume
1128 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1129 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1131 // create the horizontal frame volume
1133 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1134 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1136 // create the horizontal border volume
1138 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1139 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1142 for (i = 0; i<nSlats5; i++){
1143 sprintf(volNam9,"S09%d",i);
1144 sprintf(volNam10,"S10%d",i);
1145 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
1146 // position the vertical frames
1148 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1149 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1150 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1151 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1154 // position the panels and the insulating material
1155 for (j=0; j<nPCB5[i]; j++){
1157 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1159 Float_t zPanel = spar[2] - panelpar[2];
1160 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1161 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1162 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1163 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1165 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1166 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1170 // position the rohacell volume inside the panel volume
1171 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1172 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1174 // position the PCB volume inside the insulating material volume
1175 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1176 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1177 // position the horizontal frame volume inside the PCB volume
1178 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1179 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1180 // position the sensitive volume inside the horizontal frame volume
1181 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1182 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1183 // position the border volumes inside the PCB volume
1184 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1185 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1186 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1187 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1188 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1190 // create the NULOC volume and position it in the horizontal frame
1192 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1193 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
1195 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1197 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1198 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1199 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1200 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
1202 // position the volumes approximating the circular section of the pipe
1203 Float_t yoffs = sensHeight/2. - yOverlap;
1204 Float_t epsilon = 0.001;
1207 Double_t dydiv= sensHeight/ndiv;
1208 Double_t ydiv = yoffs -dydiv;
1210 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1213 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1214 for (Int_t idiv=0;idiv<ndiv; idiv++){
1217 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1218 divpar[0] = (pcbLength-xdiv)/2.;
1219 divpar[1] = dydiv/2. - epsilon;
1220 divpar[2] = sensWidth/2.;
1221 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
1222 Float_t yvol=ydiv + dydiv/2.;
1223 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1224 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1225 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1226 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1227 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1228 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1229 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1230 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1236 //********************************************************************
1238 //********************************************************************
1241 zpos1 and zpos2 are the middle of the first and second
1242 planes of station 1 (+1m for second station):
1243 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
1244 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
1245 zposxm and zposxp= middles of gaz gaps within a detection plane
1246 rem: the total thickness accounts for 1 mm of al on both
1247 side of the RPCs (see zpos1 and zpos2)
1250 // vertical gap between right and left chambers (kDXZERO*2=4cm)
1251 const Float_t kDXZERO=2.;
1252 // main distances for chamber definition in first plane/first station
1253 const Float_t kXMIN=34.;
1254 const Float_t kXMED=51.;
1255 const Float_t kXMAX=272.;
1256 // kXMAX will become 255. in real life. segmentation to be updated accordingly
1257 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
1258 const Float_t kYMIN=34.;
1259 const Float_t kYMAX=51.;
1260 // inner/outer radius of flange between beam shield. and chambers (1/station)
1261 const Float_t kRMIN[2]={50.,50.};
1262 const Float_t kRMAX[2]={64.,68.};
1263 // z position of the middle of the gas gap in mother vol
1264 const Float_t kZm=-3.6;
1265 const Float_t kZp=+3.6;
1267 iChamber1 = (AliMUONChamber*) (*fChambers)[10];
1268 zpos1 = iChamber1->Z();
1270 // ratio of zpos1m/zpos1p and inverse for first plane
1271 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1274 Int_t icount=0; // chamber counter (0 1 2 3)
1276 for (Int_t istation=0; istation<2; istation++) { // loop on stations
1277 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
1279 Int_t iVolNum=1; // counter Volume Number
1280 icount = Int_t(iplane*TMath::Power(2,0))+
1281 Int_t(istation*TMath::Power(2,1));
1284 sprintf(volPlane,"SM%d%d",istation+1,iplane+1);
1286 iChamber = (AliMUONChamber*) (*fChambers)[10+icount];
1287 Float_t zpos = iChamber->Z();
1290 tpar[0] = iChamber->RInner();
1291 tpar[1] = iChamber->ROuter();
1293 gMC->Gsvolu(volPlane,"TUBE",idAir,tpar,3);
1295 // Flange between beam shielding and RPC
1296 tpar[0]= kRMIN[istation];
1297 tpar[1]= kRMAX[istation];
1301 sprintf(volFlange,"SF%dA",icount+1);
1302 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); //Al
1303 gMC->Gspos(volFlange,1,volPlane,0.,0.,0.,0,"MANY");
1306 Float_t zRatio = zpos / zpos1;
1308 // chamber prototype
1313 char volAlu[5]; // Alu
1314 char volBak[5]; // Bakelite
1315 char volGaz[5]; // Gas streamer
1317 sprintf(volAlu,"SC%dA",icount+1);
1318 sprintf(volBak,"SB%dA",icount+1);
1319 sprintf(volGaz,"SG%dA",icount+1);
1321 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
1322 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
1323 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
1329 Float_t xA=(kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
1334 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
1336 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
1339 tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
1340 tpar[1] = kYMIN*zRatio;
1342 gMC->Gsposp(volAlu,iVolNum++,volPlane, xA,yAm,kZm,0,"ONLY",tpar,3);
1343 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xA,yAp,kZp,0,"ONLY",tpar,3);
1344 gMC->Gsbool(volAlu,volFlange);
1347 Float_t tpar1save=tpar[1];
1348 Float_t y1msave=yAm;
1349 Float_t y1psave=yAp;
1351 tpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
1352 tpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
1354 Float_t xB=(kDXZERO+kXMIN)*zRatio+tpar[0];
1355 Float_t yBp=(y1msave+tpar1save)*zpm+tpar[1];
1356 Float_t yBm=(y1psave+tpar1save)*zmp+tpar[1];
1358 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB, yBp,kZp,0,"ONLY",tpar,3);
1359 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xB, yBm,kZm,0,"ONLY",tpar,3);
1360 gMC->Gsposp(volAlu,iVolNum++,volPlane, xB,-yBp,kZp,0,"ONLY",tpar,3);
1361 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xB,-yBm,kZm,0,"ONLY",tpar,3);
1363 // chamber type C (note : same Z than type B)
1368 tpar[0] = (kXMAX/2)*zRatio;
1369 tpar[1] = (kYMAX/2)*zRatio;
1371 Float_t xC=kDXZERO*zRatio+tpar[0];
1372 Float_t yCp=(y1psave+tpar1save)*1.+tpar[1];
1373 Float_t yCm=(y1msave+tpar1save)*1.+tpar[1];
1375 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC, yCp,kZp,0,"ONLY",tpar,3);
1376 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC, yCm,kZm,0,"ONLY",tpar,3);
1377 gMC->Gsposp(volAlu,iVolNum++,volPlane, xC,-yCp,kZp,0,"ONLY",tpar,3);
1378 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xC,-yCm,kZm,0,"ONLY",tpar,3);
1380 // chamber type D, E and F (same size)
1385 tpar[0] = (kXMAX/2.)*zRatio;
1386 tpar[1] = kYMIN*zRatio;
1388 Float_t xD=kDXZERO*zRatio+tpar[0];
1389 Float_t yDp=(y1msave+tpar1save)*zpm+tpar[1];
1390 Float_t yDm=(y1psave+tpar1save)*zmp+tpar[1];
1392 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yDm,kZm,0,"ONLY",tpar,3);
1393 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD, yDp,kZp,0,"ONLY",tpar,3);
1394 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yDm,kZm,0,"ONLY",tpar,3);
1395 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD,-yDp,kZp,0,"ONLY",tpar,3);
1400 Float_t yEp=(y1msave+tpar1save)*zpm+tpar[1];
1401 Float_t yEm=(y1psave+tpar1save)*zmp+tpar[1];
1403 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yEp,kZp,0,"ONLY",tpar,3);
1404 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD, yEm,kZm,0,"ONLY",tpar,3);
1405 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yEp,kZp,0,"ONLY",tpar,3);
1406 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD,-yEm,kZm,0,"ONLY",tpar,3);
1411 Float_t yFp=(y1msave+tpar1save)*zpm+tpar[1];
1412 Float_t yFm=(y1psave+tpar1save)*zmp+tpar[1];
1414 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD, yFm,kZm,0,"ONLY",tpar,3);
1415 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD, yFp,kZp,0,"ONLY",tpar,3);
1416 gMC->Gsposp(volAlu,iVolNum++,volPlane, xD,-yFm,kZm,0,"ONLY",tpar,3);
1417 gMC->Gsposp(volAlu,iVolNum++,volPlane,-xD,-yFp,kZp,0,"ONLY",tpar,3);
1419 // Positioning plane in ALICE
1420 gMC->Gspos(volPlane,1,"ALIC",0.,0.,zpos,0,"ONLY");
1422 } // end loop on detection planes
1423 } // end loop on stations
1428 //___________________________________________
1429 void AliMUONv1::CreateMaterials()
1431 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1433 // Ar-CO2 gas (80%+20%)
1434 Float_t ag1[3] = { 39.95,12.01,16. };
1435 Float_t zg1[3] = { 18.,6.,8. };
1436 Float_t wg1[3] = { .8,.0667,.13333 };
1437 Float_t dg1 = .001821;
1439 // Ar-buthane-freon gas -- trigger chambers
1440 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1441 Float_t ztr1[4] = { 18.,6.,1.,9. };
1442 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1443 Float_t dtr1 = .002599;
1446 Float_t agas[3] = { 39.95,12.01,16. };
1447 Float_t zgas[3] = { 18.,6.,8. };
1448 Float_t wgas[3] = { .74,.086684,.173316 };
1449 Float_t dgas = .0018327;
1451 // Ar-Isobutane gas (80%+20%) -- tracking
1452 Float_t ag[3] = { 39.95,12.01,1.01 };
1453 Float_t zg[3] = { 18.,6.,1. };
1454 Float_t wg[3] = { .8,.057,.143 };
1455 Float_t dg = .0019596;
1457 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1458 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1459 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1460 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1461 Float_t dtrig = .0031463;
1465 Float_t abak[3] = {12.01 , 1.01 , 16.};
1466 Float_t zbak[3] = {6. , 1. , 8.};
1467 Float_t wbak[3] = {6. , 6. , 1.};
1470 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1472 Int_t iSXFLD = gAlice->Field()->Integ();
1473 Float_t sXMGMX = gAlice->Field()->Max();
1475 // --- Define the various materials for GEANT ---
1476 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1477 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1478 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1479 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1480 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1481 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1482 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1483 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1484 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1485 // materials for slat:
1486 // Sensitive area: gas (already defined)
1488 // insulating material and frame: vetronite
1489 // walls: carbon, rohacell, carbon
1490 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1491 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1492 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1493 Float_t dglass=1.74;
1495 // rohacell: C9 H13 N1 O2
1496 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1497 Float_t zrohac[4] = { 6., 1., 7., 8.};
1498 Float_t wrohac[4] = { 9., 13., 1., 2.};
1499 Float_t drohac = 0.03;
1501 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1502 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1503 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1504 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1507 epsil = .001; // Tracking precision,
1508 stemax = -1.; // Maximum displacement for multiple scat
1509 tmaxfd = -20.; // Maximum angle due to field deflection
1510 deemax = -.3; // Maximum fractional energy loss, DLS
1514 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1518 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1519 fMaxDestepAlu, epsil, stmin);
1520 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1521 fMaxDestepAlu, epsil, stmin);
1525 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1526 fMaxDestepGas, epsil, stmin);
1528 // Ar-Isobuthane-Forane-SF6 gas
1530 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1532 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1533 fMaxDestepAlu, epsil, stmin);
1535 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1536 fMaxDestepAlu, epsil, stmin);
1537 // tracking media for slats: check the parameters!!
1538 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1539 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1540 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1541 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1542 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1543 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1544 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1545 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1548 //___________________________________________
1550 void AliMUONv1::Init()
1553 // Initialize Tracking Chambers
1556 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
1558 for (i=0; i<AliMUONConstants::NCh(); i++) {
1559 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1563 // Set the chamber (sensitive region) GEANT identifier
1564 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("S01G"));
1565 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("S02G"));
1567 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
1568 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
1570 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1571 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
1573 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1574 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
1576 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1577 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
1579 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
1580 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
1581 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
1582 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
1584 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
1587 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
1588 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1589 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1591 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
1595 //___________________________________________
1596 void AliMUONv1::StepManager()
1598 if (fStepManagerVersionOld) {
1606 // Particule id, pos and mom vectors,
1607 // theta, phi angles with respect the normal of the chamber,
1608 // spatial step, delta_energy and time of flight
1610 TLorentzVector pos, mom;
1611 Float_t theta, phi, tof;
1612 Float_t destep, step;
1613 const Float_t kBig = 1.e10;
1615 // Only charged tracks
1616 if( !(gMC->TrackCharge()) ) return;
1618 // Only gas gap inside chamber
1619 // Tag chambers and record hits when track enters
1621 id=gMC->CurrentVolID(copy);
1622 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
1623 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) {
1628 if (idvol == -1) return;
1631 // record hits when track enters ...
1632 if( gMC->IsTrackEntering()) gMC->SetMaxStep(fStepMaxInActiveGas);
1634 if (gMC->TrackStep() > 0.) {
1635 // Get current particle id (ipart), track position (pos) and momentum (mom)
1636 gMC->TrackPosition(pos);
1637 gMC->TrackMomentum(mom);
1638 ipart = gMC->TrackPid();
1639 theta = mom.Theta()*kRaddeg; // theta of track
1640 phi = mom.Phi() *kRaddeg; // phi of the track
1641 tof = gMC->TrackTime(); // Time of flight
1643 // momentum loss and steplength in last step
1644 destep = gMC->Edep();
1645 step = gMC->TrackStep();
1648 GetMUONData()->AddHit(fIshunt, gAlice->GetCurrentTrackNumber(), iChamber, ipart,
1649 pos.X(), pos.Y(), pos.Z(), tof, mom.P(),
1650 theta, phi, step, destep);
1652 // Track left chamber ...
1653 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1654 gMC->SetMaxStep(kBig);
1659 Int_t AliMUONv1::GetChamberId(Int_t volId) const
1661 // Check if the volume with specified volId is a sensitive volume (gas)
1662 // of some chamber and returns the chamber number;
1663 // if not sensitive volume - return 0.
1666 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
1667 if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
1672 //___________________________________________
1673 void AliMUONv1::StepManagerOld()
1677 static Int_t vol[2];
1682 Float_t destep, step;
1684 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
1685 const Float_t kBig = 1.e10;
1686 static Float_t hits[15];
1688 TClonesArray &lhits = *fHits;
1692 // Only charged tracks
1693 if( !(gMC->TrackCharge()) ) return;
1695 // Only gas gap inside chamber
1696 // Tag chambers and record hits when track enters
1697 id=gMC->CurrentVolID(copy);
1698 vol[0] = GetChamberId(id);
1701 if (idvol == -1) return;
1704 // Get current particle id (ipart), track position (pos) and momentum (mom)
1705 gMC->TrackPosition(pos);
1706 gMC->TrackMomentum(mom);
1708 ipart = gMC->TrackPid();
1711 // momentum loss and steplength in last step
1712 destep = gMC->Edep();
1713 step = gMC->TrackStep();
1716 // record hits when track enters ...
1717 if( gMC->IsTrackEntering()) {
1718 gMC->SetMaxStep(fMaxStepGas);
1719 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1720 Double_t rt = TMath::Sqrt(tc);
1721 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1722 Double_t tx = mom[0]/pmom;
1723 Double_t ty = mom[1]/pmom;
1724 Double_t tz = mom[2]/pmom;
1725 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
1728 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1729 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1730 hits[0] = Float_t(ipart); // Geant3 particle type
1731 hits[1] = pos[0]+s*tx; // X-position for hit
1732 hits[2] = pos[1]+s*ty; // Y-position for hit
1733 hits[3] = pos[2]+s*tz; // Z-position for hit
1734 hits[4] = theta; // theta angle of incidence
1735 hits[5] = phi; // phi angle of incidence
1736 hits[8] = 0;//PadHits does not exist anymore (Float_t) fNPadHits; // first padhit
1737 hits[9] = -1; // last pad hit
1738 hits[10] = mom[3]; // hit momentum P
1739 hits[11] = mom[0]; // Px
1740 hits[12] = mom[1]; // Py
1741 hits[13] = mom[2]; // Pz
1742 tof=gMC->TrackTime();
1743 hits[14] = tof; // Time of flight
1750 Chamber(idvol).ChargeCorrelationInit();
1751 // Only if not trigger chamber
1756 if(idvol < AliMUONConstants::NTrackingCh()) {
1758 // Initialize hit position (cursor) in the segmentation model
1759 ((AliMUONChamber*) (*fChambers)[idvol])
1760 ->SigGenInit(pos[0], pos[1], pos[2]);
1763 //printf("In the Trigger Chamber #%d\n",idvol-9);
1769 // Calculate the charge induced on a pad (disintegration) in case
1771 // Mip left chamber ...
1772 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1773 gMC->SetMaxStep(kBig);
1778 Float_t localPos[3];
1779 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1780 gMC->Gmtod(globalPos,localPos,1);
1782 if(idvol < AliMUONConstants::NTrackingCh()) {
1783 // tracking chambers
1784 x0 = 0.5*(xhit+pos[0]);
1785 y0 = 0.5*(yhit+pos[1]);
1786 z0 = 0.5*(zhit+pos[2]);
1795 // if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
1798 hits[6] = tlength; // track length
1799 hits[7] = eloss2; // de/dx energy loss
1801 // if (fNPadHits > (Int_t)hits[8]) {
1802 // hits[8] = hits[8]+1;
1803 // hits[9] = 0: // PadHits does not exist anymore (Float_t) fNPadHits;
1808 new(lhits[fNhits++])
1809 AliMUONHit(fIshunt, gAlice->GetCurrentTrackNumber(), vol,hits);
1812 // Check additional signal generation conditions
1813 // defined by the segmentation
1814 // model (boundary crossing conditions)
1815 // only for tracking chambers
1817 ((idvol < AliMUONConstants::NTrackingCh()) &&
1818 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
1820 ((AliMUONChamber*) (*fChambers)[idvol])
1821 ->SigGenInit(pos[0], pos[1], pos[2]);
1823 Float_t localPos[3];
1824 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
1825 gMC->Gmtod(globalPos,localPos,1);
1829 // if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1830 // MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
1837 // nothing special happened, add up energy loss