3 // Class AliMUONSlatGeometryBuilder
4 // -------------------------------
5 // Abstract base class for geometry construction per chamber.
7 // Author: Eric Dumonteil (dumontei@cea.fr)
10 // This Builder is designed according to the enveloppe methode. The basic idea is to be able to allow moves of the slats on the support panels.
11 // Those moves can be described with a simple set of parameters. The next step should be now to describe all the slats and their places by a unique
12 // class, which would make the SlatBuilder far more compact since now only three parameters can define a slat and its position, like:
13 // * Bool_t rounded_shape_slat
14 // * Float_t slat_length
15 // * Float_t slat_number or Float_t slat_position
19 #include <TVirtualMC.h>
20 #include <TGeoMatrix.h>
23 #include "AliMUONSlatGeometryBuilder.h"
25 #include "AliMUONChamber.h"
26 #include "AliMUONChamberGeometry.h"
28 ClassImp(AliMUONSlatGeometryBuilder)
30 Int_t ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq);
34 //______________________________________________________________________________
35 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
36 : AliMUONVGeometryBuilder(&muon->Chamber(4), &muon->Chamber(5), &muon->Chamber(6), &muon->Chamber(7), &muon->Chamber(8), &muon->Chamber(9)),
37 // : AliMUONVGeometryBuilder(&muon->Chamber(4), &muon->Chamber(5)),
40 // Standard constructor
44 //______________________________________________________________________________
45 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
46 : AliMUONVGeometryBuilder(),
49 // Default constructor
53 //______________________________________________________________________________
54 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
55 : AliMUONVGeometryBuilder(rhs)
57 Fatal("Copy constructor",
58 "Copy constructor is not implemented.");
61 //______________________________________________________________________________
62 AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
66 //______________________________________________________________________________
67 AliMUONSlatGeometryBuilder&
68 AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
70 // check assignement to self
71 if (this == &rhs) return *this;
74 "Assignment operator is not implemented.");
83 //______________________________________________________________________________
84 void AliMUONSlatGeometryBuilder::CreateGeometry()
86 // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
87 // It includes description and placements of support panels and slats.
88 // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning the use of Enveloppe method to place the Geant volumes.
89 // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, and this builder would then be dedicated only to the
90 // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
94 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
99 // define the id of tracking media:
100 Int_t idCopper = idtmed[1110];
101 Int_t idGlass = idtmed[1111];
102 Int_t idCarbon = idtmed[1112];
103 Int_t idRoha = idtmed[1113];
104 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
105 Int_t idAir= idtmed[1100]; // medium 1
107 // sensitive area: 40*40 cm**2
108 const Float_t kSensLength = 40.;
109 const Float_t kSensHeight = 40.;
110 const Float_t kSensWidth = 0.5; // according to TDR fig 2.120
111 const Int_t kSensMaterial = idGas;
112 const Float_t kYoverlap = 1.5;
114 // PCB dimensions in cm; width: 30 mum copper
115 const Float_t kPcbLength = kSensLength;
116 const Float_t kPcbHeight = 60.;
117 const Float_t kPcbWidth = 0.003;
118 const Int_t kPcbMaterial = idCopper;
120 // Insulating material: 200 mum glass fiber glued to pcb
121 const Float_t kInsuLength = kPcbLength;
122 const Float_t kInsuHeight = kPcbHeight;
123 const Float_t kInsuWidth = 0.020;
124 const Int_t kInsuMaterial = idGlass;
126 // Carbon fiber panels: 200mum carbon/epoxy skin
127 const Float_t kPanelLength = kSensLength;
128 const Float_t kPanelHeight = kSensHeight;
129 const Float_t kPanelWidth = 0.020;
130 const Int_t kPanelMaterial = idCarbon;
132 // rohacell between the two carbon panels
133 const Float_t kRohaLength = kSensLength;
134 const Float_t kRohaHeight = kSensHeight;
135 const Float_t kRohaWidth = 0.5;
136 const Int_t kRohaMaterial = idRoha;
138 // Frame around the slat: 2 sticks along length,2 along height
139 // H: the horizontal ones
140 const Float_t kHframeLength = kPcbLength;
141 const Float_t kHframeHeight = 1.5;
142 const Float_t kHframeWidth = kSensWidth;
143 const Int_t kHframeMaterial = idGlass;
145 // V: the vertical ones
146 const Float_t kVframeLength = 4.0;
147 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
148 const Float_t kVframeWidth = kSensWidth;
149 const Int_t kVframeMaterial = idGlass;
151 // B: the horizontal border filled with rohacell
152 const Float_t kBframeLength = kHframeLength;
153 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
154 const Float_t kBframeWidth = kHframeWidth;
155 const Int_t kBframeMaterial = idRoha;
157 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
158 const Float_t kNulocLength = 2.5;
159 const Float_t kNulocHeight = 7.5;
160 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
161 const Int_t kNulocMaterial = idCopper;
163 const Float_t kSlatHeight = kPcbHeight;
164 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth +
165 2.* kPanelWidth + kRohaWidth);
166 const Int_t kSlatMaterial = idAir;
167 const Float_t kDslatLength = kVframeLength; // border on left and right
172 // the panel volume contains the rohacell
174 Float_t twidth = 2 * kPanelWidth + kRohaWidth;
175 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., twidth/2. };
176 Float_t rohapar[3] = { kRohaLength/2., kRohaHeight/2., kRohaWidth/2. };
178 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
180 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth;
181 Float_t insupar[3] = { kInsuLength/2., kInsuHeight/2., twidth/2. };
182 twidth -= 2 * kInsuWidth;
183 Float_t pcbpar[3] = { kPcbLength/2., kPcbHeight/2., twidth/2. };
184 Float_t senspar[3] = { kSensLength/2., kSensHeight/2., kSensWidth/2. };
185 Float_t theight = 2*kHframeHeight + kSensHeight;
186 Float_t hFramepar[3]={kHframeLength/2., theight/2., kHframeWidth/2.};
187 Float_t bFramepar[3]={kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
188 Float_t vFramepar[3]={kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
189 Float_t nulocpar[3]={kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
191 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
194 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
196 Int_t* fStations = new Int_t[5];
197 for (Int_t i=0; i<5; i++) fStations[i] = 1;
202 //********************************************************************
204 //********************************************************************
205 // indices 1 and 2 for first and second chambers in the station
206 // iChamber (first chamber) kept for other quanties than Z,
207 // assumed to be the same in both chambers
209 iChamber = GetChamber(4);
210 iChamber1 = iChamber;
211 iChamber2 = GetChamber(5);
213 //iChamber1->GetGeometry()->SetDebug(kTRUE);
214 //iChamber2->GetGeometry()->SetDebug(kTRUE);
216 if (gAlice->GetModule("DIPO")) {
217 // if DIPO is preset, the whole station will be placed in DDIP volume
218 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
219 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
222 // if (gAlice->GetModule("DIPO")) {
223 // slats5Mother="DDIP";
224 // slats6Mother="DDIP";
230 // gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
231 // gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
232 // gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
234 // gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
237 // volumes for slat geometry (xx=5,..,10 chamber id):
238 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
239 // SxxG --> Sensitive volume (gas)
240 // SxxP --> PCB (copper)
241 // SxxI --> Insulator (vetronite)
242 // SxxC --> Carbon panel
244 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
245 // SB5x --> Volumes for the 35 cm long PCB
246 // slat dimensions: slat is a MOTHER volume!!! made of air
248 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
250 Float_t tlength = 35.;
251 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
252 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
253 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
254 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
255 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
256 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
257 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
260 const Int_t kNslats3 = 5; // number of slats per quadrant
261 const Int_t kNPCB3[kNslats3] = {3,4,4,3,2}; // n PCB per slat
262 const Float_t kXpos3[kNslats3] = {31., 0., 0., 0., 0.};
263 Float_t slatLength3[kNslats3];
265 // create and position the slat (mother) volumes
275 for (i = 0; i<kNslats3; i++){
276 slatLength3[i] = kPcbLength * kNPCB3[i] + 2. * kDslatLength;
277 xSlat3 = slatLength3[i]/2. - kVframeLength/2. + kXpos3[i];
278 if (i==1 || i==0) slatLength3[i] -= 2. *kDslatLength; // frame out in PCB with circular border
279 Float_t ySlat31 = kSensHeight * i - kYoverlap * i;
280 Float_t ySlat32 = -kSensHeight * i + kYoverlap * i;
281 spar[0] = slatLength3[i]/2.;
282 spar[1] = kSlatHeight/2.;
283 spar[2] = kSlatWidth/2. * 1.01;
284 // take away 5 cm from the first slat in chamber 5
286 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
287 spar2[0] = spar[0]-5./2.;
288 xSlat32 = xSlat3 - 5/2.;
296 Float_t dzCh3=spar[2] * 1.01;
297 // zSlat to be checked (odd downstream or upstream?)
298 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
299 // sprintf(volNam5,"S05%d",i);
300 // gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
301 // gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
302 // gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
304 sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
305 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
306 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat31, zSlat+2.*dzCh3) ,TGeoRotation("rot1",90,angle,90,90+angle,0,0)
309 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
310 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
311 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat31, zSlat-2.*dzCh3) ,TGeoRotation("rot2",90,180+angle,90,90+angle,180,0)
316 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
317 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
318 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat32, zSlat+2.*dzCh3) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
321 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
322 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
323 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat32, zSlat-2.*dzCh3) ,TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)
327 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
328 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
329 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat31, zSlat+2.*dzCh3) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
331 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
332 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
333 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat31, zSlat-2.*dzCh3) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
337 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
338 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
339 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat32, zSlat+2.*dzCh3) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
342 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
343 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
344 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat32, zSlat-2.*dzCh3) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
349 // create the panel volume
351 gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
352 gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
353 gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
355 // create the rohacell volume
357 gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
358 gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
359 gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
361 // create the insulating material volume
363 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
364 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
365 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
367 // create the PCB volume
369 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
370 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
371 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
373 // create the sensitive volumes,
374 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
375 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
378 // create the vertical frame volume
380 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
381 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
383 // create the horizontal frame volume
386 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
387 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
388 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
390 // create the horizontal border volume
392 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
393 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
394 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
397 for (i = 0; i<kNslats3; i++){
398 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
400 if (i==0&&quadrant==2) continue;
401 if (i==0&&quadrant==4) continue;
403 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,4));
404 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,4));
405 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
406 Float_t xvFrame2 = xvFrame;
408 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
410 // position the vertical frames
412 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
413 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5, (2*i)*10+quadrant,TGeoTranslation(-xvFrame2,0.,0.));
414 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
415 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
418 // position the panels and the insulating material
419 for (j=0; j<kNPCB3[i]; j++){
420 if (i==1&&j==0) continue;
422 Float_t xx = kSensLength * (-kNPCB3[i]/2.+j+.5);
423 Float_t xx2 = xx + 5/2.;
425 Float_t zPanel = spar[2] - panelpar[2];
426 if ( (i==1 || i==2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
427 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
428 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
429 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
431 else if ( (i==1 || i==2) && j < kNPCB3[i]-1) {
432 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
433 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
434 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
437 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
438 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
439 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
441 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
442 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
443 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
449 // position the rohacell volume inside the panel volume
450 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
451 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
452 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
454 // position the PCB volume inside the insulating material volume
455 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
456 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
457 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
458 // position the horizontal frame volume inside the PCB volume
459 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
460 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
461 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
462 // position the sensitive volume inside the horizontal frame volume
463 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
464 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
465 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
466 // position the border volumes inside the PCB volume
467 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
468 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
469 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
470 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
471 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
472 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
473 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
475 // create the NULOC volume and position it in the horizontal frame
477 gMC->Gsvolu("S05N","BOX",kNulocMaterial,nulocpar,3);
478 gMC->Gsvolu("S06N","BOX",kNulocMaterial,nulocpar,3);
480 Float_t xxmax2 = xxmax - 5./2.;
481 for (xx = -xxmax; xx<=xxmax; xx+=2*kNulocLength) {
483 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
484 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., kBframeWidth/4., 0, "ONLY");
485 if (xx > -xxmax2 && xx< xxmax2) {
486 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
487 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., kBframeWidth/4., 0, "ONLY");
489 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
490 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., kBframeWidth/4., 0, "ONLY");
493 // position the volumes approximating the circular section of the pipe
494 Float_t yoffs = kSensHeight/2.-kYoverlap;
495 Float_t epsilon = 0.001;
498 Double_t dydiv= kSensHeight/ndiv;
499 Double_t ydiv = yoffs -dydiv;
503 for (Int_t idiv=0;idiv<ndiv; idiv++){
506 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
507 divpar[0] = (kPcbLength-xdiv)/2.;
508 divpar[1] = dydiv/2. - epsilon;
509 divpar[2] = kSensWidth/2.;
510 Float_t xvol=(kPcbLength+xdiv)/2.;
511 Float_t yvol=ydiv + dydiv/2.;
513 for (Int_t quadrant=1; quadrant<=4; quadrant++)
515 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,4));
516 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,4));
518 GetChamber(4)->GetGeometry()->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1]-1)/2. + 35./2.),yvol-kPcbLength+kYoverlap,0.),3,divpar);
519 GetChamber(5)->GetGeometry()->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
523 cout << "Geometry for Station 3...... done" << endl;
529 // //********************************************************************
531 // //********************************************************************
532 // // indices 1 and 2 for first and second chambers in the station
533 // // iChamber (first chamber) kept for other quanties than Z,
534 // // assumed to be the same in both chambers
536 iChamber = GetChamber(6);
537 iChamber1 = iChamber;
538 iChamber2 = GetChamber(7);
540 const Int_t kNslats4 = 6; // number of slats per quadrant
541 const Int_t kNPCB4[kNslats4] = {4,4,5,5,4,3}; // n PCB per slat
542 const Float_t kXpos4[kNslats4] = {38.5, 40., 0., 0., 0., 0.};
543 Float_t slatLength4[kNslats4];
545 // // create and position the slat (mother) volumes
553 for (i = 0; i<kNslats4; i++){
554 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kDslatLength;
555 xSlat4 = slatLength4[i]/2. - kVframeLength/2. + kXpos4[i];
556 if (i==1) slatLength4[i] -= 2. *kDslatLength; // frame out in PCB with circular border
557 ySlat4 = kSensHeight * i - kYoverlap *i;
559 spar[0] = slatLength4[i]/2.;
560 spar[1] = kSlatHeight/2.;
561 spar[2] = kSlatWidth/2.*1.01;
562 Float_t dzCh4=spar[2]*1.01;
563 // zSlat to be checked (odd downstream or upstream?)
564 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
566 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
567 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
568 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4));
570 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
571 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
572 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4));
576 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
577 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
578 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
581 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
582 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
583 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
587 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
588 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
589 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
591 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
592 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
593 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
596 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
597 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
598 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
600 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
601 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
602 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
608 // create the panel volume
610 gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
611 gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
613 // create the rohacell volume
615 gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
616 gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
618 // create the insulating material volume
620 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
621 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
623 // create the PCB volume
625 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
626 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
628 // create the sensitive volumes,
630 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
631 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
633 // create the vertical frame volume
635 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
636 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
638 // create the horizontal frame volume
640 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
641 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
643 // create the horizontal border volume
645 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
646 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
649 for (i = 0; i<kNslats4; i++){
650 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
652 if (i==0&&quadrant==2) continue;
653 if (i==0&&quadrant==4) continue;
655 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,5));
656 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,5));
657 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
659 // position the vertical frames
661 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
662 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
663 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
664 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
666 // position the panels and the insulating material
667 for (j=0; j<kNPCB4[i]; j++){
669 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
671 Float_t zPanel = spar[2] - panelpar[2];
672 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
673 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
674 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
675 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
676 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
677 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
682 // position the rohacell volume inside the panel volume
683 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
684 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
686 // position the PCB volume inside the insulating material volume
687 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
688 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
689 // position the horizontal frame volume inside the PCB volume
690 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
691 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
692 // position the sensitive volume inside the horizontal frame volume
693 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
694 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
695 // position the border volumes inside the PCB volume
696 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
697 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
698 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
699 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
700 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
702 // // create the NULOC volume and position it in the horizontal frame
704 gMC->Gsvolu("S07N","BOX",kNulocMaterial,nulocpar,3);
705 gMC->Gsvolu("S08N","BOX",kNulocMaterial,nulocpar,3);
707 for (xx = -xxmax; xx<=xxmax; xx+=2*kNulocLength) {
709 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
710 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., kBframeWidth/4., 0, "ONLY");
711 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
712 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., kBframeWidth/4., 0, "ONLY");
715 // // position the volumes approximating the circular section of the pipe
716 Float_t yoffs = kSensHeight/2. - kYoverlap;
717 Float_t epsilon = 0.001;
720 Double_t dydiv= kSensHeight/ndiv;
721 Double_t ydiv = yoffs -dydiv;
725 for (Int_t idiv=0;idiv<ndiv; idiv++){
728 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
729 divpar[0] = (kPcbLength-xdiv)/2.;
730 divpar[1] = dydiv/2. - epsilon;
731 divpar[2] = kSensWidth/2.;
732 Float_t xvol=(kPcbLength+xdiv)/2.+1.999;
733 Float_t yvol=ydiv + dydiv/2.;
735 for (Int_t quadrant=1; quadrant<=4; quadrant++)
737 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,5));
738 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,5));
740 GetChamber(6)->GetGeometry()->AddEnvelopeConstituentParam("S07G", idSlatCh7, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
741 GetChamber(7)->GetGeometry()->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
744 cout << "Geometry for Station 4...... done" << endl;
751 // //********************************************************************
753 // //********************************************************************
754 // // indices 1 and 2 for first and second chambers in the station
755 // // iChamber (first chamber) kept for other quanties than Z,
756 // // assumed to be the same in both chambers
758 iChamber = GetChamber(8);
759 iChamber1 = iChamber;
760 iChamber2 = GetChamber(9);
762 const Int_t kNslats5 = 7; // number of slats per quadrant
763 const Int_t kNPCB5[kNslats5] = {5,5,6,6,5,4,3}; // n PCB per slat
764 const Float_t kXpos5[kNslats5] = {38.5, 40., 0., 0., 0., 0., 0.};
765 Float_t slatLength5[kNslats5];
767 // // create and position the slat (mother) volumes
775 for (i = 0; i<kNslats5; i++){
776 slatLength5[i] = kPcbLength * kNPCB5[i] + 2. * kDslatLength;
777 xSlat5 = slatLength5[i]/2. - kVframeLength/2. +kXpos5[i];
778 if (i==1 || i==0) slatLength5[i] -= 2. *kDslatLength; // frame out in PCB with circular border
779 ySlat5 = kSensHeight * i - kYoverlap * i;
781 spar[0] = slatLength5[i]/2.;
782 spar[1] = kSlatHeight/2.;
783 spar[2] = kSlatWidth/2. * 1.01;
784 Float_t dzCh5=spar[2]*1.01;
785 // zSlat to be checked (odd downstream or upstream?)
786 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
788 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
789 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
790 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5));
792 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
793 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
794 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5));
798 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
799 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
800 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
803 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
804 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
805 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
809 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
810 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
811 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
814 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
815 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
816 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
821 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
822 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
823 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
825 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
826 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
827 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
831 // // create the panel volume
833 gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
834 gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
836 // create the rohacell volume
838 gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
839 gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
841 // create the insulating material volume
843 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
844 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
846 // create the PCB volume
848 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
849 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
851 // create the sensitive volumes,
853 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
854 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
856 // create the vertical frame volume
858 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
859 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
861 // create the horizontal frame volume
863 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
864 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
866 // create the horizontal border volume
868 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
869 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
872 for (i = 0; i<kNslats5; i++){
873 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
875 if (i==0&&quadrant==2) continue;
876 if (i==0&&quadrant==4) continue;
878 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,6));
879 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,6));
880 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.;
882 // position the vertical frames
884 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
885 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
886 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
887 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
890 // position the panels and the insulating material
891 for (j=0; j<kNPCB5[i]; j++){
893 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
895 Float_t zPanel = spar[2] - panelpar[2];
896 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
897 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
898 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
899 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
900 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
901 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
906 // position the rohacell volume inside the panel volume
907 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
908 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
910 // position the PCB volume inside the insulating material volume
911 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
912 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
913 // position the horizontal frame volume inside the PCB volume
914 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
915 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
916 // position the sensitive volume inside the horizontal frame volume
917 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
918 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
919 // position the border volumes inside the PCB volume
920 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
921 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
922 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
923 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
924 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
926 // // create the NULOC volume and position it in the horizontal frame
928 gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
929 gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
931 for (xx = -xxmax; xx<=xxmax; xx+=2*kNulocLength) {
933 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
934 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
935 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
936 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
939 // // position the volumes approximating the circular section of the pipe
940 Float_t yoffs = kSensHeight/2. - kYoverlap;
941 Float_t epsilon = 0.001;
944 Double_t dydiv= kSensHeight/ndiv;
945 Double_t ydiv = yoffs -dydiv;
947 // for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat];
950 for (Int_t idiv=0;idiv<ndiv; idiv++){
953 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
954 divpar[0] = (kPcbLength-xdiv)/2.;
955 divpar[1] = dydiv/2. - epsilon;
956 divpar[2] = kSensWidth/2.;
957 Float_t xvol=(kPcbLength+xdiv)/2. + 1.999;
958 Float_t yvol=ydiv + dydiv/2.;
960 for (Int_t quadrant=1; quadrant<=4; quadrant++)
962 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,6));
963 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,6));
965 GetChamber(8)->GetGeometry()->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
966 GetChamber(9)->GetGeometry()->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
969 cout << "Geometry for Station 5...... done" << endl;
975 //______________________________________________________________________________
976 void AliMUONSlatGeometryBuilder::SetTransformations()
978 // Defines the transformations for the station2 chambers.
981 AliMUONChamber* iChamber1 = GetChamber(4);
982 Double_t zpos1 = - iChamber1->Z();
983 iChamber1->GetGeometry()
984 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
986 AliMUONChamber* iChamber2 = GetChamber(5);
987 Double_t zpos2 = - iChamber2->Z();
988 iChamber2->GetGeometry()
989 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
991 iChamber1 = GetChamber(6);
992 zpos1 = - iChamber1->Z();
993 iChamber1->GetGeometry()
994 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
996 iChamber2 = GetChamber(7);
997 zpos2 = - iChamber2->Z();
998 iChamber2->GetGeometry()
999 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1001 iChamber1 = GetChamber(8);
1002 zpos1 = - iChamber1->Z();
1003 iChamber1->GetGeometry()
1004 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1006 iChamber2 = GetChamber(9);
1007 zpos2 = - iChamber2->Z();
1008 iChamber2->GetGeometry()
1009 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1013 //______________________________________________________________________________
1014 void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1016 // Defines the sensitive volumes for slat stations chambers.
1019 GetChamber(4)->GetGeometry()->SetSensitiveVolume("S05G");
1020 GetChamber(5)->GetGeometry()->SetSensitiveVolume("S06G");
1021 GetChamber(6)->GetGeometry()->SetSensitiveVolume("S07G");
1022 GetChamber(7)->GetGeometry()->SetSensitiveVolume("S08G");
1023 GetChamber(8)->GetGeometry()->SetSensitiveVolume("S09G");
1024 GetChamber(9)->GetGeometry()->SetSensitiveVolume("S10G");
1027 //______________________________________________________________________________
1028 Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1030 // On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1031 // and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
1033 if (quadnum==2||quadnum==3) numslat=numslat+fspq;
1034 else numslat=fspq+2-numslat;
1037 if (quadnum==3||quadnum==4) numslat=numslat+2*fspq+1;