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