Coding conventions (C.Finck)
[u/mrichter/AliRoot.git] / MUON / AliMUONSlatGeometryBuilder.cxx
CommitLineData
e118b27e 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
d1cd2474 16// $Id$
17//
18// Class AliMUONSlatGeometryBuilder
19// -------------------------------
20// Abstract base class for geometry construction per chamber.
21//
2057e0cc 22// Author: Eric Dumonteil (dumontei@cea.fr)
23
24
c10e6eaf 25// This Builder is designed according to the enveloppe methode. The basic idea is to be able to allow moves
26// of the slats on the support panels.
27// Those moves can be described with a simple set of parameters. The next step should be now to describe all
28// the slats and their places by a unique
29// class, which would make the SlatBuilder far more compact since now only three parameters can define a slat
30// and its position, like:
2057e0cc 31// * Bool_t rounded_shape_slat
32// * Float_t slat_length
33// * Float_t slat_number or Float_t slat_position
34
d1cd2474 35#include <TVirtualMC.h>
d1cd2474 36#include <TGeoMatrix.h>
30178c30 37#include <Riostream.h>
d1cd2474 38
e118b27e 39#include "AliRun.h"
40#include "AliLog.h"
41
d1cd2474 42#include "AliMUONSlatGeometryBuilder.h"
43#include "AliMUON.h"
44#include "AliMUONChamber.h"
e118b27e 45#include "AliMUONGeometryModule.h"
a432117a 46#include "AliMUONGeometryEnvelopeStore.h"
e516b01d 47#include "AliMUONConstants.h"
d1cd2474 48
49ClassImp(AliMUONSlatGeometryBuilder)
50
d1cd2474 51
52//______________________________________________________________________________
53AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
a432117a 54 : AliMUONVGeometryBuilder("slat.dat",
e118b27e 55 muon->Chamber(4).GetGeometry(),
56 muon->Chamber(5).GetGeometry(),
57 muon->Chamber(6).GetGeometry(),
58 muon->Chamber(7).GetGeometry(),
59 muon->Chamber(8).GetGeometry(),
60 muon->Chamber(9).GetGeometry()),
d1cd2474 61 fMUON(muon)
62{
63// Standard constructor
64
65}
66
67//______________________________________________________________________________
68AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
69 : AliMUONVGeometryBuilder(),
70 fMUON(0)
71{
72// Default constructor
73}
74
75
76//______________________________________________________________________________
77AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
78 : AliMUONVGeometryBuilder(rhs)
79{
8c343c7c 80 AliFatal("Copy constructor is not implemented.");
d1cd2474 81}
82
83//______________________________________________________________________________
84AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
85//
86}
87
88//______________________________________________________________________________
89AliMUONSlatGeometryBuilder&
90AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
91{
92 // check assignement to self
93 if (this == &rhs) return *this;
94
8c343c7c 95 AliFatal("Assignment operator is not implemented.");
d1cd2474 96
97 return *this;
98}
99
100//
101// public methods
102//
103
104//______________________________________________________________________________
105void AliMUONSlatGeometryBuilder::CreateGeometry()
106{
e516b01d 107 // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
108 // It includes description and placements of support panels and slats.
109 // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning
110 // the use of Enveloppe method to place the Geant volumes.
111 // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters,
112 // and this builder would then be dedicated only to the
113 // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
d1cd2474 114
e516b01d 115 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
116
117 Float_t angle;
118 Float_t *dum=0;
119
120 // define the id of tracking media:
121 Int_t idAir = idtmed[1100]; // medium 1
122 Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
123 Int_t idCopper = idtmed[1110];
124 Int_t idG10 = idtmed[1111];
125 Int_t idCarbon = idtmed[1112];
126 Int_t idRoha = idtmed[1113];
127 Int_t idNomex = idtmed[1114]; // honey comb
128 Int_t idNoryl = idtmed[1115];
129 Int_t idNomexB = idtmed[1116]; // bulk material
130
131 // sensitive area: 40*40 cm**2
132 const Float_t kSensLength = 40.;
133 const Float_t kSensHeight = 40.;
1c334adf 134 const Float_t kSensWidth = AliMUONConstants::Pitch()*2;// 0.5 cm, according to TDR fig 2.120
e516b01d 135 const Int_t kSensMaterial = idGas;
136 // const Float_t kYoverlap = 1.5;
137
138 // PCB dimensions in cm; width: 30 mum copper
139 const Float_t kPcbLength = kSensLength;
140 const Float_t kPcbHeight = 58.; // updated Ch. Finck
141 const Float_t kPcbWidth = 0.003;
142 const Int_t kPcbMaterial = idCopper;
143
144 // Insulating material: 220 mum G10 fiber glued to pcb
145 const Float_t kInsuLength = kPcbLength;
146 const Float_t kInsuHeight = kPcbHeight;
147 const Float_t kInsuWidth = 0.022; // updated Ch. Finck
148 const Int_t kInsuMaterial = idG10;
149
150 // Carbon fiber panels: 200mum carbon/epoxy skin
151 const Float_t kCarbonWidth = 0.020;
152 const Int_t kCarbonMaterial = idCarbon;
153
154 // Nomex (honey comb) between the two panel carbon skins
155 const Float_t kNomexLength = kSensLength;
156 const Float_t kNomexHeight = kSensHeight;
157 const Float_t kNomexWidth = 0.8; // updated Ch. Finck
158 const Int_t kNomexMaterial = idNomex;
159
160 // Bulk Nomex under panel sandwich Ch. Finck
161 const Float_t kNomexBWidth = 0.025;
162 const Int_t kNomexBMaterial = idNomexB;
163
164 // Panel sandwich 0.02 carbon*2 + 0.8 nomex
165 const Float_t kPanelLength = kSensLength;
166 const Float_t kPanelHeight = kSensHeight;
167 const Float_t kPanelWidth = 2 * kCarbonWidth + kNomexWidth;
168
169 // spacer around the slat: 2 sticks along length,2 along height
170 // H: the horizontal ones
171 const Float_t kHframeLength = kPcbLength;
172 const Float_t kHframeHeight = 1.95; // updated Ch. Finck
173 const Float_t kHframeWidth = kSensWidth;
174 const Int_t kHframeMaterial = idNoryl;
175
176 // V: the vertical ones; vertical spacers
177 const Float_t kVframeLength = 2.5;
178 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
179 const Float_t kVframeWidth = kSensWidth;
180 const Int_t kVframeMaterial = idNoryl;
181
182 // B: the horizontal border filled with rohacell: ok Ch. Finck
183 const Float_t kBframeLength = kHframeLength;
184 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
185 const Float_t kBframeWidth = kHframeWidth;
186 const Int_t kBframeMaterial = idRoha;
187
188 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics
189 const Float_t kNulocLength = 2.5;
190 const Float_t kNulocHeight = kBframeHeight;
191 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
192 const Int_t kNulocMaterial = idCopper;
193
194 // Slat parameters
195 const Float_t kSlatHeight = kPcbHeight;
196 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth
197 + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck
198 const Int_t kSlatMaterial = idAir;
199 const Float_t kDslatLength = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck
200 Float_t zSlat = AliMUONConstants::DzSlat();// implemented Ch. Finck
201 Float_t dzCh = AliMUONConstants::DzCh();
202
203 Float_t spar[3];
204 Int_t i, j;
205 Int_t detElemId;
206
207 // the panel volume contains the nomex
208 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. };
209 Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. };
210 Float_t twidth = kPanelWidth + kNomexBWidth;
211 Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex
212
213 // insulating material contains PCB-> gas
214 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ;
215 Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. };
216 twidth -= 2 * kInsuWidth;
217 Float_t pcbpar[3] = {kPcbLength/2., kPcbHeight/2., twidth/2. };
218 Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. };
219 Float_t theight = 2 * kHframeHeight + kSensHeight;
220 Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.};
221 Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
222 Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
223 Float_t nulocpar[3] = {kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
224
225 Float_t xx;
226 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
227 Int_t index=0;
d1cd2474 228
e516b01d 229 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
d12a7158 230
e516b01d 231 Int_t* fStations = new Int_t[5];
232 for (Int_t i=0; i<5; i++) fStations[i] = 1;
233 fStations[2] = 1;
234
235 if (fStations[2])
d1cd2474 236 {
e516b01d 237 //********************************************************************
e118b27e 238 // Station 3 **
239 //********************************************************************
240 // indices 1 and 2 for first and second chambers in the station
241 // iChamber (first chamber) kept for other quanties than Z,
242 // assumed to be the same in both chambers
e516b01d 243
e118b27e 244 iChamber = &fMUON->Chamber(4);
e516b01d 245 iChamber1 = iChamber;
e118b27e 246 iChamber2 = &fMUON->Chamber(5);
d1cd2474 247
e516b01d 248 //iChamber1->GetGeometry()->SetDebug(kTRUE);
249 //iChamber2->GetGeometry()->SetDebug(kTRUE);
e118b27e 250
e516b01d 251 if (gAlice->GetModule("DIPO")) {
252 // if DIPO is preset, the whole station will be placed in DDIP volume
253 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
254 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
255 }
256
6ffd4cb7 257 if (!gAlice->GetModule("DIPO")) {
258 // Mother volume for each chamber in st3 are only defined if Dipole volue is there.
259 // Outer excess and inner recess for mother volume radius
260 // with respect to ROuter and RInner
261 Float_t dframep_in = 0.006;
262 Float_t dframep_out= 0.006;
263 Float_t tpar[3];
264 Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.1;
265 tpar[0] = iChamber1->RInner()-dframep_in;
266 tpar[1] = (iChamber1->ROuter()+dframep_out);
267 tpar[2] = dstation;
268 gMC->Gsvolu("CH05", "TUBE", idAir, tpar, 3);
269 gMC->Gsvolu("CH06", "TUBE", idAir, tpar, 3);
270 iChamber1->GetGeometry()->SetVolume("CH05");
271 iChamber2->GetGeometry()->SetVolume("CH06");
272 }
e516b01d 273 // volumes for slat geometry (xx=5,..,10 chamber id):
274 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
275 // SxxG --> Sensitive volume (gas)
276 // SxxP --> PCB (copper)
277 // SxxI --> Insulator (G10)
278 // SxxC --> Carbon panel
279 // SxxN --> Nomex comb
280 // SxxX --> Nomex bulk
281 // SxxH, SxxV --> Horizontal and Vertical frames (Noryl)
282 // SB5x --> Volumes for the 35 cm long PCB
283 // slat dimensions: slat is a MOTHER volume!!! made of air
284
285 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
286
287 Float_t tlength = 35.;
288 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
289 Float_t nomexpar2[3] = { tlength/2., nomexpar[1], nomexpar[2]};
290 Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1], nomexbpar[2]};
291 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
292 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
293 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
294 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
295 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
296 Float_t *dum=0;
297 Float_t pcbDLength3 = (kPcbLength - tlength);
298
299 const Int_t kNslats3 = 5; // number of slats per quadrant
300 const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
301 const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
302 const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7};
303 Float_t slatLength3[kNslats3];
304
305 // create and position the slat (mother) volumes
306
307 char idSlatCh5[5];
308 char idSlatCh6[5];
309 Float_t xSlat3;
310 Float_t ySlat3 = 0;
311 Float_t angle = 0.;
312 Float_t spar2[3];
313 for (i = 0; i < kNslats3; i++){
314
315 slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength;
316 xSlat3 = slatLength3[i]/2. + kDslatLength + kXpos3[i];
317 ySlat3 += kYpos3[i];
318
319 spar[0] = slatLength3[i]/2.;
320 spar[1] = kSlatHeight/2.;
321 spar[2] = kSlatWidth/2.;
322 // take away 5 cm from the first slat in chamber 5
7ddb761c 323 if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
e516b01d 324 spar2[0] = spar[0] - pcbDLength3/2.;
325 } else {
326 spar2[0] = spar[0];
327 }
328 spar2[1] = spar[1];
329 spar2[2] = spar[2];
330 Float_t dzCh3 = dzCh;
331 Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
332
333 sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
334 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
335 detElemId = 500 + i + kNslats3-1;
336 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
337 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
338
339 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
340 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
341 detElemId = 550 + i + kNslats3-1;
342 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
343 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
344
345 if (i > 0) {
346 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
347 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
348 detElemId = 500 - i + kNslats3-1;
349 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
350 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
351
352 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
353 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
354 detElemId = 550 - i + kNslats3-1;
355 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
356 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
357 }
358
359 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
360 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
361 detElemId = 600 + i + kNslats3-1;
362 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
363 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
364 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
365 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
366 detElemId = 650 + i + kNslats3-1;
367 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
368 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
369
370 if (i > 0) {
371 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
372 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
373 detElemId = 600 - i + kNslats3-1;
374 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
375 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
376
377 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
378 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
379 detElemId = 650 - i + kNslats3-1;
380 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
381 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
382 }
383 }
d1cd2474 384
e516b01d 385 // create the panel volume
d1cd2474 386
e516b01d 387 gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
388 gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
389 gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
4846c3ab 390
e516b01d 391 // create the nomex volume (honey comb)
d1cd2474 392
e516b01d 393 gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
394 gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
395 gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
4846c3ab 396
e516b01d 397 // create the nomex volume (bulk)
398
399 gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3);
400 gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3);
401 gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3);
d1cd2474 402
e516b01d 403 // create the insulating material volume
404
405 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
406 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
407 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
4846c3ab 408
e516b01d 409 // create the PCB volume
d1cd2474 410
e516b01d 411 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
412 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
413 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 414
e516b01d 415 // create the sensitive volumes,
4846c3ab 416
e516b01d 417 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
418 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
d1cd2474 419
e516b01d 420 // create the vertical frame volume
d1cd2474 421
e516b01d 422 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
423 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
d1cd2474 424
e516b01d 425 // create the horizontal frame volume
d1cd2474 426
e516b01d 427 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
428 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
429 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
4846c3ab 430
e516b01d 431 // create the horizontal border volume
d1cd2474 432
e516b01d 433 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
434 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
435 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
4846c3ab 436
e516b01d 437 index = 0;
438 for (i = 0; i<kNslats3; i++){
439 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
440
441 if (i == 0 && quadrant == 2) continue;
442 if (i == 0 && quadrant == 4) continue;
443
444 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
445 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
446 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
447 Float_t xvFrame2 = xvFrame;
448
449 if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
450
451 // position the vertical frames
452 if ( i > 2) {
453 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
454 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
455 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
456 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
457 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
458 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
459 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
460 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
461 }
462
463 if (i == 2) {
464 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
465 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
466 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
467 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
468 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
469 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
470 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
471 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
472 }
473
474 if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
475 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
476 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
477 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
478 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
479 }
480
481 // position the panels and the insulating material
482 for (j = 0; j < kNPCB3[i]; j++){
483 if (i == 1 && j == 0) continue;
484 if (i == 0 && j == 0) continue;
485 index++;
486 Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
487 Float_t xx2 = xx - pcbDLength3/2.;
d1cd2474 488
e516b01d 489 Float_t zPanel = spar[2] - nomexbpar[2];
490
491 if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
492 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
493 GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
494 GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
495 } else {
496 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
497 GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
498 GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
499 }
500 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
501 GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
502 GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
d1cd2474 503
e516b01d 504 }
505 }
506 }
507
508 // position the nomex volume inside the panel volume
509 gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY");
510 gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY");
511 gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY");
4846c3ab 512
e516b01d 513 // position panel volume inside the bulk nomex material volume
514 gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY");
515 gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY");
516 gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY");
517
518 // position the PCB volume inside the insulating material volume
519 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
520 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
521 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
4846c3ab 522
e516b01d 523 // position the horizontal frame volume inside the PCB volume
524 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
525 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
526 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
4846c3ab 527
e516b01d 528 // position the sensitive volume inside the horizontal frame volume
529 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
530 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
531 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
4846c3ab 532
533
e516b01d 534 // position the border volumes inside the PCB volume
535 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
536 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
537 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
538 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
539 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
540
541 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
542 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
4846c3ab 543
e516b01d 544 // create the NULOC volume and position it in the horizontal frame
545 gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
546 gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3);
547 index = 0;
548 Float_t xxmax2 = xxmax - pcbDLength3/2.;
549 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
550 index++;
551 gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
552 gMC->Gspos("S05E",2*index ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
553 gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
554 gMC->Gspos("S06E",2*index ,"S06B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
555 if (xx > -xxmax2 && xx< xxmax2) {
556 gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
557 gMC->Gspos("S05E",2*index ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
558 }
559 }
560
561 // position the volumes approximating the circular section of the pipe
562 Float_t epsilon = 0.001;
563 Int_t ndiv = 6;
564 Int_t imax = 1;
565 Double_t divpar[3];
566 Double_t dydiv = kSensHeight/ndiv;
567 Double_t ydiv = (kSensHeight - dydiv)/2.;
568 Double_t rmin = 31.5; // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
569 Double_t xdiv = 0.;
570 Float_t xvol;
571 Float_t yvol;
572
573 for (Int_t idiv = 0; idiv < ndiv; idiv++){
574 ydiv += dydiv;
575 xdiv = 0.;
6f7aa53f 576 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
e516b01d 577 divpar[0] = (kPcbLength - xdiv)/2.;
578 divpar[1] = dydiv/2. - epsilon;
579 divpar[2] = kSensWidth/2.;
580 xvol = (kPcbLength + xdiv)/2.;
581 yvol = ydiv;
582
583 // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
584 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
585 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
586 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
587
588 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
589 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
590
591 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,
592 TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
593 }
594 }
595
596 // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
597 // Gines Martinez, Subatech sep 04
598 // 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
599 // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
600 // Rmin = 31.5 cm
601 rmin = 31.5; //in cm
602 ndiv = 9;
603 dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB
604 ydiv = -kSensHeight/2 + dydiv/2.; // Initializing vertical position of the volume from bottom
605 xdiv = 0.; // Initializing horizontal position of the box volumes
606
607 for (Int_t idiv = 0; idiv < ndiv; idiv++){
608 xdiv = TMath::Abs( rmin * TMath::Sin( TMath::ACos(ydiv/rmin) ) );
609 divpar[0] = (kPcbLength - xdiv)/2.; // Dimension of the box volume
610 divpar[1] = dydiv/2. - epsilon;
611 divpar[2] = kSensWidth/2.;
612 xvol = (kPcbLength + xdiv)/2.; //2D traslition for positionning of box volume
613 yvol = ydiv;
614 Int_t side;
615 for (side = 1; side <= 2; side++) {
616 sprintf(idSlatCh5,"LA%d",4);
617 sprintf(idSlatCh6,"LB%d",4);
618 if(side == 2) {
619 sprintf(idSlatCh5,"LA%d",13);
620 sprintf(idSlatCh6,"LB%d",13);
621 }
622 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
623 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
624
625 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
626 TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
627 }
628 ydiv += dydiv; // Going from bottom to top
629 }
630 // cout << "Geometry for Station 3...... done" << endl;
d1cd2474 631 }
632
e516b01d 633 if (fStations[3]) {
d1cd2474 634
635
e516b01d 636 // //********************************************************************
637 // // Station 4 **
638 // //********************************************************************
639 // // indices 1 and 2 for first and second chambers in the station
640 // // iChamber (first chamber) kept for other quanties than Z,
641 // // assumed to be the same in both chambers
642 // corrected geometry (JP. Cussonneau, Ch. Finck)
d1cd2474 643
e118b27e 644 iChamber = &fMUON->Chamber(6);
e516b01d 645 iChamber1 = iChamber;
e118b27e 646 iChamber2 = &fMUON->Chamber(7);
e516b01d 647
648 const Int_t kNslats4 = 7; // number of slats per quadrant
649 const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
650 const Float_t kXpos4[kNslats4] = {38.2, 0., 0., 0., 0., 0., 0.};
651 const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6};
652 const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 29.4, 37.0, 28.6};
653
654 Float_t slatLength4[kNslats4];
655
6ffd4cb7 656
657 // Mother volume for each chamber
658 // Outer excess and inner recess for mother volume radius
659 // with respect to ROuter and RInner
660 Float_t dframep_in = 0.006;
661 Float_t dframep_out= 0.006;
662 Float_t tpar[3];
663 Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.1;
664 tpar[0] = iChamber1->RInner()-dframep_in;
665 tpar[1] = (iChamber1->ROuter()+dframep_out);
666 tpar[2] = dstation;
667 gMC->Gsvolu("CH07", "TUBE", idAir, tpar, 3);
668 gMC->Gsvolu("CH08", "TUBE", idAir, tpar, 3);
669 iChamber1->GetGeometry()->SetVolume("CH07");
670 iChamber2->GetGeometry()->SetVolume("CH08");
671
e516b01d 672 // create and position the slat (mother) volumes
673
674 char idSlatCh7[5];
675 char idSlatCh8[5];
676 Float_t xSlat4;
677 Float_t ySlat41 = 0;
678 Float_t ySlat42 = 0;
679
680 angle = 0.;
681
682 for (i = 0; i<kNslats4; i++){
683 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength;
684 xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i];
685 ySlat41 += kYpos41[i];
686 ySlat42 += kYpos42[i];
687
688 spar[0] = slatLength4[i]/2.;
689 spar[1] = kSlatHeight/2.;
690 spar[2] = kSlatWidth/2.;
691 Float_t dzCh4 = dzCh;
692 Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat;
693
694 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
695 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
696 detElemId = 700 + i + kNslats4-1;
697 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4),
698 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
699
700 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
701 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
702 detElemId = 750 + i + kNslats4-1;
703 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4),
704 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
d1cd2474 705
e516b01d 706 if (i > 0) {
707 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
708 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
709 detElemId = 700 - i + kNslats4-1;
710 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4),
711 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
712
713 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
714 detElemId = 750 - i + kNslats4-1;
715 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
716 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true,
717 TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4),
718 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
719 }
720
721 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
722 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
723 detElemId = 800 + i + kNslats4-1;
724 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4),
725 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
726
727 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
728 detElemId = 850 + i + kNslats4-1;
729 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
730 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4),
731 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
732 if (i > 0) {
733 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
734 detElemId = 800 - i + kNslats4-1;
735 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
736 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4),
737 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
738 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
739 detElemId = 850 - i + kNslats4-1;
740 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
741 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4),
742 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
743 }
744 }
d1cd2474 745
e516b01d 746 // create the panel volume
d1cd2474 747
e516b01d 748 gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
749 gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
d1cd2474 750
e516b01d 751 // create the nomex volume
d1cd2474 752
e516b01d 753 gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
754 gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
d1cd2474 755
d1cd2474 756
e516b01d 757 // create the nomex volume (bulk)
d1cd2474 758
e516b01d 759 gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
760 gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
d1cd2474 761
e516b01d 762 // create the insulating material volume
763
764 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
765 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
766
767 // create the PCB volume
768
769 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
770 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 771
e516b01d 772 // create the sensitive volumes,
773
774 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
775 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
776
777 // create the vertical frame volume
778
779 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
780 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
781
782 // create the horizontal frame volume
783
784 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
785 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
786
787 // create the horizontal border volume
788
789 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
790 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
791
792 index = 0;
793 for (i = 0; i < kNslats4; i++){
794 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
795
796 if (i == 0 && quadrant == 2) continue;
797 if (i == 0 && quadrant == 4) continue;
798
799 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
800 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
801 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
802
803 // position the vertical frames
804 if (i != 1) {
805 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
806 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
807 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
808 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
809 } else { // no rounded spacer yet
810 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
811 // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
812 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
813 // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
814 }
815 // position the panels and the insulating material
816 for (j = 0; j < kNPCB4[i]; j++){
817 if (i == 1 && j == 0) continue;
818 index++;
819 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
820
821 Float_t zPanel = spar[2] - nomexbpar[2];
822 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
823 GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
824 GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
825 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
826 GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
827 GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
828 }
829 }
830 }
831
832 // position the nomex volume inside the panel volume
833 gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY");
834 gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY");
835
836 // position panel volume inside the bulk nomex material volume
837 gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY");
838 gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY");
839
840 // position the PCB volume inside the insulating material volume
841 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
842 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
843
844 // position the horizontal frame volume inside the PCB volume
845 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
846 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
847
848 // position the sensitive volume inside the horizontal frame volume
849 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
850 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
851
852 // position the border volumes inside the PCB volume
853 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
854 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
855 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
856 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
857 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
858
859 // create the NULOC volume and position it in the horizontal frame
860
861 gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3);
862 gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3);
863 index = 0;
864 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
865 index++;
866 gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
867 gMC->Gspos("S07E",2*index ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
868 gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
869 gMC->Gspos("S08E",2*index ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
870 }
871
872 // position the volumes approximating the circular section of the pipe
873
874 Float_t epsilon = 0.001;
875 Int_t ndiv = 10;
876 Int_t imax = 1;
877 Double_t divpar[3];
878 Double_t dydiv = kSensHeight/ndiv;
879 Double_t ydiv = (kSensHeight - dydiv)/2.;
880 Float_t rmin = 39.5;// Corrected in sep04 from PQ-LAT-NR3 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
881 Float_t xdiv = 0.;
882 Float_t xvol;
883 Float_t yvol;
884
885 for (Int_t idiv = 0; idiv < ndiv; idiv++){
886 ydiv += dydiv;
887 xdiv = 0.;
6f7aa53f 888 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
e516b01d 889 divpar[0] = (kPcbLength - xdiv)/2.;
890 divpar[1] = dydiv/2. - epsilon;
891 divpar[2] = kSensWidth/2.;
892 xvol = (kPcbLength + xdiv)/2.;
893 yvol = ydiv ;
6296ba34 894
e516b01d 895 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
896 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
897 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
6296ba34 898
e516b01d 899 GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
900 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
6296ba34 901
e516b01d 902 GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
903 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
904 }
d12a7158 905 }
e516b01d 906 // cout << "Geometry for Station 4...... done" << endl;
907
908 }
d1cd2474 909
e516b01d 910 if (fStations[4]) {
6296ba34 911
d1cd2474 912
e516b01d 913 // //********************************************************************
914 // // Station 5 **
915 // //********************************************************************
916 // // indices 1 and 2 for first and second chambers in the station
917 // // iChamber (first chamber) kept for other quanties than Z,
918 // // assumed to be the same in both chambers
919 // corrected geometry (JP. Cussonneau, Ch. Finck)
920
e118b27e 921 iChamber = &fMUON->Chamber(8);
e516b01d 922 iChamber1 = iChamber;
e118b27e 923 iChamber2 = &fMUON->Chamber(9);
d1cd2474 924
e516b01d 925 const Int_t kNslats5 = 7; // number of slats per quadrant
926 const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
927 const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.};
928 const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75};
929 Float_t slatLength5[kNslats5];
930
6ffd4cb7 931 // Mother volume for each chamber
932 // Outer excess and inner recess for mother volume radius
933 // with respect to ROuter and RInner
934 Float_t dframep_in = 0.006;
935 Float_t dframep_out= 0.006;
936 Float_t tpar[3];
937 Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.3;
938 tpar[0] = iChamber1->RInner()-dframep_in;
939 tpar[1] = (iChamber1->ROuter()+dframep_out);
940 tpar[2] = dstation;
941 gMC->Gsvolu("CH09", "TUBE", idAir, tpar, 3);
942 gMC->Gsvolu("CH10", "TUBE", idAir, tpar, 3);
943 iChamber1->GetGeometry()->SetVolume("CH09");
944 iChamber2->GetGeometry()->SetVolume("CH10");
945
e516b01d 946 // create and position the slat (mother) volumes
947
948 char idSlatCh9[5];
949 char idSlatCh10[5];
950 Float_t xSlat5;
951 Float_t ySlat5 = 0;
952 angle = 0.;
953
954 for (i = 0; i < kNslats5; i++){
955
956 slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength;
957 xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i];
958 ySlat5 += kYpos5[i];
959
960 spar[0] = slatLength5[i]/2.;
961 spar[1] = kSlatHeight/2.;
962 spar[2] = kSlatWidth/2.;
963
964 Float_t dzCh5 = dzCh;
965 Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat;
966
967 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
968 detElemId = 900 + i + kNslats5-1;
969 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
970 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
971 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
972
973 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
974 detElemId = 950 + i + kNslats5-1;
975 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
976 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
977 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
d1cd2474 978
e516b01d 979 if (i > 0) {
980 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
981 detElemId = 900 - i + kNslats5-1;
982 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
983 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
984 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
985
986 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
987 detElemId = 950 - i + kNslats5-1;
988 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
989 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
990 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
991 }
992
993 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
994 detElemId = 1000 + i + kNslats5-1;
995 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
996 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
997 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
998
999 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
1000 detElemId = 1050 + i + kNslats5-1;
1001 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
1002 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
1003 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
1004
1005 if (i > 0) {
1006 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
1007 detElemId = 1000 - i + kNslats5-1;
1008 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
1009 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
1010 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
1011 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
1012 detElemId = 1050 - i + kNslats5-1;
1013 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
1014 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
1015 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
1016 }
1017 }
1018
1019 // create the panel volume
d12a7158 1020
e516b01d 1021 gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3);
1022 gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3);
1023
1024 // create the nomex volume
1025
1026 gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3);
1027 gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3);
d1cd2474 1028
d1cd2474 1029
e516b01d 1030 // create the nomex volume (bulk)
d1cd2474 1031
e516b01d 1032 gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
1033 gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
d1cd2474 1034
e516b01d 1035 // create the insulating material volume
d1cd2474 1036
e516b01d 1037 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
1038 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
c3b69531 1039
e516b01d 1040 // create the PCB volume
1041
1042 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
1043 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 1044
e516b01d 1045 // create the sensitive volumes,
1046
1047 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
1048 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
1049
1050 // create the vertical frame volume
1051
1052 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
1053 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
1054
1055 // create the horizontal frame volume
1056
1057 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
1058 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
1059
1060 // create the horizontal border volume
1061
1062 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
1063 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
1064
1065 index = 0;
1066 for (i = 0; i < kNslats5; i++){
1067 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1068
1069 if (i == 0 && quadrant == 2) continue;
1070 if (i == 0 && quadrant == 4) continue;
1071
1072 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1073 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
1074 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.; // ok
1075
1076 // position the vertical frames (spacers)
1077 if (i != 1) {
1078 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1079 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1080 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1081 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1082 } else { // no rounded spacer yet
1083 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1084 // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1085 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
1086 // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
1087 }
1088
1089 // position the panels and the insulating material
1090 for (j = 0; j < kNPCB5[i]; j++){
1091 if (i == 1 && j == 0) continue;
1092 index++;
1093 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
1094
1095 Float_t zPanel = spar[2] - nomexbpar[2];
1096 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1097 GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
1098 GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
1099
1100 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
1101 GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
1102 GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
1103 }
1104 }
1105 }
1106
1107 // position the nomex volume inside the panel volume
1108 gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY");
1109 gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY");
1110
1111 // position panel volume inside the bulk nomex material volume
1112 gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1113 gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY");
1114
1115 // position the PCB volume inside the insulating material volume
1116 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1117 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1118
1119 // position the horizontal frame volume inside the PCB volume
1120 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1121 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1122
1123 // position the sensitive volume inside the horizontal frame volume
1124 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1125 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
1126
1127 // position the border volumes inside the PCB volume
1128 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
1129 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1130 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1131 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1132 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1133
1134 // // create the NULOC volume and position it in the horizontal frame
1135
1136 gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
1137 gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
1138 index = 0;
1139 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
1140 index++;
1141 gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1142 gMC->Gspos("S09E",2*index ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1143 gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
1144 gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
1145 }
1146
d1cd2474 1147
e516b01d 1148 // position the volumes approximating the circular section of the pipe
1149 Float_t epsilon = 0.001;
1150 Int_t ndiv = 10;
1151 Int_t imax = 1;
1152 Double_t divpar[3];
1153 Double_t dydiv = kSensHeight/ndiv;
1154 Double_t ydiv = (kSensHeight - dydiv)/2.;
1155 Float_t rmin = 39.5;
1156 Float_t xdiv = 0.;
1157 Float_t xvol;
1158 Float_t yvol;
1159
1160 for (Int_t idiv = 0; idiv < ndiv; idiv++){
1161 ydiv += dydiv;
1162 xdiv = 0.;
6f7aa53f 1163 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) );
e516b01d 1164 divpar[0] = (kPcbLength - xdiv)/2.;
1165 divpar[1] = dydiv/2. - epsilon;
1166 divpar[2] = kSensWidth/2.;
1167 xvol = (kPcbLength + xdiv)/2.;
1168 yvol = ydiv;
1169
1170 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1171 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1172 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1173
1174 GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
1175 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1176 GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
1177 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
1178 }
d1cd2474 1179 }
e516b01d 1180 // cout << "Geometry for Station 5...... done" << endl;
1181
1182 }
d1cd2474 1183}
1184
1185
1186//______________________________________________________________________________
1187void AliMUONSlatGeometryBuilder::SetTransformations()
1188{
1189// Defines the transformations for the station2 chambers.
1190// ---
1191
e118b27e 1192 AliMUONChamber* iChamber1 = &fMUON->Chamber(4);
d1cd2474 1193 Double_t zpos1 = - iChamber1->Z();
1194 iChamber1->GetGeometry()
1195 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1196
e118b27e 1197 AliMUONChamber* iChamber2 = &fMUON->Chamber(5);
d1cd2474 1198 Double_t zpos2 = - iChamber2->Z();
1199 iChamber2->GetGeometry()
1200 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1201
e118b27e 1202 iChamber1 = &fMUON->Chamber(6);
d1cd2474 1203 zpos1 = - iChamber1->Z();
1204 iChamber1->GetGeometry()
1205 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1206
e118b27e 1207 iChamber2 = &fMUON->Chamber(7);
d1cd2474 1208 zpos2 = - iChamber2->Z();
1209 iChamber2->GetGeometry()
1210 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1211
e118b27e 1212 iChamber1 = &fMUON->Chamber(8);
d1cd2474 1213 zpos1 = - iChamber1->Z();
1214 iChamber1->GetGeometry()
1215 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1216
e118b27e 1217 iChamber2 = &fMUON->Chamber(9);
d1cd2474 1218 zpos2 = - iChamber2->Z();
1219 iChamber2->GetGeometry()
1220 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1221
1222}
1223
1224//______________________________________________________________________________
1225void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1226{
1227// Defines the sensitive volumes for slat stations chambers.
1228// ---
1229
e118b27e 1230 GetGeometry(4)->SetSensitiveVolume("S05G");
1231 GetGeometry(5)->SetSensitiveVolume("S06G");
1232 GetGeometry(6)->SetSensitiveVolume("S07G");
1233 GetGeometry(7)->SetSensitiveVolume("S08G");
1234 GetGeometry(8)->SetSensitiveVolume("S09G");
1235 GetGeometry(9)->SetSensitiveVolume("S10G");
d1cd2474 1236}
1237
1238//______________________________________________________________________________
1239Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1240{
2057e0cc 1241// On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1242// and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
c10e6eaf 1243 numslat += 1;
1244 if (quadnum==2 || quadnum==3)
1245 numslat += fspq;
1246 else
1247 numslat = fspq + 2-numslat;
1248 numslat -= 1;
d1cd2474 1249
c10e6eaf 1250 if (quadnum==3 || quadnum==4) numslat += 2*fspq+1;
1251
1252 return numslat;
d1cd2474 1253}