]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - TRD/AliTRDgeometry.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.cxx
... / ...
CommitLineData
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
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// TRD geometry class //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24#include <TGeoManager.h>
25#include <TGeoPhysicalNode.h>
26#include <TVirtualMC.h>
27#include <TMath.h>
28
29#include "AliLog.h"
30#include "AliAlignObjParams.h"
31
32#include "AliTRDgeometry.h"
33#include "AliTRDpadPlane.h"
34
35ClassImp(AliTRDgeometry)
36
37//_____________________________________________________________________________
38
39 //
40 // The geometry constants
41 //
42 const Int_t AliTRDgeometry::fgkNsector = kNsector;
43 const Int_t AliTRDgeometry::fgkNlayer = kNlayer;
44 const Int_t AliTRDgeometry::fgkNstack = kNstack;
45 const Int_t AliTRDgeometry::fgkNdet = kNdet;
46
47 //
48 // Dimensions of the detector
49 //
50
51 // Total length of the TRD mother volume
52 const Float_t AliTRDgeometry::fgkTlength = 751.0;
53
54 // Parameter of the super module mother volumes
55 const Float_t AliTRDgeometry::fgkSheight = 77.9;
56 const Float_t AliTRDgeometry::fgkSwidth1 = 94.881;
57 const Float_t AliTRDgeometry::fgkSwidth2 = 122.353;
58 const Float_t AliTRDgeometry::fgkSlength = 702.0;
59
60 // Length of the additional space in front of the supermodule
61 // used for services
62 const Float_t AliTRDgeometry::fgkFlength = (AliTRDgeometry::fgkTlength
63 - AliTRDgeometry::fgkSlength) / 2.0;
64
65 // The super module side plates
66 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
67
68 // Vertical spacing of the chambers
69 const Float_t AliTRDgeometry::fgkVspace = 1.784;
70 // Horizontal spacing of the chambers
71 const Float_t AliTRDgeometry::fgkHspace = 2.0;
72 // Radial distance of the first ROC to the outer plates of the SM
73 const Float_t AliTRDgeometry::fgkVrocsm = 1.2;
74
75 // Height of different chamber parts
76 // Radiator
77 const Float_t AliTRDgeometry::fgkCraH = 4.8;
78 // Drift region
79 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
80 // Amplification region
81 const Float_t AliTRDgeometry::fgkCamH = 0.7;
82 // Readout
83 const Float_t AliTRDgeometry::fgkCroH = 2.316;
84 // Additional width of the readout chamber frames
85 const Float_t AliTRDgeometry::fgkCroW = 0.9;
86 // Services on top of ROC
87 const Float_t AliTRDgeometry::fgkCsvH = AliTRDgeometry::fgkVspace
88 - 0.742;
89 // Total height (w/o services)
90 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
91 + AliTRDgeometry::fgkCdrH
92 + AliTRDgeometry::fgkCamH
93 + AliTRDgeometry::fgkCroH;
94 // Total height (with services)
95
96 const Float_t AliTRDgeometry::fgkCHsv = AliTRDgeometry::fgkCH
97 + AliTRDgeometry::fgkCsvH;
98
99 // Distance of anode wire plane relative to middle of alignable volume
100 const Float_t AliTRDgeometry::fgkAnodePos = AliTRDgeometry::fgkCraH
101 + AliTRDgeometry::fgkCdrH
102 + AliTRDgeometry::fgkCamH/2.0
103 - AliTRDgeometry::fgkCHsv/2.0;
104
105 // Thicknesses of different parts of the chamber frame
106 // Lower aluminum frame
107 const Float_t AliTRDgeometry::fgkCalT = 0.4;
108 // Lower Wacosit frame sides
109 const Float_t AliTRDgeometry::fgkCclsT = 0.21;
110 // Lower Wacosit frame front
111 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
112 // Thickness of glue around radiator
113 const Float_t AliTRDgeometry::fgkCglT = 0.25;
114 // Upper Wacosit frame around amplification region
115 const Float_t AliTRDgeometry::fgkCcuTa = 1.0;
116 const Float_t AliTRDgeometry::fgkCcuTb = 0.8;
117 // Al frame of back panel
118 const Float_t AliTRDgeometry::fgkCauT = 1.5;
119 // Additional Al ledge at the lower chamber frame
120 // Actually the dimensions are not realistic, but
121 // modified in order to allow to mis-alignment.
122 // The amount of material is, however, correct
123 const Float_t AliTRDgeometry::fgkCalW = 2.5;
124 const Float_t AliTRDgeometry::fgkCalH = 0.4;
125 const Float_t AliTRDgeometry::fgkCalWmod = 0.4;
126 const Float_t AliTRDgeometry::fgkCalHmod = 2.5;
127 // Additional Wacosit ledge at the lower chamber frame
128 const Float_t AliTRDgeometry::fgkCwsW = 1.2;
129 const Float_t AliTRDgeometry::fgkCwsH = 0.3;
130
131 // Difference of outer chamber width and pad plane width
132 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
133 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
134
135 //
136 // Thickness of the the material layers
137 //
138 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
139 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
140 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
141 + AliTRDgeometry::fgkAmThick;
142 const Float_t AliTRDgeometry::fgkWrThick = 0.00011;
143
144 const Float_t AliTRDgeometry::fgkRMyThick = 0.0015;
145 const Float_t AliTRDgeometry::fgkRCbThick = 0.0055;
146 const Float_t AliTRDgeometry::fgkRGlThick = 0.0065;
147 const Float_t AliTRDgeometry::fgkRRhThick = 0.8;
148 const Float_t AliTRDgeometry::fgkRFbThick = fgkCraH - 2.0 * (fgkRMyThick
149 + fgkRCbThick
150 + fgkRRhThick);
151
152 const Float_t AliTRDgeometry::fgkPPdThick = 0.0025;
153 const Float_t AliTRDgeometry::fgkPPpThick = 0.0356;
154 const Float_t AliTRDgeometry::fgkPGlThick = 0.1428;
155 const Float_t AliTRDgeometry::fgkPCbThick = 0.019;
156 const Float_t AliTRDgeometry::fgkPPcThick = 0.0486;
157 const Float_t AliTRDgeometry::fgkPRbThick = 0.0057;
158 const Float_t AliTRDgeometry::fgkPElThick = 0.0029;
159 const Float_t AliTRDgeometry::fgkPHcThick = fgkCroH - fgkPPdThick
160 - fgkPPpThick
161 - fgkPGlThick
162 - fgkPCbThick * 2.0
163 - fgkPPcThick
164 - fgkPRbThick
165 - fgkPElThick;
166
167 //
168 // Position of the material layers
169 //
170 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
171 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
172 const Float_t AliTRDgeometry::fgkWrZposA = 0.0;
173 const Float_t AliTRDgeometry::fgkWrZposB = -fgkAmThick/2.0 + 0.001;
174 const Float_t AliTRDgeometry::fgkCalZpos = 0.3;
175
176 const Int_t AliTRDgeometry::fgkMCMmax = 16;
177 const Int_t AliTRDgeometry::fgkMCMrow = 4;
178 const Int_t AliTRDgeometry::fgkROBmaxC0 = 6;
179 const Int_t AliTRDgeometry::fgkROBmaxC1 = 8;
180 const Int_t AliTRDgeometry::fgkADCmax = 21;
181 const Int_t AliTRDgeometry::fgkTBmax = 60;
182 const Int_t AliTRDgeometry::fgkPadmax = 18;
183 const Int_t AliTRDgeometry::fgkColmax = 144;
184 const Int_t AliTRDgeometry::fgkRowmaxC0 = 12;
185 const Int_t AliTRDgeometry::fgkRowmaxC1 = 16;
186
187 const Double_t AliTRDgeometry::fgkTime0Base = 300.65;
188const Float_t AliTRDgeometry::fgkTime0[6] = { static_cast<Float_t>(fgkTime0Base + 0 * (Cheight() + Cspace()))
189 , static_cast<Float_t>(fgkTime0Base + 1 * (Cheight() + Cspace()))
190 , static_cast<Float_t>(fgkTime0Base + 2 * (Cheight() + Cspace()))
191 , static_cast<Float_t>(fgkTime0Base + 3 * (Cheight() + Cspace()))
192 , static_cast<Float_t>(fgkTime0Base + 4 * (Cheight() + Cspace()))
193 , static_cast<Float_t>(fgkTime0Base + 5 * (Cheight() + Cspace()))};
194
195 const Double_t AliTRDgeometry::fgkXtrdBeg = 288.43; // Values depend on position of TRD
196 const Double_t AliTRDgeometry::fgkXtrdEnd = 366.33; // mother volume inside space frame !!!
197
198 // The outer width of the chambers
199 const Float_t AliTRDgeometry::fgkCwidth[kNlayer] = { 90.4, 94.8, 99.3, 103.7, 108.1, 112.6 };
200
201 // The outer lengths of the chambers
202 // Includes the spacings between the chambers!
203 const Float_t AliTRDgeometry::fgkClength[kNlayer][kNstack] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
204 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
205 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
206 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
207 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
208 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
209
210 Char_t AliTRDgeometry::fgSMstatus[kNsector] = { 1, 1, 1, 1, 1, 1, 1, 1, 1
211 , 1, 1, 1, 1, 1, 1, 1, 1, 1 };
212
213 TObjArray* AliTRDgeometry::fgClusterMatrixArray = NULL;
214
215 TObjArray* AliTRDgeometry::fgPadPlaneArray = NULL;
216
217//_____________________________________________________________________________
218AliTRDgeometry::AliTRDgeometry()
219{
220 //
221 // AliTRDgeometry default constructor
222 //
223
224}
225
226//_____________________________________________________________________________
227AliTRDgeometry::~AliTRDgeometry()
228{
229 //
230 // AliTRDgeometry destructor
231 //
232
233}
234
235//_____________________________________________________________________________
236void AliTRDgeometry::CreatePadPlaneArray()
237{
238 //
239 // Creates the array of AliTRDpadPlane objects
240 //
241
242 if (fgPadPlaneArray)
243 return;
244
245 static TObjArray padPlaneArray(fgkNlayer * fgkNstack);
246 padPlaneArray.SetOwner(kTRUE);
247
248 fgPadPlaneArray = &padPlaneArray;
249 for (Int_t ilayer = 0; ilayer < fgkNlayer; ilayer++) {
250 for (Int_t istack = 0; istack < fgkNstack; istack++) {
251 Int_t ipp = GetDetectorSec(ilayer,istack);
252 fgPadPlaneArray->AddAt(CreatePadPlane(ilayer,istack),ipp);
253 }
254 }
255
256}
257
258//_____________________________________________________________________________
259AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t ilayer, Int_t istack)
260{
261 //
262 // Creates an AliTRDpadPlane object
263 //
264
265 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
266
267 padPlane->SetLayer(ilayer);
268 padPlane->SetStack(istack);
269
270 padPlane->SetRowSpacing(0.0);
271 padPlane->SetColSpacing(0.0);
272
273 padPlane->SetLengthRim(1.0);
274 padPlane->SetWidthRim(0.5);
275
276 padPlane->SetNcols(144);
277
278 padPlane->SetAnodeWireOffset(0.25);
279
280 //
281 // The pad plane parameter
282 //
283 const Float_t kTiltAngle = 2.0;
284 switch (ilayer) {
285 case 0:
286 if (istack == 2) {
287 // L0C0 type
288 padPlane->SetNrows(12);
289 padPlane->SetLength(108.0);
290 padPlane->SetLengthOPad(8.0);
291 padPlane->SetLengthIPad(9.0);
292 }
293 else {
294 // L0C1 type
295 padPlane->SetNrows(16);
296 padPlane->SetLength(122.0);
297 padPlane->SetLengthOPad(7.5);
298 padPlane->SetLengthIPad(7.5);
299 }
300 padPlane->SetWidth(92.2);
301 padPlane->SetWidthOPad(0.515);
302 padPlane->SetWidthIPad(0.635);
303 padPlane->SetTiltingAngle(-kTiltAngle);
304 break;
305 case 1:
306 if (istack == 2) {
307 // L1C0 type
308 padPlane->SetNrows(12);
309 padPlane->SetLength(108.0);
310 padPlane->SetLengthOPad(8.0);
311 padPlane->SetLengthIPad(9.0);
312 }
313 else {
314 // L1C1 type
315 padPlane->SetNrows(16);
316 padPlane->SetLength(122.0);
317 padPlane->SetLengthOPad(7.5);
318 padPlane->SetLengthIPad(7.5);
319 }
320 padPlane->SetWidth(96.6);
321 padPlane->SetWidthOPad(0.585);
322 padPlane->SetWidthIPad(0.665);
323 padPlane->SetTiltingAngle(kTiltAngle);
324 break;
325 case 2:
326 if (istack == 2) {
327 // L2C0 type
328 padPlane->SetNrows(12);
329 padPlane->SetLength(108.0);
330 padPlane->SetLengthOPad(8.0);
331 padPlane->SetLengthIPad(9.0);
332 }
333 else {
334 // L2C1 type
335 padPlane->SetNrows(16);
336 padPlane->SetLength(129.0);
337 padPlane->SetLengthOPad(7.5);
338 padPlane->SetLengthIPad(8.0);
339 }
340 padPlane->SetWidth(101.1);
341 padPlane->SetWidthOPad(0.705);
342 padPlane->SetWidthIPad(0.695);
343 padPlane->SetTiltingAngle(-kTiltAngle);
344 break;
345 case 3:
346 if (istack == 2) {
347 // L3C0 type
348 padPlane->SetNrows(12);
349 padPlane->SetLength(108.0);
350 padPlane->SetLengthOPad(8.0);
351 padPlane->SetLengthIPad(9.0);
352 }
353 else {
354 // L3C1 type
355 padPlane->SetNrows(16);
356 padPlane->SetLength(136.0);
357 padPlane->SetLengthOPad(7.5);
358 padPlane->SetLengthIPad(8.5);
359 }
360 padPlane->SetWidth(105.5);
361 padPlane->SetWidthOPad(0.775);
362 padPlane->SetWidthIPad(0.725);
363 padPlane->SetTiltingAngle(kTiltAngle);
364 break;
365 case 4:
366 if (istack == 2) {
367 // L4C0 type
368 padPlane->SetNrows(12);
369 padPlane->SetLength(108.0);
370 padPlane->SetLengthOPad(8.0);
371 }
372 else {
373 // L4C1 type
374 padPlane->SetNrows(16);
375 padPlane->SetLength(143.0);
376 padPlane->SetLengthOPad(7.5);
377 }
378 padPlane->SetWidth(109.9);
379 padPlane->SetWidthOPad(0.845);
380 padPlane->SetLengthIPad(9.0);
381 padPlane->SetWidthIPad(0.755);
382 padPlane->SetTiltingAngle(-kTiltAngle);
383 break;
384 case 5:
385 if (istack == 2) {
386 // L5C0 type
387 padPlane->SetNrows(12);
388 padPlane->SetLength(108.0);
389 padPlane->SetLengthOPad(8.0);
390 }
391 else {
392 // L5C1 type
393 padPlane->SetNrows(16);
394 padPlane->SetLength(145.0);
395 padPlane->SetLengthOPad(8.5);
396 }
397 padPlane->SetWidth(114.4);
398 padPlane->SetWidthOPad(0.965);
399 padPlane->SetLengthIPad(9.0);
400 padPlane->SetWidthIPad(0.785);
401 padPlane->SetTiltingAngle(kTiltAngle);
402 break;
403 };
404
405 //
406 // The positions of the borders of the pads
407 //
408 // Row direction
409 //
410 Double_t row = fgkClength[ilayer][istack] / 2.0
411 - fgkRpadW
412 - padPlane->GetLengthRim();
413 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
414 padPlane->SetPadRow(ir,row);
415 row -= padPlane->GetRowSpacing();
416 if (ir == 0) {
417 row -= padPlane->GetLengthOPad();
418 }
419 else {
420 row -= padPlane->GetLengthIPad();
421 }
422 }
423 //
424 // Column direction
425 //
426 Double_t col = - fgkCwidth[ilayer] / 2.0
427 - fgkCroW
428 + padPlane->GetWidthRim();
429 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
430 padPlane->SetPadCol(ic,col);
431 col += padPlane->GetColSpacing();
432 if (ic == 0) {
433 col += padPlane->GetWidthOPad();
434 }
435 else {
436 col += padPlane->GetWidthIPad();
437 }
438 }
439 // Calculate the offset to translate from the local ROC system into
440 // the local supermodule system, which is used for clusters
441 Double_t rowTmp = fgkClength[ilayer][0]
442 + fgkClength[ilayer][1]
443 + fgkClength[ilayer][2] / 2.0;
444 for (Int_t jstack = 0; jstack < istack; jstack++) {
445 rowTmp -= fgkClength[ilayer][jstack];
446 }
447 padPlane->SetPadRowSMOffset(rowTmp - fgkClength[ilayer][istack]/2.0);
448
449 return padPlane;
450
451}
452
453//_____________________________________________________________________________
454void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
455{
456 //
457 // Create the TRD geometry
458 //
459 //
460 // Names of the TRD volumina (xx = detector number):
461 //
462 // Volume (Air) wrapping the readout chamber components
463 // UTxx includes: UAxx, UDxx, UFxx, UUxx
464 //
465 // Lower part of the readout chambers (drift volume + radiator)
466 // UAxx Aluminum frames (Al)
467 //
468 // Upper part of the readout chambers (readout plane + fee)
469 // UDxx Wacosit frames of amp. region (Wacosit)
470 // UFxx Aluminum frame of back panel (Al)
471 //
472 // Services on chambers (cooling, cables, MCMs, DCS boards, ...)
473 // UUxx Volume containing the services (Air)
474 //
475 // Material layers inside sensitive area:
476 // Name Description Mat. Thick. Dens. Radl. X/X_0
477 //
478 // URMYxx Mylar layers (x2) Mylar 0.0015 1.39 28.5464 0.005%
479 // URCBxx Carbon layer (x2) Carbon 0.0055 1.75 24.2824 0.023%
480 // URGLxx Glue on the carbon layers (x2) Araldite 0.0065 1.12 37.0664 0.018%
481 // URRHxx Rohacell layer (x2) Rohacell 0.8 0.075 536.005 0.149%
482 // URFBxx Fiber mat layer PP 3.186 0.068 649.727 0.490%
483 //
484 // UJxx Drift region Xe/CO2 3.0 0.00495 1792.37 0.167%
485 // UKxx Amplification region Xe/CO2 0.7 0.00495 1792.37 0.039%
486 // UWxx Wire planes (x2) Copper 0.00011 8.96 1.43503 0.008%
487 //
488 // UPPDxx Copper of pad plane Copper 0.0025 8.96 1.43503 0.174%
489 // UPPPxx PCB of pad plane G10 0.0356 2.0 14.9013 0.239%
490 // UPGLxx Glue on pad planes Araldite 0.0923 1.12 37.0664 0.249%
491 // + add. glue (ca. 600g) Araldite 0.0505 1.12 37.0663 0.107%
492 // UPCBxx Carbon fiber mats (x2) Carbon 0.019 1.75 24.2824 0.078%
493 // UPHCxx Honeycomb structure Aramide 2.0299 0.032 1198.84 0.169%
494 // UPPCxx PCB of readout board G10 0.0486 2.0 14.9013 0.326%
495 // UPRDxx Copper of readout board Copper 0.0057 8.96 1.43503 0.404%
496 // UPELxx Electronics + cables Copper 0.0029 8.96 1.43503 0.202%
497 //
498
499 const Int_t kNparTrd = 4;
500 const Int_t kNparCha = 3;
501
502 Float_t xpos;
503 Float_t ypos;
504 Float_t zpos;
505
506 Float_t parTrd[kNparTrd];
507 Float_t parCha[kNparCha];
508
509 const Int_t kTag = 100;
510 Char_t cTagV[kTag];
511 Char_t cTagM[kTag];
512
513 // There are three TRD volumes for the supermodules in order to accomodate
514 // the different arrangements in front of PHOS
515 // UTR1: Default supermodule
516 // UTR2: Supermodule in front of PHOS with double carbon cover
517 // UTR3: As UTR2, but w/o middle stack
518 //
519 // The mother volume for one sector (Air), full length in z-direction
520 // Provides material for side plates of super module
521 parTrd[0] = fgkSwidth1/2.0;
522 parTrd[1] = fgkSwidth2/2.0;
523 parTrd[2] = fgkSlength/2.0;
524 parTrd[3] = fgkSheight/2.0;
525 TVirtualMC::GetMC()->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
526 TVirtualMC::GetMC()->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
527 TVirtualMC::GetMC()->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
528 // The outer aluminum plates of the super module (Al)
529 parTrd[0] = fgkSwidth1/2.0;
530 parTrd[1] = fgkSwidth2/2.0;
531 parTrd[2] = fgkSlength/2.0;
532 parTrd[3] = fgkSheight/2.0;
533 TVirtualMC::GetMC()->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
534 TVirtualMC::GetMC()->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
535 TVirtualMC::GetMC()->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
536 // The inner part of the TRD mother volume for one sector (Air),
537 // full length in z-direction
538 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
539 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
540 parTrd[2] = fgkSlength/2.0;
541 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
542 TVirtualMC::GetMC()->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
543 TVirtualMC::GetMC()->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
544 TVirtualMC::GetMC()->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
545
546 // The inner part of the TRD mother volume for services in front
547 // of the supermodules (Air),
548 parTrd[0] = fgkSwidth1/2.0;
549 parTrd[1] = fgkSwidth2/2.0;
550 parTrd[2] = fgkFlength/2.0;
551 parTrd[3] = fgkSheight/2.0;
552 TVirtualMC::GetMC()->Gsvolu("UTF1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
553 TVirtualMC::GetMC()->Gsvolu("UTF2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
554
555 for (Int_t istack = 0; istack < kNstack; istack++) {
556 for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) {
557
558 Int_t iDet = GetDetectorSec(ilayer,istack);
559
560 // The lower part of the readout chambers (drift volume + radiator)
561 // The aluminum frames
562 snprintf(cTagV,kTag,"UA%02d",iDet);
563 parCha[0] = fgkCwidth[ilayer]/2.0;
564 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
565 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
566 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
567 // The additional aluminum on the frames
568 // This part has not the correct shape but is just supposed to
569 // represent the missing material. The correct form of the L-shaped
570 // profile would not fit into the alignable volume.
571 snprintf(cTagV,kTag,"UZ%02d",iDet);
572 parCha[0] = fgkCalWmod/2.0;
573 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
574 parCha[2] = fgkCalHmod/2.0;
575 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
576 // The additional Wacosit on the frames
577 snprintf(cTagV,kTag,"UP%02d",iDet);
578 parCha[0] = fgkCwsW/2.0;
579 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
580 parCha[2] = fgkCwsH/2.0;
581 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
582 // The Wacosit frames
583 snprintf(cTagV,kTag,"UB%02d",iDet);
584 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT;
585 parCha[1] = -1.0;
586 parCha[2] = -1.0;
587 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
588 // The glue around the radiator
589 snprintf(cTagV,kTag,"UX%02d",iDet);
590 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT;
591 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT;
592 parCha[2] = fgkCraH/2.0;
593 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
594 // The inner part of radiator (air)
595 snprintf(cTagV,kTag,"UC%02d",iDet);
596 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
597 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
598 parCha[2] = -1.0;
599 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
600
601 // The upper part of the readout chambers (amplification volume)
602 // The Wacosit frames
603 snprintf(cTagV,kTag,"UD%02d",iDet);
604 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW;
605 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
606 parCha[2] = fgkCamH/2.0;
607 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
608 // The inner part of the Wacosit frame (air)
609 snprintf(cTagV,kTag,"UE%02d",iDet);
610 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW - fgkCcuTb;
611 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCcuTa;
612 parCha[2] = -1.;
613 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
614
615 // The back panel, including pad plane and readout boards
616 // The aluminum frames
617 snprintf(cTagV,kTag,"UF%02d",iDet);
618 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW;
619 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
620 parCha[2] = fgkCroH/2.0;
621 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
622 // The inner part of the aluminum frames
623 snprintf(cTagV,kTag,"UG%02d",iDet);
624 parCha[0] = fgkCwidth[ilayer]/2.0 + fgkCroW - fgkCauT;
625 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCauT;
626 parCha[2] = -1.0;
627 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
628
629 //
630 // The material layers inside the chambers
631 //
632
633 // Mylar layer (radiator)
634 parCha[0] = -1.0;
635 parCha[1] = -1.0;
636 parCha[2] = fgkRMyThick/2.0;
637 snprintf(cTagV,kTag,"URMY%02d",iDet);
638 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1327-1],parCha,kNparCha);
639 // Carbon layer (radiator)
640 parCha[0] = -1.0;
641 parCha[1] = -1.0;
642 parCha[2] = fgkRCbThick/2.0;
643 snprintf(cTagV,kTag,"URCB%02d",iDet);
644 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1326-1],parCha,kNparCha);
645 // Araldite layer (radiator)
646 parCha[0] = -1.0;
647 parCha[1] = -1.0;
648 parCha[2] = fgkRGlThick/2.0;
649 snprintf(cTagV,kTag,"URGL%02d",iDet);
650 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
651 // Rohacell layer (radiator)
652 parCha[0] = -1.0;
653 parCha[1] = -1.0;
654 parCha[2] = fgkRRhThick/2.0;
655 snprintf(cTagV,kTag,"URRH%02d",iDet);
656 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
657 // Fiber layer (radiator)
658 parCha[0] = -1.0;
659 parCha[1] = -1.0;
660 parCha[2] = fgkRFbThick/2.0;
661 snprintf(cTagV,kTag,"URFB%02d",iDet);
662 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1328-1],parCha,kNparCha);
663
664 // Xe/Isobutane layer (drift volume)
665 parCha[0] = fgkCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT;
666 parCha[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT;
667 parCha[2] = fgkDrThick/2.0;
668 snprintf(cTagV,kTag,"UJ%02d",iDet);
669 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
670
671 // Xe/Isobutane layer (amplification volume)
672 parCha[0] = -1.0;
673 parCha[1] = -1.0;
674 parCha[2] = fgkAmThick/2.0;
675 snprintf(cTagV,kTag,"UK%02d",iDet);
676 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
677 // Cu layer (wire plane)
678 parCha[0] = -1.0;
679 parCha[1] = -1.0;
680 parCha[2] = fgkWrThick/2.0;
681 snprintf(cTagV,kTag,"UW%02d",iDet);
682 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
683
684 // Cu layer (pad plane)
685 parCha[0] = -1.0;
686 parCha[1] = -1.0;
687 parCha[2] = fgkPPdThick/2.0;
688 snprintf(cTagV,kTag,"UPPD%02d",iDet);
689 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
690 // G10 layer (pad plane)
691 parCha[0] = -1.0;
692 parCha[1] = -1.0;
693 parCha[2] = fgkPPpThick/2.0;
694 snprintf(cTagV,kTag,"UPPP%02d",iDet);
695 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
696 // Araldite layer (glue)
697 parCha[0] = -1.0;
698 parCha[1] = -1.0;
699 parCha[2] = fgkPGlThick/2.0;
700 snprintf(cTagV,kTag,"UPGL%02d",iDet);
701 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
702 // Carbon layer (carbon fiber mats)
703 parCha[0] = -1.0;
704 parCha[1] = -1.0;
705 parCha[2] = fgkPCbThick/2.0;
706 snprintf(cTagV,kTag,"UPCB%02d",iDet);
707 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1326-1],parCha,kNparCha);
708 // Aramide layer (honeycomb)
709 parCha[0] = -1.0;
710 parCha[1] = -1.0;
711 parCha[2] = fgkPHcThick/2.0;
712 snprintf(cTagV,kTag,"UPHC%02d",iDet);
713 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
714 // G10 layer (PCB readout board)
715 parCha[0] = -1.0;
716 parCha[1] = -1.0;
717 parCha[2] = fgkPPcThick/2;
718 snprintf(cTagV,kTag,"UPPC%02d",iDet);
719 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
720 // Cu layer (traces in readout board)
721 parCha[0] = -1.0;
722 parCha[1] = -1.0;
723 parCha[2] = fgkPRbThick/2.0;
724 snprintf(cTagV,kTag,"UPRB%02d",iDet);
725 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
726 // Cu layer (other material on in readout board, incl. screws)
727 parCha[0] = -1.0;
728 parCha[1] = -1.0;
729 parCha[2] = fgkPElThick/2.0;
730 snprintf(cTagV,kTag,"UPEL%02d",iDet);
731 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
732
733 //
734 // Position the layers in the chambers
735 //
736 xpos = 0.0;
737 ypos = 0.0;
738
739 // Lower part
740 // Mylar layers (radiator)
741 zpos = fgkRMyThick/2.0 - fgkCraH/2.0;
742 snprintf(cTagV,kTag,"URMY%02d",iDet);
743 snprintf(cTagM,kTag,"UC%02d",iDet);
744 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
745 zpos = -fgkRMyThick/2.0 + fgkCraH/2.0;
746 snprintf(cTagV,kTag,"URMY%02d",iDet);
747 snprintf(cTagM,kTag,"UC%02d",iDet);
748 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
749 // Carbon layers (radiator)
750 zpos = fgkRCbThick/2.0 + fgkRMyThick - fgkCraH/2.0;
751 snprintf(cTagV,kTag,"URCB%02d",iDet);
752 snprintf(cTagM,kTag,"UC%02d",iDet);
753 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
754 zpos = -fgkRCbThick/2.0 - fgkRMyThick + fgkCraH/2.0;
755 snprintf(cTagV,kTag,"URCB%02d",iDet);
756 snprintf(cTagM,kTag,"UC%02d",iDet);
757 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
758 // Carbon layers (radiator)
759 zpos = fgkRGlThick/2.0 + fgkRCbThick + fgkRMyThick - fgkCraH/2.0;
760 snprintf(cTagV,kTag,"URGL%02d",iDet);
761 snprintf(cTagM,kTag,"UC%02d",iDet);
762 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
763 zpos = -fgkRGlThick/2.0 - fgkRCbThick - fgkRMyThick + fgkCraH/2.0;
764 snprintf(cTagV,kTag,"URGL%02d",iDet);
765 snprintf(cTagM,kTag,"UC%02d",iDet);
766 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
767 // Rohacell layers (radiator)
768 zpos = fgkRRhThick/2.0 + fgkRGlThick + fgkRCbThick + fgkRMyThick - fgkCraH/2.0;
769 snprintf(cTagV,kTag,"URRH%02d",iDet);
770 snprintf(cTagM,kTag,"UC%02d",iDet);
771 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
772 zpos = -fgkRRhThick/2.0 - fgkRGlThick - fgkRCbThick - fgkRMyThick + fgkCraH/2.0;
773 snprintf(cTagV,kTag,"URRH%02d",iDet);
774 snprintf(cTagM,kTag,"UC%02d",iDet);
775 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
776 // Fiber layers (radiator)
777 zpos = 0.0;
778 snprintf(cTagV,kTag,"URFB%02d",iDet);
779 snprintf(cTagM,kTag,"UC%02d",iDet);
780 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
781
782 // Xe/Isobutane layer (drift volume)
783 zpos = fgkDrZpos;
784 snprintf(cTagV,kTag,"UJ%02d",iDet);
785 snprintf(cTagM,kTag,"UB%02d",iDet);
786 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
787
788 // Upper part
789 // Xe/Isobutane layer (amplification volume)
790 zpos = fgkAmZpos;
791 snprintf(cTagV,kTag,"UK%02d",iDet);
792 snprintf(cTagM,kTag,"UE%02d",iDet);
793 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
794 // Cu layer (wire planes inside amplification volume)
795 zpos = fgkWrZposA;
796 snprintf(cTagV,kTag,"UW%02d",iDet);
797 snprintf(cTagM,kTag,"UK%02d",iDet);
798 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
799 zpos = fgkWrZposB;
800 snprintf(cTagV,kTag,"UW%02d",iDet);
801 snprintf(cTagM,kTag,"UK%02d",iDet);
802 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
803
804 // Back panel + pad plane + readout part
805 // Cu layer (pad plane)
806 zpos = fgkPPdThick/2.0 - fgkCroH/2.0;
807 snprintf(cTagV,kTag,"UPPD%02d",iDet);
808 snprintf(cTagM,kTag,"UG%02d",iDet);
809 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
810 // G10 layer (pad plane)
811 zpos = fgkPPpThick/2.0 + fgkPPdThick - fgkCroH/2.0;
812 snprintf(cTagV,kTag,"UPPP%02d",iDet);
813 snprintf(cTagM,kTag,"UG%02d",iDet);
814 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
815 // Araldite layer (glue)
816 zpos = fgkPGlThick/2.0 + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
817 snprintf(cTagV,kTag,"UPGL%02d",iDet);
818 snprintf(cTagM,kTag,"UG%02d",iDet);
819 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
820 // Carbon layers (carbon fiber mats)
821 zpos = fgkPCbThick/2.0 + fgkPGlThick + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
822 snprintf(cTagV,kTag,"UPCB%02d",iDet);
823 snprintf(cTagM,kTag,"UG%02d",iDet);
824 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
825 zpos = -fgkPCbThick/2.0 - fgkPPcThick - fgkPRbThick - fgkPElThick + fgkCroH/2.0;
826 snprintf(cTagV,kTag,"UPCB%02d",iDet);
827 snprintf(cTagM,kTag,"UG%02d",iDet);
828 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
829 // Aramide layer (honeycomb)
830 zpos = fgkPHcThick/2.0 + fgkPCbThick + fgkPGlThick + fgkPPpThick + fgkPPdThick - fgkCroH/2.0;
831 snprintf(cTagV,kTag,"UPHC%02d",iDet);
832 snprintf(cTagM,kTag,"UG%02d",iDet);
833 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
834 // G10 layer (PCB readout board)
835 zpos = -fgkPPcThick/2.0 - fgkPRbThick - fgkPElThick + fgkCroH/2.0;
836 snprintf(cTagV,kTag,"UPPC%02d",iDet);
837 snprintf(cTagM,kTag,"UG%02d",iDet);
838 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
839 // Cu layer (traces in readout board)
840 zpos = -fgkPRbThick/2.0 - fgkPElThick + fgkCroH/2.0;
841 snprintf(cTagV,kTag,"UPRB%02d",iDet);
842 snprintf(cTagM,kTag,"UG%02d",iDet);
843 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
844 // Cu layer (other materials on readout board, incl. screws)
845 zpos = -fgkPElThick/2.0 + fgkCroH/2.0;
846 snprintf(cTagV,kTag,"UPEL%02d",iDet);
847 snprintf(cTagM,kTag,"UG%02d",iDet);
848 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
849
850 // Position the inner volumes of the chambers in the frames
851 xpos = 0.0;
852 ypos = 0.0;
853
854 // The inner part of the radiator (air)
855 zpos = 0.0;
856 snprintf(cTagV,kTag,"UC%02d",iDet);
857 snprintf(cTagM,kTag,"UX%02d",iDet);
858 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
859 // The glue around the radiator
860 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
861 snprintf(cTagV,kTag,"UX%02d",iDet);
862 snprintf(cTagM,kTag,"UB%02d",iDet);
863 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
864 // The lower Wacosit frame inside the aluminum frame
865 zpos = 0.0;
866 snprintf(cTagV,kTag,"UB%02d",iDet);
867 snprintf(cTagM,kTag,"UA%02d",iDet);
868 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
869
870 // The inside of the upper Wacosit frame
871 zpos = 0.0;
872 snprintf(cTagV,kTag,"UE%02d",iDet);
873 snprintf(cTagM,kTag,"UD%02d",iDet);
874 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
875
876 // The inside of the upper aluminum frame
877 zpos = 0.0;
878 snprintf(cTagV,kTag,"UG%02d",iDet);
879 snprintf(cTagM,kTag,"UF%02d",iDet);
880 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
881
882 }
883 }
884
885 // Create the volumes of the super module frame
886 CreateFrame(idtmed);
887
888 // Create the volumes of the services
889 CreateServices(idtmed);
890
891 for (Int_t istack = 0; istack < kNstack; istack++) {
892 for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) {
893 AssembleChamber(ilayer,istack);
894 }
895 }
896
897 xpos = 0.0;
898 ypos = 0.0;
899 zpos = 0.0;
900 TVirtualMC::GetMC()->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
901 TVirtualMC::GetMC()->Gspos("UTI2",1,"UTS2",xpos,ypos,zpos,0,"ONLY");
902 TVirtualMC::GetMC()->Gspos("UTI3",1,"UTS3",xpos,ypos,zpos,0,"ONLY");
903
904 xpos = 0.0;
905 ypos = 0.0;
906 zpos = 0.0;
907 TVirtualMC::GetMC()->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
908 TVirtualMC::GetMC()->Gspos("UTS2",1,"UTR2",xpos,ypos,zpos,0,"ONLY");
909 TVirtualMC::GetMC()->Gspos("UTS3",1,"UTR3",xpos,ypos,zpos,0,"ONLY");
910
911 // Put the TRD volumes into the space frame mother volumes
912 // if enabled via status flag
913 xpos = 0.0;
914 ypos = 0.0;
915 zpos = 0.0;
916 for (Int_t isector = 0; isector < kNsector; isector++) {
917 if (GetSMstatus(isector)) {
918 snprintf(cTagV,kTag,"BTRD%d",isector);
919 switch (isector) {
920 case 13:
921 case 14:
922 case 15:
923 // Double carbon, w/o middle stack
924 TVirtualMC::GetMC()->Gspos("UTR3",1,cTagV,xpos,ypos,zpos,0,"ONLY");
925 break;
926 case 11:
927 case 12:
928 // Double carbon, all stacks
929 TVirtualMC::GetMC()->Gspos("UTR2",1,cTagV,xpos,ypos,zpos,0,"ONLY");
930 break;
931 default:
932 // Standard supermodule
933 TVirtualMC::GetMC()->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
934 };
935 }
936 }
937
938 // Put the TRD volumes into the space frame mother volumes
939 // if enabled via status flag
940 xpos = 0.0;
941 ypos = 0.5*fgkSlength + 0.5*fgkFlength;
942 zpos = 0.0;
943 for (Int_t isector = 0; isector < kNsector; isector++) {
944 if (GetSMstatus(isector)) {
945 snprintf(cTagV,kTag,"BTRD%d",isector);
946 TVirtualMC::GetMC()->Gspos("UTF1",1,cTagV,xpos, ypos,zpos,0,"ONLY");
947 TVirtualMC::GetMC()->Gspos("UTF2",1,cTagV,xpos,-ypos,zpos,0,"ONLY");
948 }
949 }
950
951}
952
953//_____________________________________________________________________________
954void AliTRDgeometry::CreateFrame(Int_t *idtmed)
955{
956 //
957 // Create the geometry of the frame of the supermodule
958 //
959 // Names of the TRD services volumina
960 //
961 // USRL Support rails for the chambers (Al)
962 // USxx Support cross bars between the chambers (Al)
963 // USHx Horizontal connection between the cross bars (Al)
964 // USLx Long corner ledges (Al)
965 //
966
967 Int_t ilayer = 0;
968
969 Float_t xpos = 0.0;
970 Float_t ypos = 0.0;
971 Float_t zpos = 0.0;
972
973 const Int_t kTag = 100;
974 Char_t cTagV[kTag];
975 Char_t cTagM[kTag];
976
977 const Int_t kNparTRD = 4;
978 Float_t parTRD[kNparTRD];
979 const Int_t kNparBOX = 3;
980 Float_t parBOX[kNparBOX];
981 const Int_t kNparTRP = 11;
982 Float_t parTRP[kNparTRP];
983
984 // The rotation matrices
985 const Int_t kNmatrix = 7;
986 Int_t matrix[kNmatrix];
987 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
988 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
989 TVirtualMC::GetMC()->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
990 TVirtualMC::GetMC()->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
991 TVirtualMC::GetMC()->Matrix(matrix[4], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
992 TVirtualMC::GetMC()->Matrix(matrix[5], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
993 TVirtualMC::GetMC()->Matrix(matrix[6], 180.0, 180.0, 90.0, 180.0, 90.0, 90.0);
994
995 //
996 // The carbon inserts in the top/bottom aluminum plates
997 //
998
999 const Int_t kNparCrb = 3;
1000 Float_t parCrb[kNparCrb];
1001 parCrb[0] = 0.0;
1002 parCrb[1] = 0.0;
1003 parCrb[2] = 0.0;
1004 TVirtualMC::GetMC()->Gsvolu("USCR","BOX ",idtmed[1326-1],parCrb,0);
1005 // Bottom 1 (all sectors)
1006 parCrb[0] = 77.49/2.0;
1007 parCrb[1] = 104.60/2.0;
1008 parCrb[2] = fgkSMpltT/2.0;
1009 xpos = 0.0;
1010 ypos = 0.0;
1011 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1012 TVirtualMC::GetMC()->Gsposp("USCR", 1,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1013 TVirtualMC::GetMC()->Gsposp("USCR", 2,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1014 TVirtualMC::GetMC()->Gsposp("USCR", 3,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1015 // Bottom 2 (all sectors)
1016 parCrb[0] = 77.49/2.0;
1017 parCrb[1] = 55.80/2.0;
1018 parCrb[2] = fgkSMpltT/2.0;
1019 xpos = 0.0;
1020 ypos = 85.6;
1021 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1022 TVirtualMC::GetMC()->Gsposp("USCR", 4,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1023 TVirtualMC::GetMC()->Gsposp("USCR", 5,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1024 TVirtualMC::GetMC()->Gsposp("USCR", 6,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1025 TVirtualMC::GetMC()->Gsposp("USCR", 7,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1026 TVirtualMC::GetMC()->Gsposp("USCR", 8,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1027 TVirtualMC::GetMC()->Gsposp("USCR", 9,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1028 // Bottom 3 (all sectors)
1029 parCrb[0] = 77.49/2.0;
1030 parCrb[1] = 56.00/2.0;
1031 parCrb[2] = fgkSMpltT/2.0;
1032 xpos = 0.0;
1033 ypos = 148.5;
1034 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1035 TVirtualMC::GetMC()->Gsposp("USCR",10,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1036 TVirtualMC::GetMC()->Gsposp("USCR",11,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1037 TVirtualMC::GetMC()->Gsposp("USCR",12,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1038 TVirtualMC::GetMC()->Gsposp("USCR",13,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1039 TVirtualMC::GetMC()->Gsposp("USCR",14,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1040 TVirtualMC::GetMC()->Gsposp("USCR",15,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1041 // Bottom 4 (all sectors)
1042 parCrb[0] = 77.49/2.0;
1043 parCrb[1] = 118.00/2.0;
1044 parCrb[2] = fgkSMpltT/2.0;
1045 xpos = 0.0;
1046 ypos = 240.5;
1047 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1048 TVirtualMC::GetMC()->Gsposp("USCR",16,"UTS1", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1049 TVirtualMC::GetMC()->Gsposp("USCR",17,"UTS2", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1050 TVirtualMC::GetMC()->Gsposp("USCR",18,"UTS3", xpos, ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1051 TVirtualMC::GetMC()->Gsposp("USCR",19,"UTS1", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1052 TVirtualMC::GetMC()->Gsposp("USCR",20,"UTS2", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1053 TVirtualMC::GetMC()->Gsposp("USCR",21,"UTS3", xpos,-ypos, zpos,0,"ONLY",parCrb,kNparCrb);
1054 // Top 1 (only in front of PHOS)
1055 parCrb[0] = 111.48/2.0;
1056 parCrb[1] = 105.00/2.0;
1057 parCrb[2] = fgkSMpltT/2.0;
1058 xpos = 0.0;
1059 ypos = 0.0;
1060 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1061 TVirtualMC::GetMC()->Gsposp("USCR",22,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1062 TVirtualMC::GetMC()->Gsposp("USCR",23,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1063 // Top 2 (only in front of PHOS)
1064 parCrb[0] = 111.48/2.0;
1065 parCrb[1] = 56.00/2.0;
1066 parCrb[2] = fgkSMpltT/2.0;
1067 xpos = 0.0;
1068 ypos = 85.5;
1069 zpos = fgkSMpltT/2.0 - fgkSheight/2.0;
1070 TVirtualMC::GetMC()->Gsposp("USCR",24,"UTS2", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1071 TVirtualMC::GetMC()->Gsposp("USCR",25,"UTS3", xpos, ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1072 TVirtualMC::GetMC()->Gsposp("USCR",26,"UTS2", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1073 TVirtualMC::GetMC()->Gsposp("USCR",27,"UTS3", xpos,-ypos,-zpos,0,"ONLY",parCrb,kNparCrb);
1074
1075 //
1076 // The chamber support rails
1077 //
1078
1079 const Float_t kSRLhgt = 2.00;
1080 const Float_t kSRLwidA = 2.3;
1081 const Float_t kSRLwidB = 1.947;
1082 const Float_t kSRLdst = 1.135;
1083 const Int_t kNparSRL = 11;
1084 Float_t parSRL[kNparSRL];
1085 // Trapezoidal shape
1086 parSRL[ 0] = fgkSlength/2.0;
1087 parSRL[ 1] = 0.0;
1088 parSRL[ 2] = 0.0;
1089 parSRL[ 3] = kSRLhgt /2.0;
1090 parSRL[ 4] = kSRLwidB /2.0;
1091 parSRL[ 5] = kSRLwidA /2.0;
1092 parSRL[ 6] = 5.0;
1093 parSRL[ 7] = kSRLhgt /2.0;
1094 parSRL[ 8] = kSRLwidB /2.0;
1095 parSRL[ 9] = kSRLwidA /2.0;
1096 parSRL[10] = 5.0;
1097 TVirtualMC::GetMC()->Gsvolu("USRL","TRAP",idtmed[1301-1],parSRL,kNparSRL);
1098
1099 xpos = 0.0;
1100 ypos = 0.0;
1101 zpos = 0.0;
1102 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1103 xpos = fgkCwidth[ilayer]/2.0 + kSRLwidA/2.0 + kSRLdst;
1104 ypos = 0.0;
1105 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos - fgkSheight/2.0
1106 + fgkCraH + fgkCdrH - fgkCalH - kSRLhgt/2.0
1107 + ilayer * (fgkCH + fgkVspace);
1108 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1 ,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1109 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+ kNlayer,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1110 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+2*kNlayer,"UTI2", xpos,ypos,zpos,matrix[2],"ONLY");
1111 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+3*kNlayer,"UTI2",-xpos,ypos,zpos,matrix[3],"ONLY");
1112 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+4*kNlayer,"UTI3", xpos,ypos,zpos,matrix[2],"ONLY");
1113 TVirtualMC::GetMC()->Gspos("USRL",ilayer+1+5*kNlayer,"UTI3",-xpos,ypos,zpos,matrix[3],"ONLY");
1114 }
1115
1116 //
1117 // The cross bars between the chambers
1118 //
1119
1120 const Float_t kSCBwid = 1.0;
1121 const Float_t kSCBthk = 2.0;
1122 const Float_t kSCHhgt = 0.3;
1123
1124 const Int_t kNparSCB = 3;
1125 Float_t parSCB[kNparSCB];
1126 parSCB[1] = kSCBwid/2.0;
1127 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
1128
1129 const Int_t kNparSCI = 3;
1130 Float_t parSCI[kNparSCI];
1131 parSCI[1] = -1;
1132
1133 xpos = 0.0;
1134 ypos = 0.0;
1135 zpos = 0.0;
1136 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
1137
1138 // The aluminum of the cross bars
1139 parSCB[0] = fgkCwidth[ilayer]/2.0 + kSRLdst/2.0;
1140 snprintf(cTagV,kTag,"USF%01d",ilayer);
1141 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
1142
1143 // The empty regions in the cross bars
1144 Float_t thkSCB = kSCBthk;
1145 if (ilayer < 2) {
1146 thkSCB *= 1.5;
1147 }
1148 parSCI[2] = parSCB[2] - thkSCB;
1149 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
1150 snprintf(cTagV,kTag,"USI%01d",ilayer);
1151 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
1152
1153 snprintf(cTagV,kTag,"USI%01d",ilayer);
1154 snprintf(cTagM,kTag,"USF%01d",ilayer);
1155 ypos = 0.0;
1156 zpos = 0.0;
1157 xpos = parSCI[0] + thkSCB/2.0;
1158 TVirtualMC::GetMC()->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
1159 xpos = - parSCI[0] - thkSCB/2.0;
1160 TVirtualMC::GetMC()->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
1161 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1162 TVirtualMC::GetMC()->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
1163 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
1164 TVirtualMC::GetMC()->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
1165
1166 snprintf(cTagV,kTag,"USF%01d",ilayer);
1167 xpos = 0.0;
1168 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
1169 + ilayer * (fgkCH + fgkVspace);
1170
1171 ypos = fgkClength[ilayer][2]/2.0 + fgkClength[ilayer][1];
1172 TVirtualMC::GetMC()->Gspos(cTagV, 1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1173 TVirtualMC::GetMC()->Gspos(cTagV, 3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1174 TVirtualMC::GetMC()->Gspos(cTagV, 5,"UTI3", xpos,ypos,zpos,0,"ONLY");
1175
1176 ypos = - fgkClength[ilayer][2]/2.0 - fgkClength[ilayer][1];
1177 TVirtualMC::GetMC()->Gspos(cTagV, 2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1178 TVirtualMC::GetMC()->Gspos(cTagV, 4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1179 TVirtualMC::GetMC()->Gspos(cTagV, 6,"UTI3", xpos,ypos,zpos,0,"ONLY");
1180
1181 }
1182
1183 //
1184 // The horizontal connections between the cross bars
1185 //
1186
1187 const Int_t kNparSCH = 3;
1188 Float_t parSCH[kNparSCH];
1189
1190 for (ilayer = 1; ilayer < kNlayer-1; ilayer++) {
1191
1192 parSCH[0] = fgkCwidth[ilayer]/2.0;
1193 parSCH[1] = (fgkClength[ilayer+1][2]/2.0 + fgkClength[ilayer+1][1]
1194 - fgkClength[ilayer ][2]/2.0 - fgkClength[ilayer ][1])/2.0;
1195 parSCH[2] = kSCHhgt/2.0;
1196
1197 snprintf(cTagV,kTag,"USH%01d",ilayer);
1198 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
1199 xpos = 0.0;
1200 ypos = fgkClength[ilayer][2]/2.0 + fgkClength[ilayer][1] + parSCH[1];
1201 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1202 + (ilayer+1) * (fgkCH + fgkVspace);
1203 TVirtualMC::GetMC()->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1204 TVirtualMC::GetMC()->Gspos(cTagV,3,"UTI2", xpos,ypos,zpos,0,"ONLY");
1205 TVirtualMC::GetMC()->Gspos(cTagV,5,"UTI3", xpos,ypos,zpos,0,"ONLY");
1206 ypos = -ypos;
1207 TVirtualMC::GetMC()->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1208 TVirtualMC::GetMC()->Gspos(cTagV,4,"UTI2", xpos,ypos,zpos,0,"ONLY");
1209 TVirtualMC::GetMC()->Gspos(cTagV,6,"UTI3", xpos,ypos,zpos,0,"ONLY");
1210
1211 }
1212
1213 //
1214 // The aymmetric flat frame in the middle
1215 //
1216
1217 // The envelope volume (aluminum)
1218 parTRD[0] = 87.60/2.0;
1219 parTRD[1] = 114.00/2.0;
1220 parTRD[2] = 1.20/2.0;
1221 parTRD[3] = 71.30/2.0;
1222 TVirtualMC::GetMC()->Gsvolu("USDB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
1223 // Empty spaces (air)
1224 parTRP[ 0] = 1.20/2.0;
1225 parTRP[ 1] = 0.0;
1226 parTRP[ 2] = 0.0;
1227 parTRP[ 3] = 27.00/2.0;
1228 parTRP[ 4] = 50.60/2.0;
1229 parTRP[ 5] = 5.00/2.0;
1230 parTRP[ 6] = 3.5;
1231 parTRP[ 7] = 27.00/2.0;
1232 parTRP[ 8] = 50.60/2.0;
1233 parTRP[ 9] = 5.00/2.0;
1234 parTRP[10] = 3.5;
1235 TVirtualMC::GetMC()->Gsvolu("USD1","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1236 xpos = 18.0;
1237 ypos = 0.0;
1238 zpos = 27.00/2.0 - 71.3/2.0;
1239 TVirtualMC::GetMC()->Gspos("USD1",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1240 // Empty spaces (air)
1241 parTRP[ 0] = 1.20/2.0;
1242 parTRP[ 1] = 0.0;
1243 parTRP[ 2] = 0.0;
1244 parTRP[ 3] = 33.00/2.0;
1245 parTRP[ 4] = 5.00/2.0;
1246 parTRP[ 5] = 62.10/2.0;
1247 parTRP[ 6] = 3.5;
1248 parTRP[ 7] = 33.00/2.0;
1249 parTRP[ 8] = 5.00/2.0;
1250 parTRP[ 9] = 62.10/2.0;
1251 parTRP[10] = 3.5;
1252 TVirtualMC::GetMC()->Gsvolu("USD2","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1253 xpos = 21.0;
1254 ypos = 0.0;
1255 zpos = 71.3/2.0 - 33.0/2.0;
1256 TVirtualMC::GetMC()->Gspos("USD2",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1257 // Empty spaces (air)
1258 parBOX[ 0] = 22.50/2.0;
1259 parBOX[ 1] = 1.20/2.0;
1260 parBOX[ 2] = 70.50/2.0;
1261 TVirtualMC::GetMC()->Gsvolu("USD3","BOX ",idtmed[1302-1],parBOX,kNparBOX);
1262 xpos = -25.75;
1263 ypos = 0.0;
1264 zpos = 0.4;
1265 TVirtualMC::GetMC()->Gspos("USD3",1,"USDB", xpos, ypos, zpos, 0,"ONLY");
1266 // Empty spaces (air)
1267 parTRP[ 0] = 1.20/2.0;
1268 parTRP[ 1] = 0.0;
1269 parTRP[ 2] = 0.0;
1270 parTRP[ 3] = 25.50/2.0;
1271 parTRP[ 4] = 5.00/2.0;
1272 parTRP[ 5] = 65.00/2.0;
1273 parTRP[ 6] = -1.0;
1274 parTRP[ 7] = 25.50/2.0;
1275 parTRP[ 8] = 5.00/2.0;
1276 parTRP[ 9] = 65.00/2.0;
1277 parTRP[10] = -1.0;
1278 TVirtualMC::GetMC()->Gsvolu("USD4","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1279 xpos = 2.0;
1280 ypos = 0.0;
1281 zpos = -1.6;
1282 TVirtualMC::GetMC()->Gspos("USD4",1,"USDB", xpos, ypos, zpos,matrix[6],"ONLY");
1283 // Empty spaces (air)
1284 parTRP[ 0] = 1.20/2.0;
1285 parTRP[ 1] = 0.0;
1286 parTRP[ 2] = 0.0;
1287 parTRP[ 3] = 23.50/2.0;
1288 parTRP[ 4] = 63.50/2.0;
1289 parTRP[ 5] = 5.00/2.0;
1290 parTRP[ 6] = 16.0;
1291 parTRP[ 7] = 23.50/2.0;
1292 parTRP[ 8] = 63.50/2.0;
1293 parTRP[ 9] = 5.00/2.0;
1294 parTRP[10] = 16.0;
1295 TVirtualMC::GetMC()->Gsvolu("USD5","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1296 xpos = 36.5;
1297 ypos = 0.0;
1298 zpos = -1.5;
1299 TVirtualMC::GetMC()->Gspos("USD5",1,"USDB", xpos, ypos, zpos,matrix[5],"ONLY");
1300 // Empty spaces (air)
1301 parTRP[ 0] = 1.20/2.0;
1302 parTRP[ 1] = 0.0;
1303 parTRP[ 2] = 0.0;
1304 parTRP[ 3] = 70.50/2.0;
1305 parTRP[ 4] = 4.50/2.0;
1306 parTRP[ 5] = 16.50/2.0;
1307 parTRP[ 6] = -5.0;
1308 parTRP[ 7] = 70.50/2.0;
1309 parTRP[ 8] = 4.50/2.0;
1310 parTRP[ 9] = 16.50/2.0;
1311 parTRP[10] = -5.0;
1312 TVirtualMC::GetMC()->Gsvolu("USD6","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1313 xpos = -43.7;
1314 ypos = 0.0;
1315 zpos = 0.4;
1316 TVirtualMC::GetMC()->Gspos("USD6",1,"USDB", xpos, ypos, zpos,matrix[2],"ONLY");
1317 xpos = 0.0;
1318 ypos = fgkClength[5][2]/2.0;
1319 zpos = 0.04;
1320 TVirtualMC::GetMC()->Gspos("USDB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1321 TVirtualMC::GetMC()->Gspos("USDB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1322 TVirtualMC::GetMC()->Gspos("USDB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1323 TVirtualMC::GetMC()->Gspos("USDB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1324 TVirtualMC::GetMC()->Gspos("USDB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1325 TVirtualMC::GetMC()->Gspos("USDB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1326 // Upper bar (aluminum)
1327 parBOX[0] = 95.00/2.0;
1328 parBOX[1] = 1.20/2.0;
1329 parBOX[2] = 3.00/2.0;
1330 TVirtualMC::GetMC()->Gsvolu("USD7","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1331 xpos = 0.0;
1332 ypos = fgkClength[5][2]/2.0;
1333 zpos = fgkSheight/2.0 - fgkSMpltT - 3.00/2.0;
1334 TVirtualMC::GetMC()->Gspos("USD7",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1335 TVirtualMC::GetMC()->Gspos("USD7",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1336 TVirtualMC::GetMC()->Gspos("USD7",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1337 TVirtualMC::GetMC()->Gspos("USD7",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1338 TVirtualMC::GetMC()->Gspos("USD7",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1339 TVirtualMC::GetMC()->Gspos("USD7",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1340 // Lower bar (aluminum)
1341 parBOX[0] = 90.22/2.0;
1342 parBOX[1] = 1.20/2.0;
1343 parBOX[2] = 1.74/2.0;
1344 TVirtualMC::GetMC()->Gsvolu("USD8","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1345 xpos = 0.0;
1346 ypos = fgkClength[5][2]/2.0 - 0.1;
1347 zpos = -fgkSheight/2.0 + fgkSMpltT + 2.27;
1348 TVirtualMC::GetMC()->Gspos("USD8",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1349 TVirtualMC::GetMC()->Gspos("USD8",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1350 TVirtualMC::GetMC()->Gspos("USD8",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1351 TVirtualMC::GetMC()->Gspos("USD8",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1352 TVirtualMC::GetMC()->Gspos("USD8",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1353 TVirtualMC::GetMC()->Gspos("USD8",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1354 // Lower bar (aluminum)
1355 parBOX[0] = 82.60/2.0;
1356 parBOX[1] = 1.20/2.0;
1357 parBOX[2] = 1.40/2.0;
1358 TVirtualMC::GetMC()->Gsvolu("USD9","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1359 xpos = 0.0;
1360 ypos = fgkClength[5][2]/2.0;
1361 zpos = -fgkSheight/2.0 + fgkSMpltT + 1.40/2.0;
1362 TVirtualMC::GetMC()->Gspos("USD9",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1363 TVirtualMC::GetMC()->Gspos("USD9",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1364 TVirtualMC::GetMC()->Gspos("USD9",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1365 TVirtualMC::GetMC()->Gspos("USD9",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1366 TVirtualMC::GetMC()->Gspos("USD9",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1367 TVirtualMC::GetMC()->Gspos("USD9",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1368 // Front sheet (aluminum)
1369 parTRP[ 0] = 0.10/2.0;
1370 parTRP[ 1] = 0.0;
1371 parTRP[ 2] = 0.0;
1372 parTRP[ 3] = 74.50/2.0;
1373 parTRP[ 4] = 31.70/2.0;
1374 parTRP[ 5] = 44.00/2.0;
1375 parTRP[ 6] = -5.0;
1376 parTRP[ 7] = 74.50/2.0;
1377 parTRP[ 8] = 31.70/2.0;
1378 parTRP[ 9] = 44.00/2.0;
1379 parTRP[10] = -5.0;
1380 TVirtualMC::GetMC()->Gsvolu("USDF","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1381 xpos = -32.0;
1382 ypos = fgkClength[5][2]/2.0 + 1.20/2.0 + 0.10/2.0;
1383 zpos = 0.0;
1384 TVirtualMC::GetMC()->Gspos("USDF",1,"UTI1", xpos, ypos, zpos,matrix[2],"ONLY");
1385 TVirtualMC::GetMC()->Gspos("USDF",2,"UTI1", xpos,-ypos, zpos,matrix[2],"ONLY");
1386 TVirtualMC::GetMC()->Gspos("USDF",3,"UTI2", xpos, ypos, zpos,matrix[2],"ONLY");
1387 TVirtualMC::GetMC()->Gspos("USDF",4,"UTI2", xpos,-ypos, zpos,matrix[2],"ONLY");
1388 TVirtualMC::GetMC()->Gspos("USDF",5,"UTI3", xpos, ypos, zpos,matrix[2],"ONLY");
1389 TVirtualMC::GetMC()->Gspos("USDF",6,"UTI3", xpos,-ypos, zpos,matrix[2],"ONLY");
1390
1391 //
1392 // The flat frame in front of the chambers
1393 //
1394
1395 // The envelope volume (aluminum)
1396 parTRD[0] = 90.00/2.0 - 0.1;
1397 parTRD[1] = 114.00/2.0 - 0.1;
1398 parTRD[2] = 1.50/2.0;
1399 parTRD[3] = 70.30/2.0;
1400 TVirtualMC::GetMC()->Gsvolu("USCB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
1401 // Empty spaces (air)
1402 parTRD[0] = 87.00/2.0;
1403 parTRD[1] = 10.00/2.0;
1404 parTRD[2] = 1.50/2.0;
1405 parTRD[3] = 26.35/2.0;
1406 TVirtualMC::GetMC()->Gsvolu("USC1","TRD1",idtmed[1302-1],parTRD,kNparTRD);
1407 xpos = 0.0;
1408 ypos = 0.0;
1409 zpos = 26.35/2.0 - 70.3/2.0;
1410 TVirtualMC::GetMC()->Gspos("USC1",1,"USCB",xpos,ypos,zpos,0,"ONLY");
1411 // Empty spaces (air)
1412 parTRD[0] = 10.00/2.0;
1413 parTRD[1] = 111.00/2.0;
1414 parTRD[2] = 1.50/2.0;
1415 parTRD[3] = 35.05/2.0;
1416 TVirtualMC::GetMC()->Gsvolu("USC2","TRD1",idtmed[1302-1],parTRD,kNparTRD);
1417 xpos = 0.0;
1418 ypos = 0.0;
1419 zpos = 70.3/2.0 - 35.05/2.0;
1420 TVirtualMC::GetMC()->Gspos("USC2",1,"USCB",xpos,ypos,zpos,0,"ONLY");
1421 // Empty spaces (air)
1422 parTRP[ 0] = 1.50/2.0;
1423 parTRP[ 1] = 0.0;
1424 parTRP[ 2] = 0.0;
1425 parTRP[ 3] = 37.60/2.0;
1426 parTRP[ 4] = 63.90/2.0;
1427 parTRP[ 5] = 8.86/2.0;
1428 parTRP[ 6] = 16.0;
1429 parTRP[ 7] = 37.60/2.0;
1430 parTRP[ 8] = 63.90/2.0;
1431 parTRP[ 9] = 8.86/2.0;
1432 parTRP[10] = 16.0;
1433 TVirtualMC::GetMC()->Gsvolu("USC3","TRAP",idtmed[1302-1],parTRP,kNparTRP);
1434 xpos = -30.5;
1435 ypos = 0.0;
1436 zpos = -2.0;
1437 TVirtualMC::GetMC()->Gspos("USC3",1,"USCB", xpos, ypos, zpos,matrix[4],"ONLY");
1438 TVirtualMC::GetMC()->Gspos("USC3",2,"USCB",-xpos, ypos, zpos,matrix[5],"ONLY");
1439 xpos = 0.0;
1440 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
1441 zpos = 0.0;
1442 TVirtualMC::GetMC()->Gspos("USCB",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1443 TVirtualMC::GetMC()->Gspos("USCB",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1444 TVirtualMC::GetMC()->Gspos("USCB",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1445 TVirtualMC::GetMC()->Gspos("USCB",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1446 TVirtualMC::GetMC()->Gspos("USCB",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1447 TVirtualMC::GetMC()->Gspos("USCB",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1448 // Upper bar (aluminum)
1449 parBOX[0] = 95.00/2.0;
1450 parBOX[1] = 1.50/2.0;
1451 parBOX[2] = 3.00/2.0;
1452 TVirtualMC::GetMC()->Gsvolu("USC4","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1453 xpos = 0.0;
1454 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
1455 zpos = fgkSheight/2.0 - fgkSMpltT - 3.00/2.0;
1456 TVirtualMC::GetMC()->Gspos("USC4",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1457 TVirtualMC::GetMC()->Gspos("USC4",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1458 TVirtualMC::GetMC()->Gspos("USC4",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1459 TVirtualMC::GetMC()->Gspos("USC4",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1460 TVirtualMC::GetMC()->Gspos("USC4",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1461 TVirtualMC::GetMC()->Gspos("USC4",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1462 // Lower bar (aluminum)
1463 parBOX[0] = 90.22/2.0;
1464 parBOX[1] = 1.50/2.0;
1465 parBOX[2] = 2.00/2.0;
1466 TVirtualMC::GetMC()->Gsvolu("USC5","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1467 xpos = 0.0;
1468 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
1469 zpos = -fgkSheight/2.0 + fgkSMpltT + 2.60;
1470 TVirtualMC::GetMC()->Gspos("USC5",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1471 TVirtualMC::GetMC()->Gspos("USC5",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1472 TVirtualMC::GetMC()->Gspos("USC5",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1473 TVirtualMC::GetMC()->Gspos("USC5",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1474 TVirtualMC::GetMC()->Gspos("USC5",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1475 TVirtualMC::GetMC()->Gspos("USC5",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1476 // Lower bar (aluminum)
1477 parBOX[0] = 82.60/2.0;
1478 parBOX[1] = 1.50/2.0;
1479 parBOX[2] = 1.60/2.0;
1480 TVirtualMC::GetMC()->Gsvolu("USC6","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1481 xpos = 0.0;
1482 ypos = fgkClength[5][2]/2.0 + fgkClength[5][1] + fgkClength[5][0];
1483 zpos = -fgkSheight/2.0 + fgkSMpltT + 1.60/2.0;
1484 TVirtualMC::GetMC()->Gspos("USC6",1,"UTI1", xpos, ypos, zpos, 0,"ONLY");
1485 TVirtualMC::GetMC()->Gspos("USC6",2,"UTI1", xpos,-ypos, zpos, 0,"ONLY");
1486 TVirtualMC::GetMC()->Gspos("USC6",3,"UTI2", xpos, ypos, zpos, 0,"ONLY");
1487 TVirtualMC::GetMC()->Gspos("USC6",4,"UTI2", xpos,-ypos, zpos, 0,"ONLY");
1488 TVirtualMC::GetMC()->Gspos("USC6",5,"UTI3", xpos, ypos, zpos, 0,"ONLY");
1489 TVirtualMC::GetMC()->Gspos("USC6",6,"UTI3", xpos,-ypos, zpos, 0,"ONLY");
1490
1491 //
1492 // The long corner ledges
1493 //
1494
1495 const Int_t kNparSCL = 3;
1496 Float_t parSCL[kNparSCL];
1497 const Int_t kNparSCLb = 11;
1498 Float_t parSCLb[kNparSCLb];
1499
1500 // Upper ledges
1501 // Thickness of the corner ledges
1502 const Float_t kSCLthkUa = 0.6;
1503 const Float_t kSCLthkUb = 0.6;
1504 // Width of the corner ledges
1505 const Float_t kSCLwidUa = 3.2;
1506 const Float_t kSCLwidUb = 4.8;
1507 // Position of the corner ledges
1508 const Float_t kSCLposxUa = 0.7;
1509 const Float_t kSCLposxUb = 3.3;
1510 const Float_t kSCLposzUa = 1.65;
1511 const Float_t kSCLposzUb = 0.3;
1512 // Vertical
1513 parSCL[0] = kSCLthkUa /2.0;
1514 parSCL[1] = fgkSlength/2.0;
1515 parSCL[2] = kSCLwidUa /2.0;
1516 TVirtualMC::GetMC()->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1517 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1518 ypos = 0.0;
1519 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1520 TVirtualMC::GetMC()->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1521 xpos = -xpos;
1522 TVirtualMC::GetMC()->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1523 // Horizontal
1524 parSCL[0] = kSCLwidUb /2.0;
1525 parSCL[1] = fgkSlength/2.0;
1526 parSCL[2] = kSCLthkUb /2.0;
1527 TVirtualMC::GetMC()->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1528 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1529 ypos = 0.0;
1530 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1531 TVirtualMC::GetMC()->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1532 TVirtualMC::GetMC()->Gspos("USL2",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1533 TVirtualMC::GetMC()->Gspos("USL2",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1534 xpos = -xpos;
1535 TVirtualMC::GetMC()->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1536 TVirtualMC::GetMC()->Gspos("USL2",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1537 TVirtualMC::GetMC()->Gspos("USL2",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1538
1539 // Lower ledges
1540 // Thickness of the corner ledges
1541 const Float_t kSCLthkLa = 2.464;
1542 const Float_t kSCLthkLb = 1.0;
1543 // Width of the corner ledges
1544 const Float_t kSCLwidLa = 8.3;
1545 const Float_t kSCLwidLb = 4.0;
1546 // Position of the corner ledges
1547 const Float_t kSCLposxLa = (3.0 * kSCLthkLb - kSCLthkLa) / 4.0 + 0.05;
1548 const Float_t kSCLposxLb = kSCLthkLb + kSCLwidLb/2.0 + 0.05;
1549 const Float_t kSCLposzLa = kSCLwidLa/2.0;
1550 const Float_t kSCLposzLb = kSCLthkLb/2.0;
1551 // Vertical
1552 // Trapezoidal shape
1553 parSCLb[ 0] = fgkSlength/2.0;
1554 parSCLb[ 1] = 0.0;
1555 parSCLb[ 2] = 0.0;
1556 parSCLb[ 3] = kSCLwidLa /2.0;
1557 parSCLb[ 4] = kSCLthkLb /2.0;
1558 parSCLb[ 5] = kSCLthkLa /2.0;
1559 parSCLb[ 6] = 5.0;
1560 parSCLb[ 7] = kSCLwidLa /2.0;
1561 parSCLb[ 8] = kSCLthkLb /2.0;
1562 parSCLb[ 9] = kSCLthkLa /2.0;
1563 parSCLb[10] = 5.0;
1564 TVirtualMC::GetMC()->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1565 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1566 ypos = 0.0;
1567 zpos = - fgkSheight/2.0 + fgkSMpltT + kSCLposzLa;
1568 TVirtualMC::GetMC()->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1569 TVirtualMC::GetMC()->Gspos("USL3",3,"UTI2", xpos,ypos,zpos,matrix[2],"ONLY");
1570 TVirtualMC::GetMC()->Gspos("USL3",5,"UTI3", xpos,ypos,zpos,matrix[2],"ONLY");
1571 xpos = -xpos;
1572 TVirtualMC::GetMC()->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1573 TVirtualMC::GetMC()->Gspos("USL3",4,"UTI2", xpos,ypos,zpos,matrix[3],"ONLY");
1574 TVirtualMC::GetMC()->Gspos("USL3",6,"UTI3", xpos,ypos,zpos,matrix[3],"ONLY");
1575 // Horizontal part
1576 parSCL[0] = kSCLwidLb /2.0;
1577 parSCL[1] = fgkSlength/2.0;
1578 parSCL[2] = kSCLthkLb /2.0;
1579 TVirtualMC::GetMC()->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1580 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1581 ypos = 0.0;
1582 zpos = - fgkSheight/2.0 + fgkSMpltT + kSCLposzLb;
1583 TVirtualMC::GetMC()->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1584 TVirtualMC::GetMC()->Gspos("USL4",3,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1585 TVirtualMC::GetMC()->Gspos("USL4",5,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1586 xpos = -xpos;
1587 TVirtualMC::GetMC()->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1588 TVirtualMC::GetMC()->Gspos("USL4",4,"UTI2", xpos,ypos,zpos, 0,"ONLY");
1589 TVirtualMC::GetMC()->Gspos("USL4",6,"UTI3", xpos,ypos,zpos, 0,"ONLY");
1590
1591 //
1592 // Aluminum plates in the front part of the super modules
1593 //
1594
1595 const Int_t kNparTrd = 4;
1596 Float_t parTrd[kNparTrd];
1597 parTrd[0] = fgkSwidth1/2.0 - 2.5;
1598 parTrd[1] = fgkSwidth2/2.0 - 2.5;
1599 parTrd[2] = fgkSMpltT /2.0;
1600 parTrd[3] = fgkSheight/2.0 - 1.0;
1601 TVirtualMC::GetMC()->Gsvolu("UTA1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
1602 xpos = 0.0;
1603 ypos = fgkSMpltT/2.0 - fgkFlength/2.0;
1604 zpos = -0.5;
1605 TVirtualMC::GetMC()->Gspos("UTA1",1,"UTF1",xpos, ypos,zpos, 0,"ONLY");
1606 TVirtualMC::GetMC()->Gspos("UTA1",2,"UTF2",xpos,-ypos,zpos, 0,"ONLY");
1607
1608 const Int_t kNparPlt = 3;
1609 Float_t parPlt[kNparPlt];
1610 parPlt[0] = 0.0;
1611 parPlt[1] = 0.0;
1612 parPlt[2] = 0.0;
1613 TVirtualMC::GetMC()->Gsvolu("UTA2","BOX ",idtmed[1301-1],parPlt,0);
1614 xpos = 0.0;
1615 ypos = 0.0;
1616 zpos = fgkSheight/2.0 - fgkSMpltT/2.0;
1617 parPlt[0] = fgkSwidth2/2.0 - 0.2;
1618 parPlt[1] = fgkFlength/2.0;
1619 parPlt[2] = fgkSMpltT /2.0;
1620 TVirtualMC::GetMC()->Gsposp("UTA2",1,"UTF2",xpos,ypos,zpos
1621 , 0,"ONLY",parPlt,kNparPlt);
1622 xpos = (fgkSwidth1 + fgkSwidth2)/4.0 - fgkSMpltT/2.0 - 0.0016;
1623 ypos = 0.0;
1624 zpos = 0.0;
1625 parPlt[0] = fgkSMpltT /2.0;
1626 parPlt[1] = fgkFlength/2.0;
1627 parPlt[2] = fgkSheight/2.0;
1628 TVirtualMC::GetMC()->Gsposp("UTA2",2,"UTF2", xpos,ypos,zpos
1629 ,matrix[0],"ONLY",parPlt,kNparPlt);
1630 TVirtualMC::GetMC()->Gsposp("UTA2",3,"UTF2",-xpos,ypos,zpos
1631 ,matrix[1],"ONLY",parPlt,kNparPlt);
1632
1633 // Additional aluminum bar
1634 parBOX[0] = 80.0/2.0;
1635 parBOX[1] = 1.0/2.0;
1636 parBOX[2] = 10.0/2.0;
1637 TVirtualMC::GetMC()->Gsvolu("UTA3","BOX ",idtmed[1301-1],parBOX,kNparBOX);
1638 xpos = 0.0;
1639 ypos = 1.0/2.0 + fgkSMpltT - fgkFlength/2.0;
1640 zpos = fgkSheight/2.0 - 1.5 - 10.0/2.0;
1641 TVirtualMC::GetMC()->Gspos("UTA3",1,"UTF1", xpos, ypos, zpos, 0,"ONLY");
1642 TVirtualMC::GetMC()->Gspos("UTA3",2,"UTF2", xpos,-ypos, zpos, 0,"ONLY");
1643
1644}
1645
1646//_____________________________________________________________________________
1647void AliTRDgeometry::CreateServices(Int_t *idtmed)
1648{
1649 //
1650 // Create the geometry of the services
1651 //
1652 // Names of the TRD services volumina
1653 //
1654 // UTC1 Cooling arterias (Al)
1655 // UTC2 Cooling arterias (Water)
1656 // UUxx Volumes for the services at the chambers (Air)
1657 // UMCM Readout MCMs (G10/Cu/Si)
1658 // UDCS DCSs boards (G10/Cu)
1659 // UTP1 Power bars (Cu)
1660 // UTCP Cooling pipes (Fe)
1661 // UTCH Cooling pipes (Water)
1662 // UTPL Power lines (Cu)
1663 // UTGD Gas distribution box (V2A)
1664 //
1665
1666 Int_t ilayer = 0;
1667 Int_t istack = 0;
1668
1669 Float_t xpos = 0.0;
1670 Float_t ypos = 0.0;
1671 Float_t zpos = 0.0;
1672
1673 const Int_t kTag = 100;
1674 Char_t cTagV[kTag];
1675
1676 const Int_t kNparBox = 3;
1677 Float_t parBox[kNparBox];
1678
1679 const Int_t kNparTube = 3;
1680 Float_t parTube[kNparTube];
1681
1682 // Services inside the baby frame
1683 const Float_t kBBMdz = 223.0;
1684 const Float_t kBBSdz = 8.5;
1685
1686 // Services inside the back frame
1687 const Float_t kBFMdz = 118.0;
1688 const Float_t kBFSdz = 8.5;
1689
1690 // The rotation matrices
1691 const Int_t kNmatrix = 10;
1692 Int_t matrix[kNmatrix];
1693 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0); // rotation around y-axis
1694 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0); // rotation around y-axis
1695 TVirtualMC::GetMC()->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1696 TVirtualMC::GetMC()->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1697 TVirtualMC::GetMC()->Matrix(matrix[4], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1698 TVirtualMC::GetMC()->Matrix(matrix[5], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
1699 TVirtualMC::GetMC()->Matrix(matrix[6], 80.0, 0.0, 90.0, 270.0, 10.0, 180.0);
1700 TVirtualMC::GetMC()->Matrix(matrix[7], 90.0, 10.0, 90.0, 100.0, 0.0, 0.0); // rotation around z-axis
1701 TVirtualMC::GetMC()->Matrix(matrix[8], 90.0, 350.0, 90.0, 80.0, 0.0, 0.0); // rotation around z-axis
1702 TVirtualMC::GetMC()->Matrix(matrix[9], 90.0, 90.0, 90.0, 180.0, 0.0, 0.0); // rotation around z-axis
1703
1704 //
1705 // The cooling arterias
1706 //
1707
1708 // Width of the cooling arterias
1709 const Float_t kCOLwid = 0.8;
1710 // Height of the cooling arterias
1711 const Float_t kCOLhgt = 6.5;
1712 // Positioning of the cooling
1713 const Float_t kCOLposx = 1.0;
1714 const Float_t kCOLposz = -1.2;
1715 // Thickness of the walls of the cooling arterias
1716 const Float_t kCOLthk = 0.1;
1717 const Int_t kNparCOL = 3;
1718 Float_t parCOL[kNparCOL];
1719 parCOL[0] = 0.0;
1720 parCOL[1] = 0.0;
1721 parCOL[2] = 0.0;
1722 TVirtualMC::GetMC()->Gsvolu("UTC1","BOX ",idtmed[1308-1],parCOL,0);
1723 TVirtualMC::GetMC()->Gsvolu("UTC3","BOX ",idtmed[1308-1],parCOL,0);
1724 parCOL[0] = kCOLwid/2.0 - kCOLthk;
1725 parCOL[1] = -1.0;
1726 parCOL[2] = kCOLhgt/2.0 - kCOLthk;
1727 TVirtualMC::GetMC()->Gsvolu("UTC2","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1728 TVirtualMC::GetMC()->Gsvolu("UTC4","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1729
1730 xpos = 0.0;
1731 ypos = 0.0;
1732 zpos = 0.0;
1733 TVirtualMC::GetMC()->Gspos("UTC2",1,"UTC1", xpos,ypos,zpos,0,"ONLY");
1734 TVirtualMC::GetMC()->Gspos("UTC4",1,"UTC3", xpos,ypos,zpos,0,"ONLY");
1735
1736 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1737
1738 // Along the chambers
1739 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx;
1740 ypos = 0.0;
1741 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1742 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1743 + ilayer * (fgkCH + fgkVspace);
1744 parCOL[0] = kCOLwid /2.0;
1745 parCOL[1] = fgkSlength/2.0;
1746 parCOL[2] = kCOLhgt /2.0;
1747 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer ,"UTI1", xpos,ypos,zpos
1748 ,matrix[0],"ONLY",parCOL,kNparCOL);
1749 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos
1750 ,matrix[1],"ONLY",parCOL,kNparCOL);
1751 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+6*kNlayer,"UTI2", xpos,ypos,zpos
1752 ,matrix[0],"ONLY",parCOL,kNparCOL);
1753 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+7*kNlayer,"UTI2",-xpos,ypos,zpos
1754 ,matrix[1],"ONLY",parCOL,kNparCOL);
1755 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+8*kNlayer ,"UTI3", xpos,ypos,zpos
1756 ,matrix[0],"ONLY",parCOL,kNparCOL);
1757 TVirtualMC::GetMC()->Gsposp("UTC1",ilayer+9*kNlayer,"UTI3",-xpos,ypos,zpos
1758 ,matrix[1],"ONLY",parCOL,kNparCOL);
1759
1760 // Front of supermodules
1761 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx;
1762 ypos = 0.0;
1763 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1764 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1765 + ilayer * (fgkCH + fgkVspace);
1766 parCOL[0] = kCOLwid /2.0;
1767 parCOL[1] = fgkFlength/2.0;
1768 parCOL[2] = kCOLhgt /2.0;
1769 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+2*kNlayer,"UTF1", xpos,ypos,zpos
1770 ,matrix[0],"ONLY",parCOL,kNparCOL);
1771 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+3*kNlayer,"UTF1",-xpos,ypos,zpos
1772 ,matrix[1],"ONLY",parCOL,kNparCOL);
1773 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+4*kNlayer,"UTF2", xpos,ypos,zpos
1774 ,matrix[0],"ONLY",parCOL,kNparCOL);
1775 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+5*kNlayer,"UTF2",-xpos,ypos,zpos
1776 ,matrix[1],"ONLY",parCOL,kNparCOL);
1777
1778 }
1779
1780 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1781
1782 // In baby frame
1783 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx - 2.5;
1784 ypos = kBBSdz/2.0 - kBBMdz/2.0;
1785 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1786 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1787 + ilayer * (fgkCH + fgkVspace);
1788 parCOL[0] = kCOLwid/2.0;
1789 parCOL[1] = kBBSdz /2.0;
1790 parCOL[2] = kCOLhgt/2.0;
1791 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos
1792 ,matrix[0],"ONLY",parCOL,kNparCOL);
1793 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos
1794 ,matrix[1],"ONLY",parCOL,kNparCOL);
1795
1796 }
1797
1798 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1799
1800 // In back frame
1801 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx - 0.3;
1802 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
1803 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1804 + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
1805 + ilayer * (fgkCH + fgkVspace);
1806 parCOL[0] = kCOLwid/2.0;
1807 parCOL[1] = kBFSdz /2.0;
1808 parCOL[2] = kCOLhgt/2.0;
1809 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+6*kNlayer,"BFTRD", xpos,ypos,zpos
1810 ,matrix[0],"ONLY",parCOL,kNparCOL);
1811 TVirtualMC::GetMC()->Gsposp("UTC3",ilayer+7*kNlayer,"BFTRD",-xpos,ypos,zpos
1812 ,matrix[1],"ONLY",parCOL,kNparCOL);
1813
1814 }
1815
1816 // The upper most layer
1817 // Along the chambers
1818 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1819 ypos = 0.0;
1820 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1821 parCOL[0] = kCOLwid /2.0;
1822 parCOL[1] = fgkSlength/2.0;
1823 parCOL[2] = kCOLhgt /2.0;
1824 TVirtualMC::GetMC()->Gsposp("UTC1",6 ,"UTI1", xpos,ypos,zpos
1825 ,matrix[3],"ONLY",parCOL,kNparCOL);
1826 TVirtualMC::GetMC()->Gsposp("UTC1",6+ kNlayer,"UTI1",-xpos,ypos,zpos
1827 ,matrix[3],"ONLY",parCOL,kNparCOL);
1828 TVirtualMC::GetMC()->Gsposp("UTC1",6+6*kNlayer,"UTI2", xpos,ypos,zpos
1829 ,matrix[3],"ONLY",parCOL,kNparCOL);
1830 TVirtualMC::GetMC()->Gsposp("UTC1",6+7*kNlayer,"UTI2",-xpos,ypos,zpos
1831 ,matrix[3],"ONLY",parCOL,kNparCOL);
1832 TVirtualMC::GetMC()->Gsposp("UTC1",6+8*kNlayer,"UTI3", xpos,ypos,zpos
1833 ,matrix[3],"ONLY",parCOL,kNparCOL);
1834 TVirtualMC::GetMC()->Gsposp("UTC1",6+9*kNlayer,"UTI3",-xpos,ypos,zpos
1835 ,matrix[3],"ONLY",parCOL,kNparCOL);
1836 // Front of supermodules
1837 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1838 ypos = 0.0;
1839 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1840 parCOL[0] = kCOLwid /2.0;
1841 parCOL[1] = fgkFlength/2.0;
1842 parCOL[2] = kCOLhgt /2.0;
1843 TVirtualMC::GetMC()->Gsposp("UTC3",6+2*kNlayer,"UTF1", xpos,ypos,zpos
1844 ,matrix[3],"ONLY",parCOL,kNparCOL);
1845 TVirtualMC::GetMC()->Gsposp("UTC3",6+3*kNlayer,"UTF1",-xpos,ypos,zpos
1846 ,matrix[3],"ONLY",parCOL,kNparCOL);
1847 TVirtualMC::GetMC()->Gsposp("UTC3",6+4*kNlayer,"UTF2", xpos,ypos,zpos
1848 ,matrix[3],"ONLY",parCOL,kNparCOL);
1849 TVirtualMC::GetMC()->Gsposp("UTC3",6+5*kNlayer,"UTF2",-xpos,ypos,zpos
1850 ,matrix[3],"ONLY",parCOL,kNparCOL);
1851 // In baby frame
1852 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 3.1;
1853 ypos = kBBSdz/2.0 - kBBMdz/2.0;
1854 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1855 parCOL[0] = kCOLwid/2.0;
1856 parCOL[1] = kBBSdz /2.0;
1857 parCOL[2] = kCOLhgt/2.0;
1858 TVirtualMC::GetMC()->Gsposp("UTC3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos
1859 ,matrix[3],"ONLY",parCOL,kNparCOL);
1860 TVirtualMC::GetMC()->Gsposp("UTC3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos
1861 ,matrix[3],"ONLY",parCOL,kNparCOL);
1862 // In back frame
1863 xpos = fgkCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
1864 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
1865 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
1866 parCOL[0] = kCOLwid/2.0;
1867 parCOL[1] = kBFSdz /2.0;
1868 parCOL[2] = kCOLhgt/2.0;
1869 TVirtualMC::GetMC()->Gsposp("UTC3",6+6*kNlayer,"BFTRD", xpos,ypos,zpos
1870 ,matrix[3],"ONLY",parCOL,kNparCOL);
1871 TVirtualMC::GetMC()->Gsposp("UTC3",6+7*kNlayer,"BFTRD",-xpos,ypos,zpos
1872 ,matrix[3],"ONLY",parCOL,kNparCOL);
1873
1874 //
1875 // The power bus bars
1876 //
1877
1878 const Float_t kPWRwid = 0.6;
1879 // Increase the height of the power bus bars to take into
1880 // account the material of additional cables, etc.
1881 const Float_t kPWRhgtA = 5.0 + 0.2;
1882 const Float_t kPWRhgtB = 5.0;
1883 const Float_t kPWRposx = 2.0;
1884 const Float_t kPWRposz = 0.1;
1885 const Int_t kNparPWR = 3;
1886 Float_t parPWR[kNparPWR];
1887 parPWR[0] = 0.0;
1888 parPWR[1] = 0.0;
1889 parPWR[2] = 0.0;
1890 TVirtualMC::GetMC()->Gsvolu("UTP1","BOX ",idtmed[1325-1],parPWR,0);
1891 TVirtualMC::GetMC()->Gsvolu("UTP3","BOX ",idtmed[1325-1],parPWR,0);
1892
1893 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1894
1895 // Along the chambers
1896 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx;
1897 ypos = 0.0;
1898 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1899 + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
1900 + ilayer * (fgkCH + fgkVspace);
1901 parPWR[0] = kPWRwid /2.0;
1902 parPWR[1] = fgkSlength/2.0;
1903 parPWR[2] = kPWRhgtA /2.0;
1904 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer ,"UTI1", xpos,ypos,zpos
1905 ,matrix[0],"ONLY",parPWR,kNparPWR);
1906 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos
1907 ,matrix[1],"ONLY",parPWR,kNparPWR);
1908 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+6*kNlayer,"UTI2", xpos,ypos,zpos
1909 ,matrix[0],"ONLY",parPWR,kNparPWR);
1910 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+7*kNlayer,"UTI2",-xpos,ypos,zpos
1911 ,matrix[1],"ONLY",parPWR,kNparPWR);
1912 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+8*kNlayer,"UTI3", xpos,ypos,zpos
1913 ,matrix[0],"ONLY",parPWR,kNparPWR);
1914 TVirtualMC::GetMC()->Gsposp("UTP1",ilayer+9*kNlayer,"UTI3",-xpos,ypos,zpos
1915 ,matrix[1],"ONLY",parPWR,kNparPWR);
1916
1917 // Front of supermodule
1918 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx;
1919 ypos = 0.0;
1920 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1921 + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
1922 + ilayer * (fgkCH + fgkVspace);
1923 parPWR[0] = kPWRwid /2.0;
1924 parPWR[1] = fgkFlength/2.0;
1925 parPWR[2] = kPWRhgtA /2.0;
1926 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+2*kNlayer,"UTF1", xpos,ypos,zpos
1927 ,matrix[0],"ONLY",parPWR,kNparPWR);
1928 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+3*kNlayer,"UTF1",-xpos,ypos,zpos
1929 ,matrix[1],"ONLY",parPWR,kNparPWR);
1930 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+4*kNlayer,"UTF2", xpos,ypos,zpos
1931 ,matrix[0],"ONLY",parPWR,kNparPWR);
1932 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+5*kNlayer,"UTF2",-xpos,ypos,zpos
1933 ,matrix[1],"ONLY",parPWR,kNparPWR);
1934
1935 }
1936
1937 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1938
1939 // In baby frame
1940 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx - 2.5;
1941 ypos = kBBSdz/2.0 - kBBMdz/2.0;
1942 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1943 + kPWRhgtB/2.0 - fgkSheight/2.0 + kPWRposz
1944 + ilayer * (fgkCH + fgkVspace);
1945 parPWR[0] = kPWRwid /2.0;
1946 parPWR[1] = kBBSdz /2.0;
1947 parPWR[2] = kPWRhgtB/2.0;
1948 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos
1949 ,matrix[0],"ONLY",parPWR,kNparPWR);
1950 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos
1951 ,matrix[1],"ONLY",parPWR,kNparPWR);
1952
1953 }
1954
1955 for (ilayer = 1; ilayer < kNlayer; ilayer++) {
1956
1957 // In back frame
1958 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx - 0.3;
1959 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
1960 zpos = fgkVrocsm + fgkSMpltT - fgkCalZpos
1961 + kPWRhgtB/2.0 - fgkSheight/2.0 + kPWRposz
1962 + ilayer * (fgkCH + fgkVspace);
1963 parPWR[0] = kPWRwid /2.0;
1964 parPWR[1] = kBFSdz /2.0;
1965 parPWR[2] = kPWRhgtB/2.0;
1966 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+8*kNlayer,"BFTRD", xpos,ypos,zpos
1967 ,matrix[0],"ONLY",parPWR,kNparPWR);
1968 TVirtualMC::GetMC()->Gsposp("UTP3",ilayer+9*kNlayer,"BFTRD",-xpos,ypos,zpos
1969 ,matrix[1],"ONLY",parPWR,kNparPWR);
1970
1971 }
1972
1973 // The upper most layer
1974 // Along the chambers
1975 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
1976 ypos = 0.0;
1977 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1978 parPWR[0] = kPWRwid /2.0;
1979 parPWR[1] = fgkSlength/2.0;
1980 parPWR[2] = kPWRhgtB /2.0 ;
1981 TVirtualMC::GetMC()->Gsposp("UTP1",6 ,"UTI1", xpos,ypos,zpos
1982 ,matrix[3],"ONLY",parPWR,kNparPWR);
1983 TVirtualMC::GetMC()->Gsposp("UTP1",6+ kNlayer,"UTI1",-xpos,ypos,zpos
1984 ,matrix[3],"ONLY",parPWR,kNparPWR);
1985 TVirtualMC::GetMC()->Gsposp("UTP1",6+6*kNlayer,"UTI2", xpos,ypos,zpos
1986 ,matrix[3],"ONLY",parPWR,kNparPWR);
1987 TVirtualMC::GetMC()->Gsposp("UTP1",6+7*kNlayer,"UTI2",-xpos,ypos,zpos
1988 ,matrix[3],"ONLY",parPWR,kNparPWR);
1989 TVirtualMC::GetMC()->Gsposp("UTP1",6+8*kNlayer,"UTI3", xpos,ypos,zpos
1990 ,matrix[3],"ONLY",parPWR,kNparPWR);
1991 TVirtualMC::GetMC()->Gsposp("UTP1",6+9*kNlayer,"UTI3",-xpos,ypos,zpos
1992 ,matrix[3],"ONLY",parPWR,kNparPWR);
1993 // Front of supermodules
1994 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
1995 ypos = 0.0;
1996 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
1997 parPWR[0] = kPWRwid /2.0;
1998 parPWR[1] = fgkFlength/2.0;
1999 parPWR[2] = kPWRhgtB /2.0;
2000 TVirtualMC::GetMC()->Gsposp("UTP3",6+2*kNlayer,"UTF1", xpos,ypos,zpos
2001 ,matrix[3],"ONLY",parPWR,kNparPWR);
2002 TVirtualMC::GetMC()->Gsposp("UTP3",6+3*kNlayer,"UTF1",-xpos,ypos,zpos
2003 ,matrix[3],"ONLY",parPWR,kNparPWR);
2004 TVirtualMC::GetMC()->Gsposp("UTP3",6+4*kNlayer,"UTF2", xpos,ypos,zpos
2005 ,matrix[3],"ONLY",parPWR,kNparPWR);
2006 TVirtualMC::GetMC()->Gsposp("UTP3",6+5*kNlayer,"UTF2",-xpos,ypos,zpos
2007 ,matrix[3],"ONLY",parPWR,kNparPWR);
2008 // In baby frame
2009 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 3.0;
2010 ypos = kBBSdz/2.0 - kBBMdz/2.0;
2011 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
2012 parPWR[0] = kPWRwid /2.0;
2013 parPWR[1] = kBBSdz /2.0;
2014 parPWR[2] = kPWRhgtB/2.0;
2015 TVirtualMC::GetMC()->Gsposp("UTP3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos
2016 ,matrix[3],"ONLY",parPWR,kNparPWR);
2017 TVirtualMC::GetMC()->Gsposp("UTP3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos
2018 ,matrix[3],"ONLY",parPWR,kNparPWR);
2019 // In back frame
2020 xpos = fgkCwidth[5]/2.0 + kPWRhgtB/2.0 - 1.3;
2021 ypos = -kBFSdz/2.0 + kBFMdz/2.0;
2022 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
2023 parPWR[0] = kPWRwid /2.0;
2024 parPWR[1] = kBFSdz /2.0;
2025 parPWR[2] = kPWRhgtB/2.0;
2026 TVirtualMC::GetMC()->Gsposp("UTP3",6+8*kNlayer,"BFTRD", xpos,ypos,zpos
2027 ,matrix[3],"ONLY",parPWR,kNparPWR);
2028 TVirtualMC::GetMC()->Gsposp("UTP3",6+9*kNlayer,"BFTRD",-xpos,ypos,zpos
2029 ,matrix[3],"ONLY",parPWR,kNparPWR);
2030
2031 //
2032 // The gas tubes connecting the chambers in the super modules with holes
2033 // Material: Stainless steel
2034 //
2035
2036 parTube[0] = 0.0;
2037 parTube[1] = 2.2/2.0;
2038 parTube[2] = fgkClength[5][2]/2.0 - fgkHspace/2.0;
2039 TVirtualMC::GetMC()->Gsvolu("UTG1","TUBE",idtmed[1308-1],parTube,kNparTube);
2040 parTube[0] = 0.0;
2041 parTube[1] = 2.1/2.0;
2042 parTube[2] = fgkClength[5][2]/2.0 - fgkHspace/2.0;
2043 TVirtualMC::GetMC()->Gsvolu("UTG2","TUBE",idtmed[1309-1],parTube,kNparTube);
2044 xpos = 0.0;
2045 ypos = 0.0;
2046 zpos = 0.0;
2047 TVirtualMC::GetMC()->Gspos("UTG2",1,"UTG1",xpos,ypos,zpos,0,"ONLY");
2048 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2049 xpos = fgkCwidth[ilayer]/2.0 + kCOLwid/2.0 - 1.5;
2050 ypos = 0.0;
2051 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + 5.0
2052 + ilayer * (fgkCH + fgkVspace);
2053 TVirtualMC::GetMC()->Gspos("UTG1",1+ilayer,"UTI3", xpos, ypos, zpos,matrix[4],"ONLY");
2054 TVirtualMC::GetMC()->Gspos("UTG1",7+ilayer,"UTI3",-xpos, ypos, zpos,matrix[4],"ONLY");
2055 }
2056
2057 //
2058 // The volumes for the services at the chambers
2059 //
2060
2061 const Int_t kNparServ = 3;
2062 Float_t parServ[kNparServ];
2063
2064 for (istack = 0; istack < kNstack; istack++) {
2065 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2066
2067 Int_t iDet = GetDetectorSec(ilayer,istack);
2068
2069 snprintf(cTagV,kTag,"UU%02d",iDet);
2070 parServ[0] = fgkCwidth[ilayer] /2.0;
2071 parServ[1] = fgkClength[ilayer][istack]/2.0 - fgkHspace/2.0;
2072 parServ[2] = fgkCsvH /2.0;
2073 TVirtualMC::GetMC()->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
2074
2075 }
2076 }
2077
2078 //
2079 // The cooling pipes inside the service volumes
2080 //
2081
2082 // The cooling pipes
2083 parTube[0] = 0.0;
2084 parTube[1] = 0.0;
2085 parTube[2] = 0.0;
2086 TVirtualMC::GetMC()->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
2087 // The cooling water
2088 parTube[0] = 0.0;
2089 parTube[1] = 0.2/2.0;
2090 parTube[2] = -1.0;
2091 TVirtualMC::GetMC()->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
2092 // Water inside the cooling pipe
2093 xpos = 0.0;
2094 ypos = 0.0;
2095 zpos = 0.0;
2096 TVirtualMC::GetMC()->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
2097
2098 // Position the cooling pipes in the mother volume
2099 for (istack = 0; istack < kNstack; istack++) {
2100 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2101 Int_t iDet = GetDetectorSec(ilayer,istack);
2102 Int_t iCopy = GetDetector(ilayer,istack,0) * 100;
2103 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
2104 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2105 / ((Float_t) nMCMrow);
2106 snprintf(cTagV,kTag,"UU%02d",iDet);
2107 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2108 xpos = 0.0;
2109 ypos = (0.5 + iMCMrow) * ySize
2110 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
2111 zpos = 0.0 + 0.742/2.0;
2112 // The cooling pipes
2113 parTube[0] = 0.0;
2114 parTube[1] = 0.3/2.0; // Thickness of the cooling pipes
2115 parTube[2] = fgkCwidth[ilayer]/2.0;
2116 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
2117 ,matrix[2],"ONLY",parTube,kNparTube);
2118 }
2119 }
2120 }
2121
2122 //
2123 // The power lines
2124 //
2125
2126 // The copper power lines
2127 parTube[0] = 0.0;
2128 parTube[1] = 0.0;
2129 parTube[2] = 0.0;
2130 TVirtualMC::GetMC()->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
2131
2132 // Position the power lines in the mother volume
2133 for (istack = 0; istack < kNstack; istack++) {
2134 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2135 Int_t iDet = GetDetectorSec(ilayer,istack);
2136 Int_t iCopy = GetDetector(ilayer,istack,0) * 100;
2137 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
2138 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2139 / ((Float_t) nMCMrow);
2140 snprintf(cTagV,kTag,"UU%02d",iDet);
2141 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2142 xpos = 0.0;
2143 ypos = (0.5 + iMCMrow) * ySize - 1.0
2144 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
2145 zpos = -0.4 + 0.742/2.0;
2146 parTube[0] = 0.0;
2147 parTube[1] = 0.2/2.0; // Thickness of the power lines
2148 parTube[2] = fgkCwidth[ilayer]/2.0;
2149 TVirtualMC::GetMC()->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
2150 ,matrix[2],"ONLY",parTube,kNparTube);
2151 }
2152 }
2153 }
2154
2155 //
2156 // The MCMs
2157 //
2158
2159 const Float_t kMCMx = 3.0;
2160 const Float_t kMCMy = 3.0;
2161 const Float_t kMCMz = 0.3;
2162
2163 const Float_t kMCMpcTh = 0.1;
2164 const Float_t kMCMcuTh = 0.0025;
2165 const Float_t kMCMsiTh = 0.03;
2166 const Float_t kMCMcoTh = 0.04;
2167
2168 // The mother volume for the MCMs (air)
2169 const Int_t kNparMCM = 3;
2170 Float_t parMCM[kNparMCM];
2171 parMCM[0] = kMCMx /2.0;
2172 parMCM[1] = kMCMy /2.0;
2173 parMCM[2] = kMCMz /2.0;
2174 TVirtualMC::GetMC()->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
2175
2176 // The MCM carrier G10 layer
2177 parMCM[0] = kMCMx /2.0;
2178 parMCM[1] = kMCMy /2.0;
2179 parMCM[2] = kMCMpcTh/2.0;
2180 TVirtualMC::GetMC()->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
2181 // The MCM carrier Cu layer
2182 parMCM[0] = kMCMx /2.0;
2183 parMCM[1] = kMCMy /2.0;
2184 parMCM[2] = kMCMcuTh/2.0;
2185 TVirtualMC::GetMC()->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
2186 // The silicon of the chips
2187 parMCM[0] = kMCMx /2.0;
2188 parMCM[1] = kMCMy /2.0;
2189 parMCM[2] = kMCMsiTh/2.0;
2190 TVirtualMC::GetMC()->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
2191 // The aluminum of the cooling plates
2192 parMCM[0] = kMCMx /2.0;
2193 parMCM[1] = kMCMy /2.0;
2194 parMCM[2] = kMCMcoTh/2.0;
2195 TVirtualMC::GetMC()->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
2196
2197 // Put the MCM material inside the MCM mother volume
2198 xpos = 0.0;
2199 ypos = 0.0;
2200 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
2201 TVirtualMC::GetMC()->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2202 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
2203 TVirtualMC::GetMC()->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2204 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
2205 TVirtualMC::GetMC()->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2206 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
2207 TVirtualMC::GetMC()->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
2208
2209 // Position the MCMs in the mother volume
2210 for (istack = 0; istack < kNstack; istack++) {
2211 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2212 Int_t iDet = GetDetectorSec(ilayer,istack);
2213 Int_t iCopy = GetDetector(ilayer,istack,0) * 1000;
2214 Int_t nMCMrow = GetRowMax(ilayer,istack,0);
2215 Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2216 / ((Float_t) nMCMrow);
2217 Int_t nMCMcol = 8;
2218 Float_t xSize = (GetChamberWidth(ilayer) - 2.0*fgkCpadW)
2219 / ((Float_t) nMCMcol + 6); // Introduce 6 gaps
2220 Int_t iMCM[8] = { 1, 2, 3, 5, 8, 9, 10, 12 }; // 0..7 MCM + 6 gap structure
2221 snprintf(cTagV,kTag,"UU%02d",iDet);
2222 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2223 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
2224 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0
2225 - fgkCwidth[ilayer]/2.0;
2226 ypos = (0.5 + iMCMrow) * ySize + 1.0
2227 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
2228 zpos = -0.4 + 0.742/2.0;
2229 TVirtualMC::GetMC()->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
2230 ,xpos,ypos,zpos,0,"ONLY");
2231 // Add two additional smaller cooling pipes on top of the MCMs
2232 // to mimic the meandering structure
2233 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0
2234 - fgkCwidth[ilayer]/2.0;
2235 ypos = (0.5 + iMCMrow) * ySize
2236 - fgkClength[ilayer][istack]/2.0 + fgkHspace/2.0;
2237 zpos = 0.0 + 0.742/2.0;
2238 parTube[0] = 0.0;
2239 parTube[1] = 0.3/2.0; // Thickness of the cooling pipes
2240 parTube[2] = kMCMx/2.0;
2241 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow*10+iMCMcol+ 50,cTagV
2242 ,xpos,ypos+1.0,zpos
2243 ,matrix[2],"ONLY",parTube,kNparTube);
2244 TVirtualMC::GetMC()->Gsposp("UTCP",iCopy+iMCMrow*10+iMCMcol+500,cTagV
2245 ,xpos,ypos+2.0,zpos
2246 ,matrix[2],"ONLY",parTube,kNparTube);
2247
2248 }
2249 }
2250
2251 }
2252 }
2253
2254 //
2255 // The DCS boards
2256 //
2257
2258 const Float_t kDCSx = 9.0;
2259 const Float_t kDCSy = 14.5;
2260 const Float_t kDCSz = 0.3;
2261
2262 const Float_t kDCSpcTh = 0.15;
2263 const Float_t kDCScuTh = 0.01;
2264 const Float_t kDCScoTh = 0.04;
2265
2266 // The mother volume for the DCSs (air)
2267 const Int_t kNparDCS = 3;
2268 Float_t parDCS[kNparDCS];
2269 parDCS[0] = kDCSx /2.0;
2270 parDCS[1] = kDCSy /2.0;
2271 parDCS[2] = kDCSz /2.0;
2272 TVirtualMC::GetMC()->Gsvolu("UDCS","BOX",idtmed[1302-1],parDCS,kNparDCS);
2273
2274 // The DCS carrier G10 layer
2275 parDCS[0] = kDCSx /2.0;
2276 parDCS[1] = kDCSy /2.0;
2277 parDCS[2] = kDCSpcTh/2.0;
2278 TVirtualMC::GetMC()->Gsvolu("UDC1","BOX",idtmed[1319-1],parDCS,kNparDCS);
2279 // The DCS carrier Cu layer
2280 parDCS[0] = kDCSx /2.0;
2281 parDCS[1] = kDCSy /2.0;
2282 parDCS[2] = kDCScuTh/2.0;
2283 TVirtualMC::GetMC()->Gsvolu("UDC2","BOX",idtmed[1318-1],parDCS,kNparDCS);
2284 // The aluminum of the cooling plates
2285 parDCS[0] = 5.0 /2.0;
2286 parDCS[1] = 5.0 /2.0;
2287 parDCS[2] = kDCScoTh/2.0;
2288 TVirtualMC::GetMC()->Gsvolu("UDC3","BOX",idtmed[1324-1],parDCS,kNparDCS);
2289
2290 // Put the DCS material inside the DCS mother volume
2291 xpos = 0.0;
2292 ypos = 0.0;
2293 zpos = -kDCSz /2.0 + kDCSpcTh/2.0;
2294 TVirtualMC::GetMC()->Gspos("UDC1",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
2295 zpos += kDCSpcTh/2.0 + kDCScuTh/2.0;
2296 TVirtualMC::GetMC()->Gspos("UDC2",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
2297 zpos += kDCScuTh/2.0 + kDCScoTh/2.0;
2298 TVirtualMC::GetMC()->Gspos("UDC3",1,"UDCS",xpos,ypos,zpos,0,"ONLY");
2299
2300 // Put the DCS board in the chamber services mother volume
2301 for (istack = 0; istack < kNstack; istack++) {
2302 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2303 Int_t iDet = GetDetectorSec(ilayer,istack);
2304 Int_t iCopy = iDet + 1;
2305 xpos = fgkCwidth[ilayer]/2.0 - 1.9 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2306 / ((Float_t) GetRowMax(ilayer,istack,0));
2307 ypos = 0.05 * fgkClength[ilayer][istack];
2308 zpos = kDCSz/2.0 - fgkCsvH/2.0;
2309 snprintf(cTagV,kTag,"UU%02d",iDet);
2310 TVirtualMC::GetMC()->Gspos("UDCS",iCopy,cTagV,xpos,ypos,zpos,0,"ONLY");
2311 }
2312 }
2313
2314 //
2315 // The ORI boards
2316 //
2317
2318 const Float_t kORIx = 4.2;
2319 const Float_t kORIy = 13.5;
2320 const Float_t kORIz = 0.3;
2321
2322 const Float_t kORIpcTh = 0.15;
2323 const Float_t kORIcuTh = 0.01;
2324 const Float_t kORIcoTh = 0.04;
2325
2326 // The mother volume for the ORIs (air)
2327 const Int_t kNparORI = 3;
2328 Float_t parORI[kNparORI];
2329 parORI[0] = kORIx /2.0;
2330 parORI[1] = kORIy /2.0;
2331 parORI[2] = kORIz /2.0;
2332 TVirtualMC::GetMC()->Gsvolu("UORI","BOX",idtmed[1302-1],parORI,kNparORI);
2333
2334 // The ORI carrier G10 layer
2335 parORI[0] = kORIx /2.0;
2336 parORI[1] = kORIy /2.0;
2337 parORI[2] = kORIpcTh/2.0;
2338 TVirtualMC::GetMC()->Gsvolu("UOR1","BOX",idtmed[1319-1],parORI,kNparORI);
2339 // The ORI carrier Cu layer
2340 parORI[0] = kORIx /2.0;
2341 parORI[1] = kORIy /2.0;
2342 parORI[2] = kORIcuTh/2.0;
2343 TVirtualMC::GetMC()->Gsvolu("UOR2","BOX",idtmed[1318-1],parORI,kNparORI);
2344 // The aluminum of the cooling plates
2345 parORI[0] = kORIx /2.0;
2346 parORI[1] = kORIy /2.0;
2347 parORI[2] = kORIcoTh/2.0;
2348 TVirtualMC::GetMC()->Gsvolu("UOR3","BOX",idtmed[1324-1],parORI,kNparORI);
2349
2350 // Put the ORI material inside the ORI mother volume
2351 xpos = 0.0;
2352 ypos = 0.0;
2353 zpos = -kORIz /2.0 + kORIpcTh/2.0;
2354 TVirtualMC::GetMC()->Gspos("UOR1",1,"UORI",xpos,ypos,zpos,0,"ONLY");
2355 zpos += kORIpcTh/2.0 + kORIcuTh/2.0;
2356 TVirtualMC::GetMC()->Gspos("UOR2",1,"UORI",xpos,ypos,zpos,0,"ONLY");
2357 zpos += kORIcuTh/2.0 + kORIcoTh/2.0;
2358 TVirtualMC::GetMC()->Gspos("UOR3",1,"UORI",xpos,ypos,zpos,0,"ONLY");
2359
2360 // Put the ORI board in the chamber services mother volume
2361 for (istack = 0; istack < kNstack; istack++) {
2362 for (ilayer = 0; ilayer < kNlayer; ilayer++) {
2363 Int_t iDet = GetDetectorSec(ilayer,istack);
2364 Int_t iCopy = iDet + 1;
2365 xpos = fgkCwidth[ilayer]/2.0 - 1.92 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2366 / ((Float_t) GetRowMax(ilayer,istack,0));
2367 ypos = -16.0;
2368 zpos = kORIz/2.0 - fgkCsvH/2.0;
2369 snprintf(cTagV,kTag,"UU%02d",iDet);
2370 TVirtualMC::GetMC()->Gspos("UORI",iCopy ,cTagV,xpos,ypos,zpos,0,"ONLY");
2371 xpos = -fgkCwidth[ilayer]/2.0 + 3.8 * (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW)
2372 / ((Float_t) GetRowMax(ilayer,istack,0));
2373 ypos = -16.0;
2374 zpos = kORIz/2.0 - fgkCsvH/2.0;
2375 snprintf(cTagV,kTag,"UU%02d",iDet);
2376 TVirtualMC::GetMC()->Gspos("UORI",iCopy+kNdet,cTagV,xpos,ypos,zpos,0,"ONLY");
2377 }
2378 }
2379
2380 //
2381 // Services in front of the super module
2382 //
2383
2384 // Gas in-/outlet pipes (INOX)
2385 parTube[0] = 0.0;
2386 parTube[1] = 0.0;
2387 parTube[2] = 0.0;
2388 TVirtualMC::GetMC()->Gsvolu("UTG3","TUBE",idtmed[1308-1],parTube,0);
2389 // The gas inside the in-/outlet pipes (Xe)
2390 parTube[0] = 0.0;
2391 parTube[1] = 1.2/2.0;
2392 parTube[2] = -1.0;
2393 TVirtualMC::GetMC()->Gsvolu("UTG4","TUBE",idtmed[1309-1],parTube,kNparTube);
2394 xpos = 0.0;
2395 ypos = 0.0;
2396 zpos = 0.0;
2397 TVirtualMC::GetMC()->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY");
2398 for (ilayer = 0; ilayer < kNlayer-1; ilayer++) {
2399 xpos = 0.0;
2400 ypos = fgkClength[ilayer][2]/2.0
2401 + fgkClength[ilayer][1]
2402 + fgkClength[ilayer][0];
2403 zpos = 9.0 - fgkSheight/2.0
2404 + ilayer * (fgkCH + fgkVspace);
2405 parTube[0] = 0.0;
2406 parTube[1] = 1.5/2.0;
2407 parTube[2] = fgkCwidth[ilayer]/2.0 - 2.5;
2408 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1 ,"UTI1", xpos, ypos, zpos
2409 ,matrix[2],"ONLY",parTube,kNparTube);
2410 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+1*kNlayer,"UTI1", xpos,-ypos, zpos
2411 ,matrix[2],"ONLY",parTube,kNparTube);
2412 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+2*kNlayer,"UTI2", xpos, ypos, zpos
2413 ,matrix[2],"ONLY",parTube,kNparTube);
2414 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+3*kNlayer,"UTI2", xpos,-ypos, zpos
2415 ,matrix[2],"ONLY",parTube,kNparTube);
2416 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+4*kNlayer,"UTI3", xpos, ypos, zpos
2417 ,matrix[2],"ONLY",parTube,kNparTube);
2418 TVirtualMC::GetMC()->Gsposp("UTG3",ilayer+1+5*kNlayer,"UTI3", xpos,-ypos, zpos
2419 ,matrix[2],"ONLY",parTube,kNparTube);
2420 }
2421
2422 // Gas distribution box
2423 parBox[0] = 14.50/2.0;
2424 parBox[1] = 4.52/2.0;
2425 parBox[2] = 5.00/2.0;
2426 TVirtualMC::GetMC()->Gsvolu("UTGD","BOX ",idtmed[1308-1],parBox,kNparBox);
2427 parBox[0] = 14.50/2.0;
2428 parBox[1] = 4.00/2.0;
2429 parBox[2] = 4.40/2.0;
2430 TVirtualMC::GetMC()->Gsvolu("UTGI","BOX ",idtmed[1309-1],parBox,kNparBox);
2431 parTube[0] = 0.0;
2432 parTube[1] = 4.0/2.0;
2433 parTube[2] = 8.0/2.0;
2434 TVirtualMC::GetMC()->Gsvolu("UTGT","TUBE",idtmed[1308-1],parTube,kNparTube);
2435 parTube[0] = 0.0;
2436 parTube[1] = 3.4/2.0;
2437 parTube[2] = 8.0/2.0;
2438 TVirtualMC::GetMC()->Gsvolu("UTGG","TUBE",idtmed[1309-1],parTube,kNparTube);
2439 xpos = 0.0;
2440 ypos = 0.0;
2441 zpos = 0.0;
2442 TVirtualMC::GetMC()->Gspos("UTGI",1,"UTGD",xpos,ypos,zpos, 0,"ONLY");
2443 TVirtualMC::GetMC()->Gspos("UTGG",1,"UTGT",xpos,ypos,zpos, 0,"ONLY");
2444 xpos = 0.0;
2445 ypos = 0.0;
2446 zpos = 0.0;
2447 TVirtualMC::GetMC()->Gspos("UTGD",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
2448 xpos = -3.0;
2449 ypos = 0.0;
2450 zpos = 6.5;
2451 TVirtualMC::GetMC()->Gspos("UTGT",1,"UTF1",xpos,ypos,zpos, 0,"ONLY");
2452 xpos = -11.25;
2453 ypos = 0.0;
2454 zpos = 0.5;
2455 TVirtualMC::GetMC()->Gspos("UTGT",3,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
2456 xpos = 11.25;
2457 ypos = 0.0;
2458 zpos = 0.5;
2459 TVirtualMC::GetMC()->Gspos("UTGT",5,"UTF1",xpos,ypos,zpos,matrix[2],"ONLY");
2460
2461 // Cooling manifolds
2462 parBox[0] = 5.0/2.0;
2463 parBox[1] = 23.0/2.0;
2464 parBox[2] = 70.0/2.0;
2465 TVirtualMC::GetMC()->Gsvolu("UTCM","BOX ",idtmed[1302-1],parBox,kNparBox);
2466 parBox[0] = 5.0/2.0;
2467 parBox[1] = 5.0/2.0;
2468 parBox[2] = 70.0/2.0;
2469 TVirtualMC::GetMC()->Gsvolu("UTCA","BOX ",idtmed[1308-1],parBox,kNparBox);
2470 parBox[0] = 5.0/2.0 - 0.3;
2471 parBox[1] = 5.0/2.0 - 0.3;
2472 parBox[2] = 70.0/2.0 - 0.3;
2473 TVirtualMC::GetMC()->Gsvolu("UTCW","BOX ",idtmed[1314-1],parBox,kNparBox);
2474 xpos = 0.0;
2475 ypos = 0.0;
2476 zpos = 0.0;
2477 TVirtualMC::GetMC()->Gspos("UTCW",1,"UTCA", xpos, ypos, zpos, 0,"ONLY");
2478 xpos = 0.0;
2479 ypos = 5.0/2.0 - 23.0/2.0;
2480 zpos = 0.0;
2481 TVirtualMC::GetMC()->Gspos("UTCA",1,"UTCM", xpos, ypos, zpos, 0,"ONLY");
2482 parTube[0] = 0.0;
2483 parTube[1] = 3.0/2.0;
2484 parTube[2] = 18.0/2.0;
2485 TVirtualMC::GetMC()->Gsvolu("UTCO","TUBE",idtmed[1308-1],parTube,kNparTube);
2486 parTube[0] = 0.0;
2487 parTube[1] = 3.0/2.0 - 0.3;
2488 parTube[2] = 18.0/2.0;
2489 TVirtualMC::GetMC()->Gsvolu("UTCL","TUBE",idtmed[1314-1],parTube,kNparTube);
2490 xpos = 0.0;
2491 ypos = 0.0;
2492 zpos = 0.0;
2493 TVirtualMC::GetMC()->Gspos("UTCL",1,"UTCO", xpos, ypos, zpos, 0,"ONLY");
2494 xpos = 0.0;
2495 ypos = 2.5;
2496 zpos = -70.0/2.0 + 7.0;
2497 TVirtualMC::GetMC()->Gspos("UTCO",1,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2498 zpos += 7.0;
2499 TVirtualMC::GetMC()->Gspos("UTCO",2,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2500 zpos += 7.0;
2501 TVirtualMC::GetMC()->Gspos("UTCO",3,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2502 zpos += 7.0;
2503 TVirtualMC::GetMC()->Gspos("UTCO",4,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2504 zpos += 7.0;
2505 TVirtualMC::GetMC()->Gspos("UTCO",5,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2506 zpos += 7.0;
2507 TVirtualMC::GetMC()->Gspos("UTCO",6,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2508 zpos += 7.0;
2509 TVirtualMC::GetMC()->Gspos("UTCO",7,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2510 zpos += 7.0;
2511 TVirtualMC::GetMC()->Gspos("UTCO",8,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
2512
2513 xpos = 40.0;
2514 ypos = fgkFlength/2.0 - 23.0/2.0;
2515 zpos = 0.0;
2516 TVirtualMC::GetMC()->Gspos("UTCM",1,"UTF1", xpos, ypos, zpos,matrix[0],"ONLY");
2517 TVirtualMC::GetMC()->Gspos("UTCM",2,"UTF1",-xpos, ypos, zpos,matrix[1],"ONLY");
2518 TVirtualMC::GetMC()->Gspos("UTCM",3,"UTF2", xpos,-ypos, zpos,matrix[5],"ONLY");
2519 TVirtualMC::GetMC()->Gspos("UTCM",4,"UTF2",-xpos,-ypos, zpos,matrix[6],"ONLY");
2520
2521 // Power connection boards (Cu)
2522 parBox[0] = 0.5/2.0;
2523 parBox[1] = 15.0/2.0;
2524 parBox[2] = 7.0/2.0;
2525 TVirtualMC::GetMC()->Gsvolu("UTPC","BOX ",idtmed[1325-1],parBox,kNparBox);
2526 for (ilayer = 0; ilayer < kNlayer-1; ilayer++) {
2527 xpos = fgkCwidth[ilayer]/2.0 + kPWRwid/2.0;
2528 ypos = 0.0;
2529 zpos = fgkVrocsm + fgkSMpltT + kPWRhgtA/2.0 - fgkSheight/2.0 + kPWRposz
2530 + (ilayer+1) * (fgkCH + fgkVspace);
2531 TVirtualMC::GetMC()->Gspos("UTPC",ilayer ,"UTF1", xpos,ypos,zpos,matrix[0],"ONLY");
2532 TVirtualMC::GetMC()->Gspos("UTPC",ilayer+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[1],"ONLY");
2533 }
2534 xpos = fgkCwidth[5]/2.0 + kPWRhgtA/2.0 - 2.0;
2535 ypos = 0.0;
2536 zpos = fgkSheight/2.0 - fgkSMpltT - 2.0;
2537 TVirtualMC::GetMC()->Gspos("UTPC",5 ,"UTF1", xpos,ypos,zpos,matrix[3],"ONLY");
2538 TVirtualMC::GetMC()->Gspos("UTPC",5+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[3],"ONLY");
2539
2540 // Power connection panel (Al)
2541 parBox[0] = 60.0/2.0;
2542 parBox[1] = 10.0/2.0;
2543 parBox[2] = 3.0/2.0;
2544 TVirtualMC::GetMC()->Gsvolu("UTPP","BOX ",idtmed[1301-1],parBox,kNparBox);
2545 xpos = 0.0;
2546 ypos = 0.0;
2547 zpos = 18.0;
2548 TVirtualMC::GetMC()->Gspos("UTPP",1,"UTF1", xpos,ypos,zpos,0,"ONLY");
2549
2550 //
2551 // Electronics boxes
2552 //
2553
2554 // Casing (INOX)
2555 parBox[0] = 60.0/2.0;
2556 parBox[1] = 10.0/2.0;
2557 parBox[2] = 6.0/2.0;
2558 TVirtualMC::GetMC()->Gsvolu("UTE1","BOX ",idtmed[1308-1],parBox,kNparBox);
2559 // Interior (air)
2560 parBox[0] = parBox[0] - 0.5;
2561 parBox[1] = parBox[1] - 0.5;
2562 parBox[2] = parBox[2] - 0.5;
2563 TVirtualMC::GetMC()->Gsvolu("UTE2","BOX ",idtmed[1302-1],parBox,kNparBox);
2564 xpos = 0.0;
2565 ypos = 0.0;
2566 zpos = 0.0;
2567 TVirtualMC::GetMC()->Gspos("UTE2",1,"UTE1",xpos,ypos,zpos,0,"ONLY");
2568 xpos = 0.0;
2569 ypos = fgkSlength/2.0 - 10.0/2.0 - 3.0;
2570 zpos = -fgkSheight/2.0 + 6.0/2.0 + 1.0;
2571 TVirtualMC::GetMC()->Gspos("UTE1",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2572 TVirtualMC::GetMC()->Gspos("UTE1",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2573 TVirtualMC::GetMC()->Gspos("UTE1",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2574
2575 // Casing (INOX)
2576 parBox[0] = 50.0/2.0;
2577 parBox[1] = 15.0/2.0;
2578 parBox[2] = 20.0/2.0;
2579 TVirtualMC::GetMC()->Gsvolu("UTE3","BOX ",idtmed[1308-1],parBox,kNparBox);
2580 // Interior (air)
2581 parBox[0] = parBox[0] - 0.5;
2582 parBox[1] = parBox[1] - 0.5;
2583 parBox[2] = parBox[2] - 0.5;
2584 TVirtualMC::GetMC()->Gsvolu("UTE4","BOX ",idtmed[1302-1],parBox,kNparBox);
2585 xpos = 0.0;
2586 ypos = 0.0;
2587 zpos = 0.0;
2588 TVirtualMC::GetMC()->Gspos("UTE4",1,"UTE3",xpos,ypos,zpos,0,"ONLY");
2589 xpos = 0.0;
2590 ypos = -fgkSlength/2.0 + 15.0/2.0 + 3.0;
2591 zpos = -fgkSheight/2.0 + 20.0/2.0 + 1.0;
2592 TVirtualMC::GetMC()->Gspos("UTE3",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2593 TVirtualMC::GetMC()->Gspos("UTE3",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2594 TVirtualMC::GetMC()->Gspos("UTE3",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2595
2596 // Casing (INOX)
2597 parBox[0] = 20.0/2.0;
2598 parBox[1] = 7.0/2.0;
2599 parBox[2] = 20.0/2.0;
2600 TVirtualMC::GetMC()->Gsvolu("UTE5","BOX ",idtmed[1308-1],parBox,kNparBox);
2601 // Interior (air)
2602 parBox[0] = parBox[0] - 0.5;
2603 parBox[1] = parBox[1] - 0.5;
2604 parBox[2] = parBox[2] - 0.5;
2605 TVirtualMC::GetMC()->Gsvolu("UTE6","BOX ",idtmed[1302-1],parBox,kNparBox);
2606 xpos = 0.0;
2607 ypos = 0.0;
2608 zpos = 0.0;
2609 TVirtualMC::GetMC()->Gspos("UTE6",1,"UTE5",xpos,ypos,zpos,0,"ONLY");
2610 xpos = 20.0;
2611 ypos = -fgkSlength/2.0 + 7.0/2.0 + 3.0;
2612 zpos = 0.0;
2613 TVirtualMC::GetMC()->Gspos("UTE5",1,"UTI1", xpos,ypos,zpos,0,"ONLY");
2614 TVirtualMC::GetMC()->Gspos("UTE5",2,"UTI2", xpos,ypos,zpos,0,"ONLY");
2615 TVirtualMC::GetMC()->Gspos("UTE5",3,"UTI3", xpos,ypos,zpos,0,"ONLY");
2616 xpos = -xpos;
2617 TVirtualMC::GetMC()->Gspos("UTE5",4,"UTI1", xpos,ypos,zpos,0,"ONLY");
2618 TVirtualMC::GetMC()->Gspos("UTE5",5,"UTI2", xpos,ypos,zpos,0,"ONLY");
2619 TVirtualMC::GetMC()->Gspos("UTE5",6,"UTI3", xpos,ypos,zpos,0,"ONLY");
2620
2621}
2622
2623//_____________________________________________________________________________
2624void AliTRDgeometry::AssembleChamber(Int_t ilayer, Int_t istack)
2625{
2626 //
2627 // Group volumes UA, UD, UF, UU into an assembly that defines the
2628 // alignable volume of a single readout chamber
2629 //
2630
2631 const Int_t kTag = 100;
2632 Char_t cTagV[kTag];
2633 Char_t cTagM[kTag];
2634
2635 Double_t xpos = 0.0;
2636 Double_t ypos = 0.0;
2637 Double_t zpos = 0.0;
2638
2639 Int_t idet = GetDetectorSec(ilayer,istack);
2640
2641 // Create the assembly for a given ROC
2642 snprintf(cTagM,kTag,"UT%02d",idet);
2643 TGeoVolume *roc = new TGeoVolumeAssembly(cTagM);
2644
2645 // Add the lower part of the chamber (aluminum frame),
2646 // including radiator and drift region
2647 xpos = 0.0;
2648 ypos = 0.0;
2649 zpos = fgkCraH/2.0 + fgkCdrH/2.0 - fgkCHsv/2.0;
2650 snprintf(cTagV,kTag,"UA%02d",idet);
2651 TGeoVolume *rocA = gGeoManager->GetVolume(cTagV);
2652 roc->AddNode(rocA,1,new TGeoTranslation(xpos,ypos,zpos));
2653
2654 // Add the additional aluminum ledges
2655 xpos = fgkCwidth[ilayer]/2.0 + fgkCalWmod/2.0;
2656 ypos = 0.0;
2657 zpos = fgkCraH + fgkCdrH - fgkCalZpos - fgkCalHmod/2.0 - fgkCHsv/2.0;
2658 snprintf(cTagV,kTag,"UZ%02d",idet);
2659 TGeoVolume *rocZ = gGeoManager->GetVolume(cTagV);
2660 roc->AddNode(rocZ,1,new TGeoTranslation( xpos,ypos,zpos));
2661 roc->AddNode(rocZ,2,new TGeoTranslation(-xpos,ypos,zpos));
2662
2663 // Add the additional wacosit ledges
2664 xpos = fgkCwidth[ilayer]/2.0 + fgkCwsW/2.0;
2665 ypos = 0.0;
2666 zpos = fgkCraH + fgkCdrH - fgkCwsH/2.0 - fgkCHsv/2.0;
2667 snprintf(cTagV,kTag,"UP%02d",idet);
2668 TGeoVolume *rocP = gGeoManager->GetVolume(cTagV);
2669 roc->AddNode(rocP,1,new TGeoTranslation( xpos,ypos,zpos));
2670 roc->AddNode(rocP,2,new TGeoTranslation(-xpos,ypos,zpos));
2671
2672 // Add the middle part of the chamber (G10 frame),
2673 // including amplification region
2674 xpos = 0.0;
2675 ypos = 0.0;
2676 zpos = fgkCamH/2.0 + fgkCraH + fgkCdrH - fgkCHsv/2.0;
2677 snprintf(cTagV,kTag,"UD%02d",idet);
2678 TGeoVolume *rocD = gGeoManager->GetVolume(cTagV);
2679 roc->AddNode(rocD,1,new TGeoTranslation(xpos,ypos,zpos));
2680
2681 // Add the upper part of the chamber (aluminum frame),
2682 // including back panel and FEE
2683 xpos = 0.0;
2684 ypos = 0.0;
2685 zpos = fgkCroH/2.0 + fgkCamH + fgkCraH + fgkCdrH - fgkCHsv/2.0;
2686 snprintf(cTagV,kTag,"UF%02d",idet);
2687 TGeoVolume *rocF = gGeoManager->GetVolume(cTagV);
2688 roc->AddNode(rocF,1,new TGeoTranslation(xpos,ypos,zpos));
2689
2690 // Add the volume with services on top of the back panel
2691 xpos = 0.0;
2692 ypos = 0.0;
2693 zpos = fgkCsvH/2.0 + fgkCroH + fgkCamH + fgkCraH + fgkCdrH - fgkCHsv/2.0;
2694 snprintf(cTagV,kTag,"UU%02d",idet);
2695 TGeoVolume *rocU = gGeoManager->GetVolume(cTagV);
2696 roc->AddNode(rocU,1,new TGeoTranslation(xpos,ypos,zpos));
2697
2698 // Place the ROC assembly into the super modules
2699 xpos = 0.0;
2700 ypos = 0.0;
2701 ypos = fgkClength[ilayer][0] + fgkClength[ilayer][1] + fgkClength[ilayer][2]/2.0;
2702 for (Int_t ic = 0; ic < istack; ic++) {
2703 ypos -= fgkClength[ilayer][ic];
2704 }
2705 ypos -= fgkClength[ilayer][istack]/2.0;
2706 zpos = fgkVrocsm + fgkSMpltT + fgkCHsv/2.0 - fgkSheight/2.0
2707 + ilayer * (fgkCH + fgkVspace);
2708 TGeoVolume *sm1 = gGeoManager->GetVolume("UTI1");
2709 TGeoVolume *sm2 = gGeoManager->GetVolume("UTI2");
2710 TGeoVolume *sm3 = gGeoManager->GetVolume("UTI3");
2711 sm1->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
2712 sm2->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
2713 if (istack != 2) {
2714 // w/o middle stack
2715 sm3->AddNode(roc,1,new TGeoTranslation(xpos,ypos,zpos));
2716 }
2717
2718}
2719
2720//_____________________________________________________________________________
2721Bool_t AliTRDgeometry::RotateBack(Int_t det
2722 , const Double_t * const loc
2723 , Double_t *glb) const
2724{
2725 //
2726 // Rotates a chambers to transform the corresponding local frame
2727 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
2728 //
2729
2730 Int_t sector = GetSector(det);
2731 Float_t phi = 2.0 * TMath::Pi() / (Float_t) fgkNsector * ((Float_t) sector + 0.5);
2732
2733 glb[0] = loc[0] * TMath::Cos(phi) - loc[1] * TMath::Sin(phi);
2734 glb[1] = loc[0] * TMath::Sin(phi) + loc[1] * TMath::Cos(phi);
2735 glb[2] = loc[2];
2736
2737 return kTRUE;
2738
2739}
2740
2741//_____________________________________________________________________________
2742Int_t AliTRDgeometry::GetDetectorSec(Int_t layer, Int_t stack)
2743{
2744 //
2745 // Convert plane / stack into detector number for one single sector
2746 //
2747
2748 return (layer + stack * fgkNlayer);
2749
2750}
2751
2752//_____________________________________________________________________________
2753Int_t AliTRDgeometry::GetDetector(Int_t layer, Int_t stack, Int_t sector)
2754{
2755 //
2756 // Convert layer / stack / sector into detector number
2757 //
2758
2759 return (layer + stack * fgkNlayer + sector * fgkNlayer * fgkNstack);
2760
2761}
2762
2763//_____________________________________________________________________________
2764Int_t AliTRDgeometry::GetLayer(Int_t det)
2765{
2766 //
2767 // Reconstruct the layer number from the detector number
2768 //
2769
2770 return ((Int_t) (det % fgkNlayer));
2771
2772}
2773
2774//_____________________________________________________________________________
2775Int_t AliTRDgeometry::GetStack(Int_t det)
2776{
2777 //
2778 // Reconstruct the stack number from the detector number
2779 //
2780
2781 return ((Int_t) (det % (fgkNlayer * fgkNstack)) / fgkNlayer);
2782
2783}
2784
2785//_____________________________________________________________________________
2786Int_t AliTRDgeometry::GetStack(Double_t z, Int_t layer)
2787{
2788 //
2789 // Reconstruct the chamber number from the z position and layer number
2790 //
2791 // The return function has to be protected for positiveness !!
2792 //
2793
2794 if ((layer < 0) ||
2795 (layer >= fgkNlayer)) return -1;
2796
2797 Int_t istck = fgkNstack;
2798 Double_t zmin = 0.0;
2799 Double_t zmax = 0.0;
2800
2801 do {
2802 istck--;
2803 if (istck < 0) break;
2804 AliTRDpadPlane *pp = GetPadPlane(layer,istck);
2805 zmax = pp->GetRow0();
2806 Int_t nrows = pp->GetNrows();
2807 zmin = zmax - 2 * pp->GetLengthOPad()
2808 - (nrows-2) * pp->GetLengthIPad()
2809 - (nrows-1) * pp->GetRowSpacing();
2810 } while((z < zmin) || (z > zmax));
2811
2812 return istck;
2813
2814}
2815
2816//_____________________________________________________________________________
2817Int_t AliTRDgeometry::GetSector(Int_t det)
2818{
2819 //
2820 // Reconstruct the sector number from the detector number
2821 //
2822
2823 return ((Int_t) (det / (fgkNlayer * fgkNstack)));
2824
2825}
2826
2827//_____________________________________________________________________________
2828AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t layer, Int_t stack)
2829{
2830 //
2831 // Returns the pad plane for a given plane <pl> and stack <st> number
2832 //
2833
2834 if (!fgPadPlaneArray) {
2835 CreatePadPlaneArray();
2836 }
2837
2838 Int_t ipp = GetDetectorSec(layer,stack);
2839 return ((AliTRDpadPlane *) fgPadPlaneArray->At(ipp));
2840
2841}
2842
2843//_____________________________________________________________________________
2844Int_t AliTRDgeometry::GetRowMax(Int_t layer, Int_t stack, Int_t /*sector*/)
2845{
2846 //
2847 // Returns the number of rows on the pad plane
2848 //
2849
2850 return GetPadPlane(layer,stack)->GetNrows();
2851
2852}
2853
2854//_____________________________________________________________________________
2855Int_t AliTRDgeometry::GetColMax(Int_t layer)
2856{
2857 //
2858 // Returns the number of rows on the pad plane
2859 //
2860
2861 return GetPadPlane(layer,0)->GetNcols();
2862
2863}
2864
2865//_____________________________________________________________________________
2866Double_t AliTRDgeometry::GetRow0(Int_t layer, Int_t stack, Int_t /*sector*/)
2867{
2868 //
2869 // Returns the position of the border of the first pad in a row
2870 //
2871
2872 return GetPadPlane(layer,stack)->GetRow0();
2873
2874}
2875
2876//_____________________________________________________________________________
2877Double_t AliTRDgeometry::GetCol0(Int_t layer)
2878{
2879 //
2880 // Returns the position of the border of the first pad in a column
2881 //
2882
2883 return GetPadPlane(layer,0)->GetCol0();
2884
2885}
2886
2887//_____________________________________________________________________________
2888Bool_t AliTRDgeometry::CreateClusterMatrixArray()
2889{
2890 //
2891 // Create the matrices to transform cluster coordinates from the
2892 // local chamber system to the tracking coordinate system
2893 //
2894
2895 if (!gGeoManager) {
2896 return kFALSE;
2897 }
2898
2899 if(fgClusterMatrixArray)
2900 return kTRUE;
2901
2902 TString volPath;
2903 TString vpStr = "ALIC_1/B077_1/BSEGMO";
2904 TString vpApp1 = "_1/BTRD";
2905 TString vpApp2 = "_1";
2906 TString vpApp3a = "/UTR1_1/UTS1_1/UTI1_1";
2907 TString vpApp3b = "/UTR2_1/UTS2_1/UTI2_1";
2908 TString vpApp3c = "/UTR3_1/UTS3_1/UTI3_1";
2909
2910 fgClusterMatrixArray = new TObjArray(kNdet);
2911 AliAlignObjParams o;
2912
2913 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
2914 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
2915
2916 Int_t isector = iModule/Nstack();
2917 Int_t istack = iModule%Nstack();
2918 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
2919 Int_t lid = GetDetector(iLayerTRD,istack,isector);
2920
2921 // Check for disabled supermodules
2922 volPath = vpStr;
2923 volPath += isector;
2924 volPath += vpApp1;
2925 volPath += isector;
2926 volPath += vpApp2;
2927 switch (isector) {
2928 case 13:
2929 case 14:
2930 case 15:
2931 // Check for holes in from of PHOS
2932 if (istack == 2) {
2933 continue;
2934 }
2935 volPath += vpApp3c;
2936 break;
2937 case 11:
2938 case 12:
2939 volPath += vpApp3b;
2940 break;
2941 default:
2942 volPath += vpApp3a;
2943 };
2944 if (!gGeoManager->CheckPath(volPath)) {
2945 continue;
2946 }
2947
2948 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
2949 const char *symname = AliGeomManager::SymName(volid);
2950 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
2951 const char *path = symname;
2952 if (pne) {
2953 path = pne->GetTitle();
2954 }
2955 else {
2956 continue;
2957 }
2958 if (!strstr(path,"ALIC")) {
2959 AliDebugClass(1,Form("Not a valid path: %s\n",path));
2960 continue;
2961 }
2962 if (!gGeoManager->cd(path)) {
2963 AliErrorClass(Form("Cannot go to path: %s\n",path));
2964 continue;
2965 }
2966 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
2967
2968 TGeoRotation mchange;
2969 mchange.RotateY(90);
2970 mchange.RotateX(90);
2971
2972 //
2973 // Cluster transformation matrix
2974 //
2975 TGeoHMatrix rotMatrix(mchange.Inverse());
2976 rotMatrix.MultiplyLeft(m);
2977 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2978 TGeoHMatrix rotSector;
2979 rotSector.RotateZ(sectorAngle);
2980 rotMatrix.MultiplyLeft(&rotSector.Inverse());
2981
2982 fgClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);
2983
2984 }
2985 }
2986
2987 return kTRUE;
2988
2989}
2990
2991//_____________________________________________________________________________
2992TGeoHMatrix *AliTRDgeometry::GetClusterMatrix(Int_t det)
2993{
2994 //
2995 // Returns the cluster transformation matrix for a given detector
2996 //
2997
2998 if (!fgClusterMatrixArray) {
2999 if (!CreateClusterMatrixArray()) {
3000 return NULL;
3001 }
3002 }
3003 return (TGeoHMatrix *) fgClusterMatrixArray->At(det);
3004
3005}
3006
3007//_____________________________________________________________________________
3008Bool_t AliTRDgeometry::ChamberInGeometry(Int_t det)
3009{
3010 //
3011 // Checks whether the given detector is part of the current geometry
3012 //
3013
3014 if (!GetClusterMatrix(det)) {
3015 return kFALSE;
3016 }
3017 else {
3018 return kTRUE;
3019 }
3020
3021}
3022
3023//_____________________________________________________________________________
3024Bool_t AliTRDgeometry::IsHole(Int_t /*la*/, Int_t st, Int_t se) const
3025{
3026 //
3027 // Checks for holes in front of PHOS
3028 //
3029
3030 if (((se == 13) || (se == 14) || (se == 15)) &&
3031 (st == 2)) {
3032 return kTRUE;
3033 }
3034
3035 return kFALSE;
3036
3037}
3038
3039//_____________________________________________________________________________
3040Bool_t AliTRDgeometry::IsOnBoundary(Int_t det, Float_t y, Float_t z, Float_t eps) const
3041{
3042 //
3043 // Checks whether position is at the boundary of the sensitive volume
3044 //
3045
3046 Int_t ly = GetLayer(det);
3047 if ((ly < 0) ||
3048 (ly >= fgkNlayer)) return kTRUE;
3049
3050 Int_t stk = GetStack(det);
3051 if ((stk < 0) ||
3052 (stk >= fgkNstack)) return kTRUE;
3053
3054 AliTRDpadPlane *pp = (AliTRDpadPlane*) fgPadPlaneArray->At(GetDetectorSec(ly, stk));
3055 if(!pp) return kTRUE;
3056
3057 Double_t max = pp->GetRow0();
3058 Int_t n = pp->GetNrows();
3059 Double_t min = max - 2 * pp->GetLengthOPad()
3060 - (n-2) * pp->GetLengthIPad()
3061 - (n-1) * pp->GetRowSpacing();
3062 if(z < min+eps || z > max-eps){
3063 //printf("z : min[%7.2f (%7.2f)] %7.2f max[(%7.2f) %7.2f]\n", min, min+eps, z, max-eps, max);
3064 return kTRUE;
3065 }
3066 min = pp->GetCol0();
3067 n = pp->GetNcols();
3068 max = min +2 * pp->GetWidthOPad()
3069 + (n-2) * pp->GetWidthIPad()
3070 + (n-1) * pp->GetColSpacing();
3071 if(y < min+eps || y > max-eps){
3072 //printf("y : min[%7.2f (%7.2f)] %7.2f max[(%7.2f) %7.2f]\n", min, min+eps, y, max-eps, max);
3073 return kTRUE;
3074 }
3075
3076 return kFALSE;
3077
3078}