3 // Class AliMUONSlatGeometryBuilder
4 // -------------------------------
5 // Abstract base class for geometry construction per chamber.
7 // Author: Eric Dumonteil
9 #include <TVirtualMC.h>
11 #include <TGeoMatrix.h>
14 #include "AliMUONSlatGeometryBuilder.h"
16 #include "AliMUONChamber.h"
17 #include "AliMUONChamberGeometry.h"
19 ClassImp(AliMUONSlatGeometryBuilder)
21 Int_t ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq);
25 //______________________________________________________________________________
26 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
27 : AliMUONVGeometryBuilder(&muon->Chamber(4), &muon->Chamber(5), &muon->Chamber(6), &muon->Chamber(7), &muon->Chamber(8), &muon->Chamber(9)),
28 // : AliMUONVGeometryBuilder(&muon->Chamber(4), &muon->Chamber(5)),
31 // Standard constructor
35 //______________________________________________________________________________
36 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
37 : AliMUONVGeometryBuilder(),
40 // Default constructor
44 //______________________________________________________________________________
45 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
46 : AliMUONVGeometryBuilder(rhs)
48 Fatal("Copy constructor",
49 "Copy constructor is not implemented.");
52 //______________________________________________________________________________
53 AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
57 //______________________________________________________________________________
58 AliMUONSlatGeometryBuilder&
59 AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
61 // check assignement to self
62 if (this == &rhs) return *this;
65 "Assignment operator is not implemented.");
74 //______________________________________________________________________________
75 void AliMUONSlatGeometryBuilder::CreateGeometry()
78 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
83 // define the id of tracking media:
84 Int_t idCopper = idtmed[1110];
85 Int_t idGlass = idtmed[1111];
86 Int_t idCarbon = idtmed[1112];
87 Int_t idRoha = idtmed[1113];
88 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
89 Int_t idAir= idtmed[1100]; // medium 1
91 // sensitive area: 40*40 cm**2
92 const Float_t sensLength = 40.;
93 const Float_t sensHeight = 40.;
94 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
95 const Int_t sensMaterial = idGas;
96 const Float_t yOverlap = 1.5;
98 // PCB dimensions in cm; width: 30 mum copper
99 const Float_t pcbLength = sensLength;
100 const Float_t pcbHeight = 60.;
101 const Float_t pcbWidth = 0.003;
102 const Int_t pcbMaterial = idCopper;
104 // Insulating material: 200 mum glass fiber glued to pcb
105 const Float_t insuLength = pcbLength;
106 const Float_t insuHeight = pcbHeight;
107 const Float_t insuWidth = 0.020;
108 const Int_t insuMaterial = idGlass;
110 // Carbon fiber panels: 200mum carbon/epoxy skin
111 const Float_t panelLength = sensLength;
112 const Float_t panelHeight = sensHeight;
113 const Float_t panelWidth = 0.020;
114 const Int_t panelMaterial = idCarbon;
116 // rohacell between the two carbon panels
117 const Float_t rohaLength = sensLength;
118 const Float_t rohaHeight = sensHeight;
119 const Float_t rohaWidth = 0.5;
120 const Int_t rohaMaterial = idRoha;
122 // Frame around the slat: 2 sticks along length,2 along height
123 // H: the horizontal ones
124 const Float_t hFrameLength = pcbLength;
125 const Float_t hFrameHeight = 1.5;
126 const Float_t hFrameWidth = sensWidth;
127 const Int_t hFrameMaterial = idGlass;
129 // V: the vertical ones
130 const Float_t vFrameLength = 4.0;
131 const Float_t vFrameHeight = sensHeight + hFrameHeight;
132 const Float_t vFrameWidth = sensWidth;
133 const Int_t vFrameMaterial = idGlass;
135 // B: the horizontal border filled with rohacell
136 const Float_t bFrameLength = hFrameLength;
137 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
138 const Float_t bFrameWidth = hFrameWidth;
139 const Int_t bFrameMaterial = idRoha;
141 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
142 const Float_t nulocLength = 2.5;
143 const Float_t nulocHeight = 7.5;
144 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
145 const Int_t nulocMaterial = idCopper;
147 const Float_t slatHeight = pcbHeight;
148 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
149 2.* panelWidth + rohaWidth);
150 const Int_t slatMaterial = idAir;
151 const Float_t dSlatLength = vFrameLength; // border on left and right
156 // the panel volume contains the rohacell
158 Float_t twidth = 2 * panelWidth + rohaWidth;
159 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
160 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
162 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
164 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
165 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
166 twidth -= 2 * insuWidth;
167 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
168 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
169 Float_t theight = 2*hFrameHeight + sensHeight;
170 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
171 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
172 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
173 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
175 Float_t xxmax = (bFrameLength - nulocLength)/2.;
178 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
180 Int_t* fStations = new Int_t[5];
181 for (Int_t i=0; i<5; i++) fStations[i] = 1;
186 //********************************************************************
188 //********************************************************************
189 // indices 1 and 2 for first and second chambers in the station
190 // iChamber (first chamber) kept for other quanties than Z,
191 // assumed to be the same in both chambers
193 iChamber = GetChamber(4);
194 iChamber1 = iChamber;
195 iChamber2 = GetChamber(5);
197 iChamber1->GetGeometry()->SetDebug(kTRUE);
198 //iChamber2->GetGeometry()->SetDebug(kTRUE);
200 if (gAlice->GetModule("DIPO")) {
201 // if DIPO is preset, the whole station will be placed in DDIP volume
202 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
203 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
206 // if (gAlice->GetModule("DIPO")) {
207 // slats5Mother="DDIP";
208 // slats6Mother="DDIP";
214 // gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
215 // gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
216 // gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
218 // gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
221 // volumes for slat geometry (xx=5,..,10 chamber id):
222 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
223 // SxxG --> Sensitive volume (gas)
224 // SxxP --> PCB (copper)
225 // SxxI --> Insulator (vetronite)
226 // SxxC --> Carbon panel
228 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
229 // SB5x --> Volumes for the 35 cm long PCB
230 // slat dimensions: slat is a MOTHER volume!!! made of air
232 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
234 Float_t tlength = 35.;
235 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
236 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
237 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
238 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
239 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
240 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
241 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
244 const Int_t nSlats3 = 5; // number of slats per quadrant
245 const Int_t nPCB3[nSlats3] = {3,4,4,3,2}; // n PCB per slat
246 const Float_t xpos3[nSlats3] = {31., 0., 0., 0., 0.};
247 Float_t slatLength3[nSlats3];
249 // create and position the slat (mother) volumes
259 for (i = 0; i<nSlats3; i++){
260 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
261 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
262 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
263 Float_t ySlat31 = sensHeight * i - yOverlap * i;
264 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
265 spar[0] = slatLength3[i]/2.;
266 spar[1] = slatHeight/2.;
267 spar[2] = slatWidth/2. * 1.01;
268 // take away 5 cm from the first slat in chamber 5
270 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
271 spar2[0] = spar[0]-5./2.;
272 xSlat32 = xSlat3 - 5/2.;
280 Float_t dzCh3=spar[2] * 1.01;
281 // zSlat to be checked (odd downstream or upstream?)
282 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
283 // sprintf(volNam5,"S05%d",i);
284 // gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
285 // gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
286 // gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
288 sprintf(idSlatCh5,"LA%d",nSlats3-1+i);
289 gMC->Gsvolu(idSlatCh5,"BOX",slatMaterial,spar2,3);
290 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat31, zSlat+2.*dzCh3) ,TGeoRotation("rot1",90,angle,90,90+angle,0,0)
293 sprintf(idSlatCh5,"LA%d",3*nSlats3-2+i);
294 gMC->Gsvolu(idSlatCh5,"BOX",slatMaterial,spar2,3);
295 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat31, zSlat-2.*dzCh3) ,TGeoRotation("rot2",90,180+angle,90,90+angle,180,0)
300 sprintf(idSlatCh5,"LA%d",nSlats3-1-i);
301 gMC->Gsvolu(idSlatCh5,"BOX",slatMaterial,spar2,3);
302 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat32, zSlat+2.*dzCh3) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
305 sprintf(idSlatCh5,"LA%d",3*nSlats3-2-i);
306 gMC->Gsvolu(idSlatCh5,"BOX",slatMaterial,spar2,3);
307 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat32, zSlat-2.*dzCh3) ,TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)
311 sprintf(idSlatCh6,"LB%d",nSlats3-1+i);
312 gMC->Gsvolu(idSlatCh6,"BOX",slatMaterial,spar2,3);
313 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat31, zSlat+2.*dzCh3) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
315 sprintf(idSlatCh6,"LB%d",3*nSlats3-2+i);
316 gMC->Gsvolu(idSlatCh6,"BOX",slatMaterial,spar2,3);
317 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat31, zSlat-2.*dzCh3) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
321 sprintf(idSlatCh6,"LB%d",nSlats3-1-i);
322 gMC->Gsvolu(idSlatCh6,"BOX",slatMaterial,spar2,3);
323 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat32, zSlat+2.*dzCh3) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
326 sprintf(idSlatCh6,"LB%d",3*nSlats3-2-i);
327 gMC->Gsvolu(idSlatCh6,"BOX",slatMaterial,spar2,3);
328 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat32, zSlat-2.*dzCh3) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
333 // create the panel volume
335 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
336 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
337 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
339 // create the rohacell volume
341 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
342 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
343 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
345 // create the insulating material volume
347 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
348 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
349 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
351 // create the PCB volume
353 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
354 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
355 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
357 // create the sensitive volumes,
358 gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
359 gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
362 // create the vertical frame volume
364 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
365 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
367 // create the horizontal frame volume
370 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
371 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
372 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
374 // create the horizontal border volume
376 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
377 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
378 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
381 for (i = 0; i<nSlats3; i++){
382 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
384 if (i==0&&quadrant==2) continue;
385 if (i==0&&quadrant==4) continue;
387 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,4));
388 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,4));
389 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
390 Float_t xvFrame2 = xvFrame;
392 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
394 // position the vertical frames
396 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
397 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5, (2*i)*10+quadrant,TGeoTranslation(-xvFrame2,0.,0.));
398 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
399 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
402 // position the panels and the insulating material
403 for (j=0; j<nPCB3[i]; j++){
404 if (i==1&&j==0) continue;
406 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
407 Float_t xx2 = xx + 5/2.;
409 Float_t zPanel = spar[2] - panelpar[2];
410 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
411 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
412 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
413 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
415 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
416 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
417 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
418 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
421 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
422 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
423 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
425 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
426 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
427 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
433 // position the rohacell volume inside the panel volume
434 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
435 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
436 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
438 // position the PCB volume inside the insulating material volume
439 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
440 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
441 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
442 // position the horizontal frame volume inside the PCB volume
443 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
444 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
445 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
446 // position the sensitive volume inside the horizontal frame volume
447 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
448 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
449 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
450 // position the border volumes inside the PCB volume
451 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
452 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
453 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
454 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
455 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
456 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
457 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
459 // create the NULOC volume and position it in the horizontal frame
461 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
462 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
464 Float_t xxmax2 = xxmax - 5./2.;
465 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
467 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
468 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
469 if (xx > -xxmax2 && xx< xxmax2) {
470 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
471 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
473 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
474 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
477 // position the volumes approximating the circular section of the pipe
478 Float_t yoffs = sensHeight/2.-yOverlap;
479 Float_t epsilon = 0.001;
482 Double_t dydiv= sensHeight/ndiv;
483 Double_t ydiv = yoffs -dydiv;
487 for (Int_t idiv=0;idiv<ndiv; idiv++){
490 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
491 divpar[0] = (pcbLength-xdiv)/2.;
492 divpar[1] = dydiv/2. - epsilon;
493 divpar[2] = sensWidth/2.;
494 Float_t xvol=(pcbLength+xdiv)/2.;
495 Float_t yvol=ydiv + dydiv/2.;
497 for (Int_t quadrant=1; quadrant<=4; quadrant++)
499 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,4));
500 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,4));
502 GetChamber(4)->GetGeometry()->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-(pcbLength * (nPCB3[1]-1)/2. + 35./2.),yvol-pcbLength+yOverlap,0.),3,divpar);
503 GetChamber(5)->GetGeometry()->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-pcbLength * nPCB3[1]/2.,yvol-pcbLength+yOverlap,0.),3,divpar);
507 cout << "Geometry for Station 3...... done" << endl;
513 // //********************************************************************
515 // //********************************************************************
516 // // indices 1 and 2 for first and second chambers in the station
517 // // iChamber (first chamber) kept for other quanties than Z,
518 // // assumed to be the same in both chambers
520 iChamber = GetChamber(6);
521 iChamber1 = iChamber;
522 iChamber2 = GetChamber(7);
524 const Int_t nSlats4 = 6; // number of slats per quadrant
525 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
526 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
527 Float_t slatLength4[nSlats4];
529 // // create and position the slat (mother) volumes
537 for (i = 0; i<nSlats4; i++){
538 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
539 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
540 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
541 ySlat4 = sensHeight * i - yOverlap *i;
543 spar[0] = slatLength4[i]/2.;
544 spar[1] = slatHeight/2.;
545 spar[2] = slatWidth/2.*1.01;
546 Float_t dzCh4=spar[2]*1.01;
547 // zSlat to be checked (odd downstream or upstream?)
548 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
550 sprintf(idSlatCh7,"LC%d",nSlats4-1+i);
551 gMC->Gsvolu(idSlatCh7,"BOX",slatMaterial,spar,3);
552 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4));
554 sprintf(idSlatCh7,"LC%d",3*nSlats4-2+i);
555 gMC->Gsvolu(idSlatCh7,"BOX",slatMaterial,spar,3);
556 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4));
560 sprintf(idSlatCh7,"LC%d",nSlats4-1-i);
561 gMC->Gsvolu(idSlatCh7,"BOX",slatMaterial,spar,3);
562 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
565 sprintf(idSlatCh7,"LC%d",3*nSlats4-2-i);
566 gMC->Gsvolu(idSlatCh7,"BOX",slatMaterial,spar,3);
567 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
571 sprintf(idSlatCh8,"LD%d",nSlats4-1+i);
572 gMC->Gsvolu(idSlatCh8,"BOX",slatMaterial,spar,3);
573 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
575 sprintf(idSlatCh8,"LD%d",3*nSlats4-2+i);
576 gMC->Gsvolu(idSlatCh8,"BOX",slatMaterial,spar,3);
577 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
580 sprintf(idSlatCh8,"LD%d",nSlats4-1-i);
581 gMC->Gsvolu(idSlatCh8,"BOX",slatMaterial,spar,3);
582 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
584 sprintf(idSlatCh8,"LD%d",3*nSlats4-2-i);
585 gMC->Gsvolu(idSlatCh8,"BOX",slatMaterial,spar,3);
586 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
592 // create the panel volume
594 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
595 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
597 // create the rohacell volume
599 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
600 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
602 // create the insulating material volume
604 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
605 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
607 // create the PCB volume
609 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
610 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
612 // create the sensitive volumes,
614 gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
615 gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
617 // create the vertical frame volume
619 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
620 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
622 // create the horizontal frame volume
624 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
625 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
627 // create the horizontal border volume
629 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
630 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
633 for (i = 0; i<nSlats4; i++){
634 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
636 if (i==0&&quadrant==2) continue;
637 if (i==0&&quadrant==4) continue;
639 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,5));
640 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,5));
641 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
643 // position the vertical frames
645 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
646 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
647 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
648 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
650 // position the panels and the insulating material
651 for (j=0; j<nPCB4[i]; j++){
653 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
655 Float_t zPanel = spar[2] - panelpar[2];
656 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
657 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
658 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
659 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
660 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
661 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
666 // position the rohacell volume inside the panel volume
667 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
668 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
670 // position the PCB volume inside the insulating material volume
671 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
672 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
673 // position the horizontal frame volume inside the PCB volume
674 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
675 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
676 // position the sensitive volume inside the horizontal frame volume
677 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
678 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
679 // position the border volumes inside the PCB volume
680 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
681 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
682 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
683 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
684 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
686 // // create the NULOC volume and position it in the horizontal frame
688 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
689 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
691 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
693 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
694 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
695 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
696 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
699 // // position the volumes approximating the circular section of the pipe
700 Float_t yoffs = sensHeight/2. - yOverlap;
701 Float_t epsilon = 0.001;
704 Double_t dydiv= sensHeight/ndiv;
705 Double_t ydiv = yoffs -dydiv;
709 for (Int_t idiv=0;idiv<ndiv; idiv++){
712 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
713 divpar[0] = (pcbLength-xdiv)/2.;
714 divpar[1] = dydiv/2. - epsilon;
715 divpar[2] = sensWidth/2.;
716 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
717 Float_t yvol=ydiv + dydiv/2.;
719 for (Int_t quadrant=1; quadrant<=4; quadrant++)
721 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,5));
722 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,5));
724 GetChamber(6)->GetGeometry()->AddEnvelopeConstituentParam("S07G", idSlatCh7, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-pcbLength * nPCB4[1]/2.,yvol-pcbLength+yOverlap,0.),3,divpar);
725 GetChamber(7)->GetGeometry()->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-pcbLength * nPCB4[1]/2.,yvol-pcbLength+yOverlap,0.),3,divpar);
728 cout << "Geometry for Station 4...... done" << endl;
735 // //********************************************************************
737 // //********************************************************************
738 // // indices 1 and 2 for first and second chambers in the station
739 // // iChamber (first chamber) kept for other quanties than Z,
740 // // assumed to be the same in both chambers
742 iChamber = GetChamber(8);
743 iChamber1 = iChamber;
744 iChamber2 = GetChamber(9);
746 const Int_t nSlats5 = 7; // number of slats per quadrant
747 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
748 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
749 Float_t slatLength5[nSlats5];
751 // // create and position the slat (mother) volumes
759 for (i = 0; i<nSlats5; i++){
760 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
761 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
762 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
763 ySlat5 = sensHeight * i - yOverlap * i;
765 spar[0] = slatLength5[i]/2.;
766 spar[1] = slatHeight/2.;
767 spar[2] = slatWidth/2. * 1.01;
768 Float_t dzCh5=spar[2]*1.01;
769 // zSlat to be checked (odd downstream or upstream?)
770 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
772 sprintf(idSlatCh9,"LE%d",nSlats5-1+i);
773 gMC->Gsvolu(idSlatCh9,"BOX",slatMaterial,spar,3);
774 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5));
776 sprintf(idSlatCh9,"LE%d",3*nSlats5-2+i);
777 gMC->Gsvolu(idSlatCh9,"BOX",slatMaterial,spar,3);
778 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5));
782 sprintf(idSlatCh9,"LE%d",nSlats5-1-i);
783 gMC->Gsvolu(idSlatCh9,"BOX",slatMaterial,spar,3);
784 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
787 sprintf(idSlatCh9,"LE%d",3*nSlats5-2-i);
788 gMC->Gsvolu(idSlatCh9,"BOX",slatMaterial,spar,3);
789 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot3",90,angle,90,270+angle,180,0)
793 sprintf(idSlatCh10,"LF%d",nSlats5-1+i);
794 gMC->Gsvolu(idSlatCh10,"BOX",slatMaterial,spar,3);
795 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot5",90,angle,90,90+angle,0,0)
798 sprintf(idSlatCh10,"LF%d",3*nSlats5-2+i);
799 gMC->Gsvolu(idSlatCh10,"BOX",slatMaterial,spar,3);
800 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot6",90,180+angle,90,90+angle,180,0)
805 sprintf(idSlatCh10,"LF%d",nSlats5-1-i);
806 gMC->Gsvolu(idSlatCh10,"BOX",slatMaterial,spar,3);
807 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5) ,TGeoRotation("rot7",90,angle,90,270+angle,180,0)
809 sprintf(idSlatCh10,"LF%d",3*nSlats5-2-i);
810 gMC->Gsvolu(idSlatCh10,"BOX",slatMaterial,spar,3);
811 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5) ,TGeoRotation("rot8",90,180+angle,90,270+angle,0,0)
815 // // create the panel volume
817 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
818 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
820 // create the rohacell volume
822 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
823 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
825 // create the insulating material volume
827 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
828 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
830 // create the PCB volume
832 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
833 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
835 // create the sensitive volumes,
837 gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
838 gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
840 // create the vertical frame volume
842 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
843 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
845 // create the horizontal frame volume
847 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
848 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
850 // create the horizontal border volume
852 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
853 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
856 for (i = 0; i<nSlats5; i++){
857 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
859 if (i==0&&quadrant==2) continue;
860 if (i==0&&quadrant==4) continue;
862 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,6));
863 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,6));
864 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
866 // position the vertical frames
868 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
869 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
870 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
871 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
874 // position the panels and the insulating material
875 for (j=0; j<nPCB5[i]; j++){
877 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
879 Float_t zPanel = spar[2] - panelpar[2];
880 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
881 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
882 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
883 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
884 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
885 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
890 // position the rohacell volume inside the panel volume
891 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
892 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
894 // position the PCB volume inside the insulating material volume
895 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
896 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
897 // position the horizontal frame volume inside the PCB volume
898 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
899 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
900 // position the sensitive volume inside the horizontal frame volume
901 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
902 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
903 // position the border volumes inside the PCB volume
904 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
905 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
906 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
907 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
908 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
910 // // create the NULOC volume and position it in the horizontal frame
912 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
913 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
915 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
917 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
918 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
919 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
920 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
923 // // position the volumes approximating the circular section of the pipe
924 Float_t yoffs = sensHeight/2. - yOverlap;
925 Float_t epsilon = 0.001;
928 Double_t dydiv= sensHeight/ndiv;
929 Double_t ydiv = yoffs -dydiv;
931 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
934 for (Int_t idiv=0;idiv<ndiv; idiv++){
937 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
938 divpar[0] = (pcbLength-xdiv)/2.;
939 divpar[1] = dydiv/2. - epsilon;
940 divpar[2] = sensWidth/2.;
941 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
942 Float_t yvol=ydiv + dydiv/2.;
944 for (Int_t quadrant=1; quadrant<=4; quadrant++)
946 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,6));
947 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,6));
949 GetChamber(8)->GetGeometry()->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-pcbLength * nPCB5[1]/2.,yvol-pcbLength+yOverlap,0.),3,divpar);
950 GetChamber(9)->GetGeometry()->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,TGeoTranslation(xvol-pcbLength * nPCB5[1]/2.,yvol-pcbLength+yOverlap,0.),3,divpar);
953 cout << "Geometry for Station 5...... done" << endl;
959 //______________________________________________________________________________
960 void AliMUONSlatGeometryBuilder::SetTransformations()
962 // Defines the transformations for the station2 chambers.
965 AliMUONChamber* iChamber1 = GetChamber(4);
966 Double_t zpos1 = - iChamber1->Z();
967 iChamber1->GetGeometry()
968 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
970 AliMUONChamber* iChamber2 = GetChamber(5);
971 Double_t zpos2 = - iChamber2->Z();
972 iChamber2->GetGeometry()
973 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
975 iChamber1 = GetChamber(6);
976 zpos1 = - iChamber1->Z();
977 iChamber1->GetGeometry()
978 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
980 iChamber2 = GetChamber(7);
981 zpos2 = - iChamber2->Z();
982 iChamber2->GetGeometry()
983 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
985 iChamber1 = GetChamber(8);
986 zpos1 = - iChamber1->Z();
987 iChamber1->GetGeometry()
988 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
990 iChamber2 = GetChamber(9);
991 zpos2 = - iChamber2->Z();
992 iChamber2->GetGeometry()
993 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
997 //______________________________________________________________________________
998 void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1000 // Defines the sensitive volumes for slat stations chambers.
1003 GetChamber(4)->GetGeometry()->SetSensitiveVolume("S05G");
1004 GetChamber(5)->GetGeometry()->SetSensitiveVolume("S06G");
1005 GetChamber(6)->GetGeometry()->SetSensitiveVolume("S07G");
1006 GetChamber(7)->GetGeometry()->SetSensitiveVolume("S08G");
1007 GetChamber(8)->GetGeometry()->SetSensitiveVolume("S09G");
1008 GetChamber(9)->GetGeometry()->SetSensitiveVolume("S10G");
1011 //______________________________________________________________________________
1012 Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1015 if (quadnum==2||quadnum==3) numslat=numslat+fspq;
1016 else numslat=fspq+2-numslat;
1019 if (quadnum==3||quadnum==4) numslat=numslat+2*fspq+1;