]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDgeometry.cxx
Moved from Reve to Alieve.
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.cxx
CommitLineData
f7336fa3 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
afc51ac2 16/* $Id$ */
f7336fa3 17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// TRD geometry class //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
793ff80c 24
b4a9cd27 25#include <TGeoManager.h>
26#include <TGeoPhysicalNode.h>
27#include <TGeoMatrix.h>
28
2745a409 29#include "AliLog.h"
bdbb05bb 30#include "AliRunLoader.h"
b4a9cd27 31#include "AliAlignObj.h"
90dbf5fb 32#include "AliAlignObjParams.h"
ecb36af7 33#include "AliRun.h"
030b4415 34
ecb36af7 35#include "AliTRD.h"
3551db50 36#include "AliTRDcalibDB.h"
2745a409 37#include "AliTRDgeometry.h"
38#include "AliTRDpadPlane.h"
ecb36af7 39
f7336fa3 40ClassImp(AliTRDgeometry)
41
793ff80c 42//_____________________________________________________________________________
43
44 //
45 // The geometry constants
46 //
7925de54 47 const Int_t AliTRDgeometry::fgkNsect = kNsect;
48 const Int_t AliTRDgeometry::fgkNplan = kNplan;
49 const Int_t AliTRDgeometry::fgkNcham = kNcham;
50 const Int_t AliTRDgeometry::fgkNdet = kNdet;
793ff80c 51
52 //
53 // Dimensions of the detector
54 //
0a770ac9 55
0a5f3331 56 // Parameter of the BTRD mother volumes
7925de54 57 const Float_t AliTRDgeometry::fgkSheight = 77.9;
58 const Float_t AliTRDgeometry::fgkSwidth1 = 94.881;
59 const Float_t AliTRDgeometry::fgkSwidth2 = 122.353;
60 const Float_t AliTRDgeometry::fgkSlength = 751.0;
793ff80c 61
73ae7b59 62 // The super module side plates
7925de54 63 const Float_t AliTRDgeometry::fgkSMpltT = 0.2;
73ae7b59 64
0a770ac9 65 // Height of different chamber parts
66 // Radiator
7925de54 67 const Float_t AliTRDgeometry::fgkCraH = 4.8;
0a770ac9 68 // Drift region
7925de54 69 const Float_t AliTRDgeometry::fgkCdrH = 3.0;
0a770ac9 70 // Amplification region
7925de54 71 const Float_t AliTRDgeometry::fgkCamH = 0.7;
0a770ac9 72 // Readout
7925de54 73 const Float_t AliTRDgeometry::fgkCroH = 2.316;
0a770ac9 74 // Total height
7925de54 75 const Float_t AliTRDgeometry::fgkCH = AliTRDgeometry::fgkCraH
76 + AliTRDgeometry::fgkCdrH
77 + AliTRDgeometry::fgkCamH
25ca55ce 78 + AliTRDgeometry::fgkCroH;
0a770ac9 79
80 // Vertical spacing of the chambers
7925de54 81 const Float_t AliTRDgeometry::fgkVspace = 1.784;
0a770ac9 82 // Horizontal spacing of the chambers
7925de54 83 const Float_t AliTRDgeometry::fgkHspace = 2.0;
a797f961 84 // Radial distance of the first ROC to the outer plates of the SM
7925de54 85 const Float_t AliTRDgeometry::fgkVrocsm = 1.2;
a797f961 86
0a770ac9 87 // Thicknesses of different parts of the chamber frame
88 // Lower aluminum frame
7925de54 89 const Float_t AliTRDgeometry::fgkCalT = 0.4;
0a5f3331 90 // Lower Wacosit frame sides
7925de54 91 const Float_t AliTRDgeometry::fgkCclsT = 0.21;
0a5f3331 92 // Lower Wacosit frame front
7925de54 93 const Float_t AliTRDgeometry::fgkCclfT = 1.0;
0a5f3331 94 // Thickness of glue around radiator
7925de54 95 const Float_t AliTRDgeometry::fgkCglT = 0.25;
0a5f3331 96 // Upper Wacosit frame
7925de54 97 const Float_t AliTRDgeometry::fgkCcuT = 0.9;
0a5f3331 98 // Al frame of back panel
7925de54 99 const Float_t AliTRDgeometry::fgkCauT = 1.5;
0a5f3331 100 // Additional Al of the lower chamber frame
7925de54 101 const Float_t AliTRDgeometry::fgkCalW = 1.11;
0a770ac9 102
103 // Additional width of the readout chamber frames
7925de54 104 const Float_t AliTRDgeometry::fgkCroW = 0.9;
0a770ac9 105
106 // Difference of outer chamber width and pad plane width
7925de54 107 const Float_t AliTRDgeometry::fgkCpadW = 0.0;
108 const Float_t AliTRDgeometry::fgkRpadW = 1.0;
793ff80c 109
110 //
111 // Thickness of the the material layers
112 //
7925de54 113 const Float_t AliTRDgeometry::fgkMyThick = 0.005;
25ca55ce 114 const Float_t AliTRDgeometry::fgkRaThick = 0.3233;
7925de54 115 const Float_t AliTRDgeometry::fgkDrThick = AliTRDgeometry::fgkCdrH;
116 const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkCamH;
117 const Float_t AliTRDgeometry::fgkXeThick = AliTRDgeometry::fgkDrThick
118 + AliTRDgeometry::fgkAmThick;
119 const Float_t AliTRDgeometry::fgkWrThick = 0.0002;
25ca55ce 120 const Float_t AliTRDgeometry::fgkCuThick = 0.0072;
7925de54 121 const Float_t AliTRDgeometry::fgkGlThick = 0.05;
122 const Float_t AliTRDgeometry::fgkSuThick = 0.0919;
123 const Float_t AliTRDgeometry::fgkRcThick = 0.0058;
124 const Float_t AliTRDgeometry::fgkRpThick = 0.0632;
125 const Float_t AliTRDgeometry::fgkRoThick = 0.0028;
793ff80c 126
127 //
128 // Position of the material layers
129 //
7925de54 130 const Float_t AliTRDgeometry::fgkRaZpos = 0.0;
131 const Float_t AliTRDgeometry::fgkDrZpos = 2.4;
132 const Float_t AliTRDgeometry::fgkAmZpos = 0.0;
133 const Float_t AliTRDgeometry::fgkWrZpos = 0.0;
134 const Float_t AliTRDgeometry::fgkCuZpos = -0.9995;
135 const Float_t AliTRDgeometry::fgkGlZpos = -0.5;
136 const Float_t AliTRDgeometry::fgkSuZpos = 0.0;
137 const Float_t AliTRDgeometry::fgkRcZpos = 1.04;
138 const Float_t AliTRDgeometry::fgkRpZpos = 1.0;
139 const Float_t AliTRDgeometry::fgkRoZpos = 1.05;
140
25ca55ce 141 const Int_t AliTRDgeometry::fgkMCMmax = 16;
142 const Int_t AliTRDgeometry::fgkMCMrow = 4;
143 const Int_t AliTRDgeometry::fgkROBmaxC0 = 6;
144 const Int_t AliTRDgeometry::fgkROBmaxC1 = 8;
7925de54 145 const Int_t AliTRDgeometry::fgkADCmax = 21;
146 const Int_t AliTRDgeometry::fgkTBmax = 60;
25ca55ce 147 const Int_t AliTRDgeometry::fgkPadmax = 18;
7925de54 148 const Int_t AliTRDgeometry::fgkColmax = 144;
149 const Int_t AliTRDgeometry::fgkRowmaxC0 = 12;
150 const Int_t AliTRDgeometry::fgkRowmaxC1 = 16;
0a5f3331 151
ca06fab2 152 const Double_t AliTRDgeometry::fgkTime0Base = 300.65;
7925de54 153 const Float_t AliTRDgeometry::fgkTime0[6] = { fgkTime0Base + 0 * (Cheight() + Cspace())
154 , fgkTime0Base + 1 * (Cheight() + Cspace())
155 , fgkTime0Base + 2 * (Cheight() + Cspace())
156 , fgkTime0Base + 3 * (Cheight() + Cspace())
157 , fgkTime0Base + 4 * (Cheight() + Cspace())
158 , fgkTime0Base + 5 * (Cheight() + Cspace())};
793ff80c 159
f7336fa3 160//_____________________________________________________________________________
2745a409 161AliTRDgeometry::AliTRDgeometry()
162 :AliGeometry()
9a96f175 163 ,fClusterMatrixArray(0)
f162af62 164 ,fPadPlaneArray(0)
f7336fa3 165{
166 //
167 // AliTRDgeometry default constructor
168 //
bd0f8685 169
2745a409 170 Init();
171
172}
173
174//_____________________________________________________________________________
175AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
176 :AliGeometry(g)
9a96f175 177 ,fClusterMatrixArray(0)
f162af62 178 ,fPadPlaneArray(0)
2745a409 179{
180 //
181 // AliTRDgeometry copy constructor
182 //
bd0f8685 183
f7336fa3 184 Init();
bd0f8685 185
f7336fa3 186}
187
188//_____________________________________________________________________________
189AliTRDgeometry::~AliTRDgeometry()
190{
8230f242 191 //
192 // AliTRDgeometry destructor
193 //
bd0f8685 194
9a96f175 195 if (fClusterMatrixArray) {
196 fClusterMatrixArray->Delete();
197 delete fClusterMatrixArray;
198 fClusterMatrixArray = 0;
4d18f746 199 }
200
f162af62 201 if (fPadPlaneArray) {
202 fPadPlaneArray->Delete();
203 delete fPadPlaneArray;
204 fPadPlaneArray = 0;
205 }
206
f7336fa3 207}
208
2745a409 209//_____________________________________________________________________________
210AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
211{
212 //
213 // Assignment operator
214 //
215
0a5f3331 216 if (this != &g) {
217 Init();
218 }
030b4415 219
2745a409 220 return *this;
221
222}
223
f7336fa3 224//_____________________________________________________________________________
225void AliTRDgeometry::Init()
226{
227 //
228 // Initializes the geometry parameter
229 //
f7336fa3 230
0a770ac9 231 Int_t icham;
232 Int_t iplan;
233 Int_t isect;
234
235 // The outer width of the chambers
287c5d50 236 fCwidth[0] = 90.4;
e0d47c25 237 fCwidth[1] = 94.8;
238 fCwidth[2] = 99.3;
239 fCwidth[3] = 103.7;
240 fCwidth[4] = 108.1;
241 fCwidth[5] = 112.6;
0a770ac9 242
243 // The outer lengths of the chambers
73ae7b59 244 // Includes the spacings between the chambers!
8737e16f 245 Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 }
e0d47c25 246 , { 124.0, 124.0, 110.0, 124.0, 124.0 }
8737e16f 247 , { 131.0, 131.0, 110.0, 131.0, 131.0 }
248 , { 138.0, 138.0, 110.0, 138.0, 138.0 }
249 , { 145.0, 145.0, 110.0, 145.0, 145.0 }
e0d47c25 250 , { 147.0, 147.0, 110.0, 147.0, 147.0 } };
0a770ac9 251
252 for (icham = 0; icham < kNcham; icham++) {
253 for (iplan = 0; iplan < kNplan; iplan++) {
030b4415 254 fClength[iplan][icham] = length[iplan][icham];
0a770ac9 255 }
256 }
257
793ff80c 258 // The rotation matrix elements
030b4415 259 Float_t phi = 0.0;
793ff80c 260 for (isect = 0; isect < fgkNsect; isect++) {
439c63c8 261 phi = 2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5);
793ff80c 262 fRotB11[isect] = TMath::Cos(phi);
263 fRotB12[isect] = TMath::Sin(phi);
264 fRotB21[isect] = TMath::Sin(phi);
265 fRotB22[isect] = TMath::Cos(phi);
266 }
bd0f8685 267
f162af62 268 // Initialize the SM status
bd0f8685 269 for (isect = 0; isect < fgkNsect; isect++) {
270 SetSMstatus(isect,1);
271 }
793ff80c 272
273}
274
f162af62 275//_____________________________________________________________________________
276void AliTRDgeometry::CreatePadPlaneArray()
277{
278 //
279 // Creates the array of AliTRDpadPlane objects
280 //
281
282 if (fPadPlaneArray) {
283 fPadPlaneArray->Delete();
284 delete fPadPlaneArray;
285 }
286
287 fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);
288 for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
289 for (Int_t icham = 0; icham < fgkNcham; icham++) {
290 Int_t ipp = GetDetectorSec(iplan,icham);
291 fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
292 }
293 }
294
295}
296
297//_____________________________________________________________________________
298AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
299{
300 //
301 // Creates an AliTRDpadPlane object
302 //
303
304 AliTRDpadPlane *padPlane = new AliTRDpadPlane();
305
306 padPlane->SetPlane(iplan);
307 padPlane->SetChamber(icham);
308
309 padPlane->SetRowSpacing(0.0);
310 padPlane->SetColSpacing(0.0);
311
312 padPlane->SetLengthRim(1.0);
313 padPlane->SetWidthRim(0.5);
314
315 padPlane->SetNcols(144);
316
317 //
318 // The pad plane parameter
319 //
320 switch (iplan) {
321 case 0:
322 if (icham == 2) {
323 // L0C0 type
324 padPlane->SetNrows(12);
325 padPlane->SetLength(108.0);
326 padPlane->SetWidth(92.2);
327 padPlane->SetLengthOPad(8.0);
328 padPlane->SetWidthOPad(0.515);
329 padPlane->SetLengthIPad(9.0);
330 padPlane->SetWidthIPad(0.635);
331 padPlane->SetTiltingAngle(-2.0);
332 }
333 else {
334 // L0C1 type
335 padPlane->SetNrows(16);
336 padPlane->SetLength(122.0);
337 padPlane->SetWidth(92.2);
338 padPlane->SetLengthOPad(7.5);
339 padPlane->SetWidthOPad(0.515);
340 padPlane->SetLengthIPad(7.5);
341 padPlane->SetWidthIPad(0.635);
342 padPlane->SetTiltingAngle(-2.0);
343 }
344 break;
345 case 1:
346 if (icham == 2) {
347 // L1C0 type
348 padPlane->SetNrows(12);
349 padPlane->SetLength(108.0);
350 padPlane->SetWidth(96.6);
351 padPlane->SetLengthOPad(8.0);
352 padPlane->SetWidthOPad(0.585);
353 padPlane->SetLengthIPad(9.0);
354 padPlane->SetWidthIPad(0.665);
355 padPlane->SetTiltingAngle(2.0);
356 }
357 else {
358 // L1C1 type
359 padPlane->SetNrows(16);
360 padPlane->SetLength(122.0);
361 padPlane->SetWidth(96.6);
362 padPlane->SetLengthOPad(7.5);
363 padPlane->SetWidthOPad(0.585);
364 padPlane->SetLengthIPad(7.5);
365 padPlane->SetWidthIPad(0.665);
366 padPlane->SetTiltingAngle(2.0);
367 }
368 break;
369 case 2:
370 if (icham == 2) {
371 // L2C0 type
372 padPlane->SetNrows(12);
373 padPlane->SetLength(108.0);
374 padPlane->SetWidth(101.1);
375 padPlane->SetLengthOPad(8.0);
376 padPlane->SetWidthOPad(0.705);
377 padPlane->SetLengthIPad(9.0);
378 padPlane->SetWidthIPad(0.695);
379 padPlane->SetTiltingAngle(-2.0);
380 }
381 else {
382 // L2C1 type
383 padPlane->SetNrows(16);
384 padPlane->SetLength(129.0);
385 padPlane->SetWidth(101.1);
386 padPlane->SetLengthOPad(7.5);
387 padPlane->SetWidthOPad(0.705);
388 padPlane->SetLengthIPad(8.0);
389 padPlane->SetWidthIPad(0.695);
390 padPlane->SetTiltingAngle(-2.0);
391 }
392 break;
393 case 3:
394 if (icham == 2) {
395 // L3C0 type
396 padPlane->SetNrows(12);
397 padPlane->SetLength(108.0);
398 padPlane->SetWidth(105.5);
399 padPlane->SetLengthOPad(8.0);
400 padPlane->SetWidthOPad(0.775);
401 padPlane->SetLengthIPad(9.0);
402 padPlane->SetWidthIPad(0.725);
403 padPlane->SetTiltingAngle(2.0);
404 }
405 else {
406 // L3C1 type
407 padPlane->SetNrows(16);
408 padPlane->SetLength(136.0);
409 padPlane->SetWidth(105.5);
410 padPlane->SetLengthOPad(7.5);
411 padPlane->SetWidthOPad(0.775);
412 padPlane->SetLengthIPad(8.5);
413 padPlane->SetWidthIPad(0.725);
414 padPlane->SetTiltingAngle(2.0);
415 }
416 break;
417 case 4:
418 if (icham == 2) {
419 // L4C0 type
420 padPlane->SetNrows(12);
421 padPlane->SetLength(108.0);
422 padPlane->SetWidth(109.9);
423 padPlane->SetLengthOPad(8.0);
424 padPlane->SetWidthOPad(0.845);
425 padPlane->SetLengthIPad(9.0);
426 padPlane->SetWidthIPad(0.755);
427 padPlane->SetTiltingAngle(-2.0);
428 }
429 else {
430 // L4C1 type
431 padPlane->SetNrows(16);
432 padPlane->SetLength(143.0);
433 padPlane->SetWidth(109.9);
434 padPlane->SetLengthOPad(7.5);
435 padPlane->SetWidthOPad(0.845);
436 padPlane->SetLengthIPad(9.0);
437 padPlane->SetWidthIPad(0.755);
438 padPlane->SetTiltingAngle(-2.0);
439 }
440 break;
441 case 5:
442 if (icham == 2) {
443 // L5C0 type
444 padPlane->SetNrows(12);
445 padPlane->SetLength(108.0);
446 padPlane->SetWidth(114.4);
447 padPlane->SetLengthOPad(8.0);
448 padPlane->SetWidthOPad(0.965);
449 padPlane->SetLengthIPad(9.0);
450 padPlane->SetWidthIPad(0.785);
451 padPlane->SetTiltingAngle(2.0);
452 }
453 else {
454 // L5C1 type
455 padPlane->SetNrows(16);
456 padPlane->SetLength(145.0);
457 padPlane->SetWidth(114.4);
458 padPlane->SetLengthOPad(8.5);
459 padPlane->SetWidthOPad(0.965);
460 padPlane->SetLengthIPad(9.0);
461 padPlane->SetWidthIPad(0.785);
462 padPlane->SetTiltingAngle(2.0);
463 }
464 break;
465 };
466
467 //
468 // The positions of the borders of the pads
469 //
470 // Row direction
471 //
472 Double_t row = fClength[iplan][icham] / 2.0
473 - fgkRpadW
474 - padPlane->GetLengthRim();
475 for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
476 padPlane->SetPadRow(ir,row);
477 row -= padPlane->GetRowSpacing();
478 if (ir == 0) {
479 row -= padPlane->GetLengthOPad();
480 }
481 else {
482 row -= padPlane->GetLengthIPad();
483 }
484 }
485 //
486 // Column direction
487 //
488 Double_t col = fCwidth[iplan] / 2.0
489 + fgkCroW
490 - padPlane->GetWidthRim();
491 for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
492 padPlane->SetPadCol(ic,col);
493 col -= padPlane->GetColSpacing();
494 if (ic == 0) {
495 col -= padPlane->GetWidthOPad();
496 }
497 else {
498 col -= padPlane->GetWidthIPad();
499 }
500 }
501 // Calculate the offset to translate from the local ROC system into
502 // the local supermodule system, which is used for clusters
503 Double_t rowTmp = fClength[iplan][0]
504 + fClength[iplan][1]
505 + fClength[iplan][2] / 2.0;
506 for (Int_t ic = 0; ic < icham; ic++) {
507 rowTmp -= fClength[iplan][ic];
508 }
509 padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
510
511 return padPlane;
512
513}
514
f7336fa3 515//_____________________________________________________________________________
bd0f8685 516void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
517{
518 //
519 // Create the TRD geometry without hole
520 //
521 //
522 // Names of the TRD volumina (xx = detector number):
523 //
524 // Volume (Air) wrapping the readout chamber components
525 // UTxx includes: UAxx, UDxx, UFxx, UUxx
0a5f3331 526 //
527 // Volume (Air) wrapping the services (fee + cooling)
bd0f8685 528 // UUxx the services volume has been reduced by 7.42 mm
529 // in order to allow shifts in radial direction
530 //
0a5f3331 531 // Lower part of the readout chambers (drift volume + radiator)
bd0f8685 532 //
0a5f3331 533 // UAxx Aluminum frames (Al)
534 // UBxx Wacosit frames (C)
535 // UXxx Glue around radiator (Epoxy)
536 // UCxx Inner volumes (Air)
537 // UZxx Additional aluminum ledges (Al)
bd0f8685 538 //
539 // Upper part of the readout chambers (readout plane + fee)
540 //
0a5f3331 541 // UDxx Wacosit frames of amp. region (C)
542 // UExx Inner volumes of the frame (Air)
543 // UFxx Aluminum frame of back panel (Al)
544 // UGxx Inner volumes of the back panel (Air)
bd0f8685 545 //
546 // Inner material layers
547 //
0a5f3331 548 // UHxx Radiator (Rohacell)
549 // UJxx Drift volume (Xe/CO2)
550 // UKxx Amplification volume (Xe/CO2)
551 // UWxx Wire plane (Cu)
552 // ULxx Pad plane (Cu)
553 // UYxx Glue layer (Epoxy)
554 // UMxx Support structure (Rohacell)
555 // UNxx ROB base material (C)
556 // UOxx ROB copper (Cu)
557 // UVxx ROB other materials (Cu)
bd0f8685 558 //
559
560 const Int_t kNparTrd = 4;
561 const Int_t kNparCha = 3;
562
030b4415 563 Float_t xpos;
564 Float_t ypos;
565 Float_t zpos;
bd0f8685 566
567 Float_t parTrd[kNparTrd];
568 Float_t parCha[kNparCha];
569
570 Char_t cTagV[6];
571 Char_t cTagM[5];
572
e7014565 573 // There are three TRD volumes for the supermodules in order to accomodate
574 // the different arrangements in front of PHOS
575 // UTR1: Default supermodule
576 // UTR2: Supermodule in front of PHOS with double carbon cover
577 // UTR3: As UTR2, but w/o middle stack
578
bd0f8685 579 // The TRD mother volume for one sector (Air), full length in z-direction
580 // Provides material for side plates of super module
030b4415 581 parTrd[0] = fgkSwidth1/2.0;
582 parTrd[1] = fgkSwidth2/2.0;
0a5f3331 583 parTrd[2] = fgkSlength/2.0;
030b4415 584 parTrd[3] = fgkSheight/2.0;
bd0f8685 585 gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
e7014565 586 gMC->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
587 gMC->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
bd0f8685 588
a797f961 589 // The outer aluminum plates of the super module (Al)
030b4415 590 parTrd[0] = fgkSwidth1/2.0;
591 parTrd[1] = fgkSwidth2/2.0;
0a5f3331 592 parTrd[2] = fgkSlength/2.0;
030b4415 593 parTrd[3] = fgkSheight/2.0;
bd0f8685 594 gMC->Gsvolu("UTS1","TRD1",idtmed[1301-1],parTrd,kNparTrd);
e7014565 595 gMC->Gsvolu("UTS2","TRD1",idtmed[1301-1],parTrd,kNparTrd);
596 gMC->Gsvolu("UTS3","TRD1",idtmed[1301-1],parTrd,kNparTrd);
bd0f8685 597
598 // The inner part of the TRD mother volume for one sector (Air),
599 // full length in z-direction
030b4415 600 parTrd[0] = fgkSwidth1/2.0 - fgkSMpltT;
601 parTrd[1] = fgkSwidth2/2.0 - fgkSMpltT;
0a5f3331 602 parTrd[2] = fgkSlength/2.0;
030b4415 603 parTrd[3] = fgkSheight/2.0 - fgkSMpltT;
bd0f8685 604 gMC->Gsvolu("UTI1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
e7014565 605 gMC->Gsvolu("UTI2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
606 gMC->Gsvolu("UTI3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
bd0f8685 607
608 for (Int_t icham = 0; icham < kNcham; icham++) {
609 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
610
611 Int_t iDet = GetDetectorSec(iplan,icham);
612
0a5f3331 613 // The lower part of the readout chambers (drift volume + radiator)
bd0f8685 614 // The aluminum frames
615 sprintf(cTagV,"UA%02d",iDet);
030b4415 616 parCha[0] = fCwidth[iplan]/2.0;
617 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
618 parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0;
bd0f8685 619 fChamberUAboxd[iDet][0] = parCha[0];
620 fChamberUAboxd[iDet][1] = parCha[1];
621 fChamberUAboxd[iDet][2] = parCha[2];
622 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
0a5f3331 623 // The additional aluminum on the frames
624 // This part has not the correct postion but is just supposed to
625 // represent the missing material. The correct from of the L-shaped
626 // profile would not fit into the alignable volume.
627 sprintf(cTagV,"UZ%02d",iDet);
628 parCha[0] = fgkCroW/2.0;
629 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
630 parCha[2] = fgkCalW/2.0;
631 fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW;
632 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
633 // The Wacosit frames
bd0f8685 634 sprintf(cTagV,"UB%02d",iDet);
030b4415 635 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT;
636 parCha[1] = -1.0;
637 parCha[2] = -1.0;
bd0f8685 638 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
0a5f3331 639 // The glue around the radiator
640 sprintf(cTagV,"UX%02d",iDet);
030b4415 641 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
0a5f3331 642 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
643 parCha[2] = fgkCraH/2.0;
644 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
645 // The inner part of radiator (air)
646 sprintf(cTagV,"UC%02d",iDet);
647 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT;
648 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT;
030b4415 649 parCha[2] = -1.0;
bd0f8685 650 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
651
0a5f3331 652 // The upper part of the readout chambers (amplification volume)
653 // The Wacosit frames
bd0f8685 654 sprintf(cTagV,"UD%02d",iDet);
030b4415 655 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
656 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
657 parCha[2] = fgkCamH/2.0;
bd0f8685 658 fChamberUDboxd[iDet][0] = parCha[0];
659 fChamberUDboxd[iDet][1] = parCha[1];
660 fChamberUDboxd[iDet][2] = parCha[2];
661 gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
0a5f3331 662 // The inner part of the Wacosit frame (air)
bd0f8685 663 sprintf(cTagV,"UE%02d",iDet);
030b4415 664 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT;
0a5f3331 665 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT;
bd0f8685 666 parCha[2] = -1.;
667 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
0a5f3331 668
669 // The support structure (pad plane, back panel, readout boards)
bd0f8685 670 // The aluminum frames
671 sprintf(cTagV,"UF%02d",iDet);
030b4415 672 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW;
673 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
674 parCha[2] = fgkCroH/2.0;
bd0f8685 675 fChamberUFboxd[iDet][0] = parCha[0];
676 fChamberUFboxd[iDet][1] = parCha[1];
677 fChamberUFboxd[iDet][2] = parCha[2];
678 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
679 // The inner part of the aluminum frames
680 sprintf(cTagV,"UG%02d",iDet);
030b4415 681 parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT;
0a5f3331 682 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT;
030b4415 683 parCha[2] = -1.0;
bd0f8685 684 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
685
686 // The material layers inside the chambers
0a5f3331 687 // Rohacell layer (radiator)
030b4415 688 parCha[0] = -1.0;
689 parCha[1] = -1.0;
030b4415 690 parCha[2] = fgkRaThick/2.0;
bd0f8685 691 sprintf(cTagV,"UH%02d",iDet);
692 gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
bd0f8685 693 // Xe/Isobutane layer (drift volume)
0a5f3331 694 parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT;
695 parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT;
030b4415 696 parCha[2] = fgkDrThick/2.0;
bd0f8685 697 sprintf(cTagV,"UJ%02d",iDet);
698 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
699 // Xe/Isobutane layer (amplification volume)
0a5f3331 700 parCha[0] = -1.0;
701 parCha[1] = -1.0;
030b4415 702 parCha[2] = fgkAmThick/2.0;
bd0f8685 703 sprintf(cTagV,"UK%02d",iDet);
704 gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
0a5f3331 705 // Cu layer (wire plane)
706 parCha[0] = -1.0;
707 parCha[1] = -1.0;
708 parCha[2] = fgkWrThick/2.0;
709 sprintf(cTagV,"UW%02d",iDet);
710 gMC->Gsvolu(cTagV,"BOX ",idtmed[1303-1],parCha,kNparCha);
bd0f8685 711 // Cu layer (pad plane)
0a5f3331 712 parCha[0] = -1.0;
713 parCha[1] = -1.0;
030b4415 714 parCha[2] = fgkCuThick/2.0;
bd0f8685 715 sprintf(cTagV,"UL%02d",iDet);
716 gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
0a5f3331 717 // Epoxy layer (glue)
718 parCha[0] = -1.0;
719 parCha[1] = -1.0;
720 parCha[2] = fgkGlThick/2.0;
721 sprintf(cTagV,"UY%02d",iDet);
722 gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha);
bd0f8685 723 // G10 layer (support structure / honeycomb)
0a5f3331 724 parCha[0] = -1.0;
725 parCha[1] = -1.0;
030b4415 726 parCha[2] = fgkSuThick/2.0;
bd0f8685 727 sprintf(cTagV,"UM%02d",iDet);
0a5f3331 728 gMC->Gsvolu(cTagV,"BOX ",idtmed[1310-1],parCha,kNparCha);
729 // G10 layer (PCB readout board)
730 parCha[0] = -1.0;
731 parCha[1] = -1.0;
a797f961 732 parCha[2] = fgkRpThick/2;
733 sprintf(cTagV,"UN%02d",iDet);
734 gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
0a5f3331 735 // Cu layer (traces in readout board)
736 parCha[0] = -1.0;
737 parCha[1] = -1.0;
030b4415 738 parCha[2] = fgkRcThick/2.0;
a797f961 739 sprintf(cTagV,"UO%02d",iDet);
740 gMC->Gsvolu(cTagV,"BOX ",idtmed[1306-1],parCha,kNparCha);
0a5f3331 741 // Cu layer (other material on in readout board)
742 parCha[0] = -1.0;
743 parCha[1] = -1.0;
744 parCha[2] = fgkRoThick/2.0;
745 sprintf(cTagV,"UV%02d",iDet);
746 gMC->Gsvolu(cTagV,"BOX ",idtmed[1304-1],parCha,kNparCha);
bd0f8685 747
748 // Position the layers in the chambers
030b4415 749 xpos = 0.0;
750 ypos = 0.0;
bd0f8685 751 // Lower part
752 // Rohacell layer (radiator)
753 zpos = fgkRaZpos;
754 sprintf(cTagV,"UH%02d",iDet);
755 sprintf(cTagM,"UC%02d",iDet);
756 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
bd0f8685 757 // Xe/Isobutane layer (drift volume)
758 zpos = fgkDrZpos;
759 sprintf(cTagV,"UJ%02d",iDet);
0a5f3331 760 sprintf(cTagM,"UB%02d",iDet);
bd0f8685 761 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
762 // Upper part
763 // Xe/Isobutane layer (amplification volume)
764 zpos = fgkAmZpos;
765 sprintf(cTagV,"UK%02d",iDet);
766 sprintf(cTagM,"UE%02d",iDet);
767 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 768 // Cu layer (wire plane inside amplification volume)
769 zpos = fgkWrZpos;
770 sprintf(cTagV,"UW%02d",iDet);
771 sprintf(cTagM,"UK%02d",iDet);
772 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
773 // Readout part + support plane
bd0f8685 774 // Cu layer (pad plane)
775 zpos = fgkCuZpos;
776 sprintf(cTagV,"UL%02d",iDet);
777 sprintf(cTagM,"UG%02d",iDet);
778 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 779 // Epoxy layer (glue)
780 zpos = fgkGlZpos;
781 sprintf(cTagV,"UY%02d",iDet);
782 sprintf(cTagM,"UG%02d",iDet);
783 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
bd0f8685 784 // G10 layer (support structure)
785 zpos = fgkSuZpos;
786 sprintf(cTagV,"UM%02d",iDet);
787 sprintf(cTagM,"UG%02d",iDet);
788 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 789 // G10 layer (PCB readout board)
a797f961 790 zpos = fgkRpZpos;
791 sprintf(cTagV,"UN%02d",iDet);
792 sprintf(cTagM,"UG%02d",iDet);
793 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 794 // Cu layer (traces in readout board)
a797f961 795 zpos = fgkRcZpos;
796 sprintf(cTagV,"UO%02d",iDet);
797 sprintf(cTagM,"UG%02d",iDet);
798 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 799 // Cu layer (other materials on readout board)
800 zpos = fgkRoZpos;
801 sprintf(cTagV,"UV%02d",iDet);
802 sprintf(cTagM,"UG%02d",iDet);
803 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
bd0f8685 804
805 // Position the inner volumes of the chambers in the frames
030b4415 806 xpos = 0.0;
807 ypos = 0.0;
0a5f3331 808 // The inner part of the radiator
030b4415 809 zpos = 0.0;
bd0f8685 810 sprintf(cTagV,"UC%02d",iDet);
0a5f3331 811 sprintf(cTagM,"UX%02d",iDet);
812 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
813 // The glue around the radiator
814 zpos = fgkCraH/2.0 - fgkCdrH/2.0 - fgkCraH/2.0;
815 sprintf(cTagV,"UX%02d",iDet);
bd0f8685 816 sprintf(cTagM,"UB%02d",iDet);
817 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 818 // The lower Wacosit frame inside the aluminum frame
819 zpos = 0.0;
bd0f8685 820 sprintf(cTagV,"UB%02d",iDet);
821 sprintf(cTagM,"UA%02d",iDet);
822 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
0a5f3331 823 // The inside of the upper Wacosit frame
824 zpos = 0.0;
bd0f8685 825 sprintf(cTagV,"UE%02d",iDet);
826 sprintf(cTagM,"UD%02d",iDet);
827 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
828 // The inside of the upper aluminum frame
0a5f3331 829 zpos = 0.0;
bd0f8685 830 sprintf(cTagV,"UG%02d",iDet);
831 sprintf(cTagM,"UF%02d",iDet);
832 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
833
834 // Position the frames of the chambers in the TRD mother volume
030b4415 835 xpos = 0.0;
8a497c18 836 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
bd0f8685 837 for (Int_t ic = 0; ic < icham; ic++) {
8a497c18 838 ypos -= fClength[iplan][ic];
bd0f8685 839 }
8a497c18 840 ypos -= fClength[iplan][icham]/2.0;
841 zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0
a797f961 842 + iplan * (fgkCH + fgkVspace);
bd0f8685 843 // The lower aluminum frame, radiator + drift region
844 sprintf(cTagV,"UA%02d",iDet);
845 fChamberUAorig[iDet][0] = xpos;
846 fChamberUAorig[iDet][1] = ypos;
847 fChamberUAorig[iDet][2] = zpos;
848 // The upper G10 frame, amplification region
849 sprintf(cTagV,"UD%02d",iDet);
030b4415 850 zpos += fgkCamH/2.0 + fgkCraH/2.0 + fgkCdrH/2.0;
bd0f8685 851 fChamberUDorig[iDet][0] = xpos;
852 fChamberUDorig[iDet][1] = ypos;
853 fChamberUDorig[iDet][2] = zpos;
854 // The upper aluminum frame
855 sprintf(cTagV,"UF%02d",iDet);
030b4415 856 zpos += fgkCroH/2.0 + fgkCamH/2.0;
bd0f8685 857 fChamberUForig[iDet][0] = xpos;
858 fChamberUForig[iDet][1] = ypos;
859 fChamberUForig[iDet][2] = zpos;
860
861 }
862 }
863
864 // Create the volumes of the super module frame
865 CreateFrame(idtmed);
866
867 // Create the volumes of the services
868 CreateServices(idtmed);
869
870 for (Int_t icham = 0; icham < kNcham; icham++) {
871 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
872 GroupChamber(iplan,icham,idtmed);
873 }
874 }
875
030b4415 876 xpos = 0.0;
877 ypos = 0.0;
878 zpos = 0.0;
bd0f8685 879 gMC->Gspos("UTI1",1,"UTS1",xpos,ypos,zpos,0,"ONLY");
e7014565 880 gMC->Gspos("UTI2",1,"UTS2",xpos,ypos,zpos,0,"ONLY");
881 gMC->Gspos("UTI3",1,"UTS3",xpos,ypos,zpos,0,"ONLY");
bd0f8685 882
030b4415 883 xpos = 0.0;
884 ypos = 0.0;
885 zpos = 0.0;
bd0f8685 886 gMC->Gspos("UTS1",1,"UTR1",xpos,ypos,zpos,0,"ONLY");
e7014565 887 gMC->Gspos("UTS2",1,"UTR2",xpos,ypos,zpos,0,"ONLY");
888 gMC->Gspos("UTS3",1,"UTR3",xpos,ypos,zpos,0,"ONLY");
bd0f8685 889
890 // Put the TRD volumes into the space frame mother volumes
891 // if enabled via status flag
030b4415 892 xpos = 0.0;
893 ypos = 0.0;
894 zpos = 0.0;
bd0f8685 895 for (Int_t isect = 0; isect < kNsect; isect++) {
896 if (fSMstatus[isect]) {
897 sprintf(cTagV,"BTRD%d",isect);
e7014565 898 switch (isect) {
899 case 13:
900 case 14:
901 case 15:
902 // Double carbon, w/o middle stack
903 gMC->Gspos("UTR3",1,cTagV,xpos,ypos,zpos,0,"ONLY");
904 break;
905 case 11:
906 case 12:
907 // Double carbon, all stacks
908 gMC->Gspos("UTR2",1,cTagV,xpos,ypos,zpos,0,"ONLY");
909 break;
910 default:
911 // Standard supermodule
912 gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY");
913 };
bd0f8685 914 }
915 }
916
917}
918
919//_____________________________________________________________________________
920void AliTRDgeometry::CreateFrame(Int_t *idtmed)
921{
922 //
923 // Create the geometry of the frame of the supermodule
924 //
925 // Names of the TRD services volumina
926 //
927 // USRL Support rails for the chambers (Al)
928 // USxx Support cross bars between the chambers (Al)
0a5f3331 929 // USHx Horizontal connection between the cross bars (Al)
930 // USLx Long corner ledges (Al)
bd0f8685 931 //
932
933 Int_t iplan = 0;
934
935 Float_t xpos = 0.0;
936 Float_t ypos = 0.0;
937 Float_t zpos = 0.0;
938
939 Char_t cTagV[5];
0a5f3331 940 Char_t cTagM[5];
941
942 // The rotation matrices
943 const Int_t kNmatrix = 4;
944 Int_t matrix[kNmatrix];
945 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
946 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
947 gMC->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
948 gMC->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
bd0f8685 949
950 //
951 // The chamber support rails
952 //
953
030b4415 954 const Float_t kSRLwid = 2.00;
bd0f8685 955 const Float_t kSRLhgt = 2.3;
0a5f3331 956 const Float_t kSRLdst = 1.0;
bd0f8685 957 const Int_t kNparSRL = 3;
958 Float_t parSRL[kNparSRL];
0a5f3331 959 parSRL[0] = kSRLwid /2.0;
960 parSRL[1] = fgkSlength/2.0;
961 parSRL[2] = kSRLhgt /2.0;
bd0f8685 962 gMC->Gsvolu("USRL","BOX ",idtmed[1301-1],parSRL,kNparSRL);
963
964 xpos = 0.0;
965 ypos = 0.0;
966 zpos = 0.0;
967 for (iplan = 0; iplan < kNplan; iplan++) {
0a5f3331 968 xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst;
bd0f8685 969 ypos = 0.0;
0a5f3331 970 zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH
971 - fgkSheight/2.0
bd0f8685 972 + iplan * (fgkCH + fgkVspace);
973 gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY");
974 gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY");
bd0f8685 975 }
976
977 //
978 // The cross bars between the chambers
979 //
980
981 const Float_t kSCBwid = 1.0;
0a5f3331 982 const Float_t kSCBthk = 2.0;
983 const Float_t kSCHhgt = 0.3;
984
bd0f8685 985 const Int_t kNparSCB = 3;
986 Float_t parSCB[kNparSCB];
030b4415 987 parSCB[1] = kSCBwid/2.0;
0a5f3331 988 parSCB[2] = fgkCH /2.0 + fgkVspace/2.0 - kSCHhgt;
989
990 const Int_t kNparSCI = 3;
991 Float_t parSCI[kNparSCI];
992 parSCI[1] = -1;
bd0f8685 993
994 xpos = 0.0;
995 ypos = 0.0;
996 zpos = 0.0;
997 for (iplan = 0; iplan < kNplan; iplan++) {
998
0a5f3331 999 // The aluminum of the cross bars
030b4415 1000 parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0;
0a5f3331 1001 sprintf(cTagV,"USF%01d",iplan);
bd0f8685 1002 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB);
bd0f8685 1003
0a5f3331 1004 // The empty regions in the cross bars
1005 Float_t thkSCB = kSCBthk;
1006 if (iplan < 2) {
1007 thkSCB *= 1.5;
1008 }
1009 parSCI[2] = parSCB[2] - thkSCB;
1010 parSCI[0] = parSCB[0]/4.0 - kSCBthk;
1011 sprintf(cTagV,"USI%01d",iplan);
1012 gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI);
bd0f8685 1013
0a5f3331 1014 sprintf(cTagV,"USI%01d",iplan);
1015 sprintf(cTagM,"USF%01d",iplan);
1016 ypos = 0.0;
1017 zpos = 0.0;
1018 xpos = parSCI[0] + thkSCB/2.0;
1019 gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
1020 xpos = - parSCI[0] - thkSCB/2.0;
1021 gMC->Gspos(cTagV,2,cTagM,xpos,ypos,zpos,0,"ONLY");
1022 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1023 gMC->Gspos(cTagV,3,cTagM,xpos,ypos,zpos,0,"ONLY");
1024 xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB;
1025 gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY");
1026
1027 sprintf(cTagV,"USF%01d",iplan);
bd0f8685 1028 xpos = 0.0;
0a5f3331 1029 zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0
1030 + iplan * (fgkCH + fgkVspace);
1031
1032 ypos = fgkSlength/2.0 - kSCBwid/2.0;
bd0f8685 1033 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
1034
0a5f3331 1035 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1];
1036 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
1037
1038 ypos = fClength[iplan][2]/2.0;
1039 gMC->Gspos(cTagV,3,"UTI1", xpos,ypos,zpos,0,"ONLY");
1040
030b4415 1041 ypos = - fClength[iplan][2]/2.0;
0a5f3331 1042 gMC->Gspos(cTagV,4,"UTI1", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1043
030b4415 1044 ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1];
0a5f3331 1045 gMC->Gspos(cTagV,5,"UTI1", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1046
0a5f3331 1047 ypos = - fgkSlength/2.0 + kSCBwid/2.0;
1048 gMC->Gspos(cTagV,6,"UTI1", xpos,ypos,zpos,0,"ONLY");
1049
1050 }
1051
1052 //
1053 // The horizontal connections between the cross bars
1054 //
1055
1056 const Int_t kNparSCH = 3;
1057 Float_t parSCH[kNparSCH];
1058
1059 for (iplan = 1; iplan < kNplan-1; iplan++) {
1060
1061 parSCH[0] = fCwidth[iplan]/2.0;
1062 parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1]
1063 - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0;
1064 parSCH[2] = kSCHhgt/2.0;
1065
1066 sprintf(cTagV,"USH%01d",iplan);
1067 gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH);
bd0f8685 1068 xpos = 0.0;
0a5f3331 1069 ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1];
1070 zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0
1071 + (iplan+1) * (fgkCH + fgkVspace);
bd0f8685 1072 gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY");
0a5f3331 1073 ypos = -ypos;
1074 gMC->Gspos(cTagV,2,"UTI1", xpos,ypos,zpos,0,"ONLY");
bd0f8685 1075
1076 }
1077
0a5f3331 1078 //
1079 // The long corner ledges
1080 //
1081
1082 const Int_t kNparSCL = 3;
1083 Float_t parSCL[kNparSCL];
1084 const Int_t kNparSCLb = 11;
1085 Float_t parSCLb[kNparSCLb];
1086
1087 // Upper ledges
1088 // Thickness of the corner ledges
1089 const Float_t kSCLthkUa = 0.6;
1090 const Float_t kSCLthkUb = 0.6;
1091 // Width of the corner ledges
1092 const Float_t kSCLwidUa = 3.2;
1093 const Float_t kSCLwidUb = 4.8;
1094 // Position of the corner ledges
1095 const Float_t kSCLposxUa = 0.7;
1096 const Float_t kSCLposxUb = 3.3;
1097 const Float_t kSCLposzUa = 1.6;
1098 const Float_t kSCLposzUb = 0.3;
1099 // Vertical
1100 parSCL[0] = kSCLthkUa /2.0;
1101 parSCL[1] = fgkSlength/2.0;
1102 parSCL[2] = kSCLwidUa /2.0;
1103 gMC->Gsvolu("USL1","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1104 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUa;
1105 ypos = 0.0;
1106 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUa;
1107 gMC->Gspos("USL1",1,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1108 xpos = -xpos;
1109 gMC->Gspos("USL1",2,"UTI1", xpos,ypos,zpos,matrix[1],"ONLY");
1110 // Horizontal
1111 parSCL[0] = kSCLwidUb /2.0;
1112 parSCL[1] = fgkSlength/2.0;
1113 parSCL[2] = kSCLthkUb /2.0;
1114 gMC->Gsvolu("USL2","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1115 xpos = fgkSwidth2/2.0 - fgkSMpltT - kSCLposxUb;
1116 ypos = 0.0;
1117 zpos = fgkSheight/2.0 - fgkSMpltT - kSCLposzUb;
1118 gMC->Gspos("USL2",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1119 xpos = -xpos;
1120 gMC->Gspos("USL2",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1121
1122 // Lower ledges
1123 // Thickness of the corner ledges
1124 const Float_t kSCLthkLa = 2.464;
1125 const Float_t kSCLthkLb = 1.0;
1126 // Width of the corner ledges
1127 const Float_t kSCLwidLa = 8.5;
1128 const Float_t kSCLwidLb = 3.3;
1129 // Position of the corner ledges
1130 const Float_t kSCLposxLa = 0.0;
1131 const Float_t kSCLposxLb = 2.6;
1132 const Float_t kSCLposzLa = -4.25;
1133 const Float_t kSCLposzLb = -0.5;
1134 // Vertical
1135 // Trapezoidal shape
1136 parSCLb[ 0] = fgkSlength/2.0;
1137 parSCLb[ 1] = 0.0;
1138 parSCLb[ 2] = 0.0;
1139 parSCLb[ 3] = kSCLwidLa /2.0;
1140 parSCLb[ 4] = kSCLthkLb /2.0;
1141 parSCLb[ 5] = kSCLthkLa /2.0;
1142 parSCLb[ 6] = 5.0;
1143 parSCLb[ 7] = kSCLwidLa /2.0;
1144 parSCLb[ 8] = kSCLthkLb /2.0;
1145 parSCLb[ 9] = kSCLthkLa /2.0;
1146 parSCLb[10] = 5.0;
1147 gMC->Gsvolu("USL3","TRAP",idtmed[1301-1],parSCLb,kNparSCLb);
1148 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLa;
1149 ypos = 0.0;
1150 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLa;
1151 gMC->Gspos("USL3",1,"UTI1", xpos,ypos,zpos,matrix[2],"ONLY");
1152 xpos = -xpos;
1153 gMC->Gspos("USL3",2,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1154 // Horizontal
1155 parSCL[0] = kSCLwidLb /2.0;
1156 parSCL[1] = fgkSlength/2.0;
1157 parSCL[2] = kSCLthkLb /2.0;
1158 gMC->Gsvolu("USL4","BOX ",idtmed[1301-1],parSCL,kNparSCL);
1159 xpos = fgkSwidth1/2.0 - fgkSMpltT - kSCLposxLb;
1160 ypos = 0.0;
1161 zpos = - fgkSheight/2.0 + fgkSMpltT - kSCLposzLb;
1162 gMC->Gspos("USL4",1,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1163 xpos = -xpos;
1164 gMC->Gspos("USL4",2,"UTI1", xpos,ypos,zpos, 0,"ONLY");
1165
bd0f8685 1166}
1167
1168//_____________________________________________________________________________
1169void AliTRDgeometry::CreateServices(Int_t *idtmed)
1170{
1171 //
1172 // Create the geometry of the services
1173 //
1174 // Names of the TRD services volumina
1175 //
1176 // UTCL Cooling arterias (Al)
1177 // UTCW Cooling arterias (Water)
1178 // UUxx Volumes for the services at the chambers (Air)
1179 // UTPW Power bars (Cu)
0a5f3331 1180 // UTCP Cooling pipes (Fe)
bd0f8685 1181 // UTCH Cooling pipes (Water)
1182 // UTPL Power lines (Cu)
1183 // UMCM Readout MCMs (G10/Cu/Si)
1184 //
1185
1186 Int_t iplan = 0;
1187 Int_t icham = 0;
1188
1189 Float_t xpos = 0.0;
1190 Float_t ypos = 0.0;
1191 Float_t zpos = 0.0;
1192
1193 Char_t cTagV[5];
1194
1195 // The rotation matrices
99ed5146 1196 const Int_t kNmatrix = 4;
bd0f8685 1197 Int_t matrix[kNmatrix];
030b4415 1198 gMC->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1199 gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1200 gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
99ed5146 1201 gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
bd0f8685 1202
1203 //
1204 // The cooling arterias
1205 //
1206
1207 // Width of the cooling arterias
0a5f3331 1208 const Float_t kCOLwid = 0.8;
bd0f8685 1209 // Height of the cooling arterias
0a5f3331 1210 const Float_t kCOLhgt = 6.5;
bd0f8685 1211 // Positioning of the cooling
0a5f3331 1212 const Float_t kCOLposx = 1.8;
1213 const Float_t kCOLposz = -0.1;
bd0f8685 1214 // Thickness of the walls of the cooling arterias
1215 const Float_t kCOLthk = 0.1;
030b4415 1216 const Int_t kNparCOL = 3;
bd0f8685 1217 Float_t parCOL[kNparCOL];
0a5f3331 1218 parCOL[0] = kCOLwid /2.0;
1219 parCOL[1] = fgkSlength/2.0;
1220 parCOL[2] = kCOLhgt /2.0;
1221 gMC->Gsvolu("UTCL","BOX ",idtmed[1308-1],parCOL,kNparCOL);
bd0f8685 1222 parCOL[0] -= kCOLthk;
0a5f3331 1223 parCOL[1] = fgkSlength/2.0;
bd0f8685 1224 parCOL[2] -= kCOLthk;
1225 gMC->Gsvolu("UTCW","BOX ",idtmed[1314-1],parCOL,kNparCOL);
1226
1227 xpos = 0.0;
1228 ypos = 0.0;
1229 zpos = 0.0;
1230 gMC->Gspos("UTCW",1,"UTCL", xpos,ypos,zpos,0,"ONLY");
1231
99ed5146 1232 for (iplan = 1; iplan < kNplan; iplan++) {
1233
030b4415 1234 xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx;
bd0f8685 1235 ypos = 0.0;
0a5f3331 1236 zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz
a797f961 1237 + iplan * (fgkCH + fgkVspace);
99ed5146 1238 gMC->Gspos("UTCL",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1239 gMC->Gspos("UTCL",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
1240
bd0f8685 1241 }
1242
99ed5146 1243 // The upper most layer (reaching into TOF acceptance)
0a5f3331 1244 xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3;
99ed5146 1245 ypos = 0.0;
0a5f3331 1246 zpos = fgkSheight/2.0 - fgkSMpltT - 0.4 - kCOLwid/2.0;
99ed5146 1247 gMC->Gspos("UTCL",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1248 gMC->Gspos("UTCL",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1249
bd0f8685 1250 //
1251 // The power bars
1252 //
1253
1254 const Float_t kPWRwid = 0.6;
0a5f3331 1255 const Float_t kPWRhgt = 5.0;
1256 const Float_t kPWRposx = 1.4;
1257 const Float_t kPWRposz = 1.9;
030b4415 1258 const Int_t kNparPWR = 3;
bd0f8685 1259 Float_t parPWR[kNparPWR];
0a5f3331 1260 parPWR[0] = kPWRwid /2.0;
1261 parPWR[1] = fgkSlength/2.0;
1262 parPWR[2] = kPWRhgt /2.0;
bd0f8685 1263 gMC->Gsvolu("UTPW","BOX ",idtmed[1325-1],parPWR,kNparPWR);
1264
99ed5146 1265 for (iplan = 1; iplan < kNplan; iplan++) {
bd0f8685 1266
030b4415 1267 xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx;
bd0f8685 1268 ypos = 0.0;
0a5f3331 1269 zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz
a797f961 1270 + iplan * (fgkCH + fgkVspace);
99ed5146 1271 gMC->Gspos("UTPW",iplan ,"UTI1", xpos,ypos,zpos,matrix[0],"ONLY");
1272 gMC->Gspos("UTPW",iplan+kNplan,"UTI1",-xpos,ypos,zpos,matrix[1],"ONLY");
bd0f8685 1273
1274 }
1275
99ed5146 1276 // The upper most layer (reaching into TOF acceptance)
0a5f3331 1277 xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3;
99ed5146 1278 ypos = 0.0;
0a5f3331 1279 zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0;
99ed5146 1280 gMC->Gspos("UTPW",6 ,"UTI1", xpos,ypos,zpos,matrix[3],"ONLY");
1281 gMC->Gspos("UTPW",6+kNplan,"UTI1",-xpos,ypos,zpos,matrix[3],"ONLY");
1282
bd0f8685 1283 //
1284 // The volumes for the services at the chambers
1285 //
1286
1287 const Int_t kNparServ = 3;
1288 Float_t parServ[kNparServ];
1289
1290 for (icham = 0; icham < kNcham; icham++) {
1291 for (iplan = 0; iplan < kNplan; iplan++) {
bd0f8685 1292
1293 Int_t iDet = GetDetectorSec(iplan,icham);
1294
1295 sprintf(cTagV,"UU%02d",iDet);
0a5f3331 1296 parServ[0] = fCwidth[iplan] /2.0;
030b4415 1297 parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0;
0a5f3331 1298 parServ[2] = fgkVspace /2.0 - 0.742/2.0;
bd0f8685 1299 fChamberUUboxd[iDet][0] = parServ[0];
1300 fChamberUUboxd[iDet][1] = parServ[1];
1301 fChamberUUboxd[iDet][2] = parServ[2];
bd0f8685 1302 gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ);
a797f961 1303
0a5f3331 1304 xpos = 0.0;
8a497c18 1305 ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0;
bd0f8685 1306 for (Int_t ic = 0; ic < icham; ic++) {
8a497c18 1307 ypos -= fClength[iplan][ic];
bd0f8685 1308 }
8a497c18 1309 ypos -= fClength[iplan][icham]/2.0;
1310 zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0
a797f961 1311 + iplan * (fgkCH + fgkVspace);
030b4415 1312 zpos -= 0.742/2.0;
bd0f8685 1313 fChamberUUorig[iDet][0] = xpos;
1314 fChamberUUorig[iDet][1] = ypos;
1315 fChamberUUorig[iDet][2] = zpos;
1316
1317 }
1318 }
1319
1320 //
1321 // The cooling pipes inside the service volumes
1322 //
1323
1324 const Int_t kNparTube = 3;
1325 Float_t parTube[kNparTube];
0a5f3331 1326 // The cooling pipes
e7014565 1327 parTube[0] = 0.0;
1328 parTube[1] = 0.0;
1329 parTube[2] = 0.0;
bd0f8685 1330 gMC->Gsvolu("UTCP","TUBE",idtmed[1324-1],parTube,0);
1331 // The cooling water
1332 parTube[0] = 0.0;
030b4415 1333 parTube[1] = 0.2/2.0;
e7014565 1334 parTube[2] = -1.0;
bd0f8685 1335 gMC->Gsvolu("UTCH","TUBE",idtmed[1314-1],parTube,kNparTube);
1336 // Water inside the cooling pipe
1337 xpos = 0.0;
1338 ypos = 0.0;
1339 zpos = 0.0;
1340 gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY");
1341
1342 // Position the cooling pipes in the mother volume
1343 const Int_t kNpar = 3;
1344 Float_t par[kNpar];
1345 for (icham = 0; icham < kNcham; icham++) {
1346 for (iplan = 0; iplan < kNplan; iplan++) {
bd0f8685 1347 Int_t iDet = GetDetectorSec(iplan,icham);
1348 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
f162af62 1349 Int_t nMCMrow = GetRowMax(iplan,icham,0);
030b4415 1350 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
bd0f8685 1351 / ((Float_t) nMCMrow);
1352 sprintf(cTagV,"UU%02d",iDet);
1353 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1354 xpos = 0.0;
1355 ypos = (0.5 + iMCMrow) * ySize - 1.9
030b4415 1356 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1357 zpos = 0.0 + 0.742/2.0;
e7014565 1358 // The cooling pipes
bd0f8685 1359 par[0] = 0.0;
030b4415 1360 par[1] = 0.3/2.0; // Thickness of the cooling pipes
1361 par[2] = fCwidth[iplan]/2.0;
bd0f8685 1362 gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1363 ,matrix[2],"ONLY",par,kNpar);
1364 }
1365 }
1366 }
1367
1368 //
1369 // The power lines
1370 //
1371
1372 // The copper power lines
1373 parTube[0] = 0.0;
1374 parTube[1] = 0.0;
1375 parTube[2] = 0.0;
1376 gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0);
1377
1378 // Position the power lines in the mother volume
1379 for (icham = 0; icham < kNcham; icham++) {
1380 for (iplan = 0; iplan < kNplan; iplan++) {
bd0f8685 1381 Int_t iDet = GetDetectorSec(iplan,icham);
1382 Int_t iCopy = GetDetector(iplan,icham,0) * 100;
f162af62 1383 Int_t nMCMrow = GetRowMax(iplan,icham,0);
030b4415 1384 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
bd0f8685 1385 / ((Float_t) nMCMrow);
1386 sprintf(cTagV,"UU%02d",iDet);
1387 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1388 xpos = 0.0;
1389 ypos = (0.5 + iMCMrow) * ySize - 1.0
030b4415 1390 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1391 zpos = -0.4 + 0.742/2.0;
bd0f8685 1392 par[0] = 0.0;
030b4415 1393 par[1] = 0.2/2.0; // Thickness of the power lines
1394 par[2] = fCwidth[iplan]/2.0;
bd0f8685 1395 gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos
1396 ,matrix[2],"ONLY",par,kNpar);
1397 }
1398 }
1399 }
1400
1401 //
1402 // The MCMs
1403 //
1404
1f766e4b 1405 const Float_t kMCMx = 3.0;
1406 const Float_t kMCMy = 3.0;
1407 const Float_t kMCMz = 0.3;
1408
1409 const Float_t kMCMpcTh = 0.1;
1410 const Float_t kMCMcuTh = 0.0025;
1411 const Float_t kMCMsiTh = 0.03;
1412 const Float_t kMCMcoTh = 0.04;
0a5f3331 1413
bd0f8685 1414 // The mother volume for the MCMs (air)
1415 const Int_t kNparMCM = 3;
1416 Float_t parMCM[kNparMCM];
0a5f3331 1417 parMCM[0] = kMCMx /2.0;
1418 parMCM[1] = kMCMy /2.0;
1419 parMCM[2] = kMCMz /2.0;
bd0f8685 1420 gMC->Gsvolu("UMCM","BOX",idtmed[1302-1],parMCM,kNparMCM);
1421
1422 // The MCM carrier G10 layer
0a5f3331 1423 parMCM[0] = kMCMx /2.0;
1424 parMCM[1] = kMCMy /2.0;
1425 parMCM[2] = kMCMpcTh/2.0;
bd0f8685 1426 gMC->Gsvolu("UMC1","BOX",idtmed[1319-1],parMCM,kNparMCM);
1427 // The MCM carrier Cu layer
0a5f3331 1428 parMCM[0] = kMCMx /2.0;
1429 parMCM[1] = kMCMy /2.0;
1430 parMCM[2] = kMCMcuTh/2.0;
bd0f8685 1431 gMC->Gsvolu("UMC2","BOX",idtmed[1318-1],parMCM,kNparMCM);
1432 // The silicon of the chips
0a5f3331 1433 parMCM[0] = kMCMx /2.0;
1434 parMCM[1] = kMCMy /2.0;
1435 parMCM[2] = kMCMsiTh/2.0;
bd0f8685 1436 gMC->Gsvolu("UMC3","BOX",idtmed[1320-1],parMCM,kNparMCM);
0a5f3331 1437 // The aluminum of the cooling plates
1438 parMCM[0] = kMCMx /2.0;
1439 parMCM[1] = kMCMy /2.0;
1440 parMCM[2] = kMCMcoTh/2.0;
1441 gMC->Gsvolu("UMC4","BOX",idtmed[1324-1],parMCM,kNparMCM);
bd0f8685 1442
1443 // Put the MCM material inside the MCM mother volume
1444 xpos = 0.0;
1445 ypos = 0.0;
0a5f3331 1446 zpos = -kMCMz /2.0 + kMCMpcTh/2.0;
bd0f8685 1447 gMC->Gspos("UMC1",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 1448 zpos += kMCMpcTh/2.0 + kMCMcuTh/2.0;
bd0f8685 1449 gMC->Gspos("UMC2",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 1450 zpos += kMCMcuTh/2.0 + kMCMsiTh/2.0;
bd0f8685 1451 gMC->Gspos("UMC3",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
0a5f3331 1452 zpos += kMCMsiTh/2.0 + kMCMcoTh/2.0;
1453 gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY");
bd0f8685 1454
1455 // Position the MCMs in the mother volume
1456 for (icham = 0; icham < kNcham; icham++) {
1457 for (iplan = 0; iplan < kNplan; iplan++) {
bd0f8685 1458 Int_t iDet = GetDetectorSec(iplan,icham);
1459 Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
f162af62 1460 Int_t nMCMrow = GetRowMax(iplan,icham,0);
030b4415 1461 Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
bd0f8685 1462 / ((Float_t) nMCMrow);
1463 Int_t nMCMcol = 8;
0a5f3331 1464 Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW)
bd0f8685 1465 / ((Float_t) nMCMcol);
1466 sprintf(cTagV,"UU%02d",iDet);
1467 for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1468 for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
1469 xpos = (0.5 + iMCMcol) * xSize + 1.0
030b4415 1470 - fCwidth[iplan]/2.0;
1f766e4b 1471 ypos = (0.5 + iMCMrow) * ySize + 1.0
030b4415 1472 - fClength[iplan][icham]/2.0 + fgkHspace/2.0;
1473 zpos = -0.4 + 0.742/2.0;
bd0f8685 1474 par[0] = 0.0;
030b4415 1475 par[1] = 0.2/2.0; // Thickness of the power lines
1476 par[2] = fCwidth[iplan]/2.0;
bd0f8685 1477 gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV
1478 ,xpos,ypos,zpos,0,"ONLY");
1479 }
1480 }
1481
1482 }
1483 }
1484
1485}
1486
1487//_____________________________________________________________________________
1488void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed)
f7336fa3 1489{
1490 //
bd0f8685 1491 // Group volumes UA, UD, UF, UU in a single chamber (Air)
1492 // UA, UD, UF, UU are boxes
1493 // UT will be a box
0a770ac9 1494 //
bd0f8685 1495
1496 const Int_t kNparCha = 3;
1497
1498 Int_t iDet = GetDetectorSec(iplan,icham);
1499
1500 Float_t xyzMin[3];
1501 Float_t xyzMax[3];
1502 Float_t xyzOrig[3];
1503 Float_t xyzBoxd[3];
1504
1505 Char_t cTagV[5];
1506 Char_t cTagM[5];
1507
1508 for (Int_t i = 0; i < 3; i++) {
030b4415 1509 xyzMin[i] = +9999.0;
1510 xyzMax[i] = -9999.0;
bd0f8685 1511 }
1512
1513 for (Int_t i = 0; i < 3; i++) {
1514
1515 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUAorig[iDet][i]-fChamberUAboxd[iDet][i]);
1516 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUAorig[iDet][i]+fChamberUAboxd[iDet][i]);
1517
1518 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUDorig[iDet][i]-fChamberUDboxd[iDet][i]);
1519 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUDorig[iDet][i]+fChamberUDboxd[iDet][i]);
1520
1521 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUForig[iDet][i]-fChamberUFboxd[iDet][i]);
1522 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUForig[iDet][i]+fChamberUFboxd[iDet][i]);
1523
a797f961 1524 xyzMin[i] = TMath::Min(xyzMin[i],fChamberUUorig[iDet][i]-fChamberUUboxd[iDet][i]);
1525 xyzMax[i] = TMath::Max(xyzMax[i],fChamberUUorig[iDet][i]+fChamberUUboxd[iDet][i]);
bd0f8685 1526
1527 xyzOrig[i] = 0.5*(xyzMax[i]+xyzMin[i]);
1528 xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
1529
1530 }
1531
1532 sprintf(cTagM,"UT%02d",iDet);
bd0f8685 1533 gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
1534
1535 sprintf(cTagV,"UA%02d",iDet);
0a5f3331 1536 gMC->Gspos(cTagV,1,cTagM
1537 ,fChamberUAorig[iDet][0]-xyzOrig[0]
1538 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1539 ,fChamberUAorig[iDet][2]-xyzOrig[2]
1540 ,0,"ONLY");
1541
1542 sprintf(cTagV,"UZ%02d",iDet);
1543 gMC->Gspos(cTagV,1,cTagM
1544 ,fChamberUAorig[iDet][0]-xyzOrig[0] + fChamberUAboxd[iDet][0] - fgkCroW/2.0
1545 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1546 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1547 ,0,"ONLY");
1548 gMC->Gspos(cTagV,2,cTagM
1549 ,fChamberUAorig[iDet][0]-xyzOrig[0] - fChamberUAboxd[iDet][0] + fgkCroW/2.0
1550 ,fChamberUAorig[iDet][1]-xyzOrig[1]
1551 ,fChamberUAorig[iDet][2]-xyzOrig[2] + fgkCraH/2.0 + fgkCdrH/2.0 - fgkCalW/2.0
1552 ,0,"ONLY");
bd0f8685 1553
1554 sprintf(cTagV,"UD%02d",iDet);
0a5f3331 1555 gMC->Gspos(cTagV,1,cTagM
1556 ,fChamberUDorig[iDet][0]-xyzOrig[0]
1557 ,fChamberUDorig[iDet][1]-xyzOrig[1]
1558 ,fChamberUDorig[iDet][2]-xyzOrig[2]
1559 ,0,"ONLY");
bd0f8685 1560
1561 sprintf(cTagV,"UF%02d",iDet);
0a5f3331 1562 gMC->Gspos(cTagV,1,cTagM
1563 ,fChamberUForig[iDet][0]-xyzOrig[0]
1564 ,fChamberUForig[iDet][1]-xyzOrig[1]
1565 ,fChamberUForig[iDet][2]-xyzOrig[2]
1566 ,0,"ONLY");
bd0f8685 1567
a797f961 1568 sprintf(cTagV,"UU%02d",iDet);
0a5f3331 1569 gMC->Gspos(cTagV,1,cTagM
1570 ,fChamberUUorig[iDet][0]-xyzOrig[0]
1571 ,fChamberUUorig[iDet][1]-xyzOrig[1]
1572 ,fChamberUUorig[iDet][2]-xyzOrig[2]
1573 ,0,"ONLY");
bd0f8685 1574
1575 sprintf(cTagV,"UT%02d",iDet);
0a5f3331 1576 gMC->Gspos(cTagV,1,"UTI1"
1577 ,xyzOrig[0]
1578 ,xyzOrig[1]
1579 ,xyzOrig[2]
1580 ,0,"ONLY");
e7014565 1581 gMC->Gspos(cTagV,1,"UTI2"
1582 ,xyzOrig[0]
1583 ,xyzOrig[1]
1584 ,xyzOrig[2]
1585 ,0,"ONLY");
1586 if (icham != 2) {
1587 // W/o middle stack
1588 gMC->Gspos(cTagV,1,"UTI3"
1589 ,xyzOrig[0]
1590 ,xyzOrig[1]
1591 ,xyzOrig[2]
1592 ,0,"ONLY");
1593 }
f7336fa3 1594
1595}
1596
25ca55ce 1597//_____________________________________________________________________________
2669905c 1598Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const
25ca55ce 1599{
1600 //
2669905c 1601 // Rotates a chambers to transform the corresponding local frame
1602 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
25ca55ce 1603 //
1604
2669905c 1605 Int_t sector = GetSector(det);
25ca55ce 1606
2669905c 1607 glb[0] = loc[0] * fRotB11[sector] - loc[1] * fRotB12[sector];
1608 glb[1] = loc[0] * fRotB21[sector] + loc[1] * fRotB22[sector];
1609 glb[2] = loc[2];
f7336fa3 1610
1611 return kTRUE;
1612
1613}
1614
1615//_____________________________________________________________________________
3551db50 1616Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c)
0a770ac9 1617{
1618 //
1619 // Convert plane / chamber into detector number for one single sector
1620 //
1621
1622 return (p + c * fgkNplan);
1623
1624}
1625
1626//_____________________________________________________________________________
3551db50 1627Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s)
f7336fa3 1628{
1629 //
1630 // Convert plane / chamber / sector into detector number
1631 //
1632
793ff80c 1633 return (p + c * fgkNplan + s * fgkNplan * fgkNcham);
f7336fa3 1634
1635}
1636
1637//_____________________________________________________________________________
c6011b06 1638Int_t AliTRDgeometry::GetPlane(Int_t d)
f7336fa3 1639{
1640 //
1641 // Reconstruct the plane number from the detector number
1642 //
1643
793ff80c 1644 return ((Int_t) (d % fgkNplan));
f7336fa3 1645
1646}
1647
1648//_____________________________________________________________________________
afc51ac2 1649Int_t AliTRDgeometry::GetChamber(Int_t d) const
f7336fa3 1650{
1651 //
1652 // Reconstruct the chamber number from the detector number
1653 //
1654
793ff80c 1655 return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan);
f7336fa3 1656
1657}
1658
1659//_____________________________________________________________________________
afc51ac2 1660Int_t AliTRDgeometry::GetSector(Int_t d) const
f7336fa3 1661{
1662 //
1663 // Reconstruct the sector number from the detector number
1664 //
1665
793ff80c 1666 return ((Int_t) (d / (fgkNplan * fgkNcham)));
f7336fa3 1667
1668}
1669
7925de54 1670//_____________________________________________________________________________
f162af62 1671AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
7925de54 1672{
f162af62 1673 //
1674 // Returns the pad plane for a given plane <p> and chamber <c> number
1675 //
7925de54 1676
f162af62 1677 if (!fPadPlaneArray) {
1678 CreatePadPlaneArray();
1679 }
1680
1681 Int_t ipp = GetDetectorSec(p,c);
1682 return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
1683
1684}
1685
1686//_____________________________________________________________________________
1687Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
1688{
1689 //
1690 // Returns the number of rows on the pad plane
1691 //
1692
1693 return GetPadPlane(p,c)->GetNrows();
1694
1695}
1696
1697//_____________________________________________________________________________
1698Int_t AliTRDgeometry::GetColMax(Int_t p)
1699{
1700 //
1701 // Returns the number of rows on the pad plane
1702 //
1703
1704 return GetPadPlane(p,0)->GetNcols();
1705
1706}
1707
1708//_____________________________________________________________________________
1709Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
1710{
1711 //
1712 // Returns the position of the border of the first pad in a row
1713 //
1714
1715 return GetPadPlane(p,c)->GetRow0();
1716
1717}
1718
1719//_____________________________________________________________________________
1720Double_t AliTRDgeometry::GetCol0(Int_t p)
1721{
1722 //
1723 // Returns the position of the border of the first pad in a column
1724 //
1725
1726 return GetPadPlane(p,0)->GetCol0();
1727
1728}
1729
1730//_____________________________________________________________________________
ecf39416 1731//Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
1732//{
f162af62 1733 //
1734 // Return on which row this mcm sits
1735 //
ecf39416 1736//
1737// return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
1738//
1739//}
7925de54 1740
1741//_____________________________________________________________________________
ecf39416 1742//Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
1743//{
7925de54 1744 //
f162af62 1745 // Return which pad is connected to this adc channel. return -1 if it
25ca55ce 1746 // is one of the not directly connected adc channels (0, 1 20)
7925de54 1747 //
ecf39416 1748//
1749// if (iadc < 2 || iadc > 19 ) return -1;
1750//
1751// return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2;
1752//
1753//}
7925de54 1754
1755//_____________________________________________________________________________
ecf39416 1756//Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
1757//{
f162af62 1758 //
1759 // Return on which mcm this pad is
1760 //
ecf39416 1761//
1762// if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
1763//
1764// return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow);
1765//
1766//}
7925de54 1767
1768//_____________________________________________________________________________
ecf39416 1769//Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
1770//{
f162af62 1771 //
1772 // Return on which rob this pad is
1773 //
ecf39416 1774//
1775// return (irow/fgkMCMrow)*2 + GetColSide(icol);
1776//
1777//}
7925de54 1778
1779//_____________________________________________________________________________
ecf39416 1780//Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
1781//{
f162af62 1782 //
1783 // Return on which side this rob sits (A side = 0, B side = 1)
1784 //
ecf39416 1785//
1786// if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
1787//
1788// return irob%2;
1789//
1790//}
7925de54 1791
1792//_____________________________________________________________________________
ecf39416 1793//Int_t AliTRDgeometry::GetColSide(Int_t icol) const
1794//{
bdbb05bb 1795 //
f162af62 1796 // Return on which side this column sits (A side = 0, B side = 1)
bdbb05bb 1797 //
ecf39416 1798//
1799// if ( icol < 0 || icol >= fgkColmax ) return -1;
1800//
1801// return icol/(fgkColmax/2);
1802//
1803//}
b4a9cd27 1804
1805//_____________________________________________________________________________
9a96f175 1806Bool_t AliTRDgeometry::CreateClusterMatrixArray()
bd0f8685 1807{
b4a9cd27 1808 //
9a96f175 1809 // Create the matrices to transform cluster coordinates from the
1810 // local chamber system to the tracking coordinate system
b4a9cd27 1811 //
1812
030b4415 1813 if (!gGeoManager) {
1814 return kFALSE;
1815 }
0a5f3331 1816
9a96f175 1817 fClusterMatrixArray = new TObjArray(kNdet);
90dbf5fb 1818 AliAlignObjParams o;
bd0f8685 1819
ae079791 1820 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
1821 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
030b4415 1822
ae079791 1823 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
1824 const char *symname = AliGeomManager::SymName(volid);
0a5f3331 1825 TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
1826 const char *path = symname;
1827 if (pne) {
1828 path = pne->GetTitle();
1829 }
9a96f175 1830 if (!strstr(path,"ALIC")) {
1831 AliDebug(1,Form("Not a valid path: %s\n",path));
1832 continue;
1833 }
0a5f3331 1834 if (!gGeoManager->cd(path)) {
9a96f175 1835 continue;
0a5f3331 1836 }
c127f13a 1837 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
ae079791 1838 Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1;
8a497c18 1839 Int_t isector = iModule/Ncham();
1840 Int_t ichamber = iModule%Ncham();
25ca55ce 1841 Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
25ca55ce 1842
1843 TGeoRotation mchange;
1844 mchange.RotateY(90);
c127f13a 1845 mchange.RotateX(90);
1846
c127f13a 1847 //
1848 // Cluster transformation matrix
1849 //
1850 TGeoHMatrix rotMatrix(mchange.Inverse());
1851 rotMatrix.MultiplyLeft(m);
030b4415 1852 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
c127f13a 1853 TGeoHMatrix rotSector;
b4a9cd27 1854 rotSector.RotateZ(sectorAngle);
8a497c18 1855 rotMatrix.MultiplyLeft(&rotSector.Inverse());
c127f13a 1856
9a96f175 1857 fClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);
bd0f8685 1858
25ca55ce 1859 }
b4a9cd27 1860 }
bd0f8685 1861
b4a9cd27 1862 return kTRUE;
b4a9cd27 1863
bd0f8685 1864}
25ca55ce 1865