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 purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Class AliMUONSlatGeometryBuilder
19 // -------------------------------
20 // Abstract base class for geometry construction per chamber.
25 // This Builder is designed according to the enveloppe methode. The basic idea is to be able to allow moves
26 // of the slats on the support panels.
27 // Those moves can be described with a simple set of parameters. The next step should be now to describe all
28 // the slats and their places by a unique
29 // class, which would make the SlatBuilder far more compact since now only three parameters can define a slat
30 // and its position, like:
31 // * Bool_t rounded_shape_slat
32 // * Float_t slat_length
33 // * Float_t slat_number or Float_t slat_position
35 #include <TVirtualMC.h>
36 #include <TGeoMatrix.h>
37 #include <Riostream.h>
42 #include "AliMUONSlatGeometryBuilder.h"
44 #include "AliMUONConstants.h"
45 #include "AliMUONGeometryModule.h"
46 #include "AliMUONGeometryEnvelopeStore.h"
47 #include "AliMUONConstants.h"
50 ClassImp(AliMUONSlatGeometryBuilder)
53 //______________________________________________________________________________
54 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
55 : AliMUONVGeometryBuilder(4, 5, 6, 7, 8, 9),
58 // Standard constructor
62 //______________________________________________________________________________
63 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
64 : AliMUONVGeometryBuilder(),
67 // Default constructor
70 //______________________________________________________________________________
71 AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
79 //______________________________________________________________________________
80 void AliMUONSlatGeometryBuilder::CreateGeometry()
82 // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
83 // It includes description and placements of support panels and slats.
84 // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning
85 // the use of Enveloppe method to place the Geant volumes.
86 // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters,
87 // and this builder would then be dedicated only to the
88 // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
90 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
95 // define the id of tracking media:
96 Int_t idAir = idtmed[1100]; // medium 1
97 Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
98 Int_t idCopper = idtmed[1110];
99 Int_t idG10 = idtmed[1111];
100 Int_t idCarbon = idtmed[1112];
101 Int_t idRoha = idtmed[1113];
102 Int_t idNomex = idtmed[1114]; // honey comb
103 Int_t idNoryl = idtmed[1115];
104 Int_t idNomexB = idtmed[1116]; // bulk material
106 // sensitive area: 40*40 cm**2
107 const Float_t kSensLength = 40.;
108 const Float_t kSensHeight = 40.;
109 const Float_t kSensWidth = AliMUONConstants::Pitch()*2;// 0.5 cm, according to TDR fig 2.120
110 const Int_t kSensMaterial = idGas;
111 // const Float_t kYoverlap = 1.5;
113 // PCB dimensions in cm; width: 30 mum copper
114 const Float_t kPcbLength = kSensLength;
115 const Float_t kPcbHeight = 58.; // updated Ch. Finck
116 const Float_t kPcbWidth = 0.003;
117 const Int_t kPcbMaterial = idCopper;
119 // Insulating material: 220 mum G10 fiber glued to pcb
120 const Float_t kInsuLength = kPcbLength;
121 const Float_t kInsuHeight = kPcbHeight;
122 const Float_t kInsuWidth = 0.022; // updated Ch. Finck
123 const Int_t kInsuMaterial = idG10;
125 // Carbon fiber panels: 200mum carbon/epoxy skin
126 const Float_t kCarbonWidth = 0.020;
127 const Int_t kCarbonMaterial = idCarbon;
129 // Nomex (honey comb) between the two panel carbon skins
130 const Float_t kNomexLength = kSensLength;
131 const Float_t kNomexHeight = kSensHeight;
132 const Float_t kNomexWidth = 0.8; // updated Ch. Finck
133 const Int_t kNomexMaterial = idNomex;
135 // Bulk Nomex under panel sandwich Ch. Finck
136 const Float_t kNomexBWidth = 0.025;
137 const Int_t kNomexBMaterial = idNomexB;
139 // Panel sandwich 0.02 carbon*2 + 0.8 nomex
140 const Float_t kPanelLength = kSensLength;
141 const Float_t kPanelHeight = kSensHeight;
142 const Float_t kPanelWidth = 2 * kCarbonWidth + kNomexWidth;
144 // Frame along the rounded (spacers) slats
145 const Float_t kRframeHeight = 2.00;
147 // spacer around the slat: 2 sticks along length,2 along height
148 // H: the horizontal ones
149 const Float_t kHframeLength = kPcbLength;
150 const Float_t kHframeHeight = 1.95; // updated Ch. Finck
151 const Float_t kHframeWidth = kSensWidth;
152 const Int_t kHframeMaterial = idNoryl;
154 // V: the vertical ones; vertical spacers
155 const Float_t kVframeLength = 2.5;
156 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
157 const Float_t kVframeWidth = kSensWidth;
158 const Int_t kVframeMaterial = idNoryl;
160 // B: the horizontal border filled with rohacell: ok Ch. Finck
161 const Float_t kBframeLength = kHframeLength;
162 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
163 const Float_t kBframeWidth = kHframeWidth;
164 const Int_t kBframeMaterial = idRoha;
166 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics
167 const Float_t kNulocLength = 2.5;
168 const Float_t kNulocHeight = kBframeHeight;
169 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
170 const Int_t kNulocMaterial = idCopper;
173 const Float_t kSlatHeight = kPcbHeight;
174 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth
175 + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck
176 // const Int_t kSlatMaterial = idAir;
177 const Float_t kDslatLength = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck
178 Float_t zSlat = AliMUONConstants::DzSlat();// implemented Ch. Finck
179 Float_t dzCh = AliMUONConstants::DzCh();
185 // the panel volume contains the nomex
186 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. };
187 Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. };
188 Float_t twidth = kPanelWidth + kNomexBWidth;
189 Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex
191 // insulating material contains PCB-> gas
192 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ;
193 Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. };
194 twidth -= 2 * kInsuWidth;
195 Float_t pcbpar[3] = {kPcbLength/2., kPcbHeight/2., twidth/2. };
196 Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. };
197 Float_t theight = 2 * kHframeHeight + kSensHeight;
198 Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.};
199 Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
200 Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
201 Float_t nulocpar[3] = {kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
204 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
207 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
209 Int_t* fStations = new Int_t[5];
210 for (Int_t i=0; i<5; i++) fStations[i] = 1;
215 //********************************************************************
217 //********************************************************************
218 // indices 1 and 2 for first and second chambers in the station
219 // iChamber (first chamber) kept for other quanties than Z,
220 // assumed to be the same in both chambers
222 iChamber = &fMUON->Chamber(4);
223 iChamber1 = iChamber;
224 iChamber2 = &fMUON->Chamber(5);
226 //GetGeometry(4)->SetDebug(kTRUE);
227 //GetGeometry(5)->SetDebug(kTRUE);
229 if (!gAlice->GetModule("DIPO")) {
230 // Mother volume for each chamber in st3 are only defined if Dipole volue is there.
231 // Outer excess and inner recess for mother volume radius
232 // with respect to ROuter and RInner
233 Float_t dMotherInner = AliMUONConstants::Rmin(2)-kRframeHeight;
234 Float_t dMotherOutner= AliMUONConstants::Rmax(2)+kVframeLength + 37.0;
235 // Additional 37 cm gap is needed to wrap the corners of the slats sin Rmax represent the maximum active radius of the chamber with 2pi phi acceptance
237 Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(5)) -
238 (-AliMUONConstants::DefaultChamberZ(4)) ) /2.1;
239 tpar[0] = dMotherInner;
240 tpar[1] = dMotherOutner;
242 gMC->Gsvolu("CH05", "TUBE", idAir, tpar, 3);
243 gMC->Gsvolu("CH06", "TUBE", idAir, tpar, 3);
245 // volumes for slat geometry (xx=5,..,10 chamber id):
246 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
247 // SxxG --> Sensitive volume (gas)
248 // SxxP --> PCB (copper)
249 // SxxI --> Insulator (G10)
250 // SxxC --> Carbon panel
251 // SxxN --> Nomex comb
252 // SxxX --> Nomex bulk
253 // SxxH, SxxV --> Horizontal and Vertical frames (Noryl)
254 // SB5x --> Volumes for the 35 cm long PCB
255 // slat dimensions: slat is a MOTHER volume!!! made of air
257 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
259 Float_t tlength = 35.;
260 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
261 Float_t nomexpar2[3] = { tlength/2., nomexpar[1], nomexpar[2]};
262 Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1], nomexbpar[2]};
263 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
264 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
265 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
266 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
267 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
269 Float_t pcbDLength3 = (kPcbLength - tlength);
271 const Int_t kNslats3 = 5; // number of slats per quadrant
272 const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
273 const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
274 const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7};
275 Float_t slatLength3[kNslats3];
277 // create and position the slat (mother) volumes
285 for (i = 0; i < kNslats3; i++){
287 slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength;
288 xSlat3 = slatLength3[i]/2. + kDslatLength + kXpos3[i];
291 spar[0] = slatLength3[i]/2.;
292 spar[1] = kSlatHeight/2.;
293 spar[2] = kSlatWidth/2.;
294 // take away 5 cm from the first slat in chamber 5
295 if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
296 spar2[0] = spar[0] - pcbDLength3/2.;
302 Float_t dzCh3 = dzCh;
303 Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
305 sprintf(idSlatCh5,"LA%d",i+kNslats3-1);
306 //gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
307 detElemId = 509 - (i + kNslats3-1-4);
308 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
309 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
311 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
312 //gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
313 detElemId = 500 + (i + kNslats3-1-4);
314 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
315 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
318 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
319 // gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
320 detElemId = 509 + (i + kNslats3-1-4);
321 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
322 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
324 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
325 // gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
326 detElemId = 518 - (i + kNslats3-1-4);
327 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
328 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
331 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
332 // gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
333 detElemId = 609 - (i + kNslats3-1-4);
334 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
335 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
336 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
337 // gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
338 detElemId = 600 + (i + kNslats3-1-4);
339 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
340 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
343 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
344 //gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
345 detElemId = 609 + (i + kNslats3-1-4);
346 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
347 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
349 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
350 //gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
351 detElemId = 618 - (i + kNslats3-1-4);
352 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
353 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
357 // create the panel volume
359 gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
360 gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
361 gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
363 // create the nomex volume (honey comb)
365 gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
366 gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
367 gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
369 // create the nomex volume (bulk)
371 gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3);
372 gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3);
373 gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3);
375 // create the insulating material volume
377 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
378 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
379 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
381 // create the PCB volume
383 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
384 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
385 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
387 // create the sensitive volumes,
389 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
390 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
392 // create the vertical frame volume
394 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
395 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
397 // create the horizontal frame volume
399 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
400 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
401 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
403 // create the horizontal border volume
405 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
406 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
407 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
410 for (i = 0; i<kNslats3; i++){
411 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
413 if (i == 0 && quadrant == 2) continue;
414 if (i == 0 && quadrant == 4) continue;
416 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
417 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
418 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
419 Float_t xvFrame2 = xvFrame;
421 if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
423 // position the vertical frames
425 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
426 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
427 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
428 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
429 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
430 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
431 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
432 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
436 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
437 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
438 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
439 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
440 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
441 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
442 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
443 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
446 if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
447 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
448 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
449 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
450 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
453 // position the panels and the insulating material
454 for (j = 0; j < kNPCB3[i]; j++){
455 if (i == 1 && j == 0) continue;
456 if (i == 0 && j == 0) continue;
458 Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
459 Float_t xx2 = xx - pcbDLength3/2.;
461 Float_t zPanel = spar[2] - nomexbpar[2];
463 if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
464 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
465 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
466 GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
468 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
469 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
470 GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
472 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
473 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
474 GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
480 // position the nomex volume inside the panel volume
481 gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY");
482 gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY");
483 gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY");
485 // position panel volume inside the bulk nomex material volume
486 gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY");
487 gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY");
488 gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY");
490 // position the PCB volume inside the insulating material volume
491 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
492 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
493 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
495 // position the horizontal frame volume inside the PCB volume
496 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
497 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
498 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
500 // position the sensitive volume inside the horizontal frame volume
501 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
502 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
503 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
506 // position the border volumes inside the PCB volume
507 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
508 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
509 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
510 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
511 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
513 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
514 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
516 // create the NULOC volume and position it in the horizontal frame
517 gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
518 gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3);
520 Float_t xxmax2 = xxmax - pcbDLength3/2.;
521 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
523 gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
524 gMC->Gspos("S05E",2*index ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
525 gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
526 gMC->Gspos("S06E",2*index ,"S06B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
527 if (xx > -xxmax2 && xx< xxmax2) {
528 gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
529 gMC->Gspos("S05E",2*index ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
533 // position the volumes approximating the circular section of the pipe
534 Float_t epsilon = 0.001;
538 Double_t dydiv = kSensHeight/ndiv;
539 Double_t ydiv = (kSensHeight - dydiv)/2.;
540 Double_t rmin = AliMUONConstants::Rmin(2);// Same radius for both chamber in St3
545 for (Int_t idiv = 0; idiv < ndiv; idiv++){
548 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
549 divpar[0] = (kPcbLength - xdiv)/2.;
550 divpar[1] = dydiv/2. - epsilon;
551 divpar[2] = kSensWidth/2.;
552 xvol = (kPcbLength + xdiv)/2.;
555 // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
556 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
557 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
558 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
560 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
561 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
563 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,
564 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
568 // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
569 // Gines Martinez, Subatech sep 04
570 // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
571 // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
573 rmin = AliMUONConstants::Rmin(2); // Same radius for both chamber in St3
575 dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB
576 ydiv = -kSensHeight/2 + dydiv/2.; // Initializing vertical position of the volume from bottom
577 xdiv = 0.; // Initializing horizontal position of the box volumes
579 for (Int_t idiv = 0; idiv < ndiv; idiv++){
580 xdiv = TMath::Abs( rmin * TMath::Sin( TMath::ACos(ydiv/rmin) ) );
581 divpar[0] = (kPcbLength - xdiv)/2.; // Dimension of the box volume
582 divpar[1] = dydiv/2. - epsilon;
583 divpar[2] = kSensWidth/2.;
584 xvol = (kPcbLength + xdiv)/2.; //2D traslition for positionning of box volume
587 for (side = 1; side <= 2; side++) {
588 sprintf(idSlatCh5,"LA%d",4);
589 sprintf(idSlatCh6,"LB%d",4);
591 sprintf(idSlatCh5,"LA%d",13);
592 sprintf(idSlatCh6,"LB%d",13);
594 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
595 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
597 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
598 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
600 ydiv += dydiv; // Going from bottom to top
602 // cout << "Geometry for Station 3...... done" << endl;
608 // //********************************************************************
610 // //********************************************************************
611 // // indices 1 and 2 for first and second chambers in the station
612 // // iChamber (first chamber) kept for other quanties than Z,
613 // // assumed to be the same in both chambers
614 // corrected geometry (JP. Cussonneau, Ch. Finck)
616 iChamber = &fMUON->Chamber(6);
617 iChamber1 = iChamber;
618 iChamber2 = &fMUON->Chamber(7);
620 const Int_t kNslats4 = 7; // number of slats per quadrant
621 const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
622 const Float_t kXpos4[kNslats4] = {38.2, 0., 0., 0., 0., 0., 0.};
623 const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6};
624 const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 29.4, 37.0, 28.6};
626 Float_t slatLength4[kNslats4];
629 // Mother volume for each chamber
630 // Outer excess and inner recess for mother volume radius
631 // with respect to ROuter and RInner
632 Float_t dMotherInner = AliMUONConstants::Rmin(3)-kRframeHeight;
633 // Additional 40 cm gap is needed to wrap the corners of the slats since Rmax represent the maximum active radius of the chamber with 2pi phi acceptance
634 Float_t dMotherOutner= AliMUONConstants::Rmax(3)+kVframeLength + 40.0;
636 Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(7)) -
637 (-AliMUONConstants::DefaultChamberZ(6)) ) /2.2;
638 tpar[0] = dMotherInner;
639 tpar[1] = dMotherOutner;
641 gMC->Gsvolu("CH07", "TUBE", idAir, tpar, 3);
642 gMC->Gsvolu("CH08", "TUBE", idAir, tpar, 3);
644 // create and position the slat (mother) volumes
654 for (i = 0; i<kNslats4; i++){
655 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength;
656 xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i];
657 ySlat41 += kYpos41[i];
658 ySlat42 += kYpos42[i];
660 spar[0] = slatLength4[i]/2.;
661 spar[1] = kSlatHeight/2.;
662 spar[2] = kSlatWidth/2.;
663 Float_t dzCh4 = dzCh;
664 Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat;
666 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
667 //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
668 detElemId = 713 - (i + kNslats4-1-6);
669 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4),
670 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
672 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
673 //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
674 detElemId = 700 + (i + kNslats4-1-6);
675 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4),
676 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
679 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
680 //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
681 detElemId = 713 + (i + kNslats4-1-6);
682 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4),
683 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
685 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
686 detElemId = 726 - (i + kNslats4-1-6);
687 //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
688 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true,
689 TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4),
690 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
693 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
694 //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
695 detElemId = 813 - (i + kNslats4-1-6);
696 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4),
697 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
699 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
700 detElemId = 800 + (i + kNslats4-1-6);
701 //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
702 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4),
703 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
705 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
706 detElemId = 813 + (i + kNslats4-1-6);
707 //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
708 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4),
709 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
710 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
711 detElemId = 826 - (i + kNslats4-1-6);
712 //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
713 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4),
714 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
718 // create the panel volume
720 gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
721 gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
723 // create the nomex volume
725 gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
726 gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
729 // create the nomex volume (bulk)
731 gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
732 gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
734 // create the insulating material volume
736 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
737 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
739 // create the PCB volume
741 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
742 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
744 // create the sensitive volumes,
746 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
747 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
749 // create the vertical frame volume
751 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
752 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
754 // create the horizontal frame volume
756 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
757 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
759 // create the horizontal border volume
761 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
762 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
765 for (i = 0; i < kNslats4; i++){
766 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
768 if (i == 0 && quadrant == 2) continue;
769 if (i == 0 && quadrant == 4) continue;
771 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
772 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
773 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
775 // position the vertical frames
777 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
778 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
779 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
780 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
781 } else { // no rounded spacer yet
782 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
783 // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
784 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
785 // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
787 // position the panels and the insulating material
788 for (j = 0; j < kNPCB4[i]; j++){
789 if (i == 1 && j == 0) continue;
791 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
793 Float_t zPanel = spar[2] - nomexbpar[2];
794 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
795 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
796 GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
797 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
798 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
799 GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
804 // position the nomex volume inside the panel volume
805 gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY");
806 gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY");
808 // position panel volume inside the bulk nomex material volume
809 gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY");
810 gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY");
812 // position the PCB volume inside the insulating material volume
813 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
814 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
816 // position the horizontal frame volume inside the PCB volume
817 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
818 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
820 // position the sensitive volume inside the horizontal frame volume
821 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
822 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
824 // position the border volumes inside the PCB volume
825 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
826 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
827 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
828 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
829 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
831 // create the NULOC volume and position it in the horizontal frame
833 gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3);
834 gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3);
836 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
838 gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
839 gMC->Gspos("S07E",2*index ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
840 gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
841 gMC->Gspos("S08E",2*index ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
844 // position the volumes approximating the circular section of the pipe
846 Float_t epsilon = 0.001;
850 Double_t dydiv = kSensHeight/ndiv;
851 Double_t ydiv = (kSensHeight - dydiv)/2.;
852 Float_t rmin = AliMUONConstants::Rmin(3); // Same radius for both chamber of St4
857 for (Int_t idiv = 0; idiv < ndiv; idiv++){
860 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
861 divpar[0] = (kPcbLength - xdiv)/2.;
862 divpar[1] = dydiv/2. - epsilon;
863 divpar[2] = kSensWidth/2.;
864 xvol = (kPcbLength + xdiv)/2.;
867 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
868 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
869 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
871 GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
872 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
874 GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
875 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
878 // cout << "Geometry for Station 4...... done" << endl;
885 // //********************************************************************
887 // //********************************************************************
888 // // indices 1 and 2 for first and second chambers in the station
889 // // iChamber (first chamber) kept for other quanties than Z,
890 // // assumed to be the same in both chambers
891 // corrected geometry (JP. Cussonneau, Ch. Finck)
893 iChamber = &fMUON->Chamber(8);
894 iChamber1 = iChamber;
895 iChamber2 = &fMUON->Chamber(9);
897 const Int_t kNslats5 = 7; // number of slats per quadrant
898 const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
899 const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.};
900 const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75};
901 Float_t slatLength5[kNslats5];
903 // Mother volume for each chamber
904 // Outer excess and inner recess for mother volume radius
905 // with respect to ROuter and RInner
906 Float_t dMotherInner = AliMUONConstants::Rmin(4)-kRframeHeight;
907 // Additional 40 cm gap is needed to wrap the corners of the slats since Rmax represent the maximum active radius of the chamber with 2pi phi acceptance
908 Float_t dMotherOutner= AliMUONConstants::Rmax(4)+kVframeLength + 40.0;
910 Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(9)) -
911 (-AliMUONConstants::DefaultChamberZ(8)) ) /2.3;
912 tpar[0] = dMotherInner;
913 tpar[1] = dMotherOutner;
915 gMC->Gsvolu("CH09", "TUBE", idAir, tpar, 3);
916 gMC->Gsvolu("CH10", "TUBE", idAir, tpar, 3);
918 // create and position the slat (mother) volumes
926 for (i = 0; i < kNslats5; i++){
928 slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength;
929 xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i];
932 spar[0] = slatLength5[i]/2.;
933 spar[1] = kSlatHeight/2.;
934 spar[2] = kSlatWidth/2.;
936 Float_t dzCh5 = dzCh;
937 Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat;
939 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
940 detElemId = 913 - (i + kNslats5-1-6);
941 //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
942 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
943 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
945 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
946 detElemId = 900 + (i + kNslats5-1-6);
947 //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
948 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
949 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
952 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
953 detElemId = 913 + (i + kNslats5-1-6);
954 //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
955 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
956 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
958 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
959 detElemId = 926 - (i + kNslats5-1-6);
960 //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
961 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
962 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
965 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
966 detElemId = 1013 - (i + kNslats5-1-6);
967 //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
968 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
969 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
971 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
972 detElemId = 1000 + (i + kNslats5-1-6);
973 //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
974 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
975 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
978 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
979 detElemId = 1013 + (i + kNslats5-1-6);
980 //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
981 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
982 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
983 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
984 detElemId = 1026 - (i + kNslats5-1-6);
985 //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
986 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
987 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
991 // create the panel volume
993 gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3);
994 gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3);
996 // create the nomex volume
998 gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3);
999 gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3);
1002 // create the nomex volume (bulk)
1004 gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
1005 gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
1007 // create the insulating material volume
1009 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
1010 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
1012 // create the PCB volume
1014 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
1015 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
1017 // create the sensitive volumes,
1019 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
1020 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
1022 // create the vertical frame volume
1024 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
1025 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
1027 // create the horizontal frame volume
1029 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
1030 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
1032 // create the horizontal border volume
1034 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
1035 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
1038 for (i = 0; i < kNslats5; i++){
1039 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1041 if (i == 0 && quadrant == 2) continue;
1042 if (i == 0 && quadrant == 4) continue;
1044 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1045 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1046 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.; // ok
1048 // position the vertical frames (spacers)
1050 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1051 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1052 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1053 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1054 } else { // no rounded spacer yet
1055 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1056 // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1057 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1058 // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1061 // position the panels and the insulating material
1062 for (j = 0; j < kNPCB5[i]; j++){
1063 if (i == 1 && j == 0) continue;
1065 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
1067 Float_t zPanel = spar[2] - nomexbpar[2];
1068 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1069 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
1070 GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
1072 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1073 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
1074 GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
1079 // position the nomex volume inside the panel volume
1080 gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY");
1081 gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY");
1083 // position panel volume inside the bulk nomex material volume
1084 gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1085 gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1087 // position the PCB volume inside the insulating material volume
1088 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1089 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1091 // position the horizontal frame volume inside the PCB volume
1092 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1093 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1095 // position the sensitive volume inside the horizontal frame volume
1096 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1097 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1099 // position the border volumes inside the PCB volume
1100 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
1101 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1102 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1103 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1104 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1106 // // create the NULOC volume and position it in the horizontal frame
1108 gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
1109 gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
1111 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
1113 gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1114 gMC->Gspos("S09E",2*index ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1115 gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1116 gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1120 // position the volumes approximating the circular section of the pipe
1121 Float_t epsilon = 0.001;
1125 Double_t dydiv = kSensHeight/ndiv;
1126 Double_t ydiv = (kSensHeight - dydiv)/2.;
1127 Float_t rmin = AliMUONConstants::Rmin(4);
1132 for (Int_t idiv = 0; idiv < ndiv; idiv++){
1135 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
1136 divpar[0] = (kPcbLength - xdiv)/2.;
1137 divpar[1] = dydiv/2. - epsilon;
1138 divpar[2] = kSensWidth/2.;
1139 xvol = (kPcbLength + xdiv)/2.;
1142 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1143 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1144 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1146 GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
1147 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1148 GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
1149 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1152 // cout << "Geometry for Station 5...... done" << endl;
1158 //______________________________________________________________________________
1159 void AliMUONSlatGeometryBuilder::SetTransformations()
1161 // Defines the transformations for the station345 chambers.
1164 if (gAlice->GetModule("DIPO")) {
1165 // if DIPO is preset, the whole station will be placed in DDIP volume
1166 SetMotherVolume(4, "DDIP");
1167 SetMotherVolume(5, "DDIP");
1168 SetVolume(4, "CH05", true);
1169 SetVolume(5, "CH06", true);
1172 SetVolume(4, "CH05");
1173 SetVolume(5, "CH06");
1176 if (gAlice->GetModule("SHIL")) {
1177 SetMotherVolume(6, "YOUT2");
1178 SetMotherVolume(7, "YOUT2");
1179 SetMotherVolume(8, "YOUT2");
1180 SetMotherVolume(9, "YOUT2");
1183 SetVolume(6, "CH07");
1184 SetVolume(7, "CH08");
1185 SetVolume(8, "CH09");
1186 SetVolume(9, "CH10");
1188 // Stations 345 are not perpendicular to the beam axis
1189 // See AliMUONConstants class
1190 TGeoRotation st345inclination("rot99");
1191 st345inclination.RotateX(AliMUONConstants::St345Inclination());
1193 Double_t zpos1= - AliMUONConstants::DefaultChamberZ(4);
1194 SetTransformation(4, TGeoTranslation(0., 0., zpos1), st345inclination);
1196 zpos1= - AliMUONConstants::DefaultChamberZ(5);
1197 SetTransformation(5, TGeoTranslation(0., 0., zpos1), st345inclination);
1199 zpos1 = - AliMUONConstants::DefaultChamberZ(6);
1200 SetTransformation(6, TGeoTranslation(0., 0., zpos1), st345inclination);
1202 zpos1 = - AliMUONConstants::DefaultChamberZ(7);
1203 SetTransformation(7, TGeoTranslation(0., 0., zpos1), st345inclination );
1205 zpos1 = - AliMUONConstants::DefaultChamberZ(8);
1206 SetTransformation(8, TGeoTranslation(0., 0., zpos1), st345inclination);
1208 zpos1 = - AliMUONConstants::DefaultChamberZ(9);
1209 SetTransformation(9, TGeoTranslation(0., 0., zpos1), st345inclination);
1213 //______________________________________________________________________________
1214 void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1216 // Defines the sensitive volumes for slat stations chambers.
1219 GetGeometry(4)->SetSensitiveVolume("S05G");
1220 GetGeometry(5)->SetSensitiveVolume("S06G");
1221 GetGeometry(6)->SetSensitiveVolume("S07G");
1222 GetGeometry(7)->SetSensitiveVolume("S08G");
1223 GetGeometry(8)->SetSensitiveVolume("S09G");
1224 GetGeometry(9)->SetSensitiveVolume("S10G");
1227 //______________________________________________________________________________
1228 Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1230 // On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1231 // and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
1233 if (quadnum==2 || quadnum==3)
1236 numslat = fspq + 2-numslat;
1239 if (quadnum==3 || quadnum==4) numslat += 2*fspq+1;