Project
Loading...
Searching...
No Matches
Station1Geometry.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
16
17#include "Materials.h"
18#include "Station1Geometry.h"
19
20#include <TGeoCompositeShape.h>
21#include <TGeoManager.h>
22#include <TGeoMedium.h>
23#include <TGeoShape.h>
24#include <TGeoArb8.h>
25#include <TGeoXtru.h>
26#include <TGeoTube.h>
27#include <TGeoVolume.h>
28
29#include <iostream>
30#include <string>
31#include <array>
32
33namespace o2
34{
35namespace mch
36{
37
39
40// chamber z position (from AliMUONConstants)
41const double kChamberZPos[2] = {-526.16, -545.24};
42
43// quadrant z position w.r.t the chamber center
44const double kQuadrantZPos = 7.5 / 2;
45
46// thickness
47const double kHzPadPlane = 0.0148 / 2; // pad plane
48const double kHzFoam = 2.503 / 2; // foam of mechanical plane
49const double kHzFR4 = 0.062 / 2; // FR4 of mechanical plane
50const double kTotalHzPlane = kHzFoam + kHzFR4;
51const double kHzSnPb = 0.0091 / 2; // pad / kapton connection (66 pt)
52const double kHzKapton = 0.0122 / 2; // kapton
53const double kHzBergPlastic = 0.3062 / 2; // Berg connector
54const double kHzBergCopper = 0.1882 / 2; // Berg connector
55const double kHzDaughter = 0.0156 / 2; // daughter board
56const double kHzGas = 0.42 / 2; // gas
57
58// spacers
59const double kHxBoxSpacer = 0.51;
60const double kHySpacer5A = 0.17;
61const double kHzSpacer5A = 1.1515;
62const double kHySpacer6 = 1.5;
63const double kHzSpacer6 = 0.1;
64const double kRSpacer7A = 0.3;
65const double kHzSpacer7A = 0.1;
66
67// quadrant mother volume
68const double kMotherPhiL = 0.;
69const double kMotherPhiU = 90.;
70
71// TUBS1 - Middle layer of model
72const double kMotherIR1 = 18.3;
73const double kMotherOR1 = 105.673;
74const double kMotherThick1 = 6.5 / 2;
75
76// TUBS2 - near and far layers of model
77const double kMotherIR2 = 20.7;
78const double kMotherOR2 = 100.073;
79const double kMotherThick2 = 1.5;
80
81// sensitive copper pads, foam layer, PCB and electronics model parameters
82const double kHxHole = 1.5 / 2;
83const double kHyHole = 3.;
84const double kHxBergPlastic = 0.74 / 2;
85const double kHyBergPlastic = 5.09 / 2;
86const double kHxBergCopper = 0.25 / 2;
87const double kHyBergCopper = 3.6 / 2;
88const double kHxKapton = 0.4;
89const double kHyKapton = 5.7 / 2;
90const double kHxDaughter = 2.3 / 2;
91const double kHyDaughter = 6.3 / 2;
92const double kOffsetX = 1.46;
93const double kOffsetY = 0.71;
94const double kDeltaFilleEtamX = 1.;
95const double kDeltaFilleEtamY = 0.051;
96
97// lateral positionner parameters
98const double kLateralXPosShift = 92.175;
99const double kLateralYPosShift = 5.;
100
101// trapezoid angles
102const double kThetaTrap = 0.;
103const double kPhiTrap = 0.;
104
105// parameters relative to the LHC beam pipe
106const double kNearFarLHC = 2.4; // Near and Far TUBS Origin wrt LHC Origin
107const double kDeltaQuadLHC = 2.6; // LHC Origin wrt Quadrant Origin
108const double kFrameOffset = 5.2;
109
110// pad plane offsets
111const double kPadXOffsetBP = 0.50 - 0.63 / 2; // = 0.185
112const double kPadYOffsetBP = -0.31 - 0.42 / 2; // = -0.52
113const int kFoamBoxNameOffset = 200;
114const int kFR4BoxNameOffset = 400;
115const int kDaughterCopyNoOffset = 1000;
116
117// volume names
118const char* kHoleName = "SCHL";
119const char* kDaughterName = "SCDB";
120const char* kQuadrantMLayerName = "SQM";
121const char* kQuadrantNLayerName = "SQN";
122const char* kQuadrantFLayerName = "SQF";
123const char* kQuadrantMFLayerName = "SQMF";
124
125//______________________________________________________________________________
127{
129
130 auto hole = new TGeoVolumeAssembly(kHoleName);
131
132 hole->AddNode(gGeoManager->MakeBox("SNPB", assertMedium(Medium::Copper), kHxKapton, kHyKapton, kHzSnPb), 1,
133 new TGeoTranslation(0., 0., -kHzFoam + kHzSnPb));
134
135 hole->AddNode(gGeoManager->MakeBox("SKPT", assertMedium(Medium::Copper), kHxHole, kHyBergPlastic, kHzKapton), 1);
136}
137
138//______________________________________________________________________________
140{
142
143 auto daughter = new TGeoVolumeAssembly(kDaughterName);
144
145 daughter->AddNode(gGeoManager->MakeBox("SBGP", assertMedium(Medium::Plastic), kHxBergPlastic, kHyBergPlastic, kHzBergPlastic),
146 1, new TGeoTranslation(0., 0., -kHzDaughter));
147
148 daughter->AddNode(gGeoManager->MakeBox("SBGC", assertMedium(Medium::Copper), kHxBergCopper, kHyBergCopper, kHzBergCopper), 1);
149
150 daughter->AddNode(gGeoManager->MakeBox("SDGH", assertMedium(Medium::Copper), kHxDaughter, kHyDaughter, kHzDaughter),
151 1, new TGeoTranslation(0., 0., -kHzBergPlastic));
152}
153
154//______________________________________________________________________________
156{
159
160 new TGeoTube("cutTube", 0., kMotherIR1, kHzPadPlane + kHzGas);
161
162 // Xtru parameters
163 double maxXY = 89.;
164 double xy1 = 77.33;
165 double xy2 = 48.77;
166 double dxy1 = maxXY - xy1;
167
168 const int nz = 2;
169 const int nv = 6;
170 double vx[nv] = {0., 0., xy2, maxXY, maxXY, dxy1};
171 double vy[nv] = {dxy1, maxXY, maxXY, xy2, 0., 0.};
172
173 // layer parameters
174 const auto kGasMed = assertMedium(Medium::Gas);
175 const auto kPadMed = assertMedium(Medium::Copper);
176
177 const int kNLayers = 3;
178 const std::string kLayerName[kNLayers] = {"SA1G", "SA2G", "SA1C"};
179 const std::array<const TGeoMedium*, kNLayers> kLayerMedium = {kGasMed, kGasMed, kPadMed};
180 const double kLayerZpos[kNLayers] = {kHzGas, kHzGas, kHzPadPlane};
181
182 for (int i = 0; i < kNLayers; i++) {
183 TGeoXtru* xtruS = new TGeoXtru(nz);
184 xtruS->SetName(Form("xtruS%d", i + 1));
185 xtruS->DefinePolygon(nv, vx, vy);
186 xtruS->DefineSection(0, -kLayerZpos[i], 0., 0., 1.);
187 xtruS->DefineSection(1, kLayerZpos[i], 0., 0., 1.);
188 new TGeoVolume(kLayerName[i].data(), new TGeoCompositeShape(Form("layerS%d", i + 1), Form("xtruS%d-cutTube", i + 1)),
189 kLayerMedium[i]);
190 }
191}
192
193//______________________________________________________________________________
195{
197
204
208
209 new TGeoVolume("Spacer5A", new TGeoBBox(kHxBoxSpacer, kHySpacer5A, kHzSpacer5A), assertMedium(Medium::Epoxy));
210
211 new TGeoVolume("Spacer6", new TGeoBBox(kHxBoxSpacer, kHySpacer6, kHzSpacer6), assertMedium(Medium::Epoxy));
212
213 new TGeoVolume("Spacer7A", new TGeoTube(0., kRSpacer7A, kHzSpacer7A), assertMedium(Medium::Inox));
214}
215
216//______________________________________________________________________________
217void createFrame(int chamber)
218{
245
246 auto Mlayer = new TGeoVolumeAssembly(Form("%s%d", kQuadrantMLayerName, chamber));
247 auto Flayer = new TGeoVolumeAssembly(Form("%s%d", kQuadrantFLayerName, chamber));
248 auto MFlayer = new TGeoVolumeAssembly(Form("%s%d", kQuadrantMFLayerName, chamber));
249 auto Nlayer = new TGeoVolumeAssembly(Form("%s%d", kQuadrantNLayerName, chamber));
250
251 // rotation matrices
252 auto rot1 = new TGeoRotation("rot1", 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane
253 auto rot4 = new TGeoRotation("rot4", 90., 315., 90., 45., 0., 0.); // -45 deg in x-y plane
254
256
257 const double kHzFrameThickness = 1.59 / 2;
258 const double kHzOuterFrameEpoxy = 1.19 / 2;
259 const double kHzOuterFrameInox = 0.1 / 2;
260 const double kHzFoam2 = 2.083 / 2;
261
262 // Pertaining to the top outer area
263 const double kHzTopAnodeSteel1 = 0.185 / 2;
264 const double kHzTopAnodeSteel2 = 0.51 / 2;
265 const double kHzAnodeFR4 = 0.08 / 2;
266 const double kHzTopEarthFaceCu = 0.364 / 2;
267 const double kHzTopEarthProfileCu = 1.1 / 2;
268 const double kHzTopPositionerSteel = 1.45 / 2; // should really be 2.125/2.;
269 const double kHzTopGasSupportAl = 0.85 / 2;
270
271 // Pertaining to the vertical outer area
272 const double kHzVerticalCradleAl = 0.8 / 2;
273 const double kHzLateralSightAl = 0.975 / 2;
274 const double kHzLateralPosnInoxFace = 2.125 / 2;
275 const double kHzLatPosInoxProfM = 6.4 / 2;
276 const double kHzLatPosInoxProfNF = 1.45 / 2;
277 const double kHzLateralPosnAl = 0.5 / 2;
278 const double kHzVertEarthFaceCu = 0.367 / 2;
279 const double kHzVertBarSteel = 0.198 / 2;
280 const double kHzVertEarthProfCu = 1.1 / 2;
281
282 // parameter definitions in sequence
283
284 // InVFrame parameters
285 const double kHxInVFrame = 1.85 / 2;
286 const double kHyInVFrame = 73.95 / 2;
287 const double kHzInVFrame = kHzFrameThickness;
288
289 // Flat 7.5mm vertical section
290 const double kHxV1mm = 0.75 / 2;
291 const double kHyV1mm = 1.85 / 2;
292 const double kHzV1mm = kHzFrameThickness;
293
294 // OuterTopFrame Structure
295 //
296 // FRAME
297 // The frame is composed of a cuboid and two trapezoids
298 // (TopFrameAnode, TopFrameAnodeA, TopFrameAnodeB).
299 // Each shape is composed of two layers (Epoxy and Inox) and
300 // takes the frame's inner anode circuitry into account in the material budget.
301 //
302 // ANODE
303 // The overhanging anode part is composed froma cuboid and two trapezoids
304 // (TopAnode, TopAnode1, and TopAnode2). These surfaces neglect implanted
305 // resistors, but accounts for the major Cu, Pb/Sn, and FR4 material
306 // contributions.
307 // The stainless steel anode supports have been included.
308 //
309 // EARTHING (TopEarthFace, TopEarthProfile)
310 // Al GAS SUPPORT (TopGasSupport)
311 //
312 // ALIGNMENT (TopPositioner) - Alignment system, three sights per quarter
313 // chamber. This sight is forseen for the alignment of the horizontal level
314 // (parallel to the OY axis of LHC). Its position will be evaluated relative
315 // to a system of sights places on the cradles;
316
317 // TopFrameAnode parameters - cuboid, 2 layers
318 const double kHxTFA = 34.1433 / 2;
319 const double kHyTFA = 7.75 / 2;
320 const double kHzTFAE = kHzOuterFrameEpoxy; // layer 1 thickness
321 const double kHzTFAI = kHzOuterFrameInox; // layer 3 thickness
322
323 // TopFrameAnode parameters - 2 trapezoids, 2 layers (redefined with TGeoXtru shape)
324 const double kH1FAA = 8.7 / 2;
325 const double kTl1FAB = 4.35 / 2;
326 const double kTl1FAA = 7.75 / 2;
327
328 // TopAnode parameters - cuboid (part 1 of 3 parts)
329 const double kHxTA1 = 16.2 / 2;
330 const double kHyTA1 = 3.5 / 2;
331 const double kHzTA11 = kHzTopAnodeSteel1; // layer 1
332 const double kHzTA12 = kHzAnodeFR4; // layer 2
333
334 // TopAnode parameters - trapezoid 1 (part 2 of 3 parts)
335 const double kHzTA21 = kHzTopAnodeSteel2; // layer 1
336 const double kHzTA22 = kHzAnodeFR4; // layer 2
337 const double kHTA2 = 7.268 / 2;
338 const double kBlTA2 = 2.03 / 2;
339 const double kTlTA2 = 3.5 / 2;
340 const double kAlpTA2 = 5.78;
341
342 // TopAnode parameters - trapezoid 2 (part 3 of 3 parts)
343 const double kHzTA3 = kHzAnodeFR4; // layer 1
344 const double kHTA3 = 7.268 / 2;
345 const double kBlTA3 = 0.;
346 const double kTlTA3 = 2.03 / 2;
347 const double kAlpTA3 = 7.95;
348
349 // TopEarthFace parameters - single trapezoid
350 const double kHzTEF = kHzTopEarthFaceCu;
351 const double kHTEF = 1.2 / 2;
352 const double kBlTEF = 21.323 / 2;
353 const double kTlTEF = 17.963 / 2;
354 const double kAlpTEF = -54.46;
355
356 // TopEarthProfile parameters - single trapezoid
357 const double kHzTEP = kHzTopEarthProfileCu;
358 const double kHTEP = 0.2;
359 const double kBlTEP = 31.766 / 2;
360 const double kTlTEP = 30.535 / 2;
361 const double kAlpTEP = -56.98;
362
363 // TopPositioner parameters - single Stainless Steel trapezoid
364 const double kHzTP = kHzTopPositionerSteel;
365 const double kHTP = 1.5;
366 const double kBlTP = 7.023 / 2;
367 const double kTlTP = 7.314 / 2;
368 const double kAlpTP = 2.78;
369
370 // TopGasSupport parameters - single cuboid
371 const double kHxTGS = 8.5 / 2;
372 const double kHyTGS = 1.5;
373 const double kHzTGS = kHzTopGasSupportAl;
374
375 // OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material (redefined with TGeoXtru shape)
376 const double kH1OETF = 7.196 / 2; // common to all 4 trapezoids
377 const double kTl1OETF1 = 3.996 / 2; // Trapezoid 1
378 const double kTl1OETF2 = 3.75 / 2; // Trapezoid 2
379 const double kTl1OETF3 = 3.01 / 2; // Trapezoid 3
380 const double kTl1OETF4 = 1.77 / 2; // Trapezoid 4
381
383
384 // OutVFrame and corner (OutVFrame cuboid, OutVFrame trapezoid)
385 // EARTHING (VertEarthFaceCu,VertEarthSteel,VertEarthProfCu),
386 // DETECTOR POSITIONNING (SuppLateralPositionner, LateralPositionner),
387 // CRADLE (VertCradle), and
388 // ALIGNMENT (LateralSightSupport, LateralSight)
389
390 // OutVFrame parameters - cuboid
391 const double kHxOutVFrame = 1.85 / 2;
392 const double kHyOutVFrame = 46.23 / 2;
393 const double kHzOutVFrame = kHzFrameThickness;
394
395 // OutVFrame corner parameters - trapezoid
396 const double kHzOCTF = kHzFrameThickness;
397 const double kHOCTF = 1.85 / 2;
398 const double kBlOCTF = 0.;
399 const double kTlOCTF = 3.66 / 2;
400 const double kAlpOCTF = 44.67;
401
402 // VertEarthFaceCu parameters - single trapezoid
403 const double kHzVFC = kHzVertEarthFaceCu;
404 const double kHVFC = 0.6;
405 const double kBlVFC = 46.11 / 2;
406 const double kTlVFC = 48.236 / 2;
407 const double kAlpVFC = 41.54;
408
409 // VertEarthSteel parameters - single trapezoid
410 const double kHzVES = kHzVertBarSteel;
411 const double kHVES = 0.6;
412 const double kBlVES = 30.486 / 2;
413 const double kTlVES = 32.777 / 2;
414 const double kAlpVES = 43.67;
415
416 // VertEarthProfCu parameters - single trapezoid
417 const double kHzVPC = kHzVertEarthProfCu;
418 const double kHVPC = 0.2;
419 const double kBlVPC = 29.287 / 2;
420 const double kTlVPC = 30.091 / 2;
421 const double kAlpVPC = 45.14;
422
423 // SuppLateralPositionner - single cuboid
424 const double kHxSLP = 1.4;
425 const double kHySLP = 2.5;
426 const double kHzSLP = kHzLateralPosnAl;
427
428 // LateralPositionner - squared off U bend, face view
429 const double kHxLPF = 2.6;
430 const double kHyLPF = 1.5;
431 const double kHzLPF = kHzLateralPosnInoxFace;
432
433 // LateralPositionner - squared off U bend, profile view
434 const double kHxLPP = 0.425 / 2;
435 const double kHyLPP = 1.5;
436 const double kHzLPP = kHzLatPosInoxProfM; // middle layer
437 const double kHzLPNF = kHzLatPosInoxProfNF; // near and far layers
438
439 // VertCradle, 3 layers (copies), each composed of 4 trapezoids (redefined with TGeoXtru shape)
440 const double kH1VC1 = 10.25 / 2; // all cradles
441 const double kBl1VC1 = 3.7 / 2; // VertCradleA
442 const double kBl1VC2 = 6.266 / 2; // VertCradleB
443 const double kBl1VC3 = 7.75 / 2; // VertCradleC
444
445 // VertCradleD
446 const double kHzVC4 = kHzVerticalCradleAl;
447 const double kHVC4 = 10.27 / 2;
448 const double kBlVC4 = 8.273 / 2;
449 const double kTlVC4 = 7.75 / 2;
450 const double kAlpVC4 = -1.46;
451
452 // LateralSightSupport - single trapezoid
453 const double kHzVSS = kHzLateralSightAl;
454 const double kHVSS = 2.5;
455 const double kBlVSS = 7.747 / 2;
456 const double kTlVSS = 7.188 / 2;
457 const double kAlpVSS = -3.2;
458
459 // LateralSight (reference point) - 3 per quadrant, only 1 programmed for now
460 const double kVSInRad = 0.6;
461 const double kVSOutRad = 1.3;
462 const double kVSLen = kHzFrameThickness;
463
464 // InHFrame parameters
465 const double kHxInHFrame = 75.8 / 2;
466 const double kHyInHFrame = 1.85 / 2;
467 const double kHzInHFrame = kHzFrameThickness;
468
469 // Flat 7.5mm horizontal section
470 const double kHxH1mm = 1.85 / 2;
471 const double kHyH1mm = 0.75 / 2;
472 const double kHzH1mm = kHzFrameThickness;
473
474 // InArcFrame parameters
475 const double kIAF = 15.7;
476 const double kOAF = 17.55;
477 const double kHzAF = kHzFrameThickness;
478 const double kAFphi1 = 0.;
479 const double kAFphi2 = 90.;
480
481 // ScrewsInFrame parameters HEAD
482 const double kSCRUHMI = 0.;
483 const double kSCRUHMA = 0.69 / 2;
484 const double kSCRUHLE = 0.2;
485 // ScrewsInFrame parameters MIDDLE
486 const double kSCRUMMI = 0.;
487 const double kSCRUMMA = 0.39 / 2;
488 const double kSCRUMLE = kHzFrameThickness;
489 // ScrewsInFrame parameters NUT
490 const double kSCRUNMI = 0.;
491 const double kSCRUNMA = 0.78 / 2;
492 const double kSCRUNLE = 0.4;
493
494 const int npar = 11;
495 double par[npar];
496
497 if (chamber == 1) {
498 // materials
499 const auto kEpoxyMed = assertMedium(Medium::Epoxy);
500 const auto kInoxMed = assertMedium(Medium::Inox);
501 const auto kCopperMed = assertMedium(Medium::Copper);
502 const auto kAluMed = assertMedium(Medium::Aluminium);
503 const auto kFR4Med = assertMedium(Medium::FR4);
504
505 // InVFrame
506 new TGeoVolume("SQ00", new TGeoBBox(kHxInVFrame, kHyInVFrame, kHzInVFrame), kEpoxyMed);
507
508 // Flat 1mm vertical section
509 new TGeoVolume("SQ01", new TGeoBBox(kHxV1mm, kHyV1mm, kHzV1mm), kEpoxyMed);
510
512
513 // TopFrameAnode - layer 1 of 2
514 new TGeoVolume("SQ02", new TGeoBBox(kHxTFA, kHyTFA, kHzTFAE), kEpoxyMed);
515
516 // TopFrameAnode - layer 2 of 2
517 new TGeoVolume("SQ03", new TGeoBBox(kHxTFA, kHyTFA, kHzTFAI), kInoxMed);
518
519 // common declarations for TGeoXtru parameters
520 double dx, dx0, dx1, dx2, dx3, dy, dy1, dy2, dy3, dy4;
521 double vx[16], vy[16];
522 int nz = 2, nv = 5;
523
524 // SQ04to06 and SQ05to07
525
526 dx = 2 * kH1FAA;
527 dy1 = 2 * kTl1FAA;
528 dy2 = 2 * kTl1FAB;
529
530 vx[0] = 0.;
531 vy[0] = 0.;
532 vx[1] = 0.;
533 vy[1] = dy1;
534 vx[2] = dx;
535 vy[2] = dy2;
536 vx[3] = 2 * dx;
537 vy[3] = 0.;
538 vx[4] = dx;
539 vy[4] = 0.;
540
541 // shift center in the middle
542 for (int i = 0; i < nv; i++) {
543 vx[i] -= dx;
544 vy[i] -= dy1 / 2;
545 }
546
547 TGeoXtru* xtruS5 = new TGeoXtru(nz);
548 xtruS5->DefinePolygon(nv, vx, vy);
549 xtruS5->DefineSection(0, -kHzOuterFrameEpoxy, 0., 0., 1.);
550 xtruS5->DefineSection(1, kHzOuterFrameEpoxy, 0., 0., 1.);
551 new TGeoVolume("SQ04toSQ06", xtruS5, kEpoxyMed);
552
553 TGeoXtru* xtruS6 = new TGeoXtru(nz);
554 xtruS6->DefinePolygon(nv, vx, vy);
555 xtruS6->DefineSection(0, -kHzOuterFrameInox, 0., 0., 1.);
556 xtruS6->DefineSection(1, kHzOuterFrameInox, 0., 0., 1.);
557 new TGeoVolume("SQ05toSQ07", xtruS6, kInoxMed);
558
559 // TopAnode1 - layer 1 of 2
560 new TGeoVolume("SQ08", new TGeoBBox(kHxTA1, kHyTA1, kHzTA11), kInoxMed);
561
562 // TopAnode1 - layer 2 of 2
563 new TGeoVolume("SQ09", new TGeoBBox(kHxTA1, kHyTA1, kHzTA12), kFR4Med);
564
565 // TopAnode2 - layer 1 of 2
566 par[0] = kHzTA21;
567 par[1] = kThetaTrap; // defined once for all here !
568 par[2] = kPhiTrap; // defined once for all here !
569 par[3] = kHTA2;
570 par[4] = kBlTA2;
571 par[5] = kTlTA2;
572 par[6] = kAlpTA2;
573 par[7] = kHTA2;
574 par[8] = kBlTA2;
575 par[9] = kTlTA2;
576 par[10] = kAlpTA2;
577 gGeoManager->Volume("SQ10", "TRAP", kInoxMed->GetId(), par, npar);
578
579 // TopAnode2 - layer 2 of 2
580 par[0] = kHzTA22;
581 gGeoManager->Volume("SQ11", "TRAP", kFR4Med->GetId(), par, npar);
582
583 // TopAnode3 - layer 1 of 1
584 par[0] = kHzTA3;
585 par[3] = kHTA3;
586 par[4] = kBlTA3;
587 par[5] = kTlTA3;
588 par[6] = kAlpTA3;
589 par[7] = kHTA3;
590 par[8] = kBlTA3;
591 par[9] = kTlTA3;
592 par[10] = kAlpTA3;
593 gGeoManager->Volume("SQ12", "TRAP", kFR4Med->GetId(), par, npar);
594
595 // TopEarthFace
596 par[0] = kHzTEF;
597 par[3] = kHTEF;
598 par[4] = kBlTEF;
599 par[5] = kTlTEF;
600 par[6] = kAlpTEF;
601 par[7] = kHTEF;
602 par[8] = kBlTEF;
603 par[9] = kTlTEF;
604 par[10] = kAlpTEF;
605 gGeoManager->Volume("SQ13", "TRAP", kCopperMed->GetId(), par, npar);
606
607 // TopEarthProfile
608 par[0] = kHzTEP;
609 par[3] = kHTEP;
610 par[4] = kBlTEP;
611 par[5] = kTlTEP;
612 par[6] = kAlpTEP;
613 par[7] = kHTEP;
614 par[8] = kBlTEP;
615 par[9] = kTlTEP;
616 par[10] = kAlpTEP;
617 gGeoManager->Volume("SQ14", "TRAP", kCopperMed->GetId(), par, npar);
618
619 // TopGasSupport
620 new TGeoVolume("SQ15", new TGeoBBox(kHxTGS, kHyTGS, kHzTGS), assertMedium(Medium::Aluminium));
621
622 // TopPositioner parameters - single Stainless Steel trapezoid
623 par[0] = kHzTP;
624 par[3] = kHTP;
625 par[4] = kBlTP;
626 par[5] = kTlTP;
627 par[6] = kAlpTP;
628 par[7] = kHTP;
629 par[8] = kBlTP;
630 par[9] = kTlTP;
631 par[10] = kAlpTP;
632 gGeoManager->Volume("SQ16", "TRAP", kInoxMed->GetId(), par, npar);
633
634 // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox) (redefined with TGeoXtru shape )
635
636 dx = 2 * kH1OETF;
637 dy1 = 2 * kTl1OETF4;
638 dy2 = 2 * kTl1OETF3;
639 dy3 = 2 * kTl1OETF2;
640 dy4 = 2 * kTl1OETF1;
641
642 nz = 2;
643 nv = 16;
644 vx[0] = -4 * dx;
645 vy[0] = 0.;
646 vx[1] = -3 * dx;
647 vy[1] = dy1;
648 vx[2] = -2 * dx;
649 vy[2] = dy2;
650 vx[3] = -dx;
651 vy[3] = dy3;
652 vx[4] = 0.;
653 vy[4] = dy4;
654 vx[5] = dx;
655 vy[5] = dy3;
656 vx[6] = 2 * dx;
657 vy[6] = dy2;
658 vx[7] = 3 * dx;
659 vy[7] = dy1;
660 vx[8] = 4 * dx;
661 vy[8] = 0.;
662 vx[9] = 3 * dx;
663 vy[9] = 0.;
664 vx[10] = 2 * dx;
665 vy[10] = 0.;
666 vx[11] = dx;
667 vy[11] = 0.;
668 vx[12] = 0.;
669 vy[12] = 0.;
670 vx[13] = -dx;
671 vy[13] = 0.;
672 vx[14] = -2 * dx;
673 vy[14] = 0.;
674 vx[15] = -3 * dx;
675 vy[15] = 0.;
676
677 // shift center in the middle
678 for (int i = 0; i < nv; i++) {
679 vy[i] += dy4 / 2;
680 }
681
682 TGeoXtru* xtruS1 = new TGeoXtru(nz);
683 xtruS1->DefinePolygon(nv, vx, vy);
684 xtruS1->DefineSection(0, -kHzOuterFrameEpoxy, 0., 0., 1.);
685 xtruS1->DefineSection(1, kHzOuterFrameEpoxy, 0., 0., 1.);
686 new TGeoVolume("SQ17to23", xtruS1, kEpoxyMed);
687
688 TGeoXtru* xtruS2 = new TGeoXtru(nz);
689 xtruS2->DefinePolygon(nv, vx, vy);
690 xtruS2->DefineSection(0, -kHzOuterFrameInox, 0., 0., 1.);
691 xtruS2->DefineSection(1, kHzOuterFrameInox, 0., 0., 1.);
692 new TGeoVolume("SQ18to24", xtruS2, kInoxMed);
693
694 // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox)
695
696 // OutVFrame
697 new TGeoVolume("SQ25", new TGeoBBox(kHxOutVFrame, kHyOutVFrame, kHzOutVFrame), kEpoxyMed);
698
699 // OutVFrame corner
700 par[0] = kHzOCTF;
701 par[3] = kHOCTF;
702 par[4] = kBlOCTF;
703 par[5] = kTlOCTF;
704 par[6] = kAlpOCTF;
705 par[7] = kHOCTF;
706 par[8] = kBlOCTF;
707 par[9] = kTlOCTF;
708 par[10] = kAlpOCTF;
709 gGeoManager->Volume("SQ26", "TRAP", kEpoxyMed->GetId(), par, npar);
710
711 // EarthFaceCu trapezoid
712 par[0] = kHzVFC;
713 par[3] = kHVFC;
714 par[4] = kBlVFC;
715 par[5] = kTlVFC;
716 par[6] = kAlpVFC;
717 par[7] = kHVFC;
718 par[8] = kBlVFC;
719 par[9] = kTlVFC;
720 par[10] = kAlpVFC;
721 gGeoManager->Volume("SQ27", "TRAP", kCopperMed->GetId(), par, npar);
722
723 // VertEarthSteel trapezoid
724 par[0] = kHzVES;
725 par[3] = kHVES;
726 par[4] = kBlVES;
727 par[5] = kTlVES;
728 par[6] = kAlpVES;
729 par[7] = kHVES;
730 par[8] = kBlVES;
731 par[9] = kTlVES;
732 par[10] = kAlpVES;
733 gGeoManager->Volume("SQ28", "TRAP", kInoxMed->GetId(), par, npar);
734
735 // VertEarthProfCu trapezoid
736 par[0] = kHzVPC;
737 par[3] = kHVPC;
738 par[4] = kBlVPC;
739 par[5] = kTlVPC;
740 par[6] = kAlpVPC;
741 par[7] = kHVPC;
742 par[8] = kBlVPC;
743 par[9] = kTlVPC;
744 par[10] = kAlpVPC;
745 gGeoManager->Volume("SQ29", "TRAP", kCopperMed->GetId(), par, npar);
746
747 // SuppLateralPositionner cuboid
748 new TGeoVolume("SQ30", new TGeoBBox(kHxSLP, kHySLP, kHzSLP), kAluMed);
749
750 // LateralPositionerFace
751 new TGeoVolume("SQ31", new TGeoBBox(kHxLPF, kHyLPF, kHzLPF), kInoxMed);
752
753 // LateralPositionerProfile
754 new TGeoVolume("SQ32", new TGeoBBox(kHxLPP, kHyLPP, kHzLPP), kInoxMed); // middle layer
755
756 new TGeoVolume("SQ33", new TGeoBBox(kHxLPP, kHyLPP, kHzLPNF), kInoxMed); // near and far layers
757
758 dy = 2 * kH1VC1;
759 dx0 = 2 * kBlVC4;
760 dx1 = 2 * kBl1VC3;
761 dx2 = 2 * kBl1VC2;
762 dx3 = 2 * kBl1VC1;
763
764 // VertCradle (trapezoids SQ34 to SQ36 or SQ37 redefined with TGeoXtru shape)
765
766 nz = 2;
767 nv = 7;
768 vx[0] = 0.;
769 vy[0] = 0.;
770 vx[1] = 0.;
771 vy[1] = dy;
772 vx[2] = 0.;
773 vy[2] = 2 * dy;
774 vx[3] = 0.;
775 vy[3] = 3 * dy;
776 vx[4] = dx3;
777 vy[4] = 2 * dy;
778 vx[5] = dx2;
779 vy[5] = dy;
780 vx[6] = dx1;
781 vy[6] = 0.;
782
783 // shift center in the middle
784 for (int i = 0; i < nv; i++) {
785 vx[i] -= dx1 / 2;
786 vy[i] -= 1.5 * dy;
787 }
788
789 TGeoXtru* xtruS3 = new TGeoXtru(nz);
790 xtruS3->DefinePolygon(nv, vx, vy);
791 xtruS3->DefineSection(0, -kHzVerticalCradleAl, 0., 0., 1.);
792 xtruS3->DefineSection(1, kHzVerticalCradleAl, 0., 0., 1.);
793 new TGeoVolume("SQ34to36", xtruS3, kAluMed);
794
795 // Trapezoids SQ34 to SQ37 (keeping the same coordinate system as for SQ34to36)
796
797 nz = 2;
798 nv = 9;
799 vx[0] = 0.;
800 vy[0] = -dy;
801 vx[1] = 0.;
802 vy[1] = 0.;
803 vx[2] = 0.;
804 vy[2] = dy;
805 vx[3] = 0.;
806 vy[3] = 2 * dy;
807 vx[4] = 0.;
808 vy[4] = 3 * dy;
809 vx[5] = dx3;
810 vy[5] = 2 * dy;
811 vx[6] = dx2;
812 vy[6] = dy;
813 vx[7] = dx1;
814 vy[7] = 0.;
815 vx[8] = dx0;
816 vy[8] = -dy;
817
818 // shift center in the middle (of SQ34to36!!)
819 for (int i = 0; i < nv; i++) {
820 vx[i] -= dx1 / 2;
821 vy[i] -= 1.5 * dy;
822 }
823
824 TGeoXtru* xtruS4 = new TGeoXtru(nz);
825 xtruS4->DefinePolygon(nv, vx, vy);
826 xtruS4->DefineSection(0, -kHzVerticalCradleAl, 0., 0., 1.);
827 xtruS4->DefineSection(1, kHzVerticalCradleAl, 0., 0., 1.);
828 new TGeoVolume("SQ34to37", xtruS4, kAluMed);
829
830 // VertCradleD - 4th trapezoid
831 par[0] = kHzVC4;
832 par[3] = kHVC4;
833 par[4] = kBlVC4;
834 par[5] = kTlVC4;
835 par[6] = kAlpVC4;
836 par[7] = kHVC4;
837 par[8] = kBlVC4;
838 par[9] = kTlVC4;
839 par[10] = kAlpVC4;
840 gGeoManager->Volume("SQ37", "TRAP", kAluMed->GetId(), par, npar);
841
842 // LateralSightSupport trapezoid
843 par[0] = kHzVSS;
844 par[3] = kHVSS;
845 par[4] = kBlVSS;
846 par[5] = kTlVSS;
847 par[6] = kAlpVSS;
848 par[7] = kHVSS;
849 par[8] = kBlVSS;
850 par[9] = kTlVSS;
851 par[10] = kAlpVSS;
852 gGeoManager->Volume("SQ38", "TRAP", kAluMed->GetId(), par, npar);
853
854 // LateralSight
855 new TGeoVolume("SQ39", new TGeoTube(kVSInRad, kVSOutRad, kVSLen), kEpoxyMed);
856
857 // InHFrame
858 new TGeoVolume("SQ40", new TGeoBBox(kHxInHFrame, kHyInHFrame, kHzInHFrame), kEpoxyMed);
859
860 // Flat 7.5mm horizontal section
861 new TGeoVolume("SQ41", new TGeoBBox(kHxH1mm, kHyH1mm, kHzH1mm), kEpoxyMed);
862
863 // InArcFrame
864 new TGeoVolume("SQ42", new TGeoTubeSeg(kIAF, kOAF, kHzAF, kAFphi1, kAFphi2), kEpoxyMed);
865
866 // ScrewsInFrame - 3 sections in order to avoid overlapping volumes
867 // Screw Head, in air
868 new TGeoVolume("SQ43", new TGeoTube(kSCRUHMI, kSCRUHMA, kSCRUHLE), kInoxMed);
869
870 // Middle part, in the Epoxy
871 new TGeoVolume("SQ44", new TGeoTube(kSCRUMMI, kSCRUMMA, kSCRUMLE), kInoxMed);
872
873 // Screw nut, in air
874 new TGeoVolume("SQ45", new TGeoTube(kSCRUNMI, kSCRUNMA, kSCRUNLE), kInoxMed);
875 }
876
878
879 // InVFrame
880 double x = kHxInVFrame;
881 double y = 2 * (kHyInHFrame + kHyH1mm) + kIAF + kHyInVFrame;
882 double z = 0.;
883 Mlayer->AddNode(gGeoManager->GetVolume("SQ00"), 1, new TGeoTranslation(x, y, z));
884
885 // keep memory of the mid position (to place screws)
886 const double kMidVXPos = x;
887 const double kMidVYPos = y;
888 const double kMidVZPos = z;
889
890 // Flat 7.5mm vertical section
891 x = 2 * kHxInVFrame + kHxV1mm;
892 y = 2 * (kHyInHFrame + kHyH1mm) + kIAF + kHyV1mm;
893 Mlayer->AddNode(gGeoManager->GetVolume("SQ01"), 1, new TGeoTranslation(x, y, z));
894
895 // TopFrameAnode - place 2 layers of TopFrameAnode cuboids. The Inox layer is
896 // stacked on top of the Epoxy one, as for SQ17to23/SQ18to24 below, so its centre
897 // sits at the Epoxy half-thickness and not at its own.
898 x = kHxTFA;
899 y = 2 * (kHyInHFrame + kHyH1mm + kHyInVFrame) + kIAF + kHyTFA;
900 Mlayer->AddNode(gGeoManager->GetVolume("SQ02"), 1, new TGeoTranslation(x, y, -kHzOuterFrameInox));
901 Mlayer->AddNode(gGeoManager->GetVolume("SQ03"), 1, new TGeoTranslation(x, y, kHzOuterFrameEpoxy));
902
903 // TopFrameAnode - place 2 layers of 2 trapezoids (SQ04 - SQ07)
904 x += kHxTFA + 2 * kH1FAA;
905 Mlayer->AddNode(gGeoManager->GetVolume("SQ04toSQ06"), 1, new TGeoTranslation(x, y, -kHzOuterFrameInox));
906 Mlayer->AddNode(gGeoManager->GetVolume("SQ05toSQ07"), 1, new TGeoTranslation(x, y, kHzOuterFrameEpoxy));
907
908 // TopAnode1 - place 2 layers
909 x = 6.8 + kDeltaQuadLHC;
910 y = 99.85 + kDeltaQuadLHC;
911 z = -kHzAnodeFR4;
912 Mlayer->AddNode(gGeoManager->GetVolume("SQ08"), 1, new TGeoTranslation(x, y, z));
913 z = kHzTopAnodeSteel1;
914 Mlayer->AddNode(gGeoManager->GetVolume("SQ09"), 1, new TGeoTranslation(x, y, z));
915
916 // TopAnode2 - place 2 layers
917 x = 18.534 + kDeltaQuadLHC;
918 y = 99.482 + kDeltaQuadLHC;
919 z = -kHzAnodeFR4;
920 // shift up to solve overlap with SQ14
921 y += 0.1;
922 Mlayer->AddNode(gGeoManager->GetVolume("SQ10"), 1, new TGeoCombiTrans(x, y, z, rot1));
923 z = kHzTopAnodeSteel2;
924 Mlayer->AddNode(gGeoManager->GetVolume("SQ11"), 1, new TGeoCombiTrans(x, y, z, rot1));
925
926 // TopAnode3 - place 1 layer
927 x = 25.804 + kDeltaQuadLHC;
928 y = 98.61 + kDeltaQuadLHC;
929 z = 0.;
930 Mlayer->AddNode(gGeoManager->GetVolume("SQ12"), 1, new TGeoCombiTrans(x, y, z, rot1));
931
932 // TopEarthFace - 2 copies
933 x = 23.122 + kDeltaQuadLHC;
934 y = 96.9 + kDeltaQuadLHC;
935 z = kHzOuterFrameEpoxy + kHzOuterFrameInox + kHzTopEarthFaceCu;
936 Mlayer->AddNode(gGeoManager->GetVolume("SQ13"), 1, new TGeoTranslation(x, y, z));
937 Mlayer->AddNode(gGeoManager->GetVolume("SQ13"), 2, new TGeoTranslation(x, y, -z));
938
939 // TopEarthProfile
940 x = 14.475 + kDeltaQuadLHC;
941 y = 97.9 + kDeltaQuadLHC;
942 z = kHzTopEarthProfileCu;
943 Mlayer->AddNode(gGeoManager->GetVolume("SQ14"), 1, new TGeoTranslation(x, y, z));
944 Mlayer->AddNode(gGeoManager->GetVolume("SQ14"), 2, new TGeoTranslation(x, y, -z));
945
946 // TopGasSupport - 2 copies
947 x = 4.95 + kDeltaQuadLHC;
948 y = 96.2 + kDeltaQuadLHC;
949 z = kHzOuterFrameEpoxy + kHzOuterFrameInox + kHzTopGasSupportAl;
950 Mlayer->AddNode(gGeoManager->GetVolume("SQ15"), 1, new TGeoTranslation(x, y, z));
951 Mlayer->AddNode(gGeoManager->GetVolume("SQ15"), 2, new TGeoTranslation(x, y, -z));
952
953 // TopPositioner parameters - single Stainless Steel trapezoid - 2 copies
954 x = 7.6 + kDeltaQuadLHC;
955 y = 98.98 + kDeltaQuadLHC;
956 z = kHzOuterFrameEpoxy + kHzOuterFrameInox + 2 * kHzTopGasSupportAl + kHzTopPositionerSteel;
957 Mlayer->AddNode(gGeoManager->GetVolume("SQ16"), 1, new TGeoTranslation(x, y, z));
958 Mlayer->AddNode(gGeoManager->GetVolume("SQ16"), 2, new TGeoTranslation(x, y, -z));
959
960 // OutEdgeFrame
961 z = -kHzOuterFrameInox;
962 double xCenterAll = 70.5, yCenterAll = 70.35;
963 Mlayer->AddNode(gGeoManager->GetVolume("SQ17to23"), 1, new TGeoCombiTrans(xCenterAll, yCenterAll, z, rot4));
964
965 z = kHzOuterFrameEpoxy;
966 Mlayer->AddNode(gGeoManager->GetVolume("SQ18to24"), 1, new TGeoCombiTrans(xCenterAll, yCenterAll, z, rot4));
967
968 // OutVFrame
969 x = 2 * (kHxInVFrame + kHxInHFrame + kHxV1mm) + kIAF - kHxOutVFrame;
970 y = 2 * kHyInHFrame + kHyOutVFrame;
971 z = 0.;
972 Mlayer->AddNode(gGeoManager->GetVolume("SQ25"), 1, new TGeoTranslation(x, y, z));
973
974 // keep memory of the mid position (to place screws)
975 const double kMidOVXPos = x;
976 const double kMidOVYPos = y;
977 const double kMidOVZPos = z;
978
979 // OutVFrame corner
980 y += kHyOutVFrame + (kBlOCTF + kTlOCTF) / 2;
981 // shift to solve overlap with SQ17to23 and SQ18to24
982 x += 0.02;
983 Mlayer->AddNode(gGeoManager->GetVolume("SQ26"), 1, new TGeoCombiTrans(x, y, z, rot1));
984
985 // VertEarthFaceCu - 2 copies
986 x = 89.4 + kDeltaQuadLHC;
987 y = 25.79 + kDeltaQuadLHC;
988 z = kHzFrameThickness + 2 * kHzFoam2 + kHzVertEarthFaceCu;
989 Mlayer->AddNode(gGeoManager->GetVolume("SQ27"), 1, new TGeoCombiTrans(x, y, z, rot1));
990 Mlayer->AddNode(gGeoManager->GetVolume("SQ27"), 2, new TGeoCombiTrans(x, y, -z, rot1));
991
992 // VertEarthSteel - 2 copies
993 x = 91 + kDeltaQuadLHC;
994 y = 30.616 + kDeltaQuadLHC;
995 z = kHzFrameThickness + 2 * kHzFoam2 + kHzVertBarSteel;
996 Mlayer->AddNode(gGeoManager->GetVolume("SQ28"), 1, new TGeoCombiTrans(x, y, z, rot1));
997 Mlayer->AddNode(gGeoManager->GetVolume("SQ28"), 2, new TGeoCombiTrans(x, y, -z, rot1));
998
999 // VertEarthProfCu - 2 copies
1000 x = 92 + kDeltaQuadLHC;
1001 y = 29.64 + kDeltaQuadLHC;
1002 z = kHzFrameThickness;
1003 Mlayer->AddNode(gGeoManager->GetVolume("SQ29"), 1, new TGeoCombiTrans(x, y, z, rot1));
1004 Mlayer->AddNode(gGeoManager->GetVolume("SQ29"), 2, new TGeoCombiTrans(x, y, -z, rot1));
1005
1006 // SuppLateralPositionner - 2 copies
1007 x = 90.2 - kNearFarLHC;
1009 z = kHzLateralPosnAl - kMotherThick2;
1010 Flayer->AddNode(gGeoManager->GetVolume("SQ30"), 1, new TGeoTranslation(x, y, z));
1011 Nlayer->AddNode(gGeoManager->GetVolume("SQ30"), 2, new TGeoTranslation(x, y, -z));
1012
1014
1015 // Face view
1016 x = kLateralXPosShift - kNearFarLHC - 2 * kHxLPP;
1018 z = 2 * kHzLateralPosnAl + kHzLateralPosnInoxFace - kMotherThick2;
1019 Flayer->AddNode(gGeoManager->GetVolume("SQ31"), 1, new TGeoTranslation(x, y, z));
1020 Nlayer->AddNode(gGeoManager->GetVolume("SQ31"), 2, new TGeoTranslation(x, y, -z));
1021
1022 // Profile view
1023 x = kLateralXPosShift + kDeltaQuadLHC + kHxLPF - kHxLPP;
1025 z = 0.;
1026 Mlayer->AddNode(gGeoManager->GetVolume("SQ32"), 1, new TGeoTranslation(x, y, z));
1027
1028 x = kLateralXPosShift - kNearFarLHC + kHxLPF - kHxLPP;
1030 z = kMotherThick2 - kHzLPNF;
1031 Nlayer->AddNode(gGeoManager->GetVolume("SQ33"), 1, new TGeoTranslation(x, y, z));
1032 Flayer->AddNode(gGeoManager->GetVolume("SQ33"), 2, new TGeoTranslation(x, y, -z));
1033
1034 // VertCradle - 3 (or 4 ) trapezoids redefined with TGeoXtru shape
1035 const double kVertCradleX = 97.29;
1036 const double kVertCradleXshift = 1.39311;
1037 const double kVertCradleY = 23.02;
1038
1039 x = kVertCradleX + kDeltaQuadLHC + kVertCradleXshift;
1040 y = kVertCradleY + kDeltaQuadLHC;
1041 z = 0.;
1042 Mlayer->AddNode(gGeoManager->GetVolume("SQ34to37"), 2, new TGeoTranslation(x, y, z));
1043
1044 x = kVertCradleX - kNearFarLHC + kVertCradleXshift;
1045 y = kVertCradleY - kNearFarLHC;
1046 z = 2 * kHzLateralSightAl + kHzVerticalCradleAl - kMotherThick2;
1047 Nlayer->AddNode(gGeoManager->GetVolume("SQ34to36"), 1, new TGeoTranslation(x, y, z));
1048 Flayer->AddNode(gGeoManager->GetVolume("SQ34to36"), 3, new TGeoTranslation(x, y, -z));
1049
1050 // OutVertCradleD 4th Trapeze - 3 copies
1051 x = 98.81 + kDeltaQuadLHC;
1052 y = 2.52 + kDeltaQuadLHC;
1053 z = kMotherThick1 - kHzVerticalCradleAl;
1054 Mlayer->AddNode(gGeoManager->GetVolume("SQ37"), 1, new TGeoTranslation(x, y, z));
1055 Mlayer->AddNode(gGeoManager->GetVolume("SQ37"), 3, new TGeoTranslation(x, y, -z));
1056
1057 // LateralSightSupport - 2 copies
1058 x = 98.33 - kNearFarLHC;
1059 y = 10 - kNearFarLHC;
1060 z = kHzLateralSightAl - kMotherThick2;
1061
1062 Nlayer->AddNode(gGeoManager->GetVolume("SQ38"), 1, new TGeoTranslation(x, y, z));
1063 Flayer->AddNode(gGeoManager->GetVolume("SQ38"), 2, new TGeoTranslation(x, y, -z));
1064
1065 // mire placement
1066 x = 92.84 + kDeltaQuadLHC;
1067 y = 8.13 + kDeltaQuadLHC;
1068 z = 0.;
1069 Mlayer->AddNode(gGeoManager->GetVolume("SQ39"), 1, new TGeoTranslation(x, y, z));
1070
1072 x = 2 * (kHxInVFrame + kHxV1mm) + kIAF + kHxInHFrame;
1073 y = kHyInHFrame;
1074 Mlayer->AddNode(gGeoManager->GetVolume("SQ40"), 1, new TGeoTranslation(x, y, z));
1075
1076 // keep memory of the mid position (to place screws)
1077 const double kMidHXPos = x;
1078 const double kMidHYPos = y;
1079 const double kMidHZPos = z;
1080
1081 // flat 7.5 mm horizontal section
1082 x = 2 * (kHxInVFrame + kHxV1mm) + kIAF + kHxH1mm;
1083 y = 2 * kHyInHFrame + kHyH1mm;
1084 Mlayer->AddNode(gGeoManager->GetVolume("SQ41"), 1, new TGeoTranslation(x, y, z));
1085
1086 // InArcFrame
1087 x = 2 * (kHxInVFrame + kHxV1mm);
1088 y = 2 * (kHyInHFrame + kHyH1mm);
1089 Mlayer->AddNode(gGeoManager->GetVolume("SQ42"), 1, new TGeoTranslation(x, y, z));
1090
1091 // keep memory of the mid position (to place screws)
1092 const double kMidArcXPos = x;
1093 const double kMidArcYPos = y;
1094 const double kMidArcZPos = z;
1095
1096 // ScrewsInFrame - in sensitive volume
1097 const int kNScrews = 64;
1098
1099 double scruX[kNScrews], scruY[kNScrews];
1100 // screw volumes
1101 auto vol43 = gGeoManager->GetVolume("SQ43"), vol44 = gGeoManager->GetVolume("SQ44"), vol45 = gGeoManager->GetVolume("SQ45");
1102
1103 const double kSpecScrewPos = -2.23;
1104
1105 // screws on IHEpoxyFrame
1106 const int kNScrewsIH = 14; // number of screws on the IHEpoxyFrame
1107 const double kOffX = 5.; // inter-screw distance
1108
1109 // first screw coordinates
1110 scruX[0] = 21.07;
1111 scruY[0] = kSpecScrewPos;
1112 // other screw coordinates
1113 for (int i = 1; i < kNScrewsIH; i++) {
1114 scruX[i] = scruX[i - 1] + kOffX;
1115 scruY[i] = scruY[0];
1116 }
1117
1118 // place the volumes on the frames
1119 z = 0.;
1120 for (int i = 0; i < kNScrewsIH; i++) {
1121 x = kDeltaQuadLHC + scruX[i] + 0.1;
1122 y = kDeltaQuadLHC + scruY[i] + 0.1;
1123 Mlayer->AddNode(vol43, i + 1, new TGeoTranslation(x, y, z - kHzInHFrame - kSCRUHLE));
1124 if (chamber == 1) {
1125 gGeoManager->GetVolume("SQ40")->AddNode(vol44, i + 1, new TGeoTranslation(x - kMidHXPos, y - kMidHYPos, z - kMidHZPos));
1126 }
1127
1128 Mlayer->AddNode(vol45, i + 1, new TGeoTranslation(x, y, z + kHzInHFrame + kSCRUNLE));
1129 }
1130
1131 // special screw coordinates
1132 scruX[63] = 16.3;
1133 scruY[63] = kSpecScrewPos;
1134 x = kDeltaQuadLHC + scruX[63] + 0.1;
1135 y = kDeltaQuadLHC + scruY[63] + 0.1;
1136 z = 0.;
1137
1138 Mlayer->AddNode(vol43, kNScrews, new TGeoTranslation(x, y, z - kHzInHFrame - kSCRUHLE));
1139
1140 if (chamber == 1) {
1141 gGeoManager->GetVolume("SQ40")->AddNode(vol44, kNScrews, new TGeoTranslation(x - kMidHXPos, y - kMidHYPos, z - kMidHZPos));
1142 }
1143
1144 Mlayer->AddNode(vol45, kNScrews, new TGeoTranslation(x, y, z + kHzInHFrame + kSCRUNLE));
1145
1146 // screws on the IVEpoxyFrame
1147 const double kOffY = 5.; // inter-screw distance
1148 int firstScrew = 58, lastScrew = 44;
1149
1150 // first (special) screw coordinates
1151 scruX[firstScrew - 1] = kSpecScrewPos;
1152 scruY[firstScrew - 1] = 16.3;
1153 // second (repetitive) screw coordinates
1154 scruX[firstScrew - 2] = kSpecScrewPos;
1155 scruY[firstScrew - 2] = 21.07;
1156 // other screw coordinates
1157 for (int i = firstScrew - 3; i > lastScrew - 2; i--) {
1158 scruX[i] = scruX[firstScrew - 2];
1159 scruY[i] = scruY[i + 1] + kOffY;
1160 }
1161
1162 z = 0.;
1163 for (int i = lastScrew; i <= firstScrew; i++) {
1164 x = kDeltaQuadLHC + scruX[i - 1] + 0.1;
1165 y = kDeltaQuadLHC + scruY[i - 1] + 0.1;
1166
1167 Mlayer->AddNode(vol43, i, new TGeoTranslation(x, y, z - kHzInHFrame - kSCRUHLE));
1168
1169 if (chamber == 1) {
1170 gGeoManager->GetVolume("SQ00")->AddNode(vol44, i, new TGeoTranslation(x - kMidVXPos, y - kMidVYPos, z - kMidVZPos));
1171 }
1172
1173 Mlayer->AddNode(vol45, i, new TGeoTranslation(x, y, z + kHzInHFrame + kSCRUNLE));
1174 }
1175
1176 // screws on the OVEpoxyFrame
1177
1178 firstScrew = 15;
1179 lastScrew = 25;
1180
1181 // first (repetitive) screw coordinates
1182 scruX[firstScrew - 1] = 90.9;
1183 scruY[firstScrew - 1] = kSpecScrewPos;
1184
1185 // other screw coordinates
1186 for (int i = firstScrew; i < lastScrew; i++) {
1187 scruX[i] = scruX[firstScrew - 1];
1188 scruY[i] = scruY[i - 1] + kOffY;
1189 }
1190
1191 z = 0.;
1192 for (int i = 1 + firstScrew; i < lastScrew; i++) {
1193 x = kDeltaQuadLHC + scruX[i - 1] + 0.1;
1194 y = kDeltaQuadLHC + scruY[i - 1] + 0.1;
1195
1196 Mlayer->AddNode(vol43, i, new TGeoTranslation(x, y, z - kHzInHFrame - kSCRUHLE));
1197 if (chamber == 1) {
1198 gGeoManager->GetVolume("SQ25")->AddNode(vol44, i, new TGeoTranslation(x - kMidOVXPos, y - kMidOVYPos, z - kMidOVZPos));
1199 }
1200
1201 Mlayer->AddNode(vol45, i, new TGeoTranslation(x, y, z + kHzInHFrame + kSCRUNLE));
1202 }
1203
1204 // special case for 1st screw, inside the horizontal frame (volume 40)
1205 x = kDeltaQuadLHC + scruX[firstScrew - 1] + 0.1 - kMidHXPos;
1206 y = kDeltaQuadLHC + scruY[firstScrew - 1] + 0.1 - kMidHYPos;
1207 z = -kMidHZPos;
1208
1209 if (chamber == 1) {
1210 gGeoManager->GetVolume("SQ40")->AddNode(vol44, firstScrew, new TGeoTranslation(x, y, z));
1211 }
1212
1213 // inner arc of Frame, screw positions and numbers
1214 firstScrew = 58;
1215 scruX[62] = 16.009;
1216 scruY[62] = 1.401;
1217 scruX[61] = 14.564;
1218 scruY[61] = 6.791;
1219 scruX[60] = 11.363;
1220 scruY[60] = scruX[60];
1221 scruX[59] = scruY[61];
1222 scruY[59] = scruX[61];
1223 scruX[58] = scruY[62];
1224 scruY[58] = scruX[62];
1225
1226 z = 0.;
1227 for (int i = firstScrew; i < firstScrew + 5; i++) {
1228 x = kDeltaQuadLHC + scruX[i] + 0.1;
1229 y = kDeltaQuadLHC + scruY[i] + 0.1;
1230
1231 Mlayer->AddNode(vol43, i + 1, new TGeoTranslation(x, y, z - kHzInHFrame - kSCRUHLE));
1232
1233 if (chamber == 1) {
1234 gGeoManager->GetVolume("SQ42")->AddNode(vol44, i + 1, new TGeoTranslation(x - kMidArcXPos, y - kMidArcYPos, z - kMidArcZPos));
1235 }
1236
1237 Mlayer->AddNode(vol45, i + 1, new TGeoTranslation(x, y, z + kHzInHFrame + kSCRUNLE));
1238 }
1239}
1240
1241//______________________________________________________________________________
1242TGeoVolume* createPlaneSegment(int iSegment, double halfLength, double halfHeight, int nHoles)
1243{
1245
1246 auto segment = new TGeoVolumeAssembly(Form("S%d", iSegment));
1247
1248 // variables
1249 double x = 0., y = 0., z = 0.;
1250
1251 // foam layer
1252 const int kFoamNumber = iSegment + kFoamBoxNameOffset;
1253 const char* kFoamBoxName = Form("S%d", kFoamNumber);
1254
1255 auto foam = gGeoManager->MakeBox(kFoamBoxName, assertMedium(Medium::St1Rohacell), halfLength, halfHeight, kHzFoam);
1256
1257 // place spacers in the concrete plane segments:
1258 // S225 (in S025), S267 (in S067) in chamber1 and S309 (in S109). S351(in S151) in chamber2
1259 // The segments were found as those which caused overlaps when we placed the spacer in global coordinates via PlaceSpacer0
1260
1261 // <posXYZ X_Y_Z=" 12.6000; 0.75000; 0.0000"> <volume name="Spacer5A"/>
1262 // <posXYZ X_Y_Z=" 12.6000; -0.75000; 0.0000"> <volume name="Spacer5A"/>
1263 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 1.1515"> <volume name="Spacer6"/>
1264 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 0.0000"> <volume name="Spacer7A"/>
1265 bool is267or351 = (kFoamNumber == 267 || kFoamNumber == 351);
1266
1267 if (kFoamNumber == 225 || is267or351 || kFoamNumber == 309) {
1268 x = 12.6;
1269 y = 0.75;
1270 z = -0.1;
1271
1272 if (is267or351) {
1273 y += kPadYOffsetBP;
1274 }
1275
1276 foam->AddNode(gGeoManager->GetVolume("Spacer5A"), 1, new TGeoTranslation(x, y, z));
1277
1278 y = -0.75;
1279 if (is267or351) {
1280 y += kPadYOffsetBP;
1281 }
1282
1283 foam->AddNode(gGeoManager->GetVolume("Spacer5A"), 2, new TGeoTranslation(x, y, z));
1284
1285 y = 0.;
1286 z = 1.1515;
1287 if (is267or351) {
1288 y += kPadYOffsetBP;
1289 }
1290
1291 foam->AddNode(gGeoManager->GetVolume("Spacer6"), 1, new TGeoTranslation(x, y, z));
1292
1293 y = 0.;
1294 z = 0.;
1295 if (is267or351) {
1296 y += kPadYOffsetBP;
1297 }
1298
1299 foam->AddNode(gGeoManager->GetVolume("Spacer7A"), 1, new TGeoTranslation(x, y, z));
1300 }
1301
1302 y = 0.;
1303 z = 0.;
1304
1305 auto hole = gGeoManager->GetVolume(kHoleName);
1306 for (int holeNum = 0; holeNum < nHoles; holeNum++) {
1307 x = ((2 * holeNum + 1) / nHoles - 1) * halfLength;
1308
1309 foam->AddNode(hole, holeNum, new TGeoTranslation(x, y, z));
1310 }
1311
1312 z = -kTotalHzPlane + kHzFoam; // - kHzFR4
1313 segment->AddNode(foam, 1, new TGeoTranslation(0., 0., z));
1314
1315 // mechanical plane (FR4 layer)
1316 z = kHzFoam;
1317 segment->AddNode(gGeoManager->MakeBox(Form("S%d", iSegment + kFR4BoxNameOffset), assertMedium(Medium::FR4), halfLength, halfHeight, kHzFR4),
1318 1, new TGeoTranslation(0., 0., z));
1319
1320 return segment;
1321}
1322
1323/*
1324//______________________________________________________________________________
1325void placeSector(const AliMpSector* sector, TExMap specialMap, const TVector3& where, Bool_t reflectZ, Int_t chamber)
1326{
1332 static Int_t segNum = 1;
1333 Int_t sgn;
1334 Int_t reflZ;
1335 Int_t rotMat;
1336 if (!reflectZ) {
1337 sgn = 1;
1338 reflZ = 0; // no reflection along z... nothing
1339 fMUON->AliMatrix(rotMat, 90., 90., 90, 180., 0., 0.); // 90� rotation around z, NO reflection along z
1340 } else {
1341 sgn = -1;
1342 fMUON->AliMatrix(reflZ, 90., 0., 90, 90., 180., 0.); // reflection along z
1343 fMUON->AliMatrix(rotMat, 90., 90., 90, 180., 180., 0.); // 90� rotation around z AND reflection along z
1344 }
1345 GReal_t x, y, z;
1346 TArrayI alreadyDone(20);
1347 Int_t nofAlreadyDone = 0;
1348 for (Int_t irow = 0; irow < sector->GetNofRows(); irow++) { // for each row
1349 AliMpRow* row = sector->GetRow(irow);
1350 for (Int_t iseg = 0; iseg < row->GetNofRowSegments(); iseg++) { // for each row segment
1351 AliMpVRowSegment* seg = row->GetRowSegment(iseg);
1352 Long_t value = specialMap.GetValue(seg->GetMotifPositionId(0));
1353 if (value == 0) { //if this is a normal segment (ie. not part of <specialMap>)
1354 // create the cathode part
1355 auto segment = createPlaneSegment(segNum, seg->GetDimensionX()/2,seg->GetDimensionY()/2,seg->GetNofMotifs());
1356 x = where.X() + seg->GetPositionX();
1357 y = where.Y() + seg->GetPositionY();
1358 z = where.Z() + sgn * (kTotalHzPlane + kHzGas + 2. * kHzPadPlane);
1359 auto MLayer = gGeoManager->GetVolume(Form("%s%d", kQuadrantMLayerName, chamber));
1360 MLayer->AddNode(segment,1,new TGeoCombiTrans(x, y, z, reflZ));
1361 // and place all the daughter boards of this segment
1362 // COMMENT OUT BEGIN
1363 for (Int_t motifNum = 0; motifNum < seg->GetNofMotifs(); motifNum++) {
1364 // Copy number
1365 Int_t motifPosId = seg->GetMotifPositionId(motifNum);
1366 AliMpMotifPosition* motifPos =
1367 sector->GetMotifMap()->FindMotifPosition(motifPosId);
1368 Int_t copyNo = motifPosId;
1369 if (sector->GetDirection() == AliMp::kX)
1370 copyNo += kDaughterCopyNoOffset;
1371 // Position
1372 x = where.X() + motifPos->GetPositionX() + fgkOffsetX;
1373 y = where.Y() + motifPos->GetPositionY() + fgkOffsetY;
1374 z = where.Z() + sgn * (kMotherThick1 - TotalHzDaughter());
1375 TVirtualMC::GetMC()->Gspos(kDaughterName, copyNo, QuadrantMLayerName(chamber), x, y, z, reflZ, "ONLY");
1376 }
1377 // COMMENT OUT END
1378 segNum++;
1379 } else {
1380 // COMMENT OUT BEGIN
1381 // if this is a special segment
1382 for (Int_t motifNum = 0; motifNum < seg->GetNofMotifs(); motifNum++) { // for each motif
1383 Int_t motifPosId = seg->GetMotifPositionId(motifNum);
1384 Bool_t isDone = false;
1385 Int_t i = 0;
1386 while (i < nofAlreadyDone && !isDone) {
1387 if (alreadyDone.At(i) == motifPosId)
1388 isDone = true;
1389 i++;
1390 }
1391 if (isDone)
1392 continue; // don't treat the same motif twice
1393 AliMUONSt1SpecialMotif spMot = *((AliMUONSt1SpecialMotif*)specialMap.GetValue(motifPosId));
1394 AliDebugStream(2) << chamber << " processing special motif: " << motifPosId << endl;
1395 AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId);
1396 // Copy number
1397 Int_t copyNo = motifPosId;
1398 if (sector->GetDirection() == AliMp::kX)
1399 copyNo += kDaughterCopyNoOffset;
1400 // place the hole for the motif, wrt the requested rotation angle
1401 Int_t rot = (spMot.GetRotAngle() < 0.1) ? reflZ : rotMat;
1402 x = where.X() + motifPos->GetPositionX() + spMot.GetDelta().X();
1403 y = where.Y() + motifPos->GetPositionY() + spMot.GetDelta().Y();
1404 z = where.Z() + sgn * (kTotalHzPlane + kHzGas + 2. * kHzPadPlane);
1405 // Shift the hole for special motif 46 to avoid debording into S047
1406 if (copyNo == 2070) {
1407 x -= 0.1;
1408 y -= 0.1;
1409 }
1410 TVirtualMC::GetMC()->Gspos(kHoleName, copyNo, QuadrantMLayerName(chamber), x, y, z, rot, "ONLY");
1411 // then place the daughter board for the motif, wrt the requested rotation angle
1412 x = x + kDeltaFilleEtamX;
1413 y = y + kDeltaFilleEtamY;
1414 // Do not shift the daughter board
1415 if (copyNo == 2070) {
1416 x += 0.1;
1417 y += 0.1;
1418 }
1419 z = where.Z() + sgn * (kMotherThick1 - TotalHzDaughter());
1420 TVirtualMC::GetMC()->Gspos(kDaughterName, copyNo, QuadrantMLayerName(chamber), x, y, z, rot, "ONLY");
1421 if (nofAlreadyDone == alreadyDone.GetSize())
1422 alreadyDone.Set(2 * nofAlreadyDone);
1423 alreadyDone.AddAt(motifPosId, nofAlreadyDone++);
1424 AliDebugStream(2) << chamber << " processed motifPosId: " << motifPosId << endl;
1425 }
1426 // COMMENT OUT END
1427 } // end of special motif case
1428 }
1429 }
1430}
1431*/
1432//______________________________________________________________________________
1433
1434void placeInnerLayers(int chamber)
1435{
1437
1438 double x = kDeltaQuadLHC, y = kDeltaQuadLHC, zc = kHzGas + kHzPadPlane;
1439 int dpos = 2 * (chamber - 1);
1440
1441 auto layer = gGeoManager->GetVolume(Form("%s%d", kQuadrantMLayerName, chamber));
1442 layer->AddNode(gGeoManager->GetVolume(Form("SA%dG", chamber)), 1, new TGeoTranslation(x, y, 0.));
1443 layer->AddNode(gGeoManager->GetVolume("SA1C"), 1 + dpos, new TGeoTranslation(x, y, zc));
1444 layer->AddNode(gGeoManager->GetVolume("SA1C"), 2 + dpos, new TGeoTranslation(x, y, -zc));
1445}
1446
1447//______________________________________________________________________________
1448TGeoVolumeAssembly* createQuadrant(int chamber)
1449{
1451 auto quadrant = new TGeoVolumeAssembly(Form("Quadrant (chamber %d)", chamber));
1452
1453 createFrame(chamber);
1454
1455 /* TODO
1456 TExMap specialMap;
1457 specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2(0.1, 0.72), 90.));
1458 specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2(0.7, 0.36)));
1459 specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
1460 // Load mapping from OCDB
1461 if (!AliMpSegmentation::Instance()) {
1462 AliFatal("Mapping has to be loaded first !");
1463 }
1464 const AliMpSector* kSector1 =
1465 AliMpSegmentation::Instance()->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane));
1466 if (!kSector1) {
1467 AliFatal("Could not access sector segmentation !");
1468 }
1469 // Bool_t reflectZ = true;
1470 Bool_t reflectZ = false;
1471 // TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
1472 TVector3 where = TVector3(fgkDeltaQuadLHC + fgkPadXOffsetBP, fgkDeltaQuadLHC + fgkPadYOffsetBP, 0.);
1473 PlaceSector(kSector1, specialMap, where, reflectZ, chamber);
1474 int nb = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
1475 TExMapIter it(&specialMap);
1476 #if (defined(ROOT_SVN_REVISION) && ROOT_SVN_REVISION >= 29598) || \
1477 (defined(ROOT_VERSION_CODE) && ROOT_VERSION_CODE >= ROOT_VERSION(5, 25, 02))
1478 Long64_t key;
1479 Long64_t value;
1480 #else
1481 Long_t key;
1482 Long_t value;
1483 #endif
1484 while (it.Next(key, value) == kTRUE) {
1485 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
1486 }
1487 specialMap.Delete();
1488 specialMap.Add(76 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.51), 90.));
1489 specialMap.Add(75 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(2.20, -0.08)));
1490 specialMap.Add(47 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(2.40, -1.11)));
1491 specialMap.Add(20 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2, -0.08)));
1492 specialMap.Add(46 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(0.92, 0.17)));
1493 specialMap.Add(74 | nb, (Long_t) new AliMUONSt1SpecialMotif(TVector2(0.405, -0.10)));
1494 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
1495 // in the true position)
1496 const AliMpSector* kSector2 =
1497 AliMpSegmentation::Instance()->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane));
1498 if (!kSector2) {
1499 AliFatal("Could not access sector !");
1500 }
1501 // reflectZ = false;
1502 reflectZ = true;
1503 TVector2 offset = TVector2(kSector2->GetPositionX(), kSector2->GetPositionY());
1504 where = TVector3(where.X() + offset.X(), where.Y() + offset.Y(), 0.);
1505 // Add the half-pad shift of the non-bending plane wrt bending plane
1506 // (The shift is defined in the mapping as sector offset)
1507 // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2
1508 PlaceSector(kSector2, specialMap, where, reflectZ, chamber);
1509 it.Reset();
1510 while (it.Next(key, value) == kTRUE) {
1511 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
1512 }
1513 specialMap.Delete();
1514 */
1515
1516 // place gas volumes
1517 placeInnerLayers(chamber);
1518
1519 // middle layers
1520 double x = -(kDeltaQuadLHC + kPadXOffsetBP), y = -(kDeltaQuadLHC + kPadYOffsetBP), z = 0.;
1521 quadrant->AddNode(gGeoManager->GetVolume(Form("%s%d", kQuadrantMLayerName, chamber)), 1, new TGeoTranslation(x, y, z));
1522 quadrant->AddNode(gGeoManager->GetVolume(Form("%s%d", kQuadrantMFLayerName, chamber)), 1, new TGeoTranslation(x, y, z));
1523
1524 // near/far layers
1525 x += kFrameOffset;
1526 y += kFrameOffset;
1527 quadrant->AddNode(gGeoManager->GetVolume(Form("%s%d", kQuadrantFLayerName, chamber)), 1, new TGeoTranslation(x, y, z));
1528
1530 quadrant->AddNode(gGeoManager->GetVolume(Form("%s%d", kQuadrantNLayerName, chamber)), 1, new TGeoTranslation(x, y, z));
1531
1532 return quadrant;
1533}
1534
1535//______________________________________________________________________________
1536void createStation1Geometry(TGeoVolume& topVolume)
1537{
1538
1539 // create basic volumes
1540 createHole();
1543 createSpacer();
1544
1545 const int kNQuadrants = 4;
1546
1547 auto rot0 = new TGeoRotation();
1548 auto rot1 = new TGeoRotation("reflXZ", 90., 180., 90., 90., 180., 0.);
1549 auto rot2 = new TGeoRotation("reflXY", 90., 180., 90., 270., 0., 0.);
1550 auto rot3 = new TGeoRotation("reflYZ", 90., 0., 90., -90., 180., 0.);
1551 std::array<TGeoRotation*, kNQuadrants> rot = {rot0, rot1, rot2, rot3};
1552
1553 // initialize the quadrant positions
1554 double x[kNQuadrants] = {1, -1, -1, 1};
1555 double y[kNQuadrants] = {1, 1, -1, -1};
1556
1557 for (int i = 0; i < kNQuadrants; i++) {
1558 x[i] *= kPadXOffsetBP;
1559 y[i] *= kPadYOffsetBP;
1560 }
1561
1562 // build the two chambers
1563 int detElemID = 0;
1564 double z = kQuadrantZPos;
1565
1566 for (int ich = 1; ich < 3; ich++) {
1567
1568 // create two half-chambers
1569 auto* in = new TGeoVolumeAssembly(Form("SC0%dI", ich));
1570 auto* out = new TGeoVolumeAssembly(Form("SC0%dO", ich));
1571
1572 // create a quadrant volume
1573 auto* quadrant = createQuadrant(ich);
1574
1575 // place the quadrants in the half-chambers
1576 for (int i = 0; i < kNQuadrants; i++) {
1577 // alternate the z position
1578 z *= -1.;
1579
1580 // compute the detection element ID
1581 detElemID = 100 * ich + i;
1582
1583 if (x[i] > 0) {
1584 in->AddNode(quadrant, detElemID, new TGeoCombiTrans(x[i], y[i], z, rot[i]));
1585 } else {
1586 out->AddNode(quadrant, detElemID, new TGeoCombiTrans(x[i], y[i], z, rot[i]));
1587 }
1588 }
1589
1590 // place the half-chambers in the top volume
1591 topVolume.AddNode(in, 2 * (ich - 1), new TGeoTranslation(0., 0., kChamberZPos[ich - 1]));
1592 topVolume.AddNode(out, 2 * ich - 1, new TGeoTranslation(0., 0., kChamberZPos[ich - 1]));
1593
1594 } // end of the chamber loop
1595}
1596
1597//______________________________________________________________________________
1598std::vector<TGeoVolume*> getStation1SensitiveVolumes()
1599{
1601
1602 std::vector<TGeoVolume*> sensitiveVolumeNames;
1603 for (int i = 1; i <= 2; i++) {
1604
1605 auto vol = gGeoManager->GetVolume(Form("SA%dG", i));
1606
1607 if (!vol) {
1608 throw std::runtime_error(Form("could not get expected volume SA%dG", i));
1609 } else {
1610 sensitiveVolumeNames.push_back(vol);
1611 }
1612 }
1613 return sensitiveVolumeNames;
1614}
1615
1616} // namespace mch
1617} // namespace o2
int32_t i
Implementation of the MID materials definitions.
Implementation of the station 1 geometry.
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint segment
Definition glcorearb.h:4945
GLint y
Definition glcorearb.h:270
GLboolean * data
Definition glcorearb.h:298
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
Node par(int index)
Parameters.
const double kHxBergCopper
const char * kQuadrantMLayerName
void createFrame(int chamber)
const double kMotherPhiU
void createDaughterBoard()
const double kHySpacer6
const double kHzGas
const double kPhiTrap
const double kDeltaFilleEtamX
const char * kQuadrantFLayerName
const double kNearFarLHC
const double kHzPadPlane
const double kDeltaQuadLHC
const double kHySpacer5A
const double kThetaTrap
const double kHyBergPlastic
TGeoVolume * createPlaneSegment(int iSegment, double halfLength, double halfHeight, int nHoles)
const double kHyKapton
const double kMotherIR2
const char * kHoleName
const int kDaughterCopyNoOffset
const double kHyDaughter
const double kTotalHzPlane
TGeoMedium * assertMedium(int imed)
void placeInnerLayers(int chamber)
const double kMotherThick1
const double kRSpacer7A
const double kOffsetX
const char * kQuadrantNLayerName
void createStation1Geometry(TGeoVolume &topVolume)
const double kMotherOR2
const double kHxBergPlastic
void createInnerLayers()
const double kHyHole
const int kFR4BoxNameOffset
const char * kDaughterName
TGeoVolume * createQuadrant()
const double kHzSpacer5A
const double kHzDaughter
void createSpacer()
const double kHzFoam
const double kMotherIR1
const double kHzSnPb
const double kHxBoxSpacer
const double kPadYOffsetBP
const int kFoamBoxNameOffset
const double kLateralXPosShift
const double kHzSpacer6
const double kFrameOffset
const double kChamberZPos[2]
Constants.
const double kHxKapton
@ Aluminium
Definition Materials.h:39
@ Plastic
Definition Materials.h:35
@ St1Rohacell
Definition Materials.h:38
const double kMotherPhiL
const char * kQuadrantMFLayerName
const double kHyBergCopper
const double kHzSpacer7A
const double kMotherOR1
const double kPadXOffsetBP
const double kOffsetY
const double kMotherThick2
const double kHxDaughter
const double kHzKapton
const double kLateralYPosShift
const double kHzBergPlastic
const double kHzBergCopper
const double kDeltaFilleEtamY
std::vector< TGeoVolume * > getStation1SensitiveVolumes()
const double kHzFR4
const double kQuadrantZPos
const double kHxHole
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...