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
11 // of the slats on the support panels.
12 // Those moves can be described with a simple set of parameters. The next step should be now to describe all
13 // the slats and their places by a unique
14 // class, which would make the SlatBuilder far more compact since now only three parameters can define a slat
15 // and its position, like:
16 // * Bool_t rounded_shape_slat
17 // * Float_t slat_length
18 // * Float_t slat_number or Float_t slat_position
20 #include <TVirtualMC.h>
21 #include <TGeoMatrix.h>
22 #include <Riostream.h>
24 #include "AliMUONSlatGeometryBuilder.h"
26 #include "AliMUONChamber.h"
27 #include "AliMUONChamberGeometry.h"
30 ClassImp(AliMUONSlatGeometryBuilder)
32 //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),
37 &muon->Chamber(6), &muon->Chamber(7),
38 &muon->Chamber(8), &muon->Chamber(9)),
41 // Standard constructor
45 //______________________________________________________________________________
46 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
47 : AliMUONVGeometryBuilder(),
50 // Default constructor
54 //______________________________________________________________________________
55 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
56 : AliMUONVGeometryBuilder(rhs)
58 Fatal("Copy constructor",
59 "Copy constructor is not implemented.");
62 //______________________________________________________________________________
63 AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
67 //______________________________________________________________________________
68 AliMUONSlatGeometryBuilder&
69 AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
71 // check assignement to self
72 if (this == &rhs) return *this;
75 "Assignment operator is not implemented.");
84 //______________________________________________________________________________
85 void AliMUONSlatGeometryBuilder::CreateGeometry()
87 // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
88 // It includes description and placements of support panels and slats.
89 // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning
90 // the use of Enveloppe method to place the Geant volumes.
91 // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters,
92 // and this builder would then be dedicated only to the
93 // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
95 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
100 // define the id of tracking media:
101 Int_t idCopper = idtmed[1110];
102 Int_t idGlass = idtmed[1111];
103 Int_t idCarbon = idtmed[1112];
104 Int_t idRoha = idtmed[1113];
105 Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
106 Int_t idAir = idtmed[1100]; // medium 1
108 // sensitive area: 40*40 cm**2
109 const Float_t kSensLength = 40.;
110 const Float_t kSensHeight = 40.;
111 const Float_t kSensWidth = 0.5; // according to TDR fig 2.120
112 const Int_t kSensMaterial = idGas;
113 const Float_t kYoverlap = 1.5;
115 // PCB dimensions in cm; width: 30 mum copper
116 const Float_t kPcbLength = kSensLength;
117 const Float_t kPcbHeight = 60.;
118 const Float_t kPcbWidth = 0.003;
119 const Int_t kPcbMaterial = idCopper;
121 // Insulating material: 200 mum glass fiber glued to pcb
122 const Float_t kInsuLength = kPcbLength;
123 const Float_t kInsuHeight = kPcbHeight;
124 const Float_t kInsuWidth = 0.020;
125 const Int_t kInsuMaterial = idGlass;
127 // Carbon fiber panels: 200mum carbon/epoxy skin
128 const Float_t kPanelLength = kSensLength;
129 const Float_t kPanelHeight = kSensHeight;
130 const Float_t kPanelWidth = 0.020;
131 const Int_t kPanelMaterial = idCarbon;
133 // rohacell between the two carbon panels
134 const Float_t kRohaLength = kSensLength;
135 const Float_t kRohaHeight = kSensHeight;
136 const Float_t kRohaWidth = 0.5;
137 const Int_t kRohaMaterial = idRoha;
139 // Frame around the slat: 2 sticks along length,2 along height
140 // H: the horizontal ones
141 const Float_t kHframeLength = kPcbLength;
142 const Float_t kHframeHeight = 1.5;
143 const Float_t kHframeWidth = kSensWidth;
144 const Int_t kHframeMaterial = idGlass;
146 // V: the vertical ones
147 const Float_t kVframeLength = 4.0;
148 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
149 const Float_t kVframeWidth = kSensWidth;
150 const Int_t kVframeMaterial = idGlass;
152 // B: the horizontal border filled with rohacell
153 const Float_t kBframeLength = kHframeLength;
154 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
155 const Float_t kBframeWidth = kHframeWidth;
156 const Int_t kBframeMaterial = idRoha;
158 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
159 const Float_t kNulocLength = 2.5;
160 const Float_t kNulocHeight = 7.5;
161 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
162 const Int_t kNulocMaterial = idCopper;
164 const Float_t kSlatHeight = kPcbHeight;
165 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth +
166 2.* kPanelWidth + kRohaWidth);
167 const Int_t kSlatMaterial = idAir;
168 const Float_t kDslatLength = kVframeLength; // border on left and right
172 Int_t detElementNumber;
174 // the panel volume contains the rohacell
176 Float_t twidth = 2 * kPanelWidth + kRohaWidth;
177 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., twidth/2. };
178 Float_t rohapar[3] = { kRohaLength/2., kRohaHeight/2., kRohaWidth/2. };
180 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
182 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth;
183 Float_t insupar[3] = { kInsuLength/2., kInsuHeight/2., twidth/2. };
184 twidth -= 2 * kInsuWidth;
185 Float_t pcbpar[3] = { kPcbLength/2., kPcbHeight/2., twidth/2. };
186 Float_t senspar[3] = { kSensLength/2., kSensHeight/2., kSensWidth/2. };
187 Float_t theight = 2*kHframeHeight + kSensHeight;
188 Float_t hFramepar[3]={kHframeLength/2., theight/2., kHframeWidth/2.};
189 Float_t bFramepar[3]={kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
190 Float_t vFramepar[3]={kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
191 Float_t nulocpar[3]={kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
193 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
196 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
198 Int_t* fStations = new Int_t[5];
199 for (Int_t i=0; i<5; i++) fStations[i] = 1;
203 //********************************************************************
205 //********************************************************************
206 // indices 1 and 2 for first and second chambers in the station
207 // iChamber (first chamber) kept for other quanties than Z,
208 // assumed to be the same in both chambers
210 iChamber = GetChamber(4);
211 iChamber1 = iChamber;
212 iChamber2 = GetChamber(5);
214 //iChamber1->GetGeometry()->SetDebug(kTRUE);
215 //iChamber2->GetGeometry()->SetDebug(kTRUE);
217 if (gAlice->GetModule("DIPO")) {
218 // if DIPO is preset, the whole station will be placed in DDIP volume
219 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
220 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
223 // if (gAlice->GetModule("DIPO")) {
224 // slats5Mother="DDIP";
225 // slats6Mother="DDIP";
231 // gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
232 // gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
233 // gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
235 // gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
238 // volumes for slat geometry (xx=5,..,10 chamber id):
239 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
240 // SxxG --> Sensitive volume (gas)
241 // SxxP --> PCB (copper)
242 // SxxI --> Insulator (vetronite)
243 // SxxC --> Carbon panel
245 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
246 // SB5x --> Volumes for the 35 cm long PCB
247 // slat dimensions: slat is a MOTHER volume!!! made of air
249 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
251 Float_t tlength = 35.;
252 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
253 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
254 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
255 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
256 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
257 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
258 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
261 const Int_t kNslats3 = 5; // number of slats per quadrant
262 const Int_t kNPCB3[kNslats3] = {4,4,4,3,2}; // n PCB per slat
263 const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
264 Float_t slatLength3[kNslats3];
266 // 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==0 || i==1 || i==2) { // 1 pcb is shortened by 5cm
287 spar2[0] = spar[0]-5./2.;
288 xSlat32 = xSlat3 - 5/2.;
295 Float_t dzCh3=spar[2] * 1.01;
296 // zSlat to be checked (odd downstream or upstream?)
297 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
298 // sprintf(volNam5,"S05%d",i);
299 // gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
300 // gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
301 // gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
303 sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
304 detElementNumber = 500 + i + kNslats3-1;
305 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
306 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat31, zSlat+2.*dzCh3),
307 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
309 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
310 detElementNumber = 550 + i + kNslats3-1;
311 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
312 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat31, zSlat-2.*dzCh3),
313 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
316 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
317 detElementNumber = 500 - i + kNslats3-1;
318 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
319 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(xSlat32, ySlat32, zSlat+2.*dzCh3),
320 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
322 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
323 detElementNumber = 550 - i + kNslats3-1;
324 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
325 GetChamber(4)->GetGeometry()->AddEnvelope(idSlatCh5, true, TGeoTranslation(-xSlat32, ySlat32, zSlat-2.*dzCh3),
326 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
329 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
330 detElementNumber = 600 + i + kNslats3-1;
331 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
332 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat31, zSlat+2.*dzCh3),
333 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
334 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
335 detElementNumber = 650 + i + kNslats3-1;
336 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
337 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat31, zSlat-2.*dzCh3),
338 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
341 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
342 detElementNumber = 600 - i + kNslats3-1;
343 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
344 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(xSlat3, ySlat32, zSlat+2.*dzCh3),
345 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
347 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
348 detElementNumber = 650 - i + kNslats3-1;
349 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar2,3);
350 GetChamber(5)->GetGeometry()->AddEnvelope(idSlatCh6, true, TGeoTranslation(-xSlat3, ySlat32, zSlat-2.*dzCh3),
351 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
355 // create the panel volume
357 gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
358 gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
359 gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
361 // create the rohacell volume
363 gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
364 gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
365 gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
367 // create the insulating material volume
369 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
370 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
371 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
373 // create the PCB volume
375 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
376 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
377 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
379 // create the sensitive volumes,
380 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
381 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
384 // create the vertical frame volume
386 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
387 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
389 // create the horizontal frame volume
392 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
393 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
394 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
396 // create the horizontal border volume
398 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
399 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
400 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
403 for (i = 0; i<kNslats3; i++){
404 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
406 if (i==0&&quadrant==2) continue;
407 if (i==0&&quadrant==4) continue;
409 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
410 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
411 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
412 Float_t xvFrame2 = xvFrame;
414 if ( i==0 || i==1 || i ==2 ) xvFrame2 -= 5./2.;
416 // position the vertical frames
418 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5,
419 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
420 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05V", idSlatCh5,
421 (2*i)*10+quadrant,TGeoTranslation(-xvFrame2,0.,0.));
422 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6,
423 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
424 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06V", idSlatCh6,
425 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
428 // position the panels and the insulating material
429 for (j=0; j<kNPCB3[i]; j++){
430 if (i==1&&j==0) continue;
431 if (i==0&&j==0) continue;
433 Float_t xx = kSensLength * (-kNPCB3[i]/2.+j+.5);
434 Float_t xx2 = xx+ 5/2.;
436 Float_t zPanel = spar[2] - panelpar[2];
437 if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
438 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
439 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
440 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
442 else if ( (i == 0 || i == 1 || i == 2) && j < kNPCB3[i]-1) {
443 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
444 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
445 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
448 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
449 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
450 GetChamber(4)->GetGeometry()->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
452 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
453 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
454 GetChamber(5)->GetGeometry()->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
460 // position the rohacell volume inside the panel volume
461 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
462 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
463 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
465 // position the PCB volume inside the insulating material volume
466 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
467 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
468 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
469 // position the horizontal frame volume inside the PCB volume
470 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
471 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
472 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
473 // position the sensitive volume inside the horizontal frame volume
474 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
475 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
476 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
477 // position the border volumes inside the PCB volume
478 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
479 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
480 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
481 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
482 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
483 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
484 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
486 // create the NULOC volume and position it in the horizontal frame
488 gMC->Gsvolu("S05N","BOX",kNulocMaterial,nulocpar,3);
489 gMC->Gsvolu("S06N","BOX",kNulocMaterial,nulocpar,3);
491 Float_t xxmax2 = xxmax - 5./2.;
492 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
494 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
495 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., kBframeWidth/4., 0, "ONLY");
496 if (xx > -xxmax2 && xx< xxmax2) {
497 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
498 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., kBframeWidth/4., 0, "ONLY");
500 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
501 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., kBframeWidth/4., 0, "ONLY");
503 // position the volumes approximating the circular section of the pipe
504 Float_t yoffs = kSensHeight/2.-kYoverlap;
505 Float_t epsilon = 0.001;
508 Double_t dydiv= kSensHeight/ndiv;
509 Double_t ydiv = yoffs -dydiv/2.;
512 Double_t rmin = 31.5; // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
514 for (Int_t idiv = 0;idiv < ndiv; idiv++){
517 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
518 divpar[0] = (kPcbLength-xdiv)/2.;
519 divpar[1] = dydiv/2. - epsilon;
520 divpar[2] = kSensWidth/2.;
521 Float_t xvol = (kPcbLength+xdiv)/2.;
523 // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
524 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
525 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
526 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
528 GetChamber(4)->GetGeometry()->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
529 TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1]-1)/2. + 35./2.),yvol-kPcbLength+kYoverlap,0.),3,divpar);
531 GetChamber(5)->GetGeometry()->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,
532 TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
536 // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (Lattes centrales de la station 3)
537 // Gines Martinez, Subatech sep 04
538 // 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
539 // Cette code a ete ecrit suivant le plan PQ-LAT-SR1 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
541 Double_t rmin_122000SR1 = 31.5; //in cm
543 dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB
544 ydiv = -kSensHeight/2 + dydiv/2.-kYoverlap; // Initializing vertical position of the volume from bottom
545 xdiv = 0.; // Initializing horizontal position of the box volumes
546 for (Int_t idiv=0;idiv<ndiv; idiv++){
547 xdiv = TMath::Abs( rmin_122000SR1 * TMath::Sin( TMath::ACos(ydiv/rmin_122000SR1) ) );
548 divpar[0] = (kPcbLength-xdiv)/2.; // Dimension of the box volume
549 divpar[1] = dydiv/2. - epsilon;
550 divpar[2] = kSensWidth/2.;
551 Float_t xvol = (kPcbLength+xdiv)/2.; //2D traslition for positionning of box volume
554 for (side = 1; side <= 2; side++) {
555 sprintf(idSlatCh5,"LA%d",4);
556 sprintf(idSlatCh6,"LB%d",4);
558 sprintf(idSlatCh5,"LA%d",13);
559 sprintf(idSlatCh6,"LB%d",13);
561 GetChamber(4)->GetGeometry()->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
562 TGeoTranslation(xvol-(kPcbLength * (kNPCB3[0]-1)/2. + 35./2.),yvol+kYoverlap,0.),3,divpar);
564 GetChamber(5)->GetGeometry()->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
565 TGeoTranslation(xvol-kPcbLength * kNPCB3[0]/2.,yvol+kYoverlap,0.),3,divpar);
567 ydiv += dydiv; // Going from bottom to top
569 cout << "Geometry for Station 3...... done" << endl;
575 // //********************************************************************
577 // //********************************************************************
578 // // indices 1 and 2 for first and second chambers in the station
579 // // iChamber (first chamber) kept for other quanties than Z,
580 // // assumed to be the same in both chambers
581 // corrected geometry (JP. Cussonneau, Ch. Finck)
583 iChamber = GetChamber(6);
584 iChamber1 = iChamber;
585 iChamber2 = GetChamber(7);
587 const Int_t kNslats4 = 7; // number of slats per quadrant
588 const Int_t kNPCB4[kNslats4] = {5,6,5,5,4,3,2}; // n PCB per slat
589 const Float_t kXpos4[kNslats4] = {38.5, 0., 0., 0., 0., 0., 0.};
590 Float_t slatLength4[kNslats4];
592 // // create and position the slat (mother) volumes
600 for (i = 0; i<kNslats4; i++){
601 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kDslatLength;
602 xSlat4 = slatLength4[i]/2. - kVframeLength/2. + kXpos4[i];
603 if (i == 1) slatLength4[i] -= 2. *kDslatLength; // frame out in PCB with circular border
604 ySlat4 = kSensHeight * i - kYoverlap *i;
606 spar[0] = slatLength4[i]/2.;
607 spar[1] = kSlatHeight/2.;
608 spar[2] = kSlatWidth/2.*1.01;
609 Float_t dzCh4 = spar[2]*1.01;
610 // zSlat to be checked (odd downstream or upstream?)
611 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
613 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
614 detElementNumber = 700 + i + kNslats4-1;
615 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
616 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
617 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
619 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
620 detElementNumber = 750 + i + kNslats4-1;
621 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
622 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
623 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
626 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
627 detElementNumber = 700 - i + kNslats4-1;
628 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
629 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
630 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
632 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
633 detElementNumber = 750 - i + kNslats4-1;
634 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
635 GetChamber(6)->GetGeometry()->AddEnvelope(idSlatCh7, true,
636 TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
637 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
640 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
641 detElementNumber = 800 + i + kNslats4-1;
642 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
643 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
644 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
645 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
646 detElementNumber = 850 + i + kNslats4-1;
647 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
648 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
649 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
651 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
652 detElementNumber = 800 - i + kNslats4-1;
653 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
654 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
655 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
656 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
657 detElementNumber = 850 - i + kNslats4-1;
658 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
659 GetChamber(7)->GetGeometry()->AddEnvelope(idSlatCh8, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
660 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
664 // create the panel volume
666 gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
667 gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
669 // create the rohacell volume
671 gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
672 gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
674 // create the insulating material volume
676 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
677 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
679 // create the PCB volume
681 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
682 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
684 // create the sensitive volumes,
686 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
687 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
689 // create the vertical frame volume
691 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
692 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
694 // create the horizontal frame volume
696 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
697 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
699 // create the horizontal border volume
701 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
702 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
705 for (i = 0; i < kNslats4; i++){
706 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
708 if (i == 0 && quadrant == 2) continue;
709 if (i == 0 && quadrant == 4) continue;
711 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
712 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
713 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
715 // position the vertical frames
716 if (i != 1 && i != 0) {
717 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
718 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
719 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
720 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
722 // position the panels and the insulating material
723 for (j = 0; j < kNPCB4[i]; j++){
724 if (i == 1 && j == 0) continue;
726 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
728 Float_t zPanel = spar[2] - panelpar[2];
729 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
730 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
731 GetChamber(6)->GetGeometry()->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
732 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
733 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
734 GetChamber(7)->GetGeometry()->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
739 // position the rohacell volume inside the panel volume
740 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
741 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
743 // position the PCB volume inside the insulating material volume
744 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
745 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
746 // position the horizontal frame volume inside the PCB volume
747 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
748 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
749 // position the sensitive volume inside the horizontal frame volume
750 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
751 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
752 // position the border volumes inside the PCB volume
753 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
754 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
755 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
756 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
757 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
759 // // create the NULOC volume and position it in the horizontal frame
761 gMC->Gsvolu("S07N","BOX",kNulocMaterial,nulocpar,3);
762 gMC->Gsvolu("S08N","BOX",kNulocMaterial,nulocpar,3);
764 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
766 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
767 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., kBframeWidth/4., 0, "ONLY");
768 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
769 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., kBframeWidth/4., 0, "ONLY");
772 // // position the volumes approximating the circular section of the pipe
773 Float_t yoffs = kSensHeight/2. - kYoverlap;
774 Float_t epsilon = 0.001;
777 Double_t dydiv= kSensHeight/ndiv;
778 Double_t ydiv = yoffs -dydiv;
783 for (Int_t idiv = 0; idiv < ndiv; idiv++){
786 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
787 divpar[0] = (kPcbLength-xdiv-shiftR)/2.;
788 divpar[1] = dydiv/2. - epsilon;
789 divpar[2] = kSensWidth/2.;
790 Float_t xvol = (kPcbLength+xdiv)/2.+shiftR;
791 Float_t yvol = ydiv + dydiv/2.;
793 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
794 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
795 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
797 GetChamber(6)->GetGeometry()->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
798 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
800 GetChamber(7)->GetGeometry()->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
801 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
804 cout << "Geometry for Station 4...... done" << endl;
811 // //********************************************************************
813 // //********************************************************************
814 // // indices 1 and 2 for first and second chambers in the station
815 // // iChamber (first chamber) kept for other quanties than Z,
816 // // assumed to be the same in both chambers
817 // corrected geometry (JP. Cussonneau, Ch. Finck)
819 iChamber = GetChamber(8);
820 iChamber1 = iChamber;
821 iChamber2 = GetChamber(9);
823 const Int_t kNslats5 = 7; // number of slats per quadrant
824 const Int_t kNPCB5[kNslats5] = {5,6,6,6,5,4,3}; // n PCB per slat
825 const Float_t kXpos5[kNslats5] = {38.5, 0., 0., 0., 0., 0., 0.};
826 Float_t slatLength5[kNslats5];
828 // // create and position the slat (mother) volumes
836 for (i = 0; i < kNslats5; i++){
837 slatLength5[i] = kPcbLength * kNPCB5[i] + 2. * kDslatLength;
838 xSlat5 = slatLength5[i]/2. - kVframeLength/2. +kXpos5[i];
839 if (i == 1 || i == 0) slatLength5[i] -= 2. *kDslatLength; // frame out in PCB with circular border
840 ySlat5 = kSensHeight * i - kYoverlap * i;
842 spar[0] = slatLength5[i]/2.;
843 spar[1] = kSlatHeight/2.;
844 spar[2] = kSlatWidth/2. * 1.01;
845 Float_t dzCh5 = spar[2]*1.01;
846 // zSlat to be checked (odd downstream or upstream?)
847 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
849 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
850 detElementNumber = 900 + i + kNslats5-1;
851 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
852 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
853 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
855 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
856 detElementNumber = 950 + i + kNslats5-1;
857 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
858 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
859 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
862 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
863 detElementNumber = 900 - i + kNslats5-1;
864 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
865 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
866 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
868 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
869 detElementNumber = 950 - i + kNslats5-1;
870 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
871 GetChamber(8)->GetGeometry()->AddEnvelope(idSlatCh9, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
872 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
875 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
876 detElementNumber = 1000 + i + kNslats5-1;
877 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
878 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
879 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
881 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
882 detElementNumber = 1050 + i + kNslats5-1;
883 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
884 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
885 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
888 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
889 detElementNumber = 1000 - i + kNslats5-1;
890 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
891 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
892 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
893 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
894 detElementNumber = 1050 - i + kNslats5-1;
895 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
896 GetChamber(9)->GetGeometry()->AddEnvelope(idSlatCh10, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
897 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
900 // // create the panel volume
902 gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
903 gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
905 // create the rohacell volume
907 gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
908 gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
910 // create the insulating material volume
912 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
913 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
915 // create the PCB volume
917 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
918 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
920 // create the sensitive volumes,
922 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
923 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
925 // create the vertical frame volume
927 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
928 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
930 // create the horizontal frame volume
932 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
933 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
935 // create the horizontal border volume
937 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
938 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
941 for (i = 0; i < kNslats5; i++){
942 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
944 if (i == 0 && quadrant == 2) continue;
945 if (i == 0 && quadrant == 4) continue;
947 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
948 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
949 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.;
951 // position the vertical frames
953 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
954 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
955 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
956 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
959 // position the panels and the insulating material
960 for (j = 0; j < kNPCB5[i]; j++){
961 if (i == 1 && j == 0) continue;
963 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
965 Float_t zPanel = spar[2] - panelpar[2];
966 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
967 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
968 GetChamber(8)->GetGeometry()->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
969 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
970 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
971 GetChamber(9)->GetGeometry()->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
976 // position the rohacell volume inside the panel volume
977 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
978 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
980 // position the PCB volume inside the insulating material volume
981 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
982 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
983 // position the horizontal frame volume inside the PCB volume
984 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
985 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
986 // position the sensitive volume inside the horizontal frame volume
987 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
988 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
989 // position the border volumes inside the PCB volume
990 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
991 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
992 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
993 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
994 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
996 // // create the NULOC volume and position it in the horizontal frame
998 gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
999 gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
1001 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
1003 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
1004 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
1005 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
1006 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
1009 // // position the volumes approximating the circular section of the pipe
1010 Float_t yoffs = kSensHeight/2. - kYoverlap;
1011 Float_t epsilon = 0.001;
1014 Double_t dydiv = kSensHeight/ndiv;
1015 Double_t ydiv = yoffs -dydiv;
1017 // for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat];
1020 Float_t shiftR = 0.;
1021 for (Int_t idiv = 0;idiv < ndiv; idiv++){
1024 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1025 divpar[0] = (kPcbLength-xdiv-shiftR)/2.;
1026 divpar[1] = dydiv/2. - epsilon;
1027 divpar[2] = kSensWidth/2.;
1028 Float_t xvol = (kPcbLength+xdiv)/2.+ shiftR;
1029 Float_t yvol = ydiv + dydiv/2.;
1031 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1032 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1033 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1035 GetChamber(8)->GetGeometry()->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
1036 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
1038 GetChamber(9)->GetGeometry()->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
1039 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
1042 cout << "Geometry for Station 5...... done" << endl;
1048 //______________________________________________________________________________
1049 void AliMUONSlatGeometryBuilder::SetTransformations()
1051 // Defines the transformations for the station2 chambers.
1054 AliMUONChamber* iChamber1 = GetChamber(4);
1055 Double_t zpos1 = - iChamber1->Z();
1056 iChamber1->GetGeometry()
1057 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1059 AliMUONChamber* iChamber2 = GetChamber(5);
1060 Double_t zpos2 = - iChamber2->Z();
1061 iChamber2->GetGeometry()
1062 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1064 iChamber1 = GetChamber(6);
1065 zpos1 = - iChamber1->Z();
1066 iChamber1->GetGeometry()
1067 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1069 iChamber2 = GetChamber(7);
1070 zpos2 = - iChamber2->Z();
1071 iChamber2->GetGeometry()
1072 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1074 iChamber1 = GetChamber(8);
1075 zpos1 = - iChamber1->Z();
1076 iChamber1->GetGeometry()
1077 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1079 iChamber2 = GetChamber(9);
1080 zpos2 = - iChamber2->Z();
1081 iChamber2->GetGeometry()
1082 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1086 //______________________________________________________________________________
1087 void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1089 // Defines the sensitive volumes for slat stations chambers.
1092 GetChamber(4)->GetGeometry()->SetSensitiveVolume("S05G");
1093 GetChamber(5)->GetGeometry()->SetSensitiveVolume("S06G");
1094 GetChamber(6)->GetGeometry()->SetSensitiveVolume("S07G");
1095 GetChamber(7)->GetGeometry()->SetSensitiveVolume("S08G");
1096 GetChamber(8)->GetGeometry()->SetSensitiveVolume("S09G");
1097 GetChamber(9)->GetGeometry()->SetSensitiveVolume("S10G");
1100 //______________________________________________________________________________
1101 Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1103 // On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1104 // and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
1106 if (quadnum==2 || quadnum==3)
1109 numslat = fspq + 2-numslat;
1112 if (quadnum==3 || quadnum==4) numslat += 2*fspq+1;