Project
Loading...
Searching...
No Matches
Geometry.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include <TGeoManager.h>
13#include <TGeoPhysicalNode.h>
14#include <TMath.h>
15#include <TVirtualMC.h>
16#include <fairlogger/Logger.h>
17
19#include "MathUtils/Utils.h" // math_utils::bit2Mask
20#include "TRDBase/Geometry.h"
21#include "TRDBase/PadPlane.h"
22
23using namespace o2::trd;
24using namespace o2::trd::constants;
25
26//_____________________________________________________________________________
27
29
30//_____________________________________________________________________________
31Geometry::Geometry() : GeometryBase(), o2::detectors::DetMatrixCacheIndirect(sDetID)
32{
33 createPadPlaneArray();
34}
35
36//_____________________________________________________________________________
37bool Geometry::rotateBack(int det, const float* const loc, float* glb) const
38{
39 //
40 // Rotates a chambers to transform the corresponding local frame
41 // coordinates <loc> into the coordinates of the ALICE restframe <glb>.
42 //
43
44 int sector = getSector(det);
45 float phi = 2.0 * TMath::Pi() / (float)NSECTOR * ((float)sector + 0.5);
46
47 glb[0] = loc[0] * TMath::Cos(phi) - loc[1] * TMath::Sin(phi);
48 glb[1] = loc[0] * TMath::Sin(phi) + loc[1] * TMath::Cos(phi);
49 glb[2] = loc[2];
50
51 return true;
52}
53
54//_____________________________________________________________________________
56{
57 //
58 // Creates the array of PadPlane objects
59 //
60
61 for (int ilayer = 0; ilayer < NLAYER; ilayer++) {
62 for (int istack = 0; istack < NSTACK; istack++) {
63 createPadPlane(ilayer, istack);
64 }
65 }
66}
67
68//_____________________________________________________________________________
69void Geometry::createPadPlane(int ilayer, int istack)
70{
71 //
72 // Creates an PadPlane object
73 //
74 int ipp = getDetectorSec(ilayer, istack);
75 auto& padPlane = mPadPlanes[ipp];
76
77 padPlane.setLayer(ilayer);
78 padPlane.setStack(istack);
79
80 padPlane.setRowSpacing(0.0);
81 padPlane.setColSpacing(0.0);
82
83 padPlane.setLengthRim(1.0);
84 padPlane.setWidthRim(0.5);
85
86 padPlane.setNcols(144);
87
88 padPlane.setAnodeWireOffset(0.25);
89
90 //
91 // The pad plane parameter
92 //
93 const float kTiltAngle = 2.0;
94 switch (ilayer) {
95 case 0:
96 if (istack == 2) {
97 // L0C0 type
98 padPlane.setNrows(12);
99 padPlane.setLength(108.0);
100 padPlane.setLengthOPad(8.0);
101 padPlane.setLengthIPad(9.0);
102 } else {
103 // L0C1 type
104 padPlane.setNrows(16);
105 padPlane.setLength(122.0);
106 padPlane.setLengthOPad(7.5);
107 padPlane.setLengthIPad(7.5);
108 }
109 padPlane.setWidth(92.2);
110 padPlane.setWidthOPad(0.515);
111 padPlane.setWidthIPad(0.635);
112 padPlane.setTiltingAngle(-kTiltAngle);
113 break;
114 case 1:
115 if (istack == 2) {
116 // L1C0 type
117 padPlane.setNrows(12);
118 padPlane.setLength(108.0);
119 padPlane.setLengthOPad(8.0);
120 padPlane.setLengthIPad(9.0);
121 } else {
122 // L1C1 type
123 padPlane.setNrows(16);
124 padPlane.setLength(122.0);
125 padPlane.setLengthOPad(7.5);
126 padPlane.setLengthIPad(7.5);
127 }
128 padPlane.setWidth(96.6);
129 padPlane.setWidthOPad(0.585);
130 padPlane.setWidthIPad(0.665);
131 padPlane.setTiltingAngle(kTiltAngle);
132 break;
133 case 2:
134 if (istack == 2) {
135 // L2C0 type
136 padPlane.setNrows(12);
137 padPlane.setLength(108.0);
138 padPlane.setLengthOPad(8.0);
139 padPlane.setLengthIPad(9.0);
140 } else {
141 // L2C1 type
142 padPlane.setNrows(16);
143 padPlane.setLength(129.0);
144 padPlane.setLengthOPad(7.5);
145 padPlane.setLengthIPad(8.0);
146 }
147 padPlane.setWidth(101.1);
148 padPlane.setWidthOPad(0.705);
149 padPlane.setWidthIPad(0.695);
150 padPlane.setTiltingAngle(-kTiltAngle);
151 break;
152 case 3:
153 if (istack == 2) {
154 // L3C0 type
155 padPlane.setNrows(12);
156 padPlane.setLength(108.0);
157 padPlane.setLengthOPad(8.0);
158 padPlane.setLengthIPad(9.0);
159 } else {
160 // L3C1 type
161 padPlane.setNrows(16);
162 padPlane.setLength(136.0);
163 padPlane.setLengthOPad(7.5);
164 padPlane.setLengthIPad(8.5);
165 }
166 padPlane.setWidth(105.5);
167 padPlane.setWidthOPad(0.775);
168 padPlane.setWidthIPad(0.725);
169 padPlane.setTiltingAngle(kTiltAngle);
170 break;
171 case 4:
172 if (istack == 2) {
173 // L4C0 type
174 padPlane.setNrows(12);
175 padPlane.setLength(108.0);
176 padPlane.setLengthOPad(8.0);
177 } else {
178 // L4C1 type
179 padPlane.setNrows(16);
180 padPlane.setLength(143.0);
181 padPlane.setLengthOPad(7.5);
182 }
183 padPlane.setWidth(109.9);
184 padPlane.setWidthOPad(0.845);
185 padPlane.setLengthIPad(9.0);
186 padPlane.setWidthIPad(0.755);
187 padPlane.setTiltingAngle(-kTiltAngle);
188 break;
189 case 5:
190 if (istack == 2) {
191 // L5C0 type
192 padPlane.setNrows(12);
193 padPlane.setLength(108.0);
194 padPlane.setLengthOPad(8.0);
195 } else {
196 // L5C1 type
197 padPlane.setNrows(16);
198 padPlane.setLength(145.0);
199 padPlane.setLengthOPad(8.5);
200 }
201 padPlane.setWidth(114.4);
202 padPlane.setWidthOPad(0.965);
203 padPlane.setLengthIPad(9.0);
204 padPlane.setWidthIPad(0.785);
205 padPlane.setTiltingAngle(kTiltAngle);
206 break;
207 };
208
209 //
210 // The positions of the borders of the pads
211 //
212 // Row direction
213 //
214 float row = CLENGTH[ilayer][istack] / 2.0 - RPADW - padPlane.getLengthRim();
215 for (int ir = 0; ir < padPlane.getNrows(); ir++) {
216 padPlane.setPadRow(ir, row);
217 row -= padPlane.getRowSpacing();
218 if (ir == 0) {
219 row -= padPlane.getLengthOPad();
220 } else {
221 row -= padPlane.getLengthIPad();
222 }
223 }
224 //
225 // Column direction
226 //
227 float col = -CWIDTH[ilayer] / 2.0 - CROW + padPlane.getWidthRim();
228 for (int ic = 0; ic < padPlane.getNcols(); ic++) {
229 padPlane.setPadCol(ic, col);
230 col += padPlane.getColSpacing();
231 if (ic == 0) {
232 col += padPlane.getWidthOPad();
233 } else {
234 col += padPlane.getWidthIPad();
235 }
236 }
237 // Calculate the offset to translate from the local ROC system into
238 // the local supermodule system, which is used for clusters
239 float rowTmp = CLENGTH[ilayer][0] + CLENGTH[ilayer][1] + CLENGTH[ilayer][2] / 2.0;
240 for (int jstack = 0; jstack < istack; jstack++) {
241 rowTmp -= CLENGTH[ilayer][jstack];
242 }
243 padPlane.setPadRowSMOffset(rowTmp - CLENGTH[ilayer][istack] / 2.0);
244}
245
246void Geometry::createVolume(const char* name, const char* shape, int nmed, float* upar, int np)
247{
248 TVirtualMC::GetMC()->Gsvolu(name, shape, nmed, upar, np);
249
250 // add to sensitive volumes for TRD if matching criterion
251 // these are coded with J+K in the second character (according to AliTRDv1.cxx of AliROOT)
252 if (name[1] == 'J' || name[1] == 'K') {
253 mSensitiveVolumeNames.emplace_back(name);
254 }
255}
256
257//_____________________________________________________________________________
258void Geometry::createGeometry(std::vector<int> const& idtmed)
259{
260 //
261 // Create the TRD geometry
262
263 if (!gGeoManager) {
264 // RSTODO: in future there will be a method to load matrices from the CDB
265 LOG(fatal) << "Geometry is not loaded";
266 }
267
268 createVolumes(idtmed);
269}
270
271void Geometry::createVolumes(std::vector<int> const& idtmed)
272{
273 //
274 // Create the TRD geometry volumes
275 //
276 //
277 // Names of the TRD volumina (xx = detector number):
278 //
279 // Volume (Air) wrapping the readout chamber components
280 // UTxx includes: UAxx, UDxx, UFxx, UUxx
281 //
282 // Lower part of the readout chambers (drift volume + radiator)
283 // UAxx Aluminum frames (Al)
284 //
285 // Upper part of the readout chambers (readout plane + fee)
286 // UDxx Wacosit frames of amp. region (Wacosit)
287 // UFxx Aluminum frame of back panel (Al)
288 //
289 // Services on chambers (cooling, cables, MCMs, DCS boards, ...)
290 // UUxx Volume containing the services (Air)
291 //
292 // Material layers inside sensitive area:
293 // Name Description Mat. Thick. Dens. Radl. X/X_0
294 //
295 // URMYxx Mylar layers (x2) Mylar 0.0015 1.39 28.5464 0.005%
296 // URCBxx Carbon layer (x2) Carbon 0.0055 1.75 24.2824 0.023%
297 // URGLxx Glue on the carbon layers (x2) Araldite 0.0065 1.12 37.0664 0.018%
298 // URRHxx Rohacell layer (x2) Rohacell 0.8 0.075 536.005 0.149%
299 // URFBxx Fiber mat layer PP 3.186 0.068 649.727 0.490%
300 //
301 // UJxx Drift region Xe/CO2 3.0 0.00495 1792.37 0.167%
302 // UKxx Amplification region Xe/CO2 0.7 0.00495 1792.37 0.039%
303 // UWxx Wire planes (x2) Copper 0.00011 8.96 1.43503 0.008%
304 //
305 // UPPDxx Copper of pad plane Copper 0.0025 8.96 1.43503 0.174%
306 // UPPPxx PCB of pad plane G10 0.0356 2.0 14.9013 0.239%
307 // UPGLxx Glue on pad planes Araldite 0.0923 1.12 37.0664 0.249%
308 // + add. glue (ca. 600g) Araldite 0.0505 1.12 37.0663 0.107%
309 // UPCBxx Carbon fiber mats (x2) Carbon 0.019 1.75 24.2824 0.078%
310 // UPHCxx Honeycomb structure Aramide 2.0299 0.032 1198.84 0.169%
311 // UPPCxx PCB of readout board G10 0.0486 2.0 14.9013 0.326%
312 // UPRDxx Copper of readout board Copper 0.0057 8.96 1.43503 0.404%
313 // UPELxx Electronics + cables Copper 0.0029 8.96 1.43503 0.202%
314 //
315
316 const int kNparTrd = 4;
317 const int kNparCha = 3;
318
319 float xpos;
320 float ypos;
321 float zpos;
322
323 float parTrd[kNparTrd];
324 float parCha[kNparCha];
325
326 const int kTag = 100;
327 char cTagV[kTag];
328 char cTagM[kTag];
329
330 // There are three TRD volumes for the supermodules in order to accomodate
331 // the different arrangements in front of PHOS
332 // UTR1: Default supermodule
333 // UTR2: Supermodule in front of PHOS with double carbon cover
334 // UTR3: As UTR2, but w/o middle stack
335 // UTR4: Sector 17 with missing chamber L4S4
336 //
337 // The mother volume for one sector (Air), full length in z-direction
338 // Provides material for side plates of super module
339 parTrd[0] = SWIDTH1 / 2.0;
340 parTrd[1] = SWIDTH2 / 2.0;
341 parTrd[2] = SLENGTH / 2.0;
342 parTrd[3] = SHEIGHT / 2.0;
343 createVolume("UTR1", "TRD1", idtmed[2], parTrd, kNparTrd);
344 createVolume("UTR2", "TRD1", idtmed[2], parTrd, kNparTrd);
345 createVolume("UTR3", "TRD1", idtmed[2], parTrd, kNparTrd);
346 createVolume("UTR4", "TRD1", idtmed[2], parTrd, kNparTrd);
347 // The outer aluminum plates of the super module (Al)
348 parTrd[0] = SWIDTH1 / 2.0;
349 parTrd[1] = SWIDTH2 / 2.0;
350 parTrd[2] = SLENGTH / 2.0;
351 parTrd[3] = SHEIGHT / 2.0;
352 createVolume("UTS1", "TRD1", idtmed[1], parTrd, kNparTrd);
353 createVolume("UTS2", "TRD1", idtmed[1], parTrd, kNparTrd);
354 createVolume("UTS3", "TRD1", idtmed[1], parTrd, kNparTrd);
355 createVolume("UTS4", "TRD1", idtmed[1], parTrd, kNparTrd);
356 // The inner part of the TRD mother volume for one sector (Air),
357 // full length in z-direction
358 parTrd[0] = SWIDTH1 / 2.0 - SMPLTT;
359 parTrd[1] = SWIDTH2 / 2.0 - SMPLTT;
360 parTrd[2] = SLENGTH / 2.0;
361 parTrd[3] = SHEIGHT / 2.0 - SMPLTT;
362 createVolume("UTI1", "TRD1", idtmed[2], parTrd, kNparTrd);
363 createVolume("UTI2", "TRD1", idtmed[2], parTrd, kNparTrd);
364 createVolume("UTI3", "TRD1", idtmed[2], parTrd, kNparTrd);
365 createVolume("UTI4", "TRD1", idtmed[2], parTrd, kNparTrd);
366
367 // The inner part of the TRD mother volume for services in front
368 // of the supermodules (Air),
369 parTrd[0] = SWIDTH1 / 2.0;
370 parTrd[1] = SWIDTH2 / 2.0;
371 parTrd[2] = FLENGTH / 2.0;
372 parTrd[3] = SHEIGHT / 2.0;
373 createVolume("UTF1", "TRD1", idtmed[2], parTrd, kNparTrd);
374 createVolume("UTF2", "TRD1", idtmed[2], parTrd, kNparTrd);
375
376 for (int istack = 0; istack < NSTACK; istack++) {
377 for (int ilayer = 0; ilayer < NLAYER; ilayer++) {
378 int iDet = getDetectorSec(ilayer, istack);
379
380 // The lower part of the readout chambers (drift volume + radiator)
381 // The aluminum frames
382 snprintf(cTagV, kTag, "UA%02d", iDet);
383 parCha[0] = CWIDTH[ilayer] / 2.0;
384 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
385 parCha[2] = CRAH / 2.0 + CDRH / 2.0;
386 createVolume(cTagV, "BOX ", idtmed[1], parCha, kNparCha);
387 // The additional aluminum on the frames
388 // This part has not the correct shape but is just supposed to
389 // represent the missing material. The correct form of the L-shaped
390 // profile would not fit into the alignable volume.
391 snprintf(cTagV, kTag, "UZ%02d", iDet);
392 parCha[0] = CALWMOD / 2.0;
393 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
394 parCha[2] = CALHMOD / 2.0;
395 createVolume(cTagV, "BOX ", idtmed[1], parCha, kNparCha);
396 // The additional Wacosit on the frames
397 snprintf(cTagV, kTag, "UP%02d", iDet);
398 parCha[0] = CWSW / 2.0;
399 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
400 parCha[2] = CWSH / 2.0;
401 createVolume(cTagV, "BOX ", idtmed[7], parCha, kNparCha);
402 // The Wacosit frames
403 snprintf(cTagV, kTag, "UB%02d", iDet);
404 parCha[0] = CWIDTH[ilayer] / 2.0 - CALT;
405 parCha[1] = -1.0;
406 parCha[2] = -1.0;
407 createVolume(cTagV, "BOX ", idtmed[7], parCha, kNparCha);
408 // The glue around the radiator
409 snprintf(cTagV, kTag, "UX%02d", iDet);
410 parCha[0] = CWIDTH[ilayer] / 2.0 - CALT - CCLST;
411 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0 - CCLFT;
412 parCha[2] = CRAH / 2.0;
413 createVolume(cTagV, "BOX ", idtmed[11], parCha, kNparCha);
414 // The inner part of radiator (air)
415 snprintf(cTagV, kTag, "UC%02d", iDet);
416 parCha[0] = CWIDTH[ilayer] / 2.0 - CALT - CCLST - CGLT;
417 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0 - CCLFT - CGLT;
418 parCha[2] = -1.0;
419 createVolume(cTagV, "BOX ", idtmed[2], parCha, kNparCha);
420
421 // The upper part of the readout chambers (amplification volume)
422 // The Wacosit frames
423 snprintf(cTagV, kTag, "UD%02d", iDet);
424 parCha[0] = CWIDTH[ilayer] / 2.0 + CROW;
425 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
426 parCha[2] = CAMH / 2.0;
427 createVolume(cTagV, "BOX ", idtmed[7], parCha, kNparCha);
428 // The inner part of the Wacosit frame (air)
429 snprintf(cTagV, kTag, "UE%02d", iDet);
430 parCha[0] = CWIDTH[ilayer] / 2.0 + CROW - CCUTB;
431 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0 - CCUTA;
432 parCha[2] = -1.;
433 createVolume(cTagV, "BOX ", idtmed[2], parCha, kNparCha);
434
435 // The back panel, including pad plane and readout boards
436 // The aluminum frames
437 snprintf(cTagV, kTag, "UF%02d", iDet);
438 parCha[0] = CWIDTH[ilayer] / 2.0 + CROW;
439 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
440 parCha[2] = CROH / 2.0;
441 createVolume(cTagV, "BOX ", idtmed[1], parCha, kNparCha);
442 // The inner part of the aluminum frames
443 snprintf(cTagV, kTag, "UG%02d", iDet);
444 parCha[0] = CWIDTH[ilayer] / 2.0 + CROW - CAUT;
445 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0 - CAUT;
446 parCha[2] = -1.0;
447 createVolume(cTagV, "BOX ", idtmed[2], parCha, kNparCha);
448
449 //
450 // The material layers inside the chambers
451 //
452
453 // Mylar layer (radiator)
454 parCha[0] = -1.0;
455 parCha[1] = -1.0;
456 parCha[2] = RMYTHICK / 2.0;
457 snprintf(cTagV, kTag, "URMY%02d", iDet);
458 createVolume(cTagV, "BOX ", idtmed[27], parCha, kNparCha);
459 // Carbon layer (radiator)
460 parCha[0] = -1.0;
461 parCha[1] = -1.0;
462 parCha[2] = RCBTHICK / 2.0;
463 snprintf(cTagV, kTag, "URCB%02d", iDet);
464 createVolume(cTagV, "BOX ", idtmed[26], parCha, kNparCha);
465 // Araldite layer (radiator)
466 parCha[0] = -1.0;
467 parCha[1] = -1.0;
468 parCha[2] = RGLTHICK / 2.0;
469 snprintf(cTagV, kTag, "URGL%02d", iDet);
470 createVolume(cTagV, "BOX ", idtmed[11], parCha, kNparCha);
471 // Rohacell layer (radiator)
472 parCha[0] = -1.0;
473 parCha[1] = -1.0;
474 parCha[2] = RRHTHICK / 2.0;
475 snprintf(cTagV, kTag, "URRH%02d", iDet);
476 createVolume(cTagV, "BOX ", idtmed[15], parCha, kNparCha);
477 // Fiber layer (radiator)
478 parCha[0] = -1.0;
479 parCha[1] = -1.0;
480 parCha[2] = RFBTHICK / 2.0;
481 snprintf(cTagV, kTag, "URFB%02d", iDet);
482 createVolume(cTagV, "BOX ", idtmed[28], parCha, kNparCha);
483
484 // Xe/Isobutane layer (drift volume)
485 parCha[0] = CWIDTH[ilayer] / 2.0 - CALT - CCLST;
486 parCha[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0 - CCLFT;
487 parCha[2] = DRTHICK / 2.0;
488 snprintf(cTagV, kTag, "UJ%02d", iDet);
489 createVolume(cTagV, "BOX ", idtmed[9], parCha, kNparCha);
490
491 // Xe/Isobutane layer (amplification volume)
492 parCha[0] = -1.0;
493 parCha[1] = -1.0;
494 parCha[2] = AMTHICK / 2.0;
495 snprintf(cTagV, kTag, "UK%02d", iDet);
496 createVolume(cTagV, "BOX ", idtmed[9], parCha, kNparCha);
497 // Cu layer (wire plane)
498 parCha[0] = -1.0;
499 parCha[1] = -1.0;
500 parCha[2] = WRTHICK / 2.0;
501 snprintf(cTagV, kTag, "UW%02d", iDet);
502 createVolume(cTagV, "BOX ", idtmed[3], parCha, kNparCha);
503
504 // Cu layer (pad plane)
505 parCha[0] = -1.0;
506 parCha[1] = -1.0;
507 parCha[2] = PPDTHICK / 2.0;
508 snprintf(cTagV, kTag, "UPPD%02d", iDet);
509 createVolume(cTagV, "BOX ", idtmed[5], parCha, kNparCha);
510 // G10 layer (pad plane)
511 parCha[0] = -1.0;
512 parCha[1] = -1.0;
513 parCha[2] = PPPTHICK / 2.0;
514 snprintf(cTagV, kTag, "UPPP%02d", iDet);
515 createVolume(cTagV, "BOX ", idtmed[13], parCha, kNparCha);
516 // Araldite layer (glue)
517 parCha[0] = -1.0;
518 parCha[1] = -1.0;
519 parCha[2] = PGLTHICK / 2.0;
520 snprintf(cTagV, kTag, "UPGL%02d", iDet);
521 createVolume(cTagV, "BOX ", idtmed[11], parCha, kNparCha);
522 // Carbon layer (carbon fiber mats)
523 parCha[0] = -1.0;
524 parCha[1] = -1.0;
525 parCha[2] = PCBTHICK / 2.0;
526 snprintf(cTagV, kTag, "UPCB%02d", iDet);
527 createVolume(cTagV, "BOX ", idtmed[26], parCha, kNparCha);
528 // Aramide layer (honeycomb)
529 parCha[0] = -1.0;
530 parCha[1] = -1.0;
531 parCha[2] = PHCTHICK / 2.0;
532 snprintf(cTagV, kTag, "UPHC%02d", iDet);
533 createVolume(cTagV, "BOX ", idtmed[10], parCha, kNparCha);
534 // G10 layer (PCB readout board)
535 parCha[0] = -1.0;
536 parCha[1] = -1.0;
537 parCha[2] = PPCTHICK / 2;
538 snprintf(cTagV, kTag, "UPPC%02d", iDet);
539 createVolume(cTagV, "BOX ", idtmed[13], parCha, kNparCha);
540 // Cu layer (traces in readout board)
541 parCha[0] = -1.0;
542 parCha[1] = -1.0;
543 parCha[2] = PRBTHICK / 2.0;
544 snprintf(cTagV, kTag, "UPRB%02d", iDet);
545 createVolume(cTagV, "BOX ", idtmed[6], parCha, kNparCha);
546 // Cu layer (other material on in readout board, incl. screws)
547 parCha[0] = -1.0;
548 parCha[1] = -1.0;
549 parCha[2] = PELTHICK / 2.0;
550 snprintf(cTagV, kTag, "UPEL%02d", iDet);
551 createVolume(cTagV, "BOX ", idtmed[4], parCha, kNparCha);
552
553 //
554 // Position the layers in the chambers
555 //
556 xpos = 0.0;
557 ypos = 0.0;
558
559 // Lower part
560 // Mylar layers (radiator)
561 zpos = RMYTHICK / 2.0 - CRAH / 2.0;
562 snprintf(cTagV, kTag, "URMY%02d", iDet);
563 snprintf(cTagM, kTag, "UC%02d", iDet);
564 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
565 zpos = -RMYTHICK / 2.0 + CRAH / 2.0;
566 snprintf(cTagV, kTag, "URMY%02d", iDet);
567 snprintf(cTagM, kTag, "UC%02d", iDet);
568 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
569 // Carbon layers (radiator)
570 zpos = RCBTHICK / 2.0 + RMYTHICK - CRAH / 2.0;
571 snprintf(cTagV, kTag, "URCB%02d", iDet);
572 snprintf(cTagM, kTag, "UC%02d", iDet);
573 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
574 zpos = -RCBTHICK / 2.0 - RMYTHICK + CRAH / 2.0;
575 snprintf(cTagV, kTag, "URCB%02d", iDet);
576 snprintf(cTagM, kTag, "UC%02d", iDet);
577 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
578 // Carbon layers (radiator)
579 zpos = RGLTHICK / 2.0 + RCBTHICK + RMYTHICK - CRAH / 2.0;
580 snprintf(cTagV, kTag, "URGL%02d", iDet);
581 snprintf(cTagM, kTag, "UC%02d", iDet);
582 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
583 zpos = -RGLTHICK / 2.0 - RCBTHICK - RMYTHICK + CRAH / 2.0;
584 snprintf(cTagV, kTag, "URGL%02d", iDet);
585 snprintf(cTagM, kTag, "UC%02d", iDet);
586 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
587 // Rohacell layers (radiator)
588 zpos = RRHTHICK / 2.0 + RGLTHICK + RCBTHICK + RMYTHICK - CRAH / 2.0;
589 snprintf(cTagV, kTag, "URRH%02d", iDet);
590 snprintf(cTagM, kTag, "UC%02d", iDet);
591 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
592 zpos = -RRHTHICK / 2.0 - RGLTHICK - RCBTHICK - RMYTHICK + CRAH / 2.0;
593 snprintf(cTagV, kTag, "URRH%02d", iDet);
594 snprintf(cTagM, kTag, "UC%02d", iDet);
595 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
596 // Fiber layers (radiator)
597 zpos = 0.0;
598 snprintf(cTagV, kTag, "URFB%02d", iDet);
599 snprintf(cTagM, kTag, "UC%02d", iDet);
600 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
601
602 // Xe/Isobutane layer (drift volume)
603 zpos = DRZPOS;
604 snprintf(cTagV, kTag, "UJ%02d", iDet);
605 snprintf(cTagM, kTag, "UB%02d", iDet);
606 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
607
608 // Upper part
609 // Xe/Isobutane layer (amplification volume)
610 zpos = AMZPOS;
611 snprintf(cTagV, kTag, "UK%02d", iDet);
612 snprintf(cTagM, kTag, "UE%02d", iDet);
613 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
614 // Cu layer (wire planes inside amplification volume)
615 zpos = WRZPOSA;
616 snprintf(cTagV, kTag, "UW%02d", iDet);
617 snprintf(cTagM, kTag, "UK%02d", iDet);
618 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
619 zpos = WRZPOSB;
620 snprintf(cTagV, kTag, "UW%02d", iDet);
621 snprintf(cTagM, kTag, "UK%02d", iDet);
622 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
623
624 // Back panel + pad plane + readout part
625 // Cu layer (pad plane)
626 zpos = PPDTHICK / 2.0 - CROH / 2.0;
627 snprintf(cTagV, kTag, "UPPD%02d", iDet);
628 snprintf(cTagM, kTag, "UG%02d", iDet);
629 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
630 // G10 layer (pad plane)
631 zpos = PPPTHICK / 2.0 + PPDTHICK - CROH / 2.0;
632 snprintf(cTagV, kTag, "UPPP%02d", iDet);
633 snprintf(cTagM, kTag, "UG%02d", iDet);
634 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
635 // Araldite layer (glue)
636 zpos = PGLTHICK / 2.0 + PPPTHICK + PPDTHICK - CROH / 2.0;
637 snprintf(cTagV, kTag, "UPGL%02d", iDet);
638 snprintf(cTagM, kTag, "UG%02d", iDet);
639 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
640 // Carbon layers (carbon fiber mats)
641 zpos = PCBTHICK / 2.0 + PGLTHICK + PPPTHICK + PPDTHICK - CROH / 2.0;
642 snprintf(cTagV, kTag, "UPCB%02d", iDet);
643 snprintf(cTagM, kTag, "UG%02d", iDet);
644 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
645 zpos = -PCBTHICK / 2.0 - PPCTHICK - PRBTHICK - PELTHICK + CROH / 2.0;
646 snprintf(cTagV, kTag, "UPCB%02d", iDet);
647 snprintf(cTagM, kTag, "UG%02d", iDet);
648 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
649 // Aramide layer (honeycomb)
650 zpos = PHCTHICK / 2.0 + PCBTHICK + PGLTHICK + PPPTHICK + PPDTHICK - CROH / 2.0;
651 snprintf(cTagV, kTag, "UPHC%02d", iDet);
652 snprintf(cTagM, kTag, "UG%02d", iDet);
653 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
654 // G10 layer (PCB readout board)
655 zpos = -PPCTHICK / 2.0 - PRBTHICK - PELTHICK + CROH / 2.0;
656 snprintf(cTagV, kTag, "UPPC%02d", iDet);
657 snprintf(cTagM, kTag, "UG%02d", iDet);
658 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
659 // Cu layer (traces in readout board)
660 zpos = -PRBTHICK / 2.0 - PELTHICK + CROH / 2.0;
661 snprintf(cTagV, kTag, "UPRB%02d", iDet);
662 snprintf(cTagM, kTag, "UG%02d", iDet);
663 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
664 // Cu layer (other materials on readout board, incl. screws)
665 zpos = -PELTHICK / 2.0 + CROH / 2.0;
666 snprintf(cTagV, kTag, "UPEL%02d", iDet);
667 snprintf(cTagM, kTag, "UG%02d", iDet);
668 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
669
670 // Position the inner volumes of the chambers in the frames
671 xpos = 0.0;
672 ypos = 0.0;
673
674 // The inner part of the radiator (air)
675 zpos = 0.0;
676 snprintf(cTagV, kTag, "UC%02d", iDet);
677 snprintf(cTagM, kTag, "UX%02d", iDet);
678 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
679 // The glue around the radiator
680 zpos = CRAH / 2.0 - CDRH / 2.0 - CRAH / 2.0;
681 snprintf(cTagV, kTag, "UX%02d", iDet);
682 snprintf(cTagM, kTag, "UB%02d", iDet);
683 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
684 // The lower Wacosit frame inside the aluminum frame
685 zpos = 0.0;
686 snprintf(cTagV, kTag, "UB%02d", iDet);
687 snprintf(cTagM, kTag, "UA%02d", iDet);
688 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
689
690 // The inside of the upper Wacosit frame
691 zpos = 0.0;
692 snprintf(cTagV, kTag, "UE%02d", iDet);
693 snprintf(cTagM, kTag, "UD%02d", iDet);
694 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
695
696 // The inside of the upper aluminum frame
697 zpos = 0.0;
698 snprintf(cTagV, kTag, "UG%02d", iDet);
699 snprintf(cTagM, kTag, "UF%02d", iDet);
700 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
701 }
702 }
703
704 // Create the volumes of the super module frame
705 createFrame(idtmed);
706
707 // Create the volumes of the services
708 createServices(idtmed);
709
710 for (int istack = 0; istack < NSTACK; istack++) {
711 for (int ilayer = 0; ilayer < NLAYER; ilayer++) {
712 assembleChamber(ilayer, istack);
713 }
714 }
715
716 xpos = 0.0;
717 ypos = 0.0;
718 zpos = 0.0;
719 TVirtualMC::GetMC()->Gspos("UTI1", 1, "UTS1", xpos, ypos, zpos, 0, "ONLY");
720 TVirtualMC::GetMC()->Gspos("UTI2", 1, "UTS2", xpos, ypos, zpos, 0, "ONLY");
721 TVirtualMC::GetMC()->Gspos("UTI3", 1, "UTS3", xpos, ypos, zpos, 0, "ONLY");
722 TVirtualMC::GetMC()->Gspos("UTI4", 1, "UTS4", xpos, ypos, zpos, 0, "ONLY");
723
724 xpos = 0.0;
725 ypos = 0.0;
726 zpos = 0.0;
727 TVirtualMC::GetMC()->Gspos("UTS1", 1, "UTR1", xpos, ypos, zpos, 0, "ONLY");
728 TVirtualMC::GetMC()->Gspos("UTS2", 1, "UTR2", xpos, ypos, zpos, 0, "ONLY");
729 TVirtualMC::GetMC()->Gspos("UTS3", 1, "UTR3", xpos, ypos, zpos, 0, "ONLY");
730 TVirtualMC::GetMC()->Gspos("UTS4", 1, "UTR4", xpos, ypos, zpos, 0, "ONLY");
731
732 // Put the TRD volumes into the space frame mother volumes
733 // if enabled via status flag
734 xpos = 0.0;
735 ypos = 0.0;
736 zpos = 0.0;
737 for (int isector = 0; isector < NSECTOR; isector++) {
738 if (getSMstatus(isector)) {
739 snprintf(cTagV, kTag, "BTRD%d", isector);
740 switch (isector) {
741 case 17:
742 // Missing L4S4 chamber
743 TVirtualMC::GetMC()->Gspos("UTR4", 1, cTagV, xpos, ypos, zpos, 0, "ONLY");
744 break;
745 case 13:
746 case 14:
747 case 15:
748 // Double carbon, w/o middle stack
749 TVirtualMC::GetMC()->Gspos("UTR3", 1, cTagV, xpos, ypos, zpos, 0, "ONLY");
750 break;
751 case 11:
752 case 12:
753 // Double carbon, all stacks
754 TVirtualMC::GetMC()->Gspos("UTR2", 1, cTagV, xpos, ypos, zpos, 0, "ONLY");
755 break;
756 default:
757 // Standard supermodule
758 TVirtualMC::GetMC()->Gspos("UTR1", 1, cTagV, xpos, ypos, zpos, 0, "ONLY");
759 };
760 }
761 }
762
763 // Put the TRD volumes into the space frame mother volumes
764 // if enabled via status flag
765 xpos = 0.0;
766 ypos = 0.5 * SLENGTH + 0.5 * FLENGTH;
767 zpos = 0.0;
768 for (int isector = 0; isector < NSECTOR; isector++) {
769 if (getSMstatus(isector)) {
770 snprintf(cTagV, kTag, "BTRD%d", isector);
771 TVirtualMC::GetMC()->Gspos("UTF1", 1, cTagV, xpos, ypos, zpos, 0, "ONLY");
772 TVirtualMC::GetMC()->Gspos("UTF2", 1, cTagV, xpos, -ypos, zpos, 0, "ONLY");
773 }
774 }
775
776 // Resolve runtime shapes (which is done as part of TGeoManager::CheckGeometry) NOW.
777 // This is otherwise done when saying gGeoManager->CloseGeometry().
778 // However, we need to make sure all the TGeoVolumes are correctly available even before this
779 // stage because FairMCApplication initializes the sensisitive volumes before closing the geometry.
780 // The true origin of the "problem" comes from the fact, that the TRD construction above uses
781 // Geant3-like construction routines that allow giving negative parameters, indicating dimensions to be
782 // fixed later. This prevents immediate construction of the TGeoVolume.
783 gGeoManager->CheckGeometry();
784}
785
786//_____________________________________________________________________________
787void Geometry::createFrame(std::vector<int> const& idtmed)
788{
789 //
790 // Create the geometry of the frame of the supermodule
791 //
792 // Names of the TRD services volumina
793 //
794 // USRL Support rails for the chambers (Al)
795 // USxx Support cross bars between the chambers (Al)
796 // USHx Horizontal connection between the cross bars (Al)
797 // USLx Long corner ledges (Al)
798 //
799
800 int ilayer = 0;
801
802 float xpos = 0.0;
803 float ypos = 0.0;
804 float zpos = 0.0;
805
806 const int kTag = 100;
807 char cTagV[kTag];
808 char cTagM[kTag];
809
810 const int kNparTRD = 4;
811 float parTRD[kNparTRD];
812 const int kNparBOX = 3;
813 float parBOX[kNparBOX];
814 const int kNparTRP = 11;
815 float parTRP[kNparTRP];
816
817 // The rotation matrices
818 const int kNmatrix = 7;
819 int matrix[kNmatrix];
820 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
821 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
822 TVirtualMC::GetMC()->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
823 TVirtualMC::GetMC()->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
824 TVirtualMC::GetMC()->Matrix(matrix[4], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
825 TVirtualMC::GetMC()->Matrix(matrix[5], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
826 TVirtualMC::GetMC()->Matrix(matrix[6], 180.0, 180.0, 90.0, 180.0, 90.0, 90.0);
827
828 //
829 // The carbon inserts in the top/bottom aluminum plates
830 //
831
832 const int kNparCrb = 3;
833 float parCrb[kNparCrb];
834 parCrb[0] = 0.0;
835 parCrb[1] = 0.0;
836 parCrb[2] = 0.0;
837 createVolume("USCR", "BOX ", idtmed[26], parCrb, 0);
838 // Bottom 1 (all sectors)
839 parCrb[0] = 77.49 / 2.0;
840 parCrb[1] = 104.60 / 2.0;
841 parCrb[2] = SMPLTT / 2.0;
842 xpos = 0.0;
843 ypos = 0.0;
844 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
845 TVirtualMC::GetMC()->Gsposp("USCR", 1, "UTS1", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
846 TVirtualMC::GetMC()->Gsposp("USCR", 2, "UTS2", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
847 TVirtualMC::GetMC()->Gsposp("USCR", 3, "UTS3", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
848 TVirtualMC::GetMC()->Gsposp("USCR", 4, "UTS4", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
849 // Bottom 2 (all sectors)
850 parCrb[0] = 77.49 / 2.0;
851 parCrb[1] = 55.80 / 2.0;
852 parCrb[2] = SMPLTT / 2.0;
853 xpos = 0.0;
854 ypos = 85.6;
855 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
856 TVirtualMC::GetMC()->Gsposp("USCR", 5, "UTS1", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
857 TVirtualMC::GetMC()->Gsposp("USCR", 6, "UTS2", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
858 TVirtualMC::GetMC()->Gsposp("USCR", 7, "UTS3", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
859 TVirtualMC::GetMC()->Gsposp("USCR", 8, "UTS4", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
860 TVirtualMC::GetMC()->Gsposp("USCR", 9, "UTS1", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
861 TVirtualMC::GetMC()->Gsposp("USCR", 10, "UTS2", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
862 TVirtualMC::GetMC()->Gsposp("USCR", 11, "UTS3", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
863 TVirtualMC::GetMC()->Gsposp("USCR", 12, "UTS4", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
864 // Bottom 3 (all sectors)
865 parCrb[0] = 77.49 / 2.0;
866 parCrb[1] = 56.00 / 2.0;
867 parCrb[2] = SMPLTT / 2.0;
868 xpos = 0.0;
869 ypos = 148.5;
870 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
871 TVirtualMC::GetMC()->Gsposp("USCR", 13, "UTS1", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
872 TVirtualMC::GetMC()->Gsposp("USCR", 14, "UTS2", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
873 TVirtualMC::GetMC()->Gsposp("USCR", 15, "UTS3", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
874 TVirtualMC::GetMC()->Gsposp("USCR", 16, "UTS4", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
875 TVirtualMC::GetMC()->Gsposp("USCR", 17, "UTS1", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
876 TVirtualMC::GetMC()->Gsposp("USCR", 18, "UTS2", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
877 TVirtualMC::GetMC()->Gsposp("USCR", 19, "UTS3", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
878 TVirtualMC::GetMC()->Gsposp("USCR", 20, "UTS4", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
879 // Bottom 4 (all sectors)
880 parCrb[0] = 77.49 / 2.0;
881 parCrb[1] = 118.00 / 2.0;
882 parCrb[2] = SMPLTT / 2.0;
883 xpos = 0.0;
884 ypos = 240.5;
885 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
886 TVirtualMC::GetMC()->Gsposp("USCR", 21, "UTS1", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
887 TVirtualMC::GetMC()->Gsposp("USCR", 22, "UTS2", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
888 TVirtualMC::GetMC()->Gsposp("USCR", 23, "UTS3", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
889 TVirtualMC::GetMC()->Gsposp("USCR", 24, "UTS4", xpos, ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
890 TVirtualMC::GetMC()->Gsposp("USCR", 25, "UTS1", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
891 TVirtualMC::GetMC()->Gsposp("USCR", 26, "UTS2", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
892 TVirtualMC::GetMC()->Gsposp("USCR", 27, "UTS3", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
893 TVirtualMC::GetMC()->Gsposp("USCR", 28, "UTS4", xpos, -ypos, zpos, 0, "ONLY", parCrb, kNparCrb);
894 // Top 1 (only in front of PHOS)
895 parCrb[0] = 111.48 / 2.0;
896 parCrb[1] = 105.00 / 2.0;
897 parCrb[2] = SMPLTT / 2.0;
898 xpos = 0.0;
899 ypos = 0.0;
900 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
901 TVirtualMC::GetMC()->Gsposp("USCR", 29, "UTS2", xpos, ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
902 TVirtualMC::GetMC()->Gsposp("USCR", 30, "UTS3", xpos, ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
903 // Top 2 (only in front of PHOS)
904 parCrb[0] = 111.48 / 2.0;
905 parCrb[1] = 56.00 / 2.0;
906 parCrb[2] = SMPLTT / 2.0;
907 xpos = 0.0;
908 ypos = 85.5;
909 zpos = SMPLTT / 2.0 - SHEIGHT / 2.0;
910 TVirtualMC::GetMC()->Gsposp("USCR", 31, "UTS2", xpos, ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
911 TVirtualMC::GetMC()->Gsposp("USCR", 32, "UTS3", xpos, ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
912 TVirtualMC::GetMC()->Gsposp("USCR", 33, "UTS2", xpos, -ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
913 TVirtualMC::GetMC()->Gsposp("USCR", 34, "UTS3", xpos, -ypos, -zpos, 0, "ONLY", parCrb, kNparCrb);
914
915 //
916 // The chamber support rails
917 //
918
919 const float kSRLhgt = 2.00;
920 const float kSRLwidA = 2.3;
921 const float kSRLwidB = 1.947;
922 const float kSRLdst = 1.135;
923 const int kNparSRL = 11;
924 float parSRL[kNparSRL];
925 // Trapezoidal shape
926 parSRL[0] = SLENGTH / 2.0;
927 parSRL[1] = 0.0;
928 parSRL[2] = 0.0;
929 parSRL[3] = kSRLhgt / 2.0;
930 parSRL[4] = kSRLwidB / 2.0;
931 parSRL[5] = kSRLwidA / 2.0;
932 parSRL[6] = 5.0;
933 parSRL[7] = kSRLhgt / 2.0;
934 parSRL[8] = kSRLwidB / 2.0;
935 parSRL[9] = kSRLwidA / 2.0;
936 parSRL[10] = 5.0;
937 createVolume("USRL", "TRAP", idtmed[1], parSRL, kNparSRL);
938
939 xpos = 0.0;
940 ypos = 0.0;
941 zpos = 0.0;
942 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
943 xpos = CWIDTH[ilayer] / 2.0 + kSRLwidA / 2.0 + kSRLdst;
944 ypos = 0.0;
945 zpos = VROCSM + SMPLTT - CALZPOS - SHEIGHT / 2.0 + CRAH + CDRH - CALH - kSRLhgt / 2.0 +
946 ilayer * (CH + VSPACE);
947 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1, "UTI1", xpos, ypos, zpos, matrix[2], "ONLY");
948 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + NLAYER, "UTI1", -xpos, ypos, zpos, matrix[3], "ONLY");
949 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 2 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[2], "ONLY");
950 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 3 * NLAYER, "UTI2", -xpos, ypos, zpos, matrix[3], "ONLY");
951 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 4 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[2], "ONLY");
952 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 5 * NLAYER, "UTI3", -xpos, ypos, zpos, matrix[3], "ONLY");
953 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 6 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[2], "ONLY");
954 TVirtualMC::GetMC()->Gspos("USRL", ilayer + 1 + 7 * NLAYER, "UTI4", -xpos, ypos, zpos, matrix[3], "ONLY");
955 }
956
957 //
958 // The cross bars between the chambers
959 //
960
961 const float kSCBwid = 1.0;
962 const float kSCBthk = 2.0;
963 const float kSCHhgt = 0.3;
964
965 const int kNparSCB = 3;
966 float parSCB[kNparSCB];
967 parSCB[1] = kSCBwid / 2.0;
968 parSCB[2] = CH / 2.0 + VSPACE / 2.0 - kSCHhgt;
969
970 const int kNparSCI = 3;
971 float parSCI[kNparSCI];
972 parSCI[1] = -1;
973
974 xpos = 0.0;
975 ypos = 0.0;
976 zpos = 0.0;
977 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
978 // The aluminum of the cross bars
979 parSCB[0] = CWIDTH[ilayer] / 2.0 + kSRLdst / 2.0;
980 snprintf(cTagV, kTag, "USF%01d", ilayer);
981 createVolume(cTagV, "BOX ", idtmed[1], parSCB, kNparSCB);
982
983 // The empty regions in the cross bars
984 float thkSCB = kSCBthk;
985 if (ilayer < 2) {
986 thkSCB *= 1.5;
987 }
988 parSCI[2] = parSCB[2] - thkSCB;
989 parSCI[0] = parSCB[0] / 4.0 - kSCBthk;
990 snprintf(cTagV, kTag, "USI%01d", ilayer);
991 createVolume(cTagV, "BOX ", idtmed[2], parSCI, kNparSCI);
992
993 snprintf(cTagV, kTag, "USI%01d", ilayer);
994 snprintf(cTagM, kTag, "USF%01d", ilayer);
995 ypos = 0.0;
996 zpos = 0.0;
997 xpos = parSCI[0] + thkSCB / 2.0;
998 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0, "ONLY");
999 xpos = -parSCI[0] - thkSCB / 2.0;
1000 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0, "ONLY");
1001 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1002 TVirtualMC::GetMC()->Gspos(cTagV, 3, cTagM, xpos, ypos, zpos, 0, "ONLY");
1003 xpos = -3.0 * parSCI[0] - 1.5 * thkSCB;
1004 TVirtualMC::GetMC()->Gspos(cTagV, 4, cTagM, xpos, ypos, zpos, 0, "ONLY");
1005
1006 snprintf(cTagV, kTag, "USF%01d", ilayer);
1007 xpos = 0.0;
1008 zpos = VROCSM + SMPLTT + parSCB[2] - SHEIGHT / 2.0 + ilayer * (CH + VSPACE);
1009
1010 ypos = CLENGTH[ilayer][2] / 2.0 + CLENGTH[ilayer][1];
1011 TVirtualMC::GetMC()->Gspos(cTagV, 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1012 TVirtualMC::GetMC()->Gspos(cTagV, 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1013 TVirtualMC::GetMC()->Gspos(cTagV, 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1014 TVirtualMC::GetMC()->Gspos(cTagV, 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1015
1016 ypos = -CLENGTH[ilayer][2] / 2.0 - CLENGTH[ilayer][1];
1017 TVirtualMC::GetMC()->Gspos(cTagV, 2, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1018 TVirtualMC::GetMC()->Gspos(cTagV, 4, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1019 TVirtualMC::GetMC()->Gspos(cTagV, 6, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1020 TVirtualMC::GetMC()->Gspos(cTagV, 8, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1021 }
1022
1023 //
1024 // The horizontal connections between the cross bars
1025 //
1026
1027 const int kNparSCH = 3;
1028 float parSCH[kNparSCH];
1029
1030 for (ilayer = 1; ilayer < NLAYER - 1; ilayer++) {
1031 parSCH[0] = CWIDTH[ilayer] / 2.0;
1032 parSCH[1] = (CLENGTH[ilayer + 1][2] / 2.0 + CLENGTH[ilayer + 1][1] - CLENGTH[ilayer][2] / 2.0 -
1033 CLENGTH[ilayer][1]) /
1034 2.0;
1035 parSCH[2] = kSCHhgt / 2.0;
1036
1037 snprintf(cTagV, kTag, "USH%01d", ilayer);
1038 createVolume(cTagV, "BOX ", idtmed[1], parSCH, kNparSCH);
1039 xpos = 0.0;
1040 ypos = CLENGTH[ilayer][2] / 2.0 + CLENGTH[ilayer][1] + parSCH[1];
1041 zpos = VROCSM + SMPLTT - kSCHhgt / 2.0 - SHEIGHT / 2.0 + (ilayer + 1) * (CH + VSPACE);
1042 TVirtualMC::GetMC()->Gspos(cTagV, 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1043 TVirtualMC::GetMC()->Gspos(cTagV, 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1044 TVirtualMC::GetMC()->Gspos(cTagV, 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1045 TVirtualMC::GetMC()->Gspos(cTagV, 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1046 ypos = -ypos;
1047 TVirtualMC::GetMC()->Gspos(cTagV, 2, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1048 TVirtualMC::GetMC()->Gspos(cTagV, 4, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1049 TVirtualMC::GetMC()->Gspos(cTagV, 6, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1050 TVirtualMC::GetMC()->Gspos(cTagV, 8, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1051 }
1052
1053 //
1054 // The asymmetric flat frame in the middle
1055 //
1056
1057 // The envelope volume (aluminum)
1058 parTRD[0] = 87.60 / 2.0;
1059 parTRD[1] = 114.00 / 2.0;
1060 parTRD[2] = 1.20 / 2.0;
1061 parTRD[3] = 71.30 / 2.0;
1062 createVolume("USDB", "TRD1", idtmed[1], parTRD, kNparTRD);
1063 // Empty spaces (air)
1064 parTRP[0] = 1.20 / 2.0;
1065 parTRP[1] = 0.0;
1066 parTRP[2] = 0.0;
1067 parTRP[3] = 27.00 / 2.0;
1068 parTRP[4] = 50.60 / 2.0;
1069 parTRP[5] = 5.00 / 2.0;
1070 parTRP[6] = 3.5;
1071 parTRP[7] = 27.00 / 2.0;
1072 parTRP[8] = 50.60 / 2.0;
1073 parTRP[9] = 5.00 / 2.0;
1074 parTRP[10] = 3.5;
1075 createVolume("USD1", "TRAP", idtmed[2], parTRP, kNparTRP);
1076 xpos = 18.0;
1077 ypos = 0.0;
1078 zpos = 27.00 / 2.0 - 71.3 / 2.0;
1079 TVirtualMC::GetMC()->Gspos("USD1", 1, "USDB", xpos, ypos, zpos, matrix[2], "ONLY");
1080 // Empty spaces (air)
1081 parTRP[0] = 1.20 / 2.0;
1082 parTRP[1] = 0.0;
1083 parTRP[2] = 0.0;
1084 parTRP[3] = 33.00 / 2.0;
1085 parTRP[4] = 5.00 / 2.0;
1086 parTRP[5] = 62.10 / 2.0;
1087 parTRP[6] = 3.5;
1088 parTRP[7] = 33.00 / 2.0;
1089 parTRP[8] = 5.00 / 2.0;
1090 parTRP[9] = 62.10 / 2.0;
1091 parTRP[10] = 3.5;
1092 createVolume("USD2", "TRAP", idtmed[2], parTRP, kNparTRP);
1093 xpos = 21.0;
1094 ypos = 0.0;
1095 zpos = 71.3 / 2.0 - 33.0 / 2.0;
1096 TVirtualMC::GetMC()->Gspos("USD2", 1, "USDB", xpos, ypos, zpos, matrix[2], "ONLY");
1097 // Empty spaces (air)
1098 parBOX[0] = 22.50 / 2.0;
1099 parBOX[1] = 1.20 / 2.0;
1100 parBOX[2] = 70.50 / 2.0;
1101 createVolume("USD3", "BOX ", idtmed[2], parBOX, kNparBOX);
1102 xpos = -25.75;
1103 ypos = 0.0;
1104 zpos = 0.4;
1105 TVirtualMC::GetMC()->Gspos("USD3", 1, "USDB", xpos, ypos, zpos, 0, "ONLY");
1106 // Empty spaces (air)
1107 parTRP[0] = 1.20 / 2.0;
1108 parTRP[1] = 0.0;
1109 parTRP[2] = 0.0;
1110 parTRP[3] = 25.50 / 2.0;
1111 parTRP[4] = 5.00 / 2.0;
1112 parTRP[5] = 65.00 / 2.0;
1113 parTRP[6] = -1.0;
1114 parTRP[7] = 25.50 / 2.0;
1115 parTRP[8] = 5.00 / 2.0;
1116 parTRP[9] = 65.00 / 2.0;
1117 parTRP[10] = -1.0;
1118 createVolume("USD4", "TRAP", idtmed[2], parTRP, kNparTRP);
1119 xpos = 2.0;
1120 ypos = 0.0;
1121 zpos = -1.6;
1122 TVirtualMC::GetMC()->Gspos("USD4", 1, "USDB", xpos, ypos, zpos, matrix[6], "ONLY");
1123 // Empty spaces (air)
1124 parTRP[0] = 1.20 / 2.0;
1125 parTRP[1] = 0.0;
1126 parTRP[2] = 0.0;
1127 parTRP[3] = 23.50 / 2.0;
1128 parTRP[4] = 63.50 / 2.0;
1129 parTRP[5] = 5.00 / 2.0;
1130 parTRP[6] = 16.0;
1131 parTRP[7] = 23.50 / 2.0;
1132 parTRP[8] = 63.50 / 2.0;
1133 parTRP[9] = 5.00 / 2.0;
1134 parTRP[10] = 16.0;
1135 createVolume("USD5", "TRAP", idtmed[2], parTRP, kNparTRP);
1136 xpos = 36.5;
1137 ypos = 0.0;
1138 zpos = -1.5;
1139 TVirtualMC::GetMC()->Gspos("USD5", 1, "USDB", xpos, ypos, zpos, matrix[5], "ONLY");
1140 // Empty spaces (air)
1141 parTRP[0] = 1.20 / 2.0;
1142 parTRP[1] = 0.0;
1143 parTRP[2] = 0.0;
1144 parTRP[3] = 70.50 / 2.0;
1145 parTRP[4] = 4.50 / 2.0;
1146 parTRP[5] = 16.50 / 2.0;
1147 parTRP[6] = -5.0;
1148 parTRP[7] = 70.50 / 2.0;
1149 parTRP[8] = 4.50 / 2.0;
1150 parTRP[9] = 16.50 / 2.0;
1151 parTRP[10] = -5.0;
1152 createVolume("USD6", "TRAP", idtmed[2], parTRP, kNparTRP);
1153 xpos = -43.7;
1154 ypos = 0.0;
1155 zpos = 0.4;
1156 TVirtualMC::GetMC()->Gspos("USD6", 1, "USDB", xpos, ypos, zpos, matrix[2], "ONLY");
1157 xpos = 0.0;
1158 ypos = CLENGTH[5][2] / 2.0;
1159 zpos = 0.04;
1160 TVirtualMC::GetMC()->Gspos("USDB", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1161 TVirtualMC::GetMC()->Gspos("USDB", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1162 TVirtualMC::GetMC()->Gspos("USDB", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1163 TVirtualMC::GetMC()->Gspos("USDB", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1164 TVirtualMC::GetMC()->Gspos("USDB", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1165 TVirtualMC::GetMC()->Gspos("USDB", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1166 TVirtualMC::GetMC()->Gspos("USDB", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1167 TVirtualMC::GetMC()->Gspos("USDB", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1168 // Upper bar (aluminum)
1169 parBOX[0] = 95.00 / 2.0;
1170 parBOX[1] = 1.20 / 2.0;
1171 parBOX[2] = 3.00 / 2.0;
1172 createVolume("USD7", "BOX ", idtmed[1], parBOX, kNparBOX);
1173 xpos = 0.0;
1174 ypos = CLENGTH[5][2] / 2.0;
1175 zpos = SHEIGHT / 2.0 - SMPLTT - 3.00 / 2.0;
1176 TVirtualMC::GetMC()->Gspos("USD7", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1177 TVirtualMC::GetMC()->Gspos("USD7", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1178 TVirtualMC::GetMC()->Gspos("USD7", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1179 TVirtualMC::GetMC()->Gspos("USD7", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1180 TVirtualMC::GetMC()->Gspos("USD7", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1181 TVirtualMC::GetMC()->Gspos("USD7", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1182 TVirtualMC::GetMC()->Gspos("USD7", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1183 TVirtualMC::GetMC()->Gspos("USD7", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1184 // Lower bar (aluminum)
1185 parBOX[0] = 90.22 / 2.0;
1186 parBOX[1] = 1.20 / 2.0;
1187 parBOX[2] = 1.74 / 2.0;
1188 createVolume("USD8", "BOX ", idtmed[1], parBOX, kNparBOX);
1189 xpos = 0.0;
1190 ypos = CLENGTH[5][2] / 2.0 - 0.1;
1191 zpos = -SHEIGHT / 2.0 + SMPLTT + 2.27;
1192 TVirtualMC::GetMC()->Gspos("USD8", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1193 TVirtualMC::GetMC()->Gspos("USD8", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1194 TVirtualMC::GetMC()->Gspos("USD8", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1195 TVirtualMC::GetMC()->Gspos("USD8", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1196 TVirtualMC::GetMC()->Gspos("USD8", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1197 TVirtualMC::GetMC()->Gspos("USD8", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1198 TVirtualMC::GetMC()->Gspos("USD8", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1199 TVirtualMC::GetMC()->Gspos("USD8", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1200 // Lower bar (aluminum)
1201 parBOX[0] = 82.60 / 2.0;
1202 parBOX[1] = 1.20 / 2.0;
1203 parBOX[2] = 1.40 / 2.0;
1204 createVolume("USD9", "BOX ", idtmed[1], parBOX, kNparBOX);
1205 xpos = 0.0;
1206 ypos = CLENGTH[5][2] / 2.0;
1207 zpos = -SHEIGHT / 2.0 + SMPLTT + 1.40 / 2.0;
1208 TVirtualMC::GetMC()->Gspos("USD9", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1209 TVirtualMC::GetMC()->Gspos("USD9", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1210 TVirtualMC::GetMC()->Gspos("USD9", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1211 TVirtualMC::GetMC()->Gspos("USD9", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1212 TVirtualMC::GetMC()->Gspos("USD9", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1213 TVirtualMC::GetMC()->Gspos("USD9", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1214 TVirtualMC::GetMC()->Gspos("USD9", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1215 TVirtualMC::GetMC()->Gspos("USD9", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1216 // Front sheet (aluminum)
1217 parTRP[0] = 0.10 / 2.0;
1218 parTRP[1] = 0.0;
1219 parTRP[2] = 0.0;
1220 parTRP[3] = 74.50 / 2.0;
1221 parTRP[4] = 31.70 / 2.0;
1222 parTRP[5] = 44.00 / 2.0;
1223 parTRP[6] = -5.0;
1224 parTRP[7] = 74.50 / 2.0;
1225 parTRP[8] = 31.70 / 2.0;
1226 parTRP[9] = 44.00 / 2.0;
1227 parTRP[10] = -5.0;
1228 createVolume("USDF", "TRAP", idtmed[2], parTRP, kNparTRP);
1229 xpos = -32.0;
1230 ypos = CLENGTH[5][2] / 2.0 + 1.20 / 2.0 + 0.10 / 2.0;
1231 zpos = 0.0;
1232 TVirtualMC::GetMC()->Gspos("USDF", 1, "UTI1", xpos, ypos, zpos, matrix[2], "ONLY");
1233 TVirtualMC::GetMC()->Gspos("USDF", 2, "UTI1", xpos, -ypos, zpos, matrix[2], "ONLY");
1234 TVirtualMC::GetMC()->Gspos("USDF", 3, "UTI2", xpos, ypos, zpos, matrix[2], "ONLY");
1235 TVirtualMC::GetMC()->Gspos("USDF", 4, "UTI2", xpos, -ypos, zpos, matrix[2], "ONLY");
1236 TVirtualMC::GetMC()->Gspos("USDF", 5, "UTI3", xpos, ypos, zpos, matrix[2], "ONLY");
1237 TVirtualMC::GetMC()->Gspos("USDF", 6, "UTI3", xpos, -ypos, zpos, matrix[2], "ONLY");
1238 TVirtualMC::GetMC()->Gspos("USDF", 7, "UTI4", xpos, ypos, zpos, matrix[2], "ONLY");
1239 TVirtualMC::GetMC()->Gspos("USDF", 8, "UTI4", xpos, -ypos, zpos, matrix[2], "ONLY");
1240
1241 //
1242 // The flat frame in front of the chambers
1243 //
1244
1245 // The envelope volume (aluminum)
1246 parTRD[0] = 90.00 / 2.0 - 0.1;
1247 parTRD[1] = 114.00 / 2.0 - 0.1;
1248 parTRD[2] = 1.50 / 2.0;
1249 parTRD[3] = 70.30 / 2.0;
1250 createVolume("USCB", "TRD1", idtmed[1], parTRD, kNparTRD);
1251 // Empty spaces (air)
1252 parTRD[0] = 87.00 / 2.0;
1253 parTRD[1] = 10.00 / 2.0;
1254 parTRD[2] = 1.50 / 2.0;
1255 parTRD[3] = 26.35 / 2.0;
1256 createVolume("USC1", "TRD1", idtmed[2], parTRD, kNparTRD);
1257 xpos = 0.0;
1258 ypos = 0.0;
1259 zpos = 26.35 / 2.0 - 70.3 / 2.0;
1260 TVirtualMC::GetMC()->Gspos("USC1", 1, "USCB", xpos, ypos, zpos, 0, "ONLY");
1261 // Empty spaces (air)
1262 parTRD[0] = 10.00 / 2.0;
1263 parTRD[1] = 111.00 / 2.0;
1264 parTRD[2] = 1.50 / 2.0;
1265 parTRD[3] = 35.05 / 2.0;
1266 createVolume("USC2", "TRD1", idtmed[2], parTRD, kNparTRD);
1267 xpos = 0.0;
1268 ypos = 0.0;
1269 zpos = 70.3 / 2.0 - 35.05 / 2.0;
1270 TVirtualMC::GetMC()->Gspos("USC2", 1, "USCB", xpos, ypos, zpos, 0, "ONLY");
1271 // Empty spaces (air)
1272 parTRP[0] = 1.50 / 2.0;
1273 parTRP[1] = 0.0;
1274 parTRP[2] = 0.0;
1275 parTRP[3] = 37.60 / 2.0;
1276 parTRP[4] = 63.90 / 2.0;
1277 parTRP[5] = 8.86 / 2.0;
1278 parTRP[6] = 16.0;
1279 parTRP[7] = 37.60 / 2.0;
1280 parTRP[8] = 63.90 / 2.0;
1281 parTRP[9] = 8.86 / 2.0;
1282 parTRP[10] = 16.0;
1283 createVolume("USC3", "TRAP", idtmed[2], parTRP, kNparTRP);
1284 xpos = -30.5;
1285 ypos = 0.0;
1286 zpos = -2.0;
1287 TVirtualMC::GetMC()->Gspos("USC3", 1, "USCB", xpos, ypos, zpos, matrix[4], "ONLY");
1288 TVirtualMC::GetMC()->Gspos("USC3", 2, "USCB", -xpos, ypos, zpos, matrix[5], "ONLY");
1289 xpos = 0.0;
1290 ypos = CLENGTH[5][2] / 2.0 + CLENGTH[5][1] + CLENGTH[5][0];
1291 zpos = 0.0;
1292 TVirtualMC::GetMC()->Gspos("USCB", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1293 TVirtualMC::GetMC()->Gspos("USCB", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1294 TVirtualMC::GetMC()->Gspos("USCB", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1295 TVirtualMC::GetMC()->Gspos("USCB", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1296 TVirtualMC::GetMC()->Gspos("USCB", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1297 TVirtualMC::GetMC()->Gspos("USCB", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1298 TVirtualMC::GetMC()->Gspos("USCB", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1299 TVirtualMC::GetMC()->Gspos("USCB", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1300 // Upper bar (aluminum)
1301 parBOX[0] = 95.00 / 2.0;
1302 parBOX[1] = 1.50 / 2.0;
1303 parBOX[2] = 3.00 / 2.0;
1304 createVolume("USC4", "BOX ", idtmed[1], parBOX, kNparBOX);
1305 xpos = 0.0;
1306 ypos = CLENGTH[5][2] / 2.0 + CLENGTH[5][1] + CLENGTH[5][0];
1307 zpos = SHEIGHT / 2.0 - SMPLTT - 3.00 / 2.0;
1308 TVirtualMC::GetMC()->Gspos("USC4", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1309 TVirtualMC::GetMC()->Gspos("USC4", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1310 TVirtualMC::GetMC()->Gspos("USC4", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1311 TVirtualMC::GetMC()->Gspos("USC4", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1312 TVirtualMC::GetMC()->Gspos("USC4", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1313 TVirtualMC::GetMC()->Gspos("USC4", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1314 TVirtualMC::GetMC()->Gspos("USC4", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1315 TVirtualMC::GetMC()->Gspos("USC4", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1316 // Lower bar (aluminum)
1317 parBOX[0] = 90.22 / 2.0;
1318 parBOX[1] = 1.50 / 2.0;
1319 parBOX[2] = 2.00 / 2.0;
1320 createVolume("USC5", "BOX ", idtmed[1], parBOX, kNparBOX);
1321 xpos = 0.0;
1322 ypos = CLENGTH[5][2] / 2.0 + CLENGTH[5][1] + CLENGTH[5][0];
1323 zpos = -SHEIGHT / 2.0 + SMPLTT + 2.60;
1324 TVirtualMC::GetMC()->Gspos("USC5", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1325 TVirtualMC::GetMC()->Gspos("USC5", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1326 TVirtualMC::GetMC()->Gspos("USC5", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1327 TVirtualMC::GetMC()->Gspos("USC5", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1328 TVirtualMC::GetMC()->Gspos("USC5", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1329 TVirtualMC::GetMC()->Gspos("USC5", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1330 TVirtualMC::GetMC()->Gspos("USC5", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1331 TVirtualMC::GetMC()->Gspos("USC5", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1332 // Lower bar (aluminum)
1333 parBOX[0] = 82.60 / 2.0;
1334 parBOX[1] = 1.50 / 2.0;
1335 parBOX[2] = 1.60 / 2.0;
1336 createVolume("USC6", "BOX ", idtmed[1], parBOX, kNparBOX);
1337 xpos = 0.0;
1338 ypos = CLENGTH[5][2] / 2.0 + CLENGTH[5][1] + CLENGTH[5][0];
1339 zpos = -SHEIGHT / 2.0 + SMPLTT + 1.60 / 2.0;
1340 TVirtualMC::GetMC()->Gspos("USC6", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1341 TVirtualMC::GetMC()->Gspos("USC6", 2, "UTI1", xpos, -ypos, zpos, 0, "ONLY");
1342 TVirtualMC::GetMC()->Gspos("USC6", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1343 TVirtualMC::GetMC()->Gspos("USC6", 4, "UTI2", xpos, -ypos, zpos, 0, "ONLY");
1344 TVirtualMC::GetMC()->Gspos("USC6", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1345 TVirtualMC::GetMC()->Gspos("USC6", 6, "UTI3", xpos, -ypos, zpos, 0, "ONLY");
1346 TVirtualMC::GetMC()->Gspos("USC6", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1347 TVirtualMC::GetMC()->Gspos("USC6", 8, "UTI4", xpos, -ypos, zpos, 0, "ONLY");
1348
1349 //
1350 // The long corner ledges
1351 //
1352
1353 const int kNparSCL = 3;
1354 float parSCL[kNparSCL];
1355 const int kNparSCLb = 11;
1356 float parSCLb[kNparSCLb];
1357
1358 // Upper ledges
1359 // Thickness of the corner ledges
1360 const float kSCLthkUa = 0.6;
1361 const float kSCLthkUb = 0.6;
1362 // Width of the corner ledges
1363 const float kSCLwidUa = 3.2;
1364 const float kSCLwidUb = 4.8;
1365 // Position of the corner ledges
1366 const float kSCLposxUa = 0.7;
1367 const float kSCLposxUb = 3.3;
1368 const float kSCLposzUa = 1.65;
1369 const float kSCLposzUb = 0.3;
1370 // Vertical
1371 parSCL[0] = kSCLthkUa / 2.0;
1372 parSCL[1] = SLENGTH / 2.0;
1373 parSCL[2] = kSCLwidUa / 2.0;
1374 createVolume("USL1", "BOX ", idtmed[1], parSCL, kNparSCL);
1375 xpos = SWIDTH2 / 2.0 - SMPLTT - kSCLposxUa;
1376 ypos = 0.0;
1377 zpos = SHEIGHT / 2.0 - SMPLTT - kSCLposzUa;
1378 TVirtualMC::GetMC()->Gspos("USL1", 1, "UTI1", xpos, ypos, zpos, matrix[0], "ONLY");
1379 TVirtualMC::GetMC()->Gspos("USL1", 3, "UTI4", xpos, ypos, zpos, matrix[0], "ONLY");
1380 xpos = -xpos;
1381 TVirtualMC::GetMC()->Gspos("USL1", 2, "UTI1", xpos, ypos, zpos, matrix[1], "ONLY");
1382 TVirtualMC::GetMC()->Gspos("USL1", 4, "UTI4", xpos, ypos, zpos, matrix[1], "ONLY");
1383 // Horizontal
1384 parSCL[0] = kSCLwidUb / 2.0;
1385 parSCL[1] = SLENGTH / 2.0;
1386 parSCL[2] = kSCLthkUb / 2.0;
1387 createVolume("USL2", "BOX ", idtmed[1], parSCL, kNparSCL);
1388 xpos = SWIDTH2 / 2.0 - SMPLTT - kSCLposxUb;
1389 ypos = 0.0;
1390 zpos = SHEIGHT / 2.0 - SMPLTT - kSCLposzUb;
1391 TVirtualMC::GetMC()->Gspos("USL2", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1392 TVirtualMC::GetMC()->Gspos("USL2", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1393 TVirtualMC::GetMC()->Gspos("USL2", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1394 TVirtualMC::GetMC()->Gspos("USL2", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1395 xpos = -xpos;
1396 TVirtualMC::GetMC()->Gspos("USL2", 2, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1397 TVirtualMC::GetMC()->Gspos("USL2", 4, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1398 TVirtualMC::GetMC()->Gspos("USL2", 6, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1399 TVirtualMC::GetMC()->Gspos("USL2", 8, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1400
1401 // Lower ledges
1402 // Thickness of the corner ledges
1403 const float kSCLthkLa = 2.464;
1404 const float kSCLthkLb = 1.0;
1405 // Width of the corner ledges
1406 const float kSCLwidLa = 8.3;
1407 const float kSCLwidLb = 4.0;
1408 // Position of the corner ledges
1409 const float kSCLposxLa = (3.0 * kSCLthkLb - kSCLthkLa) / 4.0 + 0.05;
1410 const float kSCLposxLb = kSCLthkLb + kSCLwidLb / 2.0 + 0.05;
1411 const float kSCLposzLa = kSCLwidLa / 2.0;
1412 const float kSCLposzLb = kSCLthkLb / 2.0;
1413 // Vertical
1414 // Trapezoidal shape
1415 parSCLb[0] = SLENGTH / 2.0;
1416 parSCLb[1] = 0.0;
1417 parSCLb[2] = 0.0;
1418 parSCLb[3] = kSCLwidLa / 2.0;
1419 parSCLb[4] = kSCLthkLb / 2.0;
1420 parSCLb[5] = kSCLthkLa / 2.0;
1421 parSCLb[6] = 5.0;
1422 parSCLb[7] = kSCLwidLa / 2.0;
1423 parSCLb[8] = kSCLthkLb / 2.0;
1424 parSCLb[9] = kSCLthkLa / 2.0;
1425 parSCLb[10] = 5.0;
1426 createVolume("USL3", "TRAP", idtmed[1], parSCLb, kNparSCLb);
1427 xpos = SWIDTH1 / 2.0 - SMPLTT - kSCLposxLa;
1428 ypos = 0.0;
1429 zpos = -SHEIGHT / 2.0 + SMPLTT + kSCLposzLa;
1430 TVirtualMC::GetMC()->Gspos("USL3", 1, "UTI1", xpos, ypos, zpos, matrix[2], "ONLY");
1431 TVirtualMC::GetMC()->Gspos("USL3", 3, "UTI2", xpos, ypos, zpos, matrix[2], "ONLY");
1432 TVirtualMC::GetMC()->Gspos("USL3", 5, "UTI3", xpos, ypos, zpos, matrix[2], "ONLY");
1433 TVirtualMC::GetMC()->Gspos("USL3", 7, "UTI4", xpos, ypos, zpos, matrix[2], "ONLY");
1434 xpos = -xpos;
1435 TVirtualMC::GetMC()->Gspos("USL3", 2, "UTI1", xpos, ypos, zpos, matrix[3], "ONLY");
1436 TVirtualMC::GetMC()->Gspos("USL3", 4, "UTI2", xpos, ypos, zpos, matrix[3], "ONLY");
1437 TVirtualMC::GetMC()->Gspos("USL3", 6, "UTI3", xpos, ypos, zpos, matrix[3], "ONLY");
1438 TVirtualMC::GetMC()->Gspos("USL3", 8, "UTI4", xpos, ypos, zpos, matrix[3], "ONLY");
1439 // Horizontal part
1440 parSCL[0] = kSCLwidLb / 2.0;
1441 parSCL[1] = SLENGTH / 2.0;
1442 parSCL[2] = kSCLthkLb / 2.0;
1443 createVolume("USL4", "BOX ", idtmed[1], parSCL, kNparSCL);
1444 xpos = SWIDTH1 / 2.0 - SMPLTT - kSCLposxLb;
1445 ypos = 0.0;
1446 zpos = -SHEIGHT / 2.0 + SMPLTT + kSCLposzLb;
1447 TVirtualMC::GetMC()->Gspos("USL4", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1448 TVirtualMC::GetMC()->Gspos("USL4", 3, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1449 TVirtualMC::GetMC()->Gspos("USL4", 5, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1450 TVirtualMC::GetMC()->Gspos("USL4", 7, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1451 xpos = -xpos;
1452 TVirtualMC::GetMC()->Gspos("USL4", 2, "UTI1", xpos, ypos, zpos, 0, "ONLY");
1453 TVirtualMC::GetMC()->Gspos("USL4", 4, "UTI2", xpos, ypos, zpos, 0, "ONLY");
1454 TVirtualMC::GetMC()->Gspos("USL4", 6, "UTI3", xpos, ypos, zpos, 0, "ONLY");
1455 TVirtualMC::GetMC()->Gspos("USL4", 8, "UTI4", xpos, ypos, zpos, 0, "ONLY");
1456
1457 //
1458 // Aluminum plates in the front part of the super modules
1459 //
1460
1461 const int kNparTrd = 4;
1462 float parTrd[kNparTrd];
1463 parTrd[0] = SWIDTH1 / 2.0 - 2.5;
1464 parTrd[1] = SWIDTH2 / 2.0 - 2.5;
1465 parTrd[2] = SMPLTT / 2.0;
1466 parTrd[3] = SHEIGHT / 2.0 - 1.0;
1467 createVolume("UTA1", "TRD1", idtmed[1], parTrd, kNparTrd);
1468 xpos = 0.0;
1469 ypos = SMPLTT / 2.0 - FLENGTH / 2.0;
1470 zpos = -0.5;
1471 TVirtualMC::GetMC()->Gspos("UTA1", 1, "UTF1", xpos, ypos, zpos, 0, "ONLY");
1472 TVirtualMC::GetMC()->Gspos("UTA1", 2, "UTF2", xpos, -ypos, zpos, 0, "ONLY");
1473
1474 const int kNparPlt = 3;
1475 float parPlt[kNparPlt];
1476 parPlt[0] = 0.0;
1477 parPlt[1] = 0.0;
1478 parPlt[2] = 0.0;
1479 createVolume("UTA2", "BOX ", idtmed[1], parPlt, 0);
1480 xpos = 0.0;
1481 ypos = 0.0;
1482 zpos = SHEIGHT / 2.0 - SMPLTT / 2.0;
1483 parPlt[0] = SWIDTH2 / 2.0 - 0.2;
1484 parPlt[1] = FLENGTH / 2.0;
1485 parPlt[2] = SMPLTT / 2.0;
1486 TVirtualMC::GetMC()->Gsposp("UTA2", 1, "UTF2", xpos, ypos, zpos, 0, "ONLY", parPlt, kNparPlt);
1487 xpos = (SWIDTH1 + SWIDTH2) / 4.0 - SMPLTT / 2.0 - 0.0016;
1488 ypos = 0.0;
1489 zpos = 0.0;
1490 parPlt[0] = SMPLTT / 2.0;
1491 parPlt[1] = FLENGTH / 2.0;
1492 parPlt[2] = SHEIGHT / 2.0;
1493 TVirtualMC::GetMC()->Gsposp("UTA2", 2, "UTF2", xpos, ypos, zpos, matrix[0], "ONLY", parPlt, kNparPlt);
1494 TVirtualMC::GetMC()->Gsposp("UTA2", 3, "UTF2", -xpos, ypos, zpos, matrix[1], "ONLY", parPlt, kNparPlt);
1495
1496 // Additional aluminum bar
1497 parBOX[0] = 80.0 / 2.0;
1498 parBOX[1] = 1.0 / 2.0;
1499 parBOX[2] = 10.0 / 2.0;
1500 createVolume("UTA3", "BOX ", idtmed[1], parBOX, kNparBOX);
1501 xpos = 0.0;
1502 ypos = 1.0 / 2.0 + SMPLTT - FLENGTH / 2.0;
1503 zpos = SHEIGHT / 2.0 - 1.5 - 10.0 / 2.0;
1504 TVirtualMC::GetMC()->Gspos("UTA3", 1, "UTF1", xpos, ypos, zpos, 0, "ONLY");
1505 TVirtualMC::GetMC()->Gspos("UTA3", 2, "UTF2", xpos, -ypos, zpos, 0, "ONLY");
1506}
1507
1508//_____________________________________________________________________________
1509void Geometry::createServices(std::vector<int> const& idtmed)
1510{
1511 //
1512 // Create the geometry of the services
1513 //
1514 // Names of the TRD services volumina
1515 //
1516 // UTC1 Cooling arterias (Al)
1517 // UTC2 Cooling arterias (Water)
1518 // UUxx Volumes for the services at the chambers (Air)
1519 // UMCM Readout MCMs (G10/Cu/Si)
1520 // UDCS DCSs boards (G10/Cu)
1521 // UTP1 Power bars (Cu)
1522 // UTCP Cooling pipes (Fe)
1523 // UTCH Cooling pipes (Water)
1524 // UTPL Power lines (Cu)
1525 // UTGD Gas distribution box (V2A)
1526 //
1527
1528 int ilayer = 0;
1529 int istack = 0;
1530
1531 float xpos = 0.0;
1532 float ypos = 0.0;
1533 float zpos = 0.0;
1534
1535 const int kTag = 100;
1536 char cTagV[kTag];
1537
1538 const int kNparBox = 3;
1539 float parBox[kNparBox];
1540
1541 const int kNparTube = 3;
1542 float parTube[kNparTube];
1543
1544 // Services inside the baby frame
1545 const float kBBMdz = 223.0;
1546 const float kBBSdz = 8.5;
1547
1548 // Services inside the back frame
1549 const float kBFMdz = 118.0;
1550 const float kBFSdz = 8.5;
1551
1552 // The rotation matrices
1553 const int kNmatrix = 10;
1554 int matrix[kNmatrix];
1555 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0); // rotation around y-axis
1556 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0); // rotation around y-axis
1557 TVirtualMC::GetMC()->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1558 TVirtualMC::GetMC()->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1559 TVirtualMC::GetMC()->Matrix(matrix[4], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1560 TVirtualMC::GetMC()->Matrix(matrix[5], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
1561 TVirtualMC::GetMC()->Matrix(matrix[6], 80.0, 0.0, 90.0, 270.0, 10.0, 180.0);
1562 TVirtualMC::GetMC()->Matrix(matrix[7], 90.0, 10.0, 90.0, 100.0, 0.0, 0.0); // rotation around z-axis
1563 TVirtualMC::GetMC()->Matrix(matrix[8], 90.0, 350.0, 90.0, 80.0, 0.0, 0.0); // rotation around z-axis
1564 TVirtualMC::GetMC()->Matrix(matrix[9], 90.0, 90.0, 90.0, 180.0, 0.0, 0.0); // rotation around z-axis
1565
1566 //
1567 // The cooling arterias
1568 //
1569
1570 // Width of the cooling arterias
1571 const float kCOLwid = 0.8;
1572 // Height of the cooling arterias
1573 const float kCOLhgt = 6.5;
1574 // Positioning of the cooling
1575 const float kCOLposx = 1.0;
1576 const float kCOLposz = -1.2;
1577 // Thickness of the walls of the cooling arterias
1578 const float kCOLthk = 0.1;
1579 const int kNparCOL = 3;
1580 float parCOL[kNparCOL];
1581 parCOL[0] = 0.0;
1582 parCOL[1] = 0.0;
1583 parCOL[2] = 0.0;
1584 createVolume("UTC1", "BOX ", idtmed[8], parCOL, 0);
1585 createVolume("UTC3", "BOX ", idtmed[8], parCOL, 0);
1586 parCOL[0] = kCOLwid / 2.0 - kCOLthk;
1587 parCOL[1] = -1.0;
1588 parCOL[2] = kCOLhgt / 2.0 - kCOLthk;
1589 createVolume("UTC2", "BOX ", idtmed[14], parCOL, kNparCOL);
1590 createVolume("UTC4", "BOX ", idtmed[14], parCOL, kNparCOL);
1591
1592 xpos = 0.0;
1593 ypos = 0.0;
1594 zpos = 0.0;
1595 TVirtualMC::GetMC()->Gspos("UTC2", 1, "UTC1", xpos, ypos, zpos, 0, "ONLY");
1596 TVirtualMC::GetMC()->Gspos("UTC4", 1, "UTC3", xpos, ypos, zpos, 0, "ONLY");
1597
1598 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1599 // Along the chambers
1600 xpos = CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx;
1601 ypos = 0.0;
1602 zpos =
1603 VROCSM + SMPLTT - CALZPOS + kCOLhgt / 2.0 - SHEIGHT / 2.0 + kCOLposz + ilayer * (CH + VSPACE);
1604 parCOL[0] = kCOLwid / 2.0;
1605 parCOL[1] = SLENGTH / 2.0;
1606 parCOL[2] = kCOLhgt / 2.0;
1607 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer, "UTI1", xpos, ypos, zpos, matrix[0], "ONLY", parCOL, kNparCOL);
1608 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + NLAYER, "UTI1", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1609 kNparCOL);
1610 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 6 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1611 kNparCOL);
1612 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 7 * NLAYER, "UTI2", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1613 kNparCOL);
1614 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 8 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1615 kNparCOL);
1616 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 9 * NLAYER, "UTI3", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1617 kNparCOL);
1618 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 10 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1619 kNparCOL);
1620 TVirtualMC::GetMC()->Gsposp("UTC1", ilayer + 11 * NLAYER, "UTI4", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1621 kNparCOL);
1622
1623 // Front of supermodules
1624 xpos = CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx;
1625 ypos = 0.0;
1626 zpos =
1627 VROCSM + SMPLTT - CALZPOS + kCOLhgt / 2.0 - SHEIGHT / 2.0 + kCOLposz + ilayer * (CH + VSPACE);
1628 parCOL[0] = kCOLwid / 2.0;
1629 parCOL[1] = FLENGTH / 2.0;
1630 parCOL[2] = kCOLhgt / 2.0;
1631 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 2 * NLAYER, "UTF1", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1632 kNparCOL);
1633 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 3 * NLAYER, "UTF1", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1634 kNparCOL);
1635 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 4 * NLAYER, "UTF2", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1636 kNparCOL);
1637 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 5 * NLAYER, "UTF2", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1638 kNparCOL);
1639 }
1640
1641 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1642 // In baby frame
1643 xpos = CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx - 2.5;
1644 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1645 zpos =
1646 VROCSM + SMPLTT - CALZPOS + kCOLhgt / 2.0 - SHEIGHT / 2.0 + kCOLposz + ilayer * (CH + VSPACE);
1647 parCOL[0] = kCOLwid / 2.0;
1648 parCOL[1] = kBBSdz / 2.0;
1649 parCOL[2] = kCOLhgt / 2.0;
1650 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 6 * NLAYER, "BBTRD", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1651 kNparCOL);
1652 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 7 * NLAYER, "BBTRD", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1653 kNparCOL);
1654 }
1655
1656 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1657 // In back frame
1658 xpos = CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx - 0.3;
1659 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1660 zpos =
1661 VROCSM + SMPLTT - CALZPOS + kCOLhgt / 2.0 - SHEIGHT / 2.0 + kCOLposz + ilayer * (CH + VSPACE);
1662 parCOL[0] = kCOLwid / 2.0;
1663 parCOL[1] = kBFSdz / 2.0;
1664 parCOL[2] = kCOLhgt / 2.0;
1665 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 6 * NLAYER, "BFTRD", xpos, ypos, zpos, matrix[0], "ONLY", parCOL,
1666 kNparCOL);
1667 TVirtualMC::GetMC()->Gsposp("UTC3", ilayer + 7 * NLAYER, "BFTRD", -xpos, ypos, zpos, matrix[1], "ONLY", parCOL,
1668 kNparCOL);
1669 }
1670
1671 // The upper most layer
1672 // Along the chambers
1673 xpos = CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1674 ypos = 0.0;
1675 zpos = SHEIGHT / 2.0 - SMPLTT - 0.4 - kCOLwid / 2.0;
1676 parCOL[0] = kCOLwid / 2.0;
1677 parCOL[1] = SLENGTH / 2.0;
1678 parCOL[2] = kCOLhgt / 2.0;
1679 TVirtualMC::GetMC()->Gsposp("UTC1", 6, "UTI1", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1680 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + NLAYER, "UTI1", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1681 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 6 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1682 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 7 * NLAYER, "UTI2", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1683 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 8 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1684 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 9 * NLAYER, "UTI3", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1685 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 10 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1686 TVirtualMC::GetMC()->Gsposp("UTC1", 6 + 11 * NLAYER, "UTI4", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1687 // Front of supermodules
1688 xpos = CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1689 ypos = 0.0;
1690 zpos = SHEIGHT / 2.0 - SMPLTT - 0.4 - kCOLwid / 2.0;
1691 parCOL[0] = kCOLwid / 2.0;
1692 parCOL[1] = FLENGTH / 2.0;
1693 parCOL[2] = kCOLhgt / 2.0;
1694 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 2 * NLAYER, "UTF1", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1695 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 3 * NLAYER, "UTF1", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1696 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 4 * NLAYER, "UTF2", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1697 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 5 * NLAYER, "UTF2", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1698 // In baby frame
1699 xpos = CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 3.1;
1700 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1701 zpos = SHEIGHT / 2.0 - SMPLTT - 0.4 - kCOLwid / 2.0;
1702 parCOL[0] = kCOLwid / 2.0;
1703 parCOL[1] = kBBSdz / 2.0;
1704 parCOL[2] = kCOLhgt / 2.0;
1705 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 6 * NLAYER, "BBTRD", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1706 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 7 * NLAYER, "BBTRD", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1707 // In back frame
1708 xpos = CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1709 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1710 zpos = SHEIGHT / 2.0 - SMPLTT - 0.4 - kCOLwid / 2.0;
1711 parCOL[0] = kCOLwid / 2.0;
1712 parCOL[1] = kBFSdz / 2.0;
1713 parCOL[2] = kCOLhgt / 2.0;
1714 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 6 * NLAYER, "BFTRD", xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1715 TVirtualMC::GetMC()->Gsposp("UTC3", 6 + 7 * NLAYER, "BFTRD", -xpos, ypos, zpos, matrix[3], "ONLY", parCOL, kNparCOL);
1716
1717 //
1718 // The power bus bars
1719 //
1720
1721 const float kPWRwid = 0.6;
1722 // Increase the height of the power bus bars to take into
1723 // account the material of additional cables, etc.
1724 const float kPWRhgtA = 5.0 + 0.2;
1725 const float kPWRhgtB = 5.0;
1726 const float kPWRposx = 2.0;
1727 const float kPWRposz = 0.1;
1728 const int kNparPWR = 3;
1729 float parPWR[kNparPWR];
1730 parPWR[0] = 0.0;
1731 parPWR[1] = 0.0;
1732 parPWR[2] = 0.0;
1733 createVolume("UTP1", "BOX ", idtmed[25], parPWR, 0);
1734 createVolume("UTP3", "BOX ", idtmed[25], parPWR, 0);
1735
1736 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1737 // Along the chambers
1738 xpos = CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx;
1739 ypos = 0.0;
1740 zpos =
1741 VROCSM + SMPLTT - CALZPOS + kPWRhgtA / 2.0 - SHEIGHT / 2.0 + kPWRposz + ilayer * (CH + VSPACE);
1742 parPWR[0] = kPWRwid / 2.0;
1743 parPWR[1] = SLENGTH / 2.0;
1744 parPWR[2] = kPWRhgtA / 2.0;
1745 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer, "UTI1", xpos, ypos, zpos, matrix[0], "ONLY", parPWR, kNparPWR);
1746 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + NLAYER, "UTI1", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1747 kNparPWR);
1748 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 6 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1749 kNparPWR);
1750 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 7 * NLAYER, "UTI2", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1751 kNparPWR);
1752 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 8 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1753 kNparPWR);
1754 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 9 * NLAYER, "UTI3", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1755 kNparPWR);
1756 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 10 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1757 kNparPWR);
1758 TVirtualMC::GetMC()->Gsposp("UTP1", ilayer + 11 * NLAYER, "UTI4", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1759 kNparPWR);
1760
1761 // Front of supermodule
1762 xpos = CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx;
1763 ypos = 0.0;
1764 zpos =
1765 VROCSM + SMPLTT - CALZPOS + kPWRhgtA / 2.0 - SHEIGHT / 2.0 + kPWRposz + ilayer * (CH + VSPACE);
1766 parPWR[0] = kPWRwid / 2.0;
1767 parPWR[1] = FLENGTH / 2.0;
1768 parPWR[2] = kPWRhgtA / 2.0;
1769 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 2 * NLAYER, "UTF1", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1770 kNparPWR);
1771 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 3 * NLAYER, "UTF1", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1772 kNparPWR);
1773 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 4 * NLAYER, "UTF2", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1774 kNparPWR);
1775 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 5 * NLAYER, "UTF2", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1776 kNparPWR);
1777 }
1778
1779 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1780 // In baby frame
1781 xpos = CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx - 2.5;
1782 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1783 zpos =
1784 VROCSM + SMPLTT - CALZPOS + kPWRhgtB / 2.0 - SHEIGHT / 2.0 + kPWRposz + ilayer * (CH + VSPACE);
1785 parPWR[0] = kPWRwid / 2.0;
1786 parPWR[1] = kBBSdz / 2.0;
1787 parPWR[2] = kPWRhgtB / 2.0;
1788 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 6 * NLAYER, "BBTRD", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1789 kNparPWR);
1790 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 7 * NLAYER, "BBTRD", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1791 kNparPWR);
1792 }
1793
1794 for (ilayer = 1; ilayer < NLAYER; ilayer++) {
1795 // In back frame
1796 xpos = CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx - 0.3;
1797 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1798 zpos =
1799 VROCSM + SMPLTT - CALZPOS + kPWRhgtB / 2.0 - SHEIGHT / 2.0 + kPWRposz + ilayer * (CH + VSPACE);
1800 parPWR[0] = kPWRwid / 2.0;
1801 parPWR[1] = kBFSdz / 2.0;
1802 parPWR[2] = kPWRhgtB / 2.0;
1803 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 8 * NLAYER, "BFTRD", xpos, ypos, zpos, matrix[0], "ONLY", parPWR,
1804 kNparPWR);
1805 TVirtualMC::GetMC()->Gsposp("UTP3", ilayer + 9 * NLAYER, "BFTRD", -xpos, ypos, zpos, matrix[1], "ONLY", parPWR,
1806 kNparPWR);
1807 }
1808
1809 // The upper most layer
1810 // Along the chambers
1811 xpos = CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1812 ypos = 0.0;
1813 zpos = SHEIGHT / 2.0 - SMPLTT - 0.6 - kPWRwid / 2.0;
1814 parPWR[0] = kPWRwid / 2.0;
1815 parPWR[1] = SLENGTH / 2.0;
1816 parPWR[2] = kPWRhgtB / 2.0;
1817 TVirtualMC::GetMC()->Gsposp("UTP1", 6, "UTI1", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1818 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + NLAYER, "UTI1", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1819 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 6 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1820 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 7 * NLAYER, "UTI2", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1821 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 8 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1822 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 9 * NLAYER, "UTI3", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1823 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 10 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1824 TVirtualMC::GetMC()->Gsposp("UTP1", 6 + 11 * NLAYER, "UTI4", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1825 // Front of supermodules
1826 xpos = CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1827 ypos = 0.0;
1828 zpos = SHEIGHT / 2.0 - SMPLTT - 0.6 - kPWRwid / 2.0;
1829 parPWR[0] = kPWRwid / 2.0;
1830 parPWR[1] = FLENGTH / 2.0;
1831 parPWR[2] = kPWRhgtB / 2.0;
1832 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 2 * NLAYER, "UTF1", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1833 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 3 * NLAYER, "UTF1", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1834 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 4 * NLAYER, "UTF2", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1835 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 5 * NLAYER, "UTF2", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1836 // In baby frame
1837 xpos = CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 3.0;
1838 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1839 zpos = SHEIGHT / 2.0 - SMPLTT - 0.6 - kPWRwid / 2.0;
1840 parPWR[0] = kPWRwid / 2.0;
1841 parPWR[1] = kBBSdz / 2.0;
1842 parPWR[2] = kPWRhgtB / 2.0;
1843 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 6 * NLAYER, "BBTRD", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1844 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 7 * NLAYER, "BBTRD", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1845 // In back frame
1846 xpos = CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1847 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1848 zpos = SHEIGHT / 2.0 - SMPLTT - 0.6 - kPWRwid / 2.0;
1849 parPWR[0] = kPWRwid / 2.0;
1850 parPWR[1] = kBFSdz / 2.0;
1851 parPWR[2] = kPWRhgtB / 2.0;
1852 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 8 * NLAYER, "BFTRD", xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1853 TVirtualMC::GetMC()->Gsposp("UTP3", 6 + 9 * NLAYER, "BFTRD", -xpos, ypos, zpos, matrix[3], "ONLY", parPWR, kNparPWR);
1854
1855 //
1856 // The gas tubes connecting the chambers in the super modules with holes
1857 // Material: Stainless steel
1858 //
1859
1860 // PHOS holes
1861 parTube[0] = 0.0;
1862 parTube[1] = 2.2 / 2.0;
1863 parTube[2] = CLENGTH[5][2] / 2.0 - HSPACE / 2.0;
1864 createVolume("UTG1", "TUBE", idtmed[8], parTube, kNparTube);
1865 parTube[0] = 0.0;
1866 parTube[1] = 2.1 / 2.0;
1867 parTube[2] = CLENGTH[5][2] / 2.0 - HSPACE / 2.0;
1868 createVolume("UTG2", "TUBE", idtmed[9], parTube, kNparTube);
1869 xpos = 0.0;
1870 ypos = 0.0;
1871 zpos = 0.0;
1872 TVirtualMC::GetMC()->Gspos("UTG2", 1, "UTG1", xpos, ypos, zpos, 0, "ONLY");
1873 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
1874 xpos = CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 - 1.5;
1875 ypos = 0.0;
1876 zpos = VROCSM + SMPLTT + kCOLhgt / 2.0 - SHEIGHT / 2.0 + 5.0 + ilayer * (CH + VSPACE);
1877 TVirtualMC::GetMC()->Gspos("UTG1", 1 + ilayer, "UTI3", xpos, ypos, zpos, matrix[4], "ONLY");
1878 TVirtualMC::GetMC()->Gspos("UTG1", 7 + ilayer, "UTI3", -xpos, ypos, zpos, matrix[4], "ONLY");
1879 }
1880 // Missing L4S4 chamber in sector 17
1881 parTube[0] = 0.0;
1882 parTube[1] = 2.2 / 2.0;
1883 parTube[2] = CLENGTH[4][4] / 2.0 - HSPACE / 2.0;
1884 createVolume("UTG3", "TUBE", idtmed[8], parTube, kNparTube);
1885 parTube[0] = 0.0;
1886 parTube[1] = 2.1 / 2.0;
1887 parTube[2] = CLENGTH[4][4] / 2.0 - HSPACE / 2.0;
1888 createVolume("UTG4", "TUBE", idtmed[9], parTube, kNparTube);
1889 xpos = 0.0;
1890 ypos = 0.0;
1891 zpos = 0.0;
1892 TVirtualMC::GetMC()->Gspos("UTG4", 1, "UTG3", xpos, ypos, zpos, 0, "ONLY");
1893 xpos = CWIDTH[4] / 2.0 + kCOLwid / 2.0 - 1.5;
1894 ypos = -CLENGTH[4][0] / 2.0 - CLENGTH[4][1] - CLENGTH[4][2] / 2.0;
1895 zpos = VROCSM + SMPLTT + kCOLhgt / 2.0 - SHEIGHT / 2.0 + 5.0 + 4 * (CH + VSPACE);
1896 TVirtualMC::GetMC()->Gspos("UTG3", 1, "UTI4", xpos, ypos, zpos, matrix[4], "ONLY");
1897 TVirtualMC::GetMC()->Gspos("UTG4", 2, "UTI4", -xpos, ypos, zpos, matrix[4], "ONLY");
1898
1899 //
1900 // The volumes for the services at the chambers
1901 //
1902
1903 const int kNparServ = 3;
1904 float parServ[kNparServ];
1905
1906 for (istack = 0; istack < NSTACK; istack++) {
1907 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
1908 int iDet = getDetectorSec(ilayer, istack);
1909
1910 snprintf(cTagV, kTag, "UU%02d", iDet);
1911 parServ[0] = CWIDTH[ilayer] / 2.0;
1912 parServ[1] = CLENGTH[ilayer][istack] / 2.0 - HSPACE / 2.0;
1913 parServ[2] = CSVH / 2.0;
1914 createVolume(cTagV, "BOX", idtmed[2], parServ, kNparServ);
1915 }
1916 }
1917
1918 //
1919 // The cooling pipes inside the service volumes
1920 //
1921
1922 // The cooling pipes
1923 parTube[0] = 0.0;
1924 parTube[1] = 0.0;
1925 parTube[2] = 0.0;
1926 createVolume("UTCP", "TUBE", idtmed[24], parTube, 0);
1927 // The cooling water
1928 parTube[0] = 0.0;
1929 parTube[1] = 0.2 / 2.0;
1930 parTube[2] = -1.0;
1931 createVolume("UTCH", "TUBE", idtmed[14], parTube, kNparTube);
1932 // Water inside the cooling pipe
1933 xpos = 0.0;
1934 ypos = 0.0;
1935 zpos = 0.0;
1936 TVirtualMC::GetMC()->Gspos("UTCH", 1, "UTCP", xpos, ypos, zpos, 0, "ONLY");
1937
1938 // Position the cooling pipes in the mother volume
1939 for (istack = 0; istack < NSTACK; istack++) {
1940 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
1941 int iDet = getDetectorSec(ilayer, istack);
1942 int iCopy = getDetector(ilayer, istack, 0) * 100;
1943 int nMCMrow = getRowMax(ilayer, istack, 0);
1944 float ySize = (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)nMCMrow);
1945 snprintf(cTagV, kTag, "UU%02d", iDet);
1946 for (int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1947 xpos = 0.0;
1948 ypos = (0.5 + iMCMrow) * ySize - CLENGTH[ilayer][istack] / 2.0 + HSPACE / 2.0;
1949 zpos = 0.0 + 0.742 / 2.0;
1950 // The cooling pipes
1951 parTube[0] = 0.0;
1952 parTube[1] = 0.3 / 2.0; // Thickness of the cooling pipes
1953 parTube[2] = CWIDTH[ilayer] / 2.0;
1954 TVirtualMC::GetMC()->Gsposp("UTCP", iCopy + iMCMrow, cTagV, xpos, ypos, zpos, matrix[2], "ONLY", parTube,
1955 kNparTube);
1956 }
1957 }
1958 }
1959
1960 //
1961 // The power lines
1962 //
1963
1964 // The copper power lines
1965 parTube[0] = 0.0;
1966 parTube[1] = 0.0;
1967 parTube[2] = 0.0;
1968 createVolume("UTPL", "TUBE", idtmed[5], parTube, 0);
1969
1970 // Position the power lines in the mother volume
1971 for (istack = 0; istack < NSTACK; istack++) {
1972 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
1973 int iDet = getDetectorSec(ilayer, istack);
1974 int iCopy = getDetector(ilayer, istack, 0) * 100;
1975 int nMCMrow = getRowMax(ilayer, istack, 0);
1976 float ySize = (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)nMCMrow);
1977 snprintf(cTagV, kTag, "UU%02d", iDet);
1978 for (int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1979 xpos = 0.0;
1980 ypos = (0.5 + iMCMrow) * ySize - 1.0 - CLENGTH[ilayer][istack] / 2.0 + HSPACE / 2.0;
1981 zpos = -0.4 + 0.742 / 2.0;
1982 parTube[0] = 0.0;
1983 parTube[1] = 0.2 / 2.0; // Thickness of the power lines
1984 parTube[2] = CWIDTH[ilayer] / 2.0;
1985 TVirtualMC::GetMC()->Gsposp("UTPL", iCopy + iMCMrow, cTagV, xpos, ypos, zpos, matrix[2], "ONLY", parTube,
1986 kNparTube);
1987 }
1988 }
1989 }
1990
1991 //
1992 // The MCMs
1993 //
1994
1995 const float kMCMx = 3.0;
1996 const float kMCMy = 3.0;
1997 const float kMCMz = 0.3;
1998
1999 const float kMCMpcTh = 0.1;
2000 const float kMCMcuTh = 0.0025;
2001 const float kMCMsiTh = 0.03;
2002 const float kMCMcoTh = 0.04;
2003
2004 // The mother volume for the MCMs (air)
2005 const int kNparMCM = 3;
2006 float parMCM[kNparMCM];
2007 parMCM[0] = kMCMx / 2.0;
2008 parMCM[1] = kMCMy / 2.0;
2009 parMCM[2] = kMCMz / 2.0;
2010 createVolume("UMCM", "BOX", idtmed[2], parMCM, kNparMCM);
2011
2012 // The MCM carrier G10 layer
2013 parMCM[0] = kMCMx / 2.0;
2014 parMCM[1] = kMCMy / 2.0;
2015 parMCM[2] = kMCMpcTh / 2.0;
2016 createVolume("UMC1", "BOX", idtmed[19], parMCM, kNparMCM);
2017 // The MCM carrier Cu layer
2018 parMCM[0] = kMCMx / 2.0;
2019 parMCM[1] = kMCMy / 2.0;
2020 parMCM[2] = kMCMcuTh / 2.0;
2021 createVolume("UMC2", "BOX", idtmed[18], parMCM, kNparMCM);
2022 // The silicon of the chips
2023 parMCM[0] = kMCMx / 2.0;
2024 parMCM[1] = kMCMy / 2.0;
2025 parMCM[2] = kMCMsiTh / 2.0;
2026 createVolume("UMC3", "BOX", idtmed[20], parMCM, kNparMCM);
2027 // The aluminum of the cooling plates
2028 parMCM[0] = kMCMx / 2.0;
2029 parMCM[1] = kMCMy / 2.0;
2030 parMCM[2] = kMCMcoTh / 2.0;
2031 createVolume("UMC4", "BOX", idtmed[24], parMCM, kNparMCM);
2032
2033 // Put the MCM material inside the MCM mother volume
2034 xpos = 0.0;
2035 ypos = 0.0;
2036 zpos = -kMCMz / 2.0 + kMCMpcTh / 2.0;
2037 TVirtualMC::GetMC()->Gspos("UMC1", 1, "UMCM", xpos, ypos, zpos, 0, "ONLY");
2038 zpos += kMCMpcTh / 2.0 + kMCMcuTh / 2.0;
2039 TVirtualMC::GetMC()->Gspos("UMC2", 1, "UMCM", xpos, ypos, zpos, 0, "ONLY");
2040 zpos += kMCMcuTh / 2.0 + kMCMsiTh / 2.0;
2041 TVirtualMC::GetMC()->Gspos("UMC3", 1, "UMCM", xpos, ypos, zpos, 0, "ONLY");
2042 zpos += kMCMsiTh / 2.0 + kMCMcoTh / 2.0;
2043 TVirtualMC::GetMC()->Gspos("UMC4", 1, "UMCM", xpos, ypos, zpos, 0, "ONLY");
2044
2045 // Position the MCMs in the mother volume
2046 for (istack = 0; istack < NSTACK; istack++) {
2047 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
2048 int iDet = getDetectorSec(ilayer, istack);
2049 int iCopy = getDetector(ilayer, istack, 0) * 1000;
2050 int nMCMrow = getRowMax(ilayer, istack, 0);
2051 float ySize = (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)nMCMrow);
2052 int nMCMcol = 8;
2053 float xSize = (getChamberWidth(ilayer) - 2.0 * CPADW) / ((float)nMCMcol + 6); // Introduce 6 gaps
2054 int iMCM[8] = {1, 2, 3, 5, 8, 9, 10, 12}; // 0..7 MCM + 6 gap structure
2055 snprintf(cTagV, kTag, "UU%02d", iDet);
2056 for (int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2057 for (int iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
2058 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0 - CWIDTH[ilayer] / 2.0;
2059 ypos = (0.5 + iMCMrow) * ySize + 1.0 - CLENGTH[ilayer][istack] / 2.0 + HSPACE / 2.0;
2060 zpos = -0.4 + 0.742 / 2.0;
2061 TVirtualMC::GetMC()->Gspos("UMCM", iCopy + iMCMrow * 10 + iMCMcol, cTagV, xpos, ypos, zpos, 0, "ONLY");
2062 // Add two additional smaller cooling pipes on top of the MCMs
2063 // to mimic the meandering structure
2064 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0 - CWIDTH[ilayer] / 2.0;
2065 ypos = (0.5 + iMCMrow) * ySize - CLENGTH[ilayer][istack] / 2.0 + HSPACE / 2.0;
2066 zpos = 0.0 + 0.742 / 2.0;
2067 parTube[0] = 0.0;
2068 parTube[1] = 0.3 / 2.0; // Thickness of the cooling pipes
2069 parTube[2] = kMCMx / 2.0;
2070 TVirtualMC::GetMC()->Gsposp("UTCP", iCopy + iMCMrow * 10 + iMCMcol + 50, cTagV, xpos, ypos + 1.0, zpos,
2071 matrix[2], "ONLY", parTube, kNparTube);
2072 TVirtualMC::GetMC()->Gsposp("UTCP", iCopy + iMCMrow * 10 + iMCMcol + 500, cTagV, xpos, ypos + 2.0, zpos,
2073 matrix[2], "ONLY", parTube, kNparTube);
2074 }
2075 }
2076 }
2077 }
2078
2079 //
2080 // The DCS boards
2081 //
2082
2083 const float kDCSx = 9.0;
2084 const float kDCSy = 14.5;
2085 const float kDCSz = 0.3;
2086
2087 const float kDCSpcTh = 0.15;
2088 const float kDCScuTh = 0.01;
2089 const float kDCScoTh = 0.04;
2090
2091 // The mother volume for the DCSs (air)
2092 const int kNparDCS = 3;
2093 float parDCS[kNparDCS];
2094 parDCS[0] = kDCSx / 2.0;
2095 parDCS[1] = kDCSy / 2.0;
2096 parDCS[2] = kDCSz / 2.0;
2097 createVolume("UDCS", "BOX", idtmed[2], parDCS, kNparDCS);
2098
2099 // The DCS carrier G10 layer
2100 parDCS[0] = kDCSx / 2.0;
2101 parDCS[1] = kDCSy / 2.0;
2102 parDCS[2] = kDCSpcTh / 2.0;
2103 createVolume("UDC1", "BOX", idtmed[19], parDCS, kNparDCS);
2104 // The DCS carrier Cu layer
2105 parDCS[0] = kDCSx / 2.0;
2106 parDCS[1] = kDCSy / 2.0;
2107 parDCS[2] = kDCScuTh / 2.0;
2108 createVolume("UDC2", "BOX", idtmed[18], parDCS, kNparDCS);
2109 // The aluminum of the cooling plates
2110 parDCS[0] = 5.0 / 2.0;
2111 parDCS[1] = 5.0 / 2.0;
2112 parDCS[2] = kDCScoTh / 2.0;
2113 createVolume("UDC3", "BOX", idtmed[24], parDCS, kNparDCS);
2114
2115 // Put the DCS material inside the DCS mother volume
2116 xpos = 0.0;
2117 ypos = 0.0;
2118 zpos = -kDCSz / 2.0 + kDCSpcTh / 2.0;
2119 TVirtualMC::GetMC()->Gspos("UDC1", 1, "UDCS", xpos, ypos, zpos, 0, "ONLY");
2120 zpos += kDCSpcTh / 2.0 + kDCScuTh / 2.0;
2121 TVirtualMC::GetMC()->Gspos("UDC2", 1, "UDCS", xpos, ypos, zpos, 0, "ONLY");
2122 zpos += kDCScuTh / 2.0 + kDCScoTh / 2.0;
2123 TVirtualMC::GetMC()->Gspos("UDC3", 1, "UDCS", xpos, ypos, zpos, 0, "ONLY");
2124
2125 // Put the DCS board in the chamber services mother volume
2126 for (istack = 0; istack < NSTACK; istack++) {
2127 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
2128 int iDet = getDetectorSec(ilayer, istack);
2129 int iCopy = iDet + 1;
2130 xpos = CWIDTH[ilayer] / 2.0 -
2131 1.9 * (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)getRowMax(ilayer, istack, 0));
2132 ypos = 0.05 * CLENGTH[ilayer][istack];
2133 zpos = kDCSz / 2.0 - CSVH / 2.0;
2134 snprintf(cTagV, kTag, "UU%02d", iDet);
2135 TVirtualMC::GetMC()->Gspos("UDCS", iCopy, cTagV, xpos, ypos, zpos, 0, "ONLY");
2136 }
2137 }
2138
2139 //
2140 // The ORI boards
2141 //
2142
2143 const float kORIx = 4.2;
2144 const float kORIy = 13.5;
2145 const float kORIz = 0.3;
2146
2147 const float kORIpcTh = 0.15;
2148 const float kORIcuTh = 0.01;
2149 const float kORIcoTh = 0.04;
2150
2151 // The mother volume for the ORIs (air)
2152 const int kNparORI = 3;
2153 float parORI[kNparORI];
2154 parORI[0] = kORIx / 2.0;
2155 parORI[1] = kORIy / 2.0;
2156 parORI[2] = kORIz / 2.0;
2157 createVolume("UORI", "BOX", idtmed[2], parORI, kNparORI);
2158
2159 // The ORI carrier G10 layer
2160 parORI[0] = kORIx / 2.0;
2161 parORI[1] = kORIy / 2.0;
2162 parORI[2] = kORIpcTh / 2.0;
2163 createVolume("UOR1", "BOX", idtmed[19], parORI, kNparORI);
2164 // The ORI carrier Cu layer
2165 parORI[0] = kORIx / 2.0;
2166 parORI[1] = kORIy / 2.0;
2167 parORI[2] = kORIcuTh / 2.0;
2168 createVolume("UOR2", "BOX", idtmed[18], parORI, kNparORI);
2169 // The aluminum of the cooling plates
2170 parORI[0] = kORIx / 2.0;
2171 parORI[1] = kORIy / 2.0;
2172 parORI[2] = kORIcoTh / 2.0;
2173 createVolume("UOR3", "BOX", idtmed[24], parORI, kNparORI);
2174
2175 // Put the ORI material inside the ORI mother volume
2176 xpos = 0.0;
2177 ypos = 0.0;
2178 zpos = -kORIz / 2.0 + kORIpcTh / 2.0;
2179 TVirtualMC::GetMC()->Gspos("UOR1", 1, "UORI", xpos, ypos, zpos, 0, "ONLY");
2180 zpos += kORIpcTh / 2.0 + kORIcuTh / 2.0;
2181 TVirtualMC::GetMC()->Gspos("UOR2", 1, "UORI", xpos, ypos, zpos, 0, "ONLY");
2182 zpos += kORIcuTh / 2.0 + kORIcoTh / 2.0;
2183 TVirtualMC::GetMC()->Gspos("UOR3", 1, "UORI", xpos, ypos, zpos, 0, "ONLY");
2184
2185 // Put the ORI board in the chamber services mother volume
2186 for (istack = 0; istack < NSTACK; istack++) {
2187 for (ilayer = 0; ilayer < NLAYER; ilayer++) {
2188 int iDet = getDetectorSec(ilayer, istack);
2189 int iCopy = iDet + 1;
2190 xpos = CWIDTH[ilayer] / 2.0 -
2191 1.92 * (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)getRowMax(ilayer, istack, 0));
2192 ypos = -16.0;
2193 zpos = kORIz / 2.0 - CSVH / 2.0;
2194 snprintf(cTagV, kTag, "UU%02d", iDet);
2195 TVirtualMC::GetMC()->Gspos("UORI", iCopy, cTagV, xpos, ypos, zpos, 0, "ONLY");
2196 xpos = -CWIDTH[ilayer] / 2.0 +
2197 3.8 * (getChamberLength(ilayer, istack) - 2.0 * RPADW) / ((float)getRowMax(ilayer, istack, 0));
2198 ypos = -16.0;
2199 zpos = kORIz / 2.0 - CSVH / 2.0;
2200 snprintf(cTagV, kTag, "UU%02d", iDet);
2201 TVirtualMC::GetMC()->Gspos("UORI", iCopy + MAXCHAMBER, cTagV, xpos, ypos, zpos, 0, "ONLY");
2202 }
2203 }
2204
2205 //
2206 // Services in front of the super module
2207 //
2208
2209 // Gas in-/outlet pipes (INOX)
2210 parTube[0] = 0.0;
2211 parTube[1] = 0.0;
2212 parTube[2] = 0.0;
2213 createVolume("UTG3", "TUBE", idtmed[8], parTube, 0);
2214 // The gas inside the in-/outlet pipes (Xe)
2215 parTube[0] = 0.0;
2216 parTube[1] = 1.2 / 2.0;
2217 parTube[2] = -1.0;
2218 createVolume("UTG4", "TUBE", idtmed[9], parTube, kNparTube);
2219 xpos = 0.0;
2220 ypos = 0.0;
2221 zpos = 0.0;
2222 TVirtualMC::GetMC()->Gspos("UTG4", 1, "UTG3", xpos, ypos, zpos, 0, "ONLY");
2223 for (ilayer = 0; ilayer < NLAYER - 1; ilayer++) {
2224 xpos = 0.0;
2225 ypos = CLENGTH[ilayer][2] / 2.0 + CLENGTH[ilayer][1] + CLENGTH[ilayer][0];
2226 zpos = 9.0 - SHEIGHT / 2.0 + ilayer * (CH + VSPACE);
2227 parTube[0] = 0.0;
2228 parTube[1] = 1.5 / 2.0;
2229 parTube[2] = CWIDTH[ilayer] / 2.0 - 2.5;
2230 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1, "UTI1", xpos, ypos, zpos, matrix[2], "ONLY", parTube, kNparTube);
2231 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 1 * NLAYER, "UTI1", xpos, -ypos, zpos, matrix[2], "ONLY", parTube,
2232 kNparTube);
2233 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 2 * NLAYER, "UTI2", xpos, ypos, zpos, matrix[2], "ONLY", parTube,
2234 kNparTube);
2235 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 3 * NLAYER, "UTI2", xpos, -ypos, zpos, matrix[2], "ONLY", parTube,
2236 kNparTube);
2237 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 4 * NLAYER, "UTI3", xpos, ypos, zpos, matrix[2], "ONLY", parTube,
2238 kNparTube);
2239 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 5 * NLAYER, "UTI3", xpos, -ypos, zpos, matrix[2], "ONLY", parTube,
2240 kNparTube);
2241 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 6 * NLAYER, "UTI4", xpos, ypos, zpos, matrix[2], "ONLY", parTube,
2242 kNparTube);
2243 TVirtualMC::GetMC()->Gsposp("UTG3", ilayer + 1 + 7 * NLAYER, "UTI4", xpos, -ypos, zpos, matrix[2], "ONLY", parTube,
2244 kNparTube);
2245 }
2246
2247 // Gas distribution box
2248 parBox[0] = 14.50 / 2.0;
2249 parBox[1] = 4.52 / 2.0;
2250 parBox[2] = 5.00 / 2.0;
2251 createVolume("UTGD", "BOX ", idtmed[8], parBox, kNparBox);
2252 parBox[0] = 14.50 / 2.0;
2253 parBox[1] = 4.00 / 2.0;
2254 parBox[2] = 4.40 / 2.0;
2255 createVolume("UTGI", "BOX ", idtmed[9], parBox, kNparBox);
2256 parTube[0] = 0.0;
2257 parTube[1] = 4.0 / 2.0;
2258 parTube[2] = 8.0 / 2.0;
2259 createVolume("UTGT", "TUBE", idtmed[8], parTube, kNparTube);
2260 parTube[0] = 0.0;
2261 parTube[1] = 3.4 / 2.0;
2262 parTube[2] = 8.0 / 2.0;
2263 createVolume("UTGG", "TUBE", idtmed[9], parTube, kNparTube);
2264 xpos = 0.0;
2265 ypos = 0.0;
2266 zpos = 0.0;
2267 TVirtualMC::GetMC()->Gspos("UTGI", 1, "UTGD", xpos, ypos, zpos, 0, "ONLY");
2268 TVirtualMC::GetMC()->Gspos("UTGG", 1, "UTGT", xpos, ypos, zpos, 0, "ONLY");
2269 xpos = 0.0;
2270 ypos = 0.0;
2271 zpos = 0.0;
2272 TVirtualMC::GetMC()->Gspos("UTGD", 1, "UTF1", xpos, ypos, zpos, 0, "ONLY");
2273 xpos = -3.0;
2274 ypos = 0.0;
2275 zpos = 6.5;
2276 TVirtualMC::GetMC()->Gspos("UTGT", 1, "UTF1", xpos, ypos, zpos, 0, "ONLY");
2277 xpos = -11.25;
2278 ypos = 0.0;
2279 zpos = 0.5;
2280 TVirtualMC::GetMC()->Gspos("UTGT", 3, "UTF1", xpos, ypos, zpos, matrix[2], "ONLY");
2281 xpos = 11.25;
2282 ypos = 0.0;
2283 zpos = 0.5;
2284 TVirtualMC::GetMC()->Gspos("UTGT", 5, "UTF1", xpos, ypos, zpos, matrix[2], "ONLY");
2285
2286 // Cooling manifolds
2287 parBox[0] = 5.0 / 2.0;
2288 parBox[1] = 23.0 / 2.0;
2289 parBox[2] = 70.0 / 2.0;
2290 createVolume("UTCM", "BOX ", idtmed[2], parBox, kNparBox);
2291 parBox[0] = 5.0 / 2.0;
2292 parBox[1] = 5.0 / 2.0;
2293 parBox[2] = 70.0 / 2.0;
2294 createVolume("UTCA", "BOX ", idtmed[8], parBox, kNparBox);
2295 parBox[0] = 5.0 / 2.0 - 0.3;
2296 parBox[1] = 5.0 / 2.0 - 0.3;
2297 parBox[2] = 70.0 / 2.0 - 0.3;
2298 createVolume("UTCW", "BOX ", idtmed[14], parBox, kNparBox);
2299 xpos = 0.0;
2300 ypos = 0.0;
2301 zpos = 0.0;
2302 TVirtualMC::GetMC()->Gspos("UTCW", 1, "UTCA", xpos, ypos, zpos, 0, "ONLY");
2303 xpos = 0.0;
2304 ypos = 5.0 / 2.0 - 23.0 / 2.0;
2305 zpos = 0.0;
2306 TVirtualMC::GetMC()->Gspos("UTCA", 1, "UTCM", xpos, ypos, zpos, 0, "ONLY");
2307 parTube[0] = 0.0;
2308 parTube[1] = 3.0 / 2.0;
2309 parTube[2] = 18.0 / 2.0;
2310 createVolume("UTCO", "TUBE", idtmed[8], parTube, kNparTube);
2311 parTube[0] = 0.0;
2312 parTube[1] = 3.0 / 2.0 - 0.3;
2313 parTube[2] = 18.0 / 2.0;
2314 createVolume("UTCL", "TUBE", idtmed[14], parTube, kNparTube);
2315 xpos = 0.0;
2316 ypos = 0.0;
2317 zpos = 0.0;
2318 TVirtualMC::GetMC()->Gspos("UTCL", 1, "UTCO", xpos, ypos, zpos, 0, "ONLY");
2319 xpos = 0.0;
2320 ypos = 2.5;
2321 zpos = -70.0 / 2.0 + 7.0;
2322 TVirtualMC::GetMC()->Gspos("UTCO", 1, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2323 zpos += 7.0;
2324 TVirtualMC::GetMC()->Gspos("UTCO", 2, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2325 zpos += 7.0;
2326 TVirtualMC::GetMC()->Gspos("UTCO", 3, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2327 zpos += 7.0;
2328 TVirtualMC::GetMC()->Gspos("UTCO", 4, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2329 zpos += 7.0;
2330 TVirtualMC::GetMC()->Gspos("UTCO", 5, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2331 zpos += 7.0;
2332 TVirtualMC::GetMC()->Gspos("UTCO", 6, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2333 zpos += 7.0;
2334 TVirtualMC::GetMC()->Gspos("UTCO", 7, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2335 zpos += 7.0;
2336 TVirtualMC::GetMC()->Gspos("UTCO", 8, "UTCM", xpos, ypos, zpos, matrix[4], "ONLY");
2337
2338 xpos = 40.0;
2339 ypos = FLENGTH / 2.0 - 23.0 / 2.0;
2340 zpos = 0.0;
2341 TVirtualMC::GetMC()->Gspos("UTCM", 1, "UTF1", xpos, ypos, zpos, matrix[0], "ONLY");
2342 TVirtualMC::GetMC()->Gspos("UTCM", 2, "UTF1", -xpos, ypos, zpos, matrix[1], "ONLY");
2343 TVirtualMC::GetMC()->Gspos("UTCM", 3, "UTF2", xpos, -ypos, zpos, matrix[5], "ONLY");
2344 TVirtualMC::GetMC()->Gspos("UTCM", 4, "UTF2", -xpos, -ypos, zpos, matrix[6], "ONLY");
2345
2346 // Power connection boards (Cu)
2347 parBox[0] = 0.5 / 2.0;
2348 parBox[1] = 15.0 / 2.0;
2349 parBox[2] = 7.0 / 2.0;
2350 createVolume("UTPC", "BOX ", idtmed[25], parBox, kNparBox);
2351 for (ilayer = 0; ilayer < NLAYER - 1; ilayer++) {
2352 xpos = CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0;
2353 ypos = 0.0;
2354 zpos = VROCSM + SMPLTT + kPWRhgtA / 2.0 - SHEIGHT / 2.0 + kPWRposz + (ilayer + 1) * (CH + VSPACE);
2355 TVirtualMC::GetMC()->Gspos("UTPC", ilayer, "UTF1", xpos, ypos, zpos, matrix[0], "ONLY");
2356 TVirtualMC::GetMC()->Gspos("UTPC", ilayer + NLAYER, "UTF1", -xpos, ypos, zpos, matrix[1], "ONLY");
2357 }
2358 xpos = CWIDTH[5] / 2.0 + kPWRhgtA / 2.0 - 2.0;
2359 ypos = 0.0;
2360 zpos = SHEIGHT / 2.0 - SMPLTT - 2.0;
2361 TVirtualMC::GetMC()->Gspos("UTPC", 5, "UTF1", xpos, ypos, zpos, matrix[3], "ONLY");
2362 TVirtualMC::GetMC()->Gspos("UTPC", 5 + NLAYER, "UTF1", -xpos, ypos, zpos, matrix[3], "ONLY");
2363
2364 // Power connection panel (Al)
2365 parBox[0] = 60.0 / 2.0;
2366 parBox[1] = 10.0 / 2.0;
2367 parBox[2] = 3.0 / 2.0;
2368 createVolume("UTPP", "BOX ", idtmed[1], parBox, kNparBox);
2369 xpos = 0.0;
2370 ypos = 0.0;
2371 zpos = 18.0;
2372 TVirtualMC::GetMC()->Gspos("UTPP", 1, "UTF1", xpos, ypos, zpos, 0, "ONLY");
2373
2374 //
2375 // Electronics boxes
2376 //
2377
2378 // Casing (INOX)
2379 parBox[0] = 60.0 / 2.0;
2380 parBox[1] = 10.0 / 2.0;
2381 parBox[2] = 6.0 / 2.0;
2382 createVolume("UTE1", "BOX ", idtmed[8], parBox, kNparBox);
2383 // Interior (air)
2384 parBox[0] = parBox[0] - 0.5;
2385 parBox[1] = parBox[1] - 0.5;
2386 parBox[2] = parBox[2] - 0.5;
2387 createVolume("UTE2", "BOX ", idtmed[2], parBox, kNparBox);
2388 xpos = 0.0;
2389 ypos = 0.0;
2390 zpos = 0.0;
2391 TVirtualMC::GetMC()->Gspos("UTE2", 1, "UTE1", xpos, ypos, zpos, 0, "ONLY");
2392 xpos = 0.0;
2393 ypos = SLENGTH / 2.0 - 10.0 / 2.0 - 3.0;
2394 zpos = -SHEIGHT / 2.0 + 6.0 / 2.0 + 1.0;
2395 TVirtualMC::GetMC()->Gspos("UTE1", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
2396 TVirtualMC::GetMC()->Gspos("UTE1", 2, "UTI2", xpos, ypos, zpos, 0, "ONLY");
2397 TVirtualMC::GetMC()->Gspos("UTE1", 3, "UTI3", xpos, ypos, zpos, 0, "ONLY");
2398 TVirtualMC::GetMC()->Gspos("UTE1", 4, "UTI4", xpos, ypos, zpos, 0, "ONLY");
2399
2400 // Casing (INOX)
2401 parBox[0] = 50.0 / 2.0;
2402 parBox[1] = 15.0 / 2.0;
2403 parBox[2] = 20.0 / 2.0;
2404 createVolume("UTE3", "BOX ", idtmed[8], parBox, kNparBox);
2405 // Interior (air)
2406 parBox[0] = parBox[0] - 0.5;
2407 parBox[1] = parBox[1] - 0.5;
2408 parBox[2] = parBox[2] - 0.5;
2409 createVolume("UTE4", "BOX ", idtmed[2], parBox, kNparBox);
2410 xpos = 0.0;
2411 ypos = 0.0;
2412 zpos = 0.0;
2413 TVirtualMC::GetMC()->Gspos("UTE4", 1, "UTE3", xpos, ypos, zpos, 0, "ONLY");
2414 xpos = 0.0;
2415 ypos = -SLENGTH / 2.0 + 15.0 / 2.0 + 3.0;
2416 zpos = -SHEIGHT / 2.0 + 20.0 / 2.0 + 1.0;
2417 TVirtualMC::GetMC()->Gspos("UTE3", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
2418 TVirtualMC::GetMC()->Gspos("UTE3", 2, "UTI2", xpos, ypos, zpos, 0, "ONLY");
2419 TVirtualMC::GetMC()->Gspos("UTE3", 3, "UTI3", xpos, ypos, zpos, 0, "ONLY");
2420 TVirtualMC::GetMC()->Gspos("UTE3", 4, "UTI4", xpos, ypos, zpos, 0, "ONLY");
2421
2422 // Casing (INOX)
2423 parBox[0] = 20.0 / 2.0;
2424 parBox[1] = 7.0 / 2.0;
2425 parBox[2] = 20.0 / 2.0;
2426 createVolume("UTE5", "BOX ", idtmed[8], parBox, kNparBox);
2427 // Interior (air)
2428 parBox[0] = parBox[0] - 0.5;
2429 parBox[1] = parBox[1] - 0.5;
2430 parBox[2] = parBox[2] - 0.5;
2431 createVolume("UTE6", "BOX ", idtmed[2], parBox, kNparBox);
2432 xpos = 0.0;
2433 ypos = 0.0;
2434 zpos = 0.0;
2435 TVirtualMC::GetMC()->Gspos("UTE6", 1, "UTE5", xpos, ypos, zpos, 0, "ONLY");
2436 xpos = 20.0;
2437 ypos = -SLENGTH / 2.0 + 7.0 / 2.0 + 3.0;
2438 zpos = 0.0;
2439 TVirtualMC::GetMC()->Gspos("UTE5", 1, "UTI1", xpos, ypos, zpos, 0, "ONLY");
2440 TVirtualMC::GetMC()->Gspos("UTE5", 2, "UTI2", xpos, ypos, zpos, 0, "ONLY");
2441 TVirtualMC::GetMC()->Gspos("UTE5", 3, "UTI3", xpos, ypos, zpos, 0, "ONLY");
2442 TVirtualMC::GetMC()->Gspos("UTE5", 4, "UTI4", xpos, ypos, zpos, 0, "ONLY");
2443 xpos = -xpos;
2444 TVirtualMC::GetMC()->Gspos("UTE5", 5, "UTI1", xpos, ypos, zpos, 0, "ONLY");
2445 TVirtualMC::GetMC()->Gspos("UTE5", 6, "UTI2", xpos, ypos, zpos, 0, "ONLY");
2446 TVirtualMC::GetMC()->Gspos("UTE5", 7, "UTI3", xpos, ypos, zpos, 0, "ONLY");
2447 TVirtualMC::GetMC()->Gspos("UTE5", 8, "UTI4", xpos, ypos, zpos, 0, "ONLY");
2448}
2449
2450//_____________________________________________________________________________
2451void Geometry::assembleChamber(int ilayer, int istack)
2452{
2453 //
2454 // Group volumes UA, UD, UF, UU into an assembly that defines the
2455 // alignable volume of a single readout chamber
2456 //
2457
2458 const int kTag = 100;
2459 char cTagV[kTag];
2460 char cTagM[kTag];
2461
2462 double xpos = 0.0;
2463 double ypos = 0.0;
2464 double zpos = 0.0;
2465
2466 int idet = getDetectorSec(ilayer, istack);
2467
2468 // Create the assembly for a given ROC
2469 snprintf(cTagM, kTag, "UT%02d", idet);
2470 TGeoVolume* roc = new TGeoVolumeAssembly(cTagM);
2471
2472 // Add the lower part of the chamber (aluminum frame),
2473 // including radiator and drift region
2474 xpos = 0.0;
2475 ypos = 0.0;
2476 zpos = CRAH / 2.0 + CDRH / 2.0 - CHSV / 2.0;
2477 snprintf(cTagV, kTag, "UA%02d", idet);
2478 TGeoVolume* rocA = gGeoManager->GetVolume(cTagV);
2479 roc->AddNode(rocA, 1, new TGeoTranslation(xpos, ypos, zpos));
2480
2481 // Add the additional aluminum ledges
2482 xpos = CWIDTH[ilayer] / 2.0 + CALWMOD / 2.0;
2483 ypos = 0.0;
2484 zpos = CRAH + CDRH - CALZPOS - CALHMOD / 2.0 - CHSV / 2.0;
2485 snprintf(cTagV, kTag, "UZ%02d", idet);
2486 TGeoVolume* rocZ = gGeoManager->GetVolume(cTagV);
2487 roc->AddNode(rocZ, 1, new TGeoTranslation(xpos, ypos, zpos));
2488 roc->AddNode(rocZ, 2, new TGeoTranslation(-xpos, ypos, zpos));
2489
2490 // Add the additional wacosit ledges
2491 xpos = CWIDTH[ilayer] / 2.0 + CWSW / 2.0;
2492 ypos = 0.0;
2493 zpos = CRAH + CDRH - CWSH / 2.0 - CHSV / 2.0;
2494 snprintf(cTagV, kTag, "UP%02d", idet);
2495 TGeoVolume* rocP = gGeoManager->GetVolume(cTagV);
2496 roc->AddNode(rocP, 1, new TGeoTranslation(xpos, ypos, zpos));
2497 roc->AddNode(rocP, 2, new TGeoTranslation(-xpos, ypos, zpos));
2498
2499 // Add the middle part of the chamber (G10 frame),
2500 // including amplification region
2501 xpos = 0.0;
2502 ypos = 0.0;
2503 zpos = CAMH / 2.0 + CRAH + CDRH - CHSV / 2.0;
2504 snprintf(cTagV, kTag, "UD%02d", idet);
2505 TGeoVolume* rocD = gGeoManager->GetVolume(cTagV);
2506 roc->AddNode(rocD, 1, new TGeoTranslation(xpos, ypos, zpos));
2507
2508 // Add the upper part of the chamber (aluminum frame),
2509 // including back panel and FEE
2510 xpos = 0.0;
2511 ypos = 0.0;
2512 zpos = CROH / 2.0 + CAMH + CRAH + CDRH - CHSV / 2.0;
2513 snprintf(cTagV, kTag, "UF%02d", idet);
2514 TGeoVolume* rocF = gGeoManager->GetVolume(cTagV);
2515 roc->AddNode(rocF, 1, new TGeoTranslation(xpos, ypos, zpos));
2516
2517 // Add the volume with services on top of the back panel
2518 xpos = 0.0;
2519 ypos = 0.0;
2520 zpos = CSVH / 2.0 + CROH + CAMH + CRAH + CDRH - CHSV / 2.0;
2521 snprintf(cTagV, kTag, "UU%02d", idet);
2522 TGeoVolume* rocU = gGeoManager->GetVolume(cTagV);
2523 roc->AddNode(rocU, 1, new TGeoTranslation(xpos, ypos, zpos));
2524
2525 // Place the ROC assembly into the super modules
2526 xpos = 0.0;
2527 ypos = 0.0;
2528 ypos = CLENGTH[ilayer][0] + CLENGTH[ilayer][1] + CLENGTH[ilayer][2] / 2.0;
2529 for (int ic = 0; ic < istack; ic++) {
2530 ypos -= CLENGTH[ilayer][ic];
2531 }
2532 ypos -= CLENGTH[ilayer][istack] / 2.0;
2533 zpos = VROCSM + SMPLTT + CHSV / 2.0 - SHEIGHT / 2.0 + ilayer * (CH + VSPACE);
2534 TGeoVolume* sm1 = gGeoManager->GetVolume("UTI1");
2535 TGeoVolume* sm2 = gGeoManager->GetVolume("UTI2");
2536 TGeoVolume* sm3 = gGeoManager->GetVolume("UTI3");
2537 TGeoVolume* sm4 = gGeoManager->GetVolume("UTI4");
2538 sm1->AddNode(roc, 1, new TGeoTranslation(xpos, ypos, zpos));
2539 sm2->AddNode(roc, 1, new TGeoTranslation(xpos, ypos, zpos));
2540 if (istack != 2) {
2541 // w/o middle stack
2542 sm3->AddNode(roc, 1, new TGeoTranslation(xpos, ypos, zpos));
2543 }
2544 if (!((ilayer == 4) && (istack == 4))) {
2545 // Sector 17 w/o L4S4 chamber
2546 sm4->AddNode(roc, 1, new TGeoTranslation(xpos, ypos, zpos));
2547 }
2548}
2549
2551{
2552 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L)) {
2553 useT2LCache();
2554 }
2555 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) {
2556 useL2GCache();
2557 }
2558 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2G)) {
2559 useT2GCache();
2560 }
2561 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2GRot)) {
2563 }
2564
2565 std::string volPath;
2566 // keep in mind that changing this path can affect behaviour in Detector.cxx
2567 // see: https://github.com/AliceO2Group/AliceO2/pull/3890
2568 const std::string vpStr{"ALIC_1/barrel_1/B077_1/BSEGMO"};
2569 const std::string vpApp1{"_1/BTRD"};
2570 const std::string vpApp2{"_1"};
2571 const std::string vpApp3a{"/UTR1_1/UTS1_1/UTI1_1"};
2572 const std::string vpApp3b{"/UTR2_1/UTS2_1/UTI2_1"};
2573 const std::string vpApp3c{"/UTR3_1/UTS3_1/UTI3_1"};
2574 const std::string vpApp3d{"/UTR4_1/UTS4_1/UTI4_1"};
2575
2576 for (int ilayer = 0; ilayer < NLAYER; ilayer++) {
2577 for (int isector = 0; isector < NSECTOR; isector++) {
2578 for (int istack = 0; istack < NSTACK; istack++) {
2579 Int_t lid = getDetector(ilayer, istack, isector);
2580 // Check for disabled supermodules
2581 volPath = vpStr;
2582 volPath += std::to_string(isector);
2583 volPath += vpApp1;
2584 volPath += std::to_string(isector);
2585 volPath += vpApp2;
2586 switch (isector) {
2587 case 17:
2588 if ((istack == 4) && (ilayer == 4)) {
2589 continue;
2590 }
2591 volPath += vpApp3d;
2592 break;
2593 case 13:
2594 case 14:
2595 case 15:
2596 // Check for holes in from of PHOS
2597 if (istack == 2) {
2598 continue;
2599 }
2600 volPath += vpApp3c;
2601 break;
2602 case 11:
2603 case 12:
2604 volPath += vpApp3b;
2605 break;
2606 default:
2607 volPath += vpApp3a;
2608 };
2609 if (!gGeoManager->CheckPath(volPath.c_str())) {
2610 continue;
2611 }
2613 TGeoHMatrix rotMatrix;
2614 rotMatrix.RotateX(-90);
2615 rotMatrix.RotateY(-90);
2616 rotMatrix.MultiplyLeft(m);
2617 const TGeoHMatrix& t2l = rotMatrix.Inverse();
2618 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) {
2619 setMatrixL2G(Mat3D(t2l), lid);
2620 }
2621
2622 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2623 TGeoHMatrix rotSector;
2624 rotSector.RotateZ(sectorAngle);
2625 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2G)) {
2626 setMatrixT2G(Mat3D(rotSector), lid);
2627 }
2628 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2GRot)) {
2629 setMatrixT2GRot(Rot2D(sectorAngle), lid);
2630 }
2631 if (mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L)) {
2632 const TGeoMatrix& inv = rotSector.Inverse();
2633 rotMatrix.MultiplyLeft(&inv);
2634 setMatrixT2L(Mat3D(rotMatrix.Inverse()), lid);
2635 }
2636 }
2637 }
2638 }
2639}
2640
2641//_____________________________________________________________________________
2643{
2644 //
2645 // define alignable volumes of the TRD
2646 //
2647 if (!gGeoManager) {
2648 LOG(fatal) << "Geometry is not loaded";
2649 }
2650
2651 std::string volPath;
2652 std::string vpStr{"ALIC_1/barrel_1/B077_1/BSEGMO"};
2653 const std::string vpApp1{"_1/BTRD"};
2654 const std::string vpApp2{"_1"};
2655 const std::string vpApp3a{"/UTR1_1/UTS1_1/UTI1_1"};
2656 const std::string vpApp3b{"/UTR2_1/UTS2_1/UTI2_1"};
2657 const std::string vpApp3c{"/UTR3_1/UTS3_1/UTI3_1"};
2658 const std::string vpApp3d{"/UTR4_1/UTS4_1/UTI4_1"};
2659 std::string symName;
2660
2661 // in opposite to AliGeomManager, we use consecutive numbering of modules through whole TRD
2662
2663 // The super modules
2664 // The symbolic names are: TRD/sm00 ... TRD/sm17
2665 for (int isector = 0; isector < NSECTOR; isector++) {
2666 volPath = vpStr;
2667 volPath += std::to_string(isector);
2668 volPath += vpApp1;
2669 volPath += std::to_string(isector);
2670 volPath += vpApp2;
2671 symName = Form("TRD/sm%02d", isector);
2672 gGeoManager->SetAlignableEntry(symName.c_str(), volPath.c_str());
2673 }
2674
2675 // The readout chambers
2676 // The symbolic names are: TRD/sm00/st0/pl0 ... TRD/sm17/st4/pl5
2677
2678 for (int isector = 0; isector < NSECTOR; isector++) {
2679 if (!getSMstatus(isector)) {
2680 continue;
2681 }
2682 for (int ilayer = 0; ilayer < NLAYER; ilayer++) {
2683 for (int istack = 0; istack < NSTACK; istack++) {
2684 Int_t lid = getDetector(ilayer, istack, isector);
2685 int idet = getDetectorSec(ilayer, istack);
2686
2687 // Check for disabled supermodules
2688 volPath = vpStr;
2689 volPath += std::to_string(isector);
2690 volPath += vpApp1;
2691 volPath += std::to_string(isector);
2692 volPath += vpApp2;
2693 switch (isector) {
2694 case 17:
2695 if ((istack == 4) && (ilayer == 4)) {
2696 continue;
2697 }
2698 volPath += vpApp3d;
2699 break;
2700 case 13:
2701 case 14:
2702 case 15:
2703 // Check for holes in from of PHOS
2704 if (istack == 2) {
2705 continue;
2706 }
2707 volPath += vpApp3c;
2708 break;
2709 case 11:
2710 case 12:
2711 volPath += vpApp3b;
2712 break;
2713 default:
2714 volPath += vpApp3a;
2715 };
2716 volPath += Form("/UT%02d_1", idet);
2717
2718 symName = Form("TRD/sm%02d/st%d/pl%d", isector, istack, ilayer);
2720
2721 TGeoPNEntry* alignableEntry = gGeoManager->SetAlignableEntry(symName.c_str(), volPath.c_str(), modID);
2722
2723 // Add the tracking to local matrix
2724 if (alignableEntry) {
2725 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
2726 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2727 TGeoHMatrix* t2lMatrix = new TGeoHMatrix();
2728 t2lMatrix->RotateZ(sectorAngle);
2729 const TGeoHMatrix& globmatrixi = globMatrix->Inverse();
2730 t2lMatrix->MultiplyLeft(&globmatrixi);
2731 alignableEntry->SetMatrix(t2lMatrix);
2732 } else {
2733 LOG(error) << "Alignable entry is not valid: ModID:" << modID << " Sector:" << isector << " Lr:" << ilayer
2734 << " Stack: " << istack << " name: " << symName.c_str() << " vol: " << volPath.c_str();
2735 }
2736 }
2737 }
2738 }
2739}
2740
2741//_____________________________________________________________________________
2743{
2744
2745 if (!gGeoManager) {
2746 LOG(error) << "Geometry is not loaded yet";
2747 return false;
2748 }
2749
2750 if (isBuilt()) {
2751 LOG(warning) << "Already built";
2752 return true; // already initialized
2753 }
2754
2755 setSize(NCHAMBER, MAXCHAMBER); //Only NCHAMBER=521 of MAXCHAMBER matrices are filled
2756 fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L) | o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G) |
2757 o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2G) | o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2GRot));
2758 return true;
2759}
2760
2761//_____________________________________________________________________________
2763{
2764 //
2765 // Checks whether the given detector is part of the current geometry
2766 //
2767
2768 if (!isMatrixAvailable(det)) {
2769 return false;
2770 } else {
2771 return true;
2772 }
2773}
General auxilliary methods.
Definition of the GeometryManager class.
uint32_t roc
Definition RawData.h:3
uint32_t col
Definition RawData.h:4
static int getSensID(o2::detectors::DetID detid, int sensid)
static TGeoHMatrix * getMatrix(const char *symname)
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
static constexpr ID TRD
Definition DetID.h:65
void setMatrixT2L(const Mat3D &matrix, int sensID)
o2::math_utils::Rotation2Df_t Rot2D
void setMatrixT2GRot(const Rot2D &matrix, int sensID)
o2::math_utils::Transform3D Mat3D
void setMatrixL2G(const Mat3D &matrix, int sensID)
void setMatrixT2G(const Mat3D &matrix, int sensID)
bool isMatrixAvailable(int sensID) const
static constexpr float PGLTHICK
Thickness of the glue layer.
static constexpr float PRBTHICK
Thickness of the PCB copper layers.
static constexpr float AMZPOS
Position of the amplification region.
static constexpr float PELTHICK
Thickness of all other electronics components (caps, etc.)
static constexpr float DRZPOS
Position of the drift region.
static constexpr float AMTHICK
Thickness of the amplification region.
static constexpr float CALHMOD
Height of additional aluminum ledge on lower frame.
static constexpr float CWSW
Width of additional wacosit ledge on lower frame.
static constexpr float CWIDTH[constants::NLAYER]
static constexpr float PPDTHICK
Thickness of copper of the pad plane.
static constexpr float CAUT
Al frame of back panel.
static constexpr float DRTHICK
Thickness of the drift region.
static constexpr float CGLT
Thichness of the glue around the radiator.
static constexpr float CSVH
Height of the services on top of the chambers.
static constexpr float RRHTHICK
Thickness of the rohacell layers in the radiator.
static constexpr float CWSH
Height of additional wacosit ledge on lower frame.
static constexpr float CLENGTH[constants::NLAYER][constants::NSTACK]
static constexpr float CHSV
Total height of the chambers (with services)
static constexpr float SWIDTH1
Lower width of the supermodule.
static constexpr float RFBTHICK
Thickness of the fiber layers in the radiator.
static constexpr float SLENGTH
Length of the supermodule.
static constexpr float WRTHICK
Thickness of the wire planes.
static constexpr float PHCTHICK
Thickness of the honeycomb support structure.
static constexpr float CROW
Additional width of the readout chamber frames.
static constexpr float CCLFT
Thickness of the lower Wacosit frame front.
static constexpr float CROH
Height of the readout of the chambers.
static constexpr float PCBTHICK
Thickness of the carbon layers.
static constexpr float CALZPOS
Position of the additional aluminum ledges.
static constexpr float RCBTHICK
Thickness of the carbon layers in the radiator.
static constexpr float CCLST
Thickness of the lower Wacosit frame sides.
static constexpr float WRZPOSB
Position of the wire planes.
static constexpr float RGLTHICK
Thickness of the glue layers in the radiator.
static constexpr float VROCSM
Radial distance of the first ROC to the outer plates of the SM.
PadPlane mPadPlanes[constants::NLAYER *constants::NSTACK]
static constexpr float FLENGTH
static constexpr float CRAH
Height of the radiator part of the chambers.
static constexpr float PPPTHICK
Thickness of PCB board of the pad plane.
static constexpr float CALH
Height of additional aluminum ledge on lower frame.
static constexpr float VSPACE
Vertical spacing of the chambers.
static constexpr float SHEIGHT
Height of the supermodule.
static constexpr float CDRH
Height of the drift region of the chambers.
static constexpr float CCUTB
Thickness of the upper Wacosit frame around amp. region.
static constexpr float SMPLTT
Thickness of the super module side plates.
static constexpr float HSPACE
Horizontal spacing of the chambers.
static constexpr float CH
Total height of the chambers (w/o services)
static constexpr float CALWMOD
Width of additional aluminum ledge on lower frame.
static constexpr float RMYTHICK
Thickness of the mylar layers in the radiator.
static constexpr float SWIDTH2
Upper width of the supermodule.
static constexpr float CPADW
static constexpr float PPCTHICK
Thickness of the PCB readout boards.
static constexpr float RPADW
>Difference of outer chamber width and pad plane width
static constexpr float WRZPOSA
Position of the wire planes.
static constexpr float CAMH
Height of the amplification region of the chambers.
static constexpr float CCUTA
Upper Wacosit frame around amplification region.
static constexpr float CALT
Thicknesses of different parts of the chamber frame Lower aluminum frame.
bool rotateBack(int det, const float *const loc, float *glb) const
Definition Geometry.cxx:37
void createPadPlaneArray()
Definition Geometry.cxx:55
void addAlignableVolumes() const
bool createClusterMatrixArray()
void fillMatrixCache(int mask) override
void createGeometry(std::vector< int > const &idtmed)
Definition Geometry.cxx:258
bool chamberInGeometry(int det) const
void setLayer(int l)
Definition PadPlane.h:42
const GLfloat * m
Definition glcorearb.h:4066
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLuint mask
Definition glcorearb.h:291
std::string detectors(const std::vector< std::string > &det, unsigned mask)
constexpr int NLAYER
the number of layers
Definition Constants.h:27
constexpr int NSECTOR
the number of sectors
Definition Constants.h:25
constexpr int NSTACK
the number of stacks per sector
Definition Constants.h:26
constexpr int MAXCHAMBER
the maximum number of installed chambers
Definition Constants.h:30
constexpr int NCHAMBER
the number of chambers actually installed
Definition Constants.h:32
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
static constexpr int L2G
Definition Cartesian.h:54
static constexpr int T2L
Definition Cartesian.h:55
static constexpr int T2GRot
Definition Cartesian.h:57
static constexpr int T2G
Definition Cartesian.h:56
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)