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.
22 // Author: Eric Dumonteil (dumontei@cea.fr)
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 "AliMUONChamber.h"
45 #include "AliMUONGeometryModule.h"
46 #include "AliMUONGeometryEnvelopeStore.h"
47 #include "AliMUONConstants.h"
49 ClassImp(AliMUONSlatGeometryBuilder)
52 //______________________________________________________________________________
53 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
54 : AliMUONVGeometryBuilder("slat.dat",
55 muon->Chamber(4).GetGeometry(),
56 muon->Chamber(5).GetGeometry(),
57 muon->Chamber(6).GetGeometry(),
58 muon->Chamber(7).GetGeometry(),
59 muon->Chamber(8).GetGeometry(),
60 muon->Chamber(9).GetGeometry()),
63 // Standard constructor
67 //______________________________________________________________________________
68 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
69 : AliMUONVGeometryBuilder(),
72 // Default constructor
76 //______________________________________________________________________________
77 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
78 : AliMUONVGeometryBuilder(rhs)
80 AliFatal("Copy constructor is not implemented.");
83 //______________________________________________________________________________
84 AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
88 //______________________________________________________________________________
89 AliMUONSlatGeometryBuilder&
90 AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
92 // check assignement to self
93 if (this == &rhs) return *this;
95 AliFatal("Assignment operator is not implemented.");
104 //______________________________________________________________________________
105 void AliMUONSlatGeometryBuilder::CreateGeometry()
107 // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
108 // It includes description and placements of support panels and slats.
109 // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning
110 // the use of Enveloppe method to place the Geant volumes.
111 // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters,
112 // and this builder would then be dedicated only to the
113 // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
115 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
120 // define the id of tracking media:
121 Int_t idAir = idtmed[1100]; // medium 1
122 Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
123 Int_t idCopper = idtmed[1110];
124 Int_t idG10 = idtmed[1111];
125 Int_t idCarbon = idtmed[1112];
126 Int_t idRoha = idtmed[1113];
127 Int_t idNomex = idtmed[1114]; // honey comb
128 Int_t idNoryl = idtmed[1115];
129 Int_t idNomexB = idtmed[1116]; // bulk material
131 // sensitive area: 40*40 cm**2
132 const Float_t kSensLength = 40.;
133 const Float_t kSensHeight = 40.;
134 const Float_t kSensWidth = AliMUONConstants::Pitch()*2;// 0.5 cm, according to TDR fig 2.120
135 const Int_t kSensMaterial = idGas;
136 // const Float_t kYoverlap = 1.5;
138 // PCB dimensions in cm; width: 30 mum copper
139 const Float_t kPcbLength = kSensLength;
140 const Float_t kPcbHeight = 58.; // updated Ch. Finck
141 const Float_t kPcbWidth = 0.003;
142 const Int_t kPcbMaterial = idCopper;
144 // Insulating material: 220 mum G10 fiber glued to pcb
145 const Float_t kInsuLength = kPcbLength;
146 const Float_t kInsuHeight = kPcbHeight;
147 const Float_t kInsuWidth = 0.022; // updated Ch. Finck
148 const Int_t kInsuMaterial = idG10;
150 // Carbon fiber panels: 200mum carbon/epoxy skin
151 const Float_t kCarbonWidth = 0.020;
152 const Int_t kCarbonMaterial = idCarbon;
154 // Nomex (honey comb) between the two panel carbon skins
155 const Float_t kNomexLength = kSensLength;
156 const Float_t kNomexHeight = kSensHeight;
157 const Float_t kNomexWidth = 0.8; // updated Ch. Finck
158 const Int_t kNomexMaterial = idNomex;
160 // Bulk Nomex under panel sandwich Ch. Finck
161 const Float_t kNomexBWidth = 0.025;
162 const Int_t kNomexBMaterial = idNomexB;
164 // Panel sandwich 0.02 carbon*2 + 0.8 nomex
165 const Float_t kPanelLength = kSensLength;
166 const Float_t kPanelHeight = kSensHeight;
167 const Float_t kPanelWidth = 2 * kCarbonWidth + kNomexWidth;
169 // spacer around the slat: 2 sticks along length,2 along height
170 // H: the horizontal ones
171 const Float_t kHframeLength = kPcbLength;
172 const Float_t kHframeHeight = 1.95; // updated Ch. Finck
173 const Float_t kHframeWidth = kSensWidth;
174 const Int_t kHframeMaterial = idNoryl;
176 // V: the vertical ones; vertical spacers
177 const Float_t kVframeLength = 2.5;
178 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
179 const Float_t kVframeWidth = kSensWidth;
180 const Int_t kVframeMaterial = idNoryl;
182 // B: the horizontal border filled with rohacell: ok Ch. Finck
183 const Float_t kBframeLength = kHframeLength;
184 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
185 const Float_t kBframeWidth = kHframeWidth;
186 const Int_t kBframeMaterial = idRoha;
188 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics
189 const Float_t kNulocLength = 2.5;
190 const Float_t kNulocHeight = kBframeHeight;
191 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
192 const Int_t kNulocMaterial = idCopper;
195 const Float_t kSlatHeight = kPcbHeight;
196 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth
197 + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck
198 const Int_t kSlatMaterial = idAir;
199 const Float_t kDslatLength = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck
200 Float_t zSlat = AliMUONConstants::DzSlat();// implemented Ch. Finck
201 Float_t dzCh = AliMUONConstants::DzCh();
207 // the panel volume contains the nomex
208 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. };
209 Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. };
210 Float_t twidth = kPanelWidth + kNomexBWidth;
211 Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex
213 // insulating material contains PCB-> gas
214 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ;
215 Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. };
216 twidth -= 2 * kInsuWidth;
217 Float_t pcbpar[3] = {kPcbLength/2., kPcbHeight/2., twidth/2. };
218 Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. };
219 Float_t theight = 2 * kHframeHeight + kSensHeight;
220 Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.};
221 Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
222 Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
223 Float_t nulocpar[3] = {kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
226 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
229 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
231 Int_t* fStations = new Int_t[5];
232 for (Int_t i=0; i<5; i++) fStations[i] = 1;
237 //********************************************************************
239 //********************************************************************
240 // indices 1 and 2 for first and second chambers in the station
241 // iChamber (first chamber) kept for other quanties than Z,
242 // assumed to be the same in both chambers
244 iChamber = &fMUON->Chamber(4);
245 iChamber1 = iChamber;
246 iChamber2 = &fMUON->Chamber(5);
248 //iChamber1->GetGeometry()->SetDebug(kTRUE);
249 //iChamber2->GetGeometry()->SetDebug(kTRUE);
251 if (gAlice->GetModule("DIPO")) {
252 // if DIPO is preset, the whole station will be placed in DDIP volume
253 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
254 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
258 // volumes for slat geometry (xx=5,..,10 chamber id):
259 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
260 // SxxG --> Sensitive volume (gas)
261 // SxxP --> PCB (copper)
262 // SxxI --> Insulator (G10)
263 // SxxC --> Carbon panel
264 // SxxN --> Nomex comb
265 // SxxX --> Nomex bulk
266 // SxxH, SxxV --> Horizontal and Vertical frames (Noryl)
267 // SB5x --> Volumes for the 35 cm long PCB
268 // slat dimensions: slat is a MOTHER volume!!! made of air
270 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
272 Float_t tlength = 35.;
273 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
274 Float_t nomexpar2[3] = { tlength/2., nomexpar[1], nomexpar[2]};
275 Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1], nomexbpar[2]};
276 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
277 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
278 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
279 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
280 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
282 Float_t pcbDLength3 = (kPcbLength - tlength);
284 const Int_t kNslats3 = 5; // number of slats per quadrant
285 const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
286 const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
287 const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7};
288 Float_t slatLength3[kNslats3];
290 // create and position the slat (mother) volumes
298 for (i = 0; i < kNslats3; i++){
300 slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength;
301 xSlat3 = slatLength3[i]/2. + kDslatLength + kXpos3[i];
304 spar[0] = slatLength3[i]/2.;
305 spar[1] = kSlatHeight/2.;
306 spar[2] = kSlatWidth/2.;
307 // take away 5 cm from the first slat in chamber 5
308 if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
309 spar2[0] = spar[0] - pcbDLength3/2.;
315 Float_t dzCh3 = dzCh;
316 Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
318 sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
319 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
320 detElemId = 500 + i + kNslats3-1;
321 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
322 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
324 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
325 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
326 detElemId = 550 + i + kNslats3-1;
327 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
328 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
331 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
332 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
333 detElemId = 500 - i + kNslats3-1;
334 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
335 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
337 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
338 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
339 detElemId = 550 - i + kNslats3-1;
340 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
341 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
344 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
345 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
346 detElemId = 600 + i + kNslats3-1;
347 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
348 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
349 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
350 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
351 detElemId = 650 + i + kNslats3-1;
352 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
353 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
356 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
357 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
358 detElemId = 600 - i + kNslats3-1;
359 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
360 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
362 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
363 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
364 detElemId = 650 - i + kNslats3-1;
365 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
366 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
370 // create the panel volume
372 gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
373 gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
374 gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
376 // create the nomex volume (honey comb)
378 gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
379 gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
380 gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
382 // create the nomex volume (bulk)
384 gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3);
385 gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3);
386 gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3);
388 // create the insulating material volume
390 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
391 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
392 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
394 // create the PCB volume
396 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
397 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
398 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
400 // create the sensitive volumes,
402 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
403 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
405 // create the vertical frame volume
407 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
408 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
410 // create the horizontal frame volume
412 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
413 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
414 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
416 // create the horizontal border volume
418 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
419 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
420 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
423 for (i = 0; i<kNslats3; i++){
424 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
426 if (i == 0 && quadrant == 2) continue;
427 if (i == 0 && quadrant == 4) continue;
429 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
430 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
431 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
432 Float_t xvFrame2 = xvFrame;
434 if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
436 // position the vertical frames
438 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
439 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
440 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
441 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
442 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
443 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
444 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
445 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
449 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
450 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
451 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
452 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
453 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
454 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
455 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
456 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
459 if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
460 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
461 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
462 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
463 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
466 // position the panels and the insulating material
467 for (j = 0; j < kNPCB3[i]; j++){
468 if (i == 1 && j == 0) continue;
469 if (i == 0 && j == 0) continue;
471 Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
472 Float_t xx2 = xx - pcbDLength3/2.;
474 Float_t zPanel = spar[2] - nomexbpar[2];
476 if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
477 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
478 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
479 GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
481 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
482 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
483 GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
485 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
486 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
487 GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
493 // position the nomex volume inside the panel volume
494 gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY");
495 gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY");
496 gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY");
498 // position panel volume inside the bulk nomex material volume
499 gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY");
500 gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY");
501 gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY");
503 // position the PCB volume inside the insulating material volume
504 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
505 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
506 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
508 // position the horizontal frame volume inside the PCB volume
509 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
510 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
511 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
513 // position the sensitive volume inside the horizontal frame volume
514 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
515 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
516 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
519 // position the border volumes inside the PCB volume
520 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
521 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
522 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
523 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
524 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
526 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
527 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
529 // create the NULOC volume and position it in the horizontal frame
530 gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
531 gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3);
533 Float_t xxmax2 = xxmax - pcbDLength3/2.;
534 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
536 gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
537 gMC->Gspos("S05E",2*index ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
538 gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
539 gMC->Gspos("S06E",2*index ,"S06B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
540 if (xx > -xxmax2 && xx< xxmax2) {
541 gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
542 gMC->Gspos("S05E",2*index ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
546 // position the volumes approximating the circular section of the pipe
547 Float_t epsilon = 0.001;
551 Double_t dydiv = kSensHeight/ndiv;
552 Double_t ydiv = (kSensHeight - dydiv)/2.;
553 Double_t rmin = 31.5; // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
558 for (Int_t idiv = 0; idiv < ndiv; idiv++){
561 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
562 divpar[0] = (kPcbLength - xdiv)/2.;
563 divpar[1] = dydiv/2. - epsilon;
564 divpar[2] = kSensWidth/2.;
565 xvol = (kPcbLength + xdiv)/2.;
568 // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
569 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
570 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
571 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
573 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
574 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
576 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,
577 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
581 // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
582 // Gines Martinez, Subatech sep 04
583 // 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
584 // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
588 dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB
589 ydiv = -kSensHeight/2 + dydiv/2.; // Initializing vertical position of the volume from bottom
590 xdiv = 0.; // Initializing horizontal position of the box volumes
592 for (Int_t idiv = 0; idiv < ndiv; idiv++){
593 xdiv = TMath::Abs( rmin * TMath::Sin( TMath::ACos(ydiv/rmin) ) );
594 divpar[0] = (kPcbLength - xdiv)/2.; // Dimension of the box volume
595 divpar[1] = dydiv/2. - epsilon;
596 divpar[2] = kSensWidth/2.;
597 xvol = (kPcbLength + xdiv)/2.; //2D traslition for positionning of box volume
600 for (side = 1; side <= 2; side++) {
601 sprintf(idSlatCh5,"LA%d",4);
602 sprintf(idSlatCh6,"LB%d",4);
604 sprintf(idSlatCh5,"LA%d",13);
605 sprintf(idSlatCh6,"LB%d",13);
607 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
608 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
610 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
611 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
613 ydiv += dydiv; // Going from bottom to top
615 // cout << "Geometry for Station 3...... done" << endl;
621 // //********************************************************************
623 // //********************************************************************
624 // // indices 1 and 2 for first and second chambers in the station
625 // // iChamber (first chamber) kept for other quanties than Z,
626 // // assumed to be the same in both chambers
627 // corrected geometry (JP. Cussonneau, Ch. Finck)
629 iChamber = &fMUON->Chamber(6);
630 iChamber1 = iChamber;
631 iChamber2 = &fMUON->Chamber(7);
633 const Int_t kNslats4 = 7; // number of slats per quadrant
634 const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
635 const Float_t kXpos4[kNslats4] = {38.2, 0., 0., 0., 0., 0., 0.};
636 const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6};
637 const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 29.4, 37.0, 28.6};
639 Float_t slatLength4[kNslats4];
641 // create and position the slat (mother) volumes
651 for (i = 0; i<kNslats4; i++){
652 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength;
653 xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i];
654 ySlat41 += kYpos41[i];
655 ySlat42 += kYpos42[i];
657 spar[0] = slatLength4[i]/2.;
658 spar[1] = kSlatHeight/2.;
659 spar[2] = kSlatWidth/2.;
660 Float_t dzCh4 = dzCh;
661 Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat;
663 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
664 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
665 detElemId = 700 + i + kNslats4-1;
666 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4),
667 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
669 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
670 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
671 detElemId = 750 + i + kNslats4-1;
672 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4),
673 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
676 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
677 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
678 detElemId = 700 - i + kNslats4-1;
679 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4),
680 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
682 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
683 detElemId = 750 - i + kNslats4-1;
684 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
685 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true,
686 TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4),
687 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
690 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
691 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
692 detElemId = 800 + i + kNslats4-1;
693 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4),
694 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
696 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
697 detElemId = 850 + i + kNslats4-1;
698 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
699 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4),
700 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
702 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
703 detElemId = 800 - i + kNslats4-1;
704 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
705 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4),
706 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
707 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
708 detElemId = 850 - i + kNslats4-1;
709 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
710 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4),
711 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
715 // create the panel volume
717 gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
718 gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
720 // create the nomex volume
722 gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
723 gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
726 // create the nomex volume (bulk)
728 gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
729 gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
731 // create the insulating material volume
733 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
734 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
736 // create the PCB volume
738 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
739 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
741 // create the sensitive volumes,
743 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
744 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
746 // create the vertical frame volume
748 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
749 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
751 // create the horizontal frame volume
753 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
754 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
756 // create the horizontal border volume
758 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
759 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
762 for (i = 0; i < kNslats4; i++){
763 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
765 if (i == 0 && quadrant == 2) continue;
766 if (i == 0 && quadrant == 4) continue;
768 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
769 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
770 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
772 // position the vertical frames
774 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
775 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
776 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
777 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
778 } else { // no rounded spacer yet
779 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
780 // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
781 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
782 // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
784 // position the panels and the insulating material
785 for (j = 0; j < kNPCB4[i]; j++){
786 if (i == 1 && j == 0) continue;
788 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
790 Float_t zPanel = spar[2] - nomexbpar[2];
791 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
792 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
793 GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
794 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
795 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
796 GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
801 // position the nomex volume inside the panel volume
802 gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY");
803 gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY");
805 // position panel volume inside the bulk nomex material volume
806 gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY");
807 gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY");
809 // position the PCB volume inside the insulating material volume
810 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
811 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
813 // position the horizontal frame volume inside the PCB volume
814 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
815 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
817 // position the sensitive volume inside the horizontal frame volume
818 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
819 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
821 // position the border volumes inside the PCB volume
822 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
823 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
824 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
825 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
826 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
828 // create the NULOC volume and position it in the horizontal frame
830 gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3);
831 gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3);
833 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
835 gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
836 gMC->Gspos("S07E",2*index ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
837 gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
838 gMC->Gspos("S08E",2*index ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
841 // position the volumes approximating the circular section of the pipe
843 Float_t epsilon = 0.001;
847 Double_t dydiv = kSensHeight/ndiv;
848 Double_t ydiv = (kSensHeight - dydiv)/2.;
849 Float_t rmin = 39.5;// Corrected in sep04 from PQ-LAT-NR3 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
854 for (Int_t idiv = 0; idiv < ndiv; idiv++){
857 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
858 divpar[0] = (kPcbLength - xdiv)/2.;
859 divpar[1] = dydiv/2. - epsilon;
860 divpar[2] = kSensWidth/2.;
861 xvol = (kPcbLength + xdiv)/2.;
864 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
865 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
866 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
868 GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
869 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
871 GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
872 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
875 // cout << "Geometry for Station 4...... done" << endl;
882 // //********************************************************************
884 // //********************************************************************
885 // // indices 1 and 2 for first and second chambers in the station
886 // // iChamber (first chamber) kept for other quanties than Z,
887 // // assumed to be the same in both chambers
888 // corrected geometry (JP. Cussonneau, Ch. Finck)
890 iChamber = &fMUON->Chamber(8);
891 iChamber1 = iChamber;
892 iChamber2 = &fMUON->Chamber(9);
894 const Int_t kNslats5 = 7; // number of slats per quadrant
895 const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
896 const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.};
897 const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75};
898 Float_t slatLength5[kNslats5];
900 // create and position the slat (mother) volumes
908 for (i = 0; i < kNslats5; i++){
910 slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength;
911 xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i];
914 spar[0] = slatLength5[i]/2.;
915 spar[1] = kSlatHeight/2.;
916 spar[2] = kSlatWidth/2.;
918 Float_t dzCh5 = dzCh;
919 Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat;
921 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
922 detElemId = 900 + i + kNslats5-1;
923 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
924 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
925 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
927 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
928 detElemId = 950 + i + kNslats5-1;
929 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
930 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
931 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
934 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
935 detElemId = 900 - i + kNslats5-1;
936 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
937 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
938 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
940 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
941 detElemId = 950 - i + kNslats5-1;
942 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
943 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
944 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
947 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
948 detElemId = 1000 + i + kNslats5-1;
949 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
950 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
951 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
953 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
954 detElemId = 1050 + i + kNslats5-1;
955 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
956 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
957 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
960 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
961 detElemId = 1000 - i + kNslats5-1;
962 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
963 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
964 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
965 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
966 detElemId = 1050 - i + kNslats5-1;
967 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
968 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
969 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
973 // create the panel volume
975 gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3);
976 gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3);
978 // create the nomex volume
980 gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3);
981 gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3);
984 // create the nomex volume (bulk)
986 gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
987 gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
989 // create the insulating material volume
991 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
992 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
994 // create the PCB volume
996 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
997 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
999 // create the sensitive volumes,
1001 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
1002 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
1004 // create the vertical frame volume
1006 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
1007 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
1009 // create the horizontal frame volume
1011 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
1012 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
1014 // create the horizontal border volume
1016 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
1017 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
1020 for (i = 0; i < kNslats5; i++){
1021 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1023 if (i == 0 && quadrant == 2) continue;
1024 if (i == 0 && quadrant == 4) continue;
1026 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1027 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1028 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.; // ok
1030 // position the vertical frames (spacers)
1032 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1033 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1034 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1035 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1036 } else { // no rounded spacer yet
1037 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1038 // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1039 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1040 // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1043 // position the panels and the insulating material
1044 for (j = 0; j < kNPCB5[i]; j++){
1045 if (i == 1 && j == 0) continue;
1047 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
1049 Float_t zPanel = spar[2] - nomexbpar[2];
1050 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1051 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
1052 GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
1054 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1055 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
1056 GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
1061 // position the nomex volume inside the panel volume
1062 gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY");
1063 gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY");
1065 // position panel volume inside the bulk nomex material volume
1066 gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1067 gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1069 // position the PCB volume inside the insulating material volume
1070 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1071 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1073 // position the horizontal frame volume inside the PCB volume
1074 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1075 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1077 // position the sensitive volume inside the horizontal frame volume
1078 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1079 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1081 // position the border volumes inside the PCB volume
1082 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
1083 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1084 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1085 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1086 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1088 // // create the NULOC volume and position it in the horizontal frame
1090 gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
1091 gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
1093 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
1095 gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1096 gMC->Gspos("S09E",2*index ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1097 gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1098 gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1102 // position the volumes approximating the circular section of the pipe
1103 Float_t epsilon = 0.001;
1107 Double_t dydiv = kSensHeight/ndiv;
1108 Double_t ydiv = (kSensHeight - dydiv)/2.;
1109 Float_t rmin = 39.5;
1114 for (Int_t idiv = 0; idiv < ndiv; idiv++){
1117 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1118 divpar[0] = (kPcbLength - xdiv)/2.;
1119 divpar[1] = dydiv/2. - epsilon;
1120 divpar[2] = kSensWidth/2.;
1121 xvol = (kPcbLength + xdiv)/2.;
1124 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1125 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1126 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1128 GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
1129 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1130 GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
1131 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1134 // cout << "Geometry for Station 5...... done" << endl;
1140 //______________________________________________________________________________
1141 void AliMUONSlatGeometryBuilder::SetTransformations()
1143 // Defines the transformations for the station2 chambers.
1146 AliMUONChamber* iChamber1 = &fMUON->Chamber(4);
1147 Double_t zpos1 = - iChamber1->Z();
1148 iChamber1->GetGeometry()
1149 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1151 AliMUONChamber* iChamber2 = &fMUON->Chamber(5);
1152 Double_t zpos2 = - iChamber2->Z();
1153 iChamber2->GetGeometry()
1154 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1156 iChamber1 = &fMUON->Chamber(6);
1157 zpos1 = - iChamber1->Z();
1158 iChamber1->GetGeometry()
1159 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1161 iChamber2 = &fMUON->Chamber(7);
1162 zpos2 = - iChamber2->Z();
1163 iChamber2->GetGeometry()
1164 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1166 iChamber1 = &fMUON->Chamber(8);
1167 zpos1 = - iChamber1->Z();
1168 iChamber1->GetGeometry()
1169 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1171 iChamber2 = &fMUON->Chamber(9);
1172 zpos2 = - iChamber2->Z();
1173 iChamber2->GetGeometry()
1174 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1178 //______________________________________________________________________________
1179 void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1181 // Defines the sensitive volumes for slat stations chambers.
1184 GetGeometry(4)->SetSensitiveVolume("S05G");
1185 GetGeometry(5)->SetSensitiveVolume("S06G");
1186 GetGeometry(6)->SetSensitiveVolume("S07G");
1187 GetGeometry(7)->SetSensitiveVolume("S08G");
1188 GetGeometry(8)->SetSensitiveVolume("S09G");
1189 GetGeometry(9)->SetSensitiveVolume("S10G");
1192 //______________________________________________________________________________
1193 Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1195 // On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1196 // and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
1198 if (quadnum==2 || quadnum==3)
1201 numslat = fspq + 2-numslat;
1204 if (quadnum==3 || quadnum==4) numslat += 2*fspq+1;