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 float kChamberZPos[2] = {-526.16, -545.24};
42
43// quadrant z position w.r.t the chamber center
44const float kQuadrantZPos = 7.5 / 2;
45
46// thickness
47const float kHzPadPlane = 0.0148 / 2; // pad plane
48const float kHzFoam = 2.503 / 2; // foam of mechanical plane
49const float kHzFR4 = 0.062 / 2; // FR4 of mechanical plane
51const float kHzSnPb = 0.0091 / 2; // pad / kapton connection (66 pt)
52const float kHzKapton = 0.0122 / 2; // kapton
53const float kHzBergPlastic = 0.3062 / 2; // Berg connector
54const float kHzBergCopper = 0.1882 / 2; // Berg connector
55const float kHzDaughter = 0.0156 / 2; // daughter board
56const float kHzGas = 0.42 / 2; // gas
57
58// spacers
59const float kHxBoxSpacer = 0.51;
60const float kHySpacer5A = 0.17;
61const float kHzSpacer5A = 1.1515;
62const float kHySpacer6 = 1.5;
63const float kHzSpacer6 = 0.1;
64const float kRSpacer7A = 0.3;
65const float kHzSpacer7A = 0.1;
66
67// quadrant mother volume
68const float kMotherPhiL = 0.;
69const float kMotherPhiU = 90.;
70
71// TUBS1 - Middle layer of model
72const float kMotherIR1 = 18.3;
73const float kMotherOR1 = 105.673;
74const float kMotherThick1 = 6.5 / 2;
75
76// TUBS2 - near and far layers of model
77const float kMotherIR2 = 20.7;
78const float kMotherOR2 = 100.073;
79const float kMotherThick2 = 1.5;
80
81// sensitive copper pads, foam layer, PCB and electronics model parameters
82const float kHxHole = 1.5 / 2;
83const float kHyHole = 3.;
84const float kHxBergPlastic = 0.74 / 2;
85const float kHyBergPlastic = 5.09 / 2;
86const float kHxBergCopper = 0.25 / 2;
87const float kHyBergCopper = 3.6 / 2;
88const float kHxKapton = 0.4;
89const float kHyKapton = 5.7 / 2;
90const float kHxDaughter = 2.3 / 2;
91const float kHyDaughter = 6.3 / 2;
92const float kOffsetX = 1.46;
93const float kOffsetY = 0.71;
94const float kDeltaFilleEtamX = 1.;
95const float kDeltaFilleEtamY = 0.051;
96
97// lateral positionner parameters
98const float kLateralXPosShift = 92.175;
99const float kLateralYPosShift = 5.;
100
101// trapezoid angles
102const float kThetaTrap = 0.;
103const float kPhiTrap = 0.;
104
105// parameters relative to the LHC beam pipe
106const float kNearFarLHC = 2.4; // Near and Far TUBS Origin wrt LHC Origin
107const float kDeltaQuadLHC = 2.6; // LHC Origin wrt Quadrant Origin
108const float kFrameOffset = 5.2;
109
110// pad plane offsets
111const float kPadXOffsetBP = 0.50 - 0.63 / 2; // = 0.185
112const float 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 float kHzFrameThickness = 1.59 / 2;
258 const float kHzOuterFrameEpoxy = 1.19 / 2;
259 const float kHzOuterFrameInox = 0.1 / 2;
260 const float kHzFoam2 = 2.083 / 2;
261
262 // Pertaining to the top outer area
263 const float kHzTopAnodeSteel1 = 0.185 / 2;
264 const float kHzTopAnodeSteel2 = 0.51 / 2;
265 const float kHzAnodeFR4 = 0.08 / 2;
266 const float kHzTopEarthFaceCu = 0.364 / 2;
267 const float kHzTopEarthProfileCu = 1.1 / 2;
268 const float kHzTopPositionerSteel = 1.45 / 2; // should really be 2.125/2.;
269 const float kHzTopGasSupportAl = 0.85 / 2;
270
271 // Pertaining to the vertical outer area
272 const float kHzVerticalCradleAl = 0.8 / 2;
273 const float kHzLateralSightAl = 0.975 / 2;
274 const float kHzLateralPosnInoxFace = 2.125 / 2;
275 const float kHzLatPosInoxProfM = 6.4 / 2;
276 const float kHzLatPosInoxProfNF = 1.45 / 2;
277 const float kHzLateralPosnAl = 0.5 / 2;
278 const float kHzVertEarthFaceCu = 0.367 / 2;
279 const float kHzVertBarSteel = 0.198 / 2;
280 const float kHzVertEarthProfCu = 1.1 / 2;
281
282 // parameter definitions in sequence
283
284 // InVFrame parameters
285 const float kHxInVFrame = 1.85 / 2;
286 const float kHyInVFrame = 73.95 / 2;
287 const float kHzInVFrame = kHzFrameThickness;
288
289 // Flat 7.5mm vertical section
290 const float kHxV1mm = 0.75 / 2;
291 const float kHyV1mm = 1.85 / 2;
292 const float 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 float kHxTFA = 34.1433 / 2;
319 const float kHyTFA = 7.75 / 2;
320 const float kHzTFAE = kHzOuterFrameEpoxy; // layer 1 thickness
321 const float kHzTFAI = kHzOuterFrameInox; // layer 3 thickness
322
323 // TopFrameAnode parameters - 2 trapezoids, 2 layers (redefined with TGeoXtru shape)
324 const float kH1FAA = 8.7 / 2;
325 const float kTl1FAB = 4.35 / 2;
326 const float kTl1FAA = 7.75 / 2;
327
328 // TopAnode parameters - cuboid (part 1 of 3 parts)
329 const float kHxTA1 = 16.2 / 2;
330 const float kHyTA1 = 3.5 / 2;
331 const float kHzTA11 = kHzTopAnodeSteel1; // layer 1
332 const float kHzTA12 = kHzAnodeFR4; // layer 2
333
334 // TopAnode parameters - trapezoid 1 (part 2 of 3 parts)
335 const float kHzTA21 = kHzTopAnodeSteel2; // layer 1
336 const float kHzTA22 = kHzAnodeFR4; // layer 2
337 const float kHTA2 = 7.268 / 2;
338 const float kBlTA2 = 2.03 / 2;
339 const float kTlTA2 = 3.5 / 2;
340 const float kAlpTA2 = 5.78;
341
342 // TopAnode parameters - trapezoid 2 (part 3 of 3 parts)
343 const float kHzTA3 = kHzAnodeFR4; // layer 1
344 const float kHTA3 = 7.268 / 2;
345 const float kBlTA3 = 0.;
346 const float kTlTA3 = 2.03 / 2;
347 const float kAlpTA3 = 7.95;
348
349 // TopEarthFace parameters - single trapezoid
350 const float kHzTEF = kHzTopEarthFaceCu;
351 const float kHTEF = 1.2 / 2;
352 const float kBlTEF = 21.323 / 2;
353 const float kTlTEF = 17.963 / 2;
354 const float kAlpTEF = -54.46;
355
356 // TopEarthProfile parameters - single trapezoid
357 const float kHzTEP = kHzTopEarthProfileCu;
358 const float kHTEP = 0.2;
359 const float kBlTEP = 31.766 / 2;
360 const float kTlTEP = 30.535 / 2;
361 const float kAlpTEP = -56.98;
362
363 // TopPositioner parameters - single Stainless Steel trapezoid
364 const float kHzTP = kHzTopPositionerSteel;
365 const float kHTP = 1.5;
366 const float kBlTP = 7.023 / 2;
367 const float kTlTP = 7.314 / 2;
368 const float kAlpTP = 2.78;
369
370 // TopGasSupport parameters - single cuboid
371 const float kHxTGS = 8.5 / 2;
372 const float kHyTGS = 1.5;
373 const float kHzTGS = kHzTopGasSupportAl;
374
375 // OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material (redefined with TGeoXtru shape)
376 const float kH1OETF = 7.196 / 2; // common to all 4 trapezoids
377 const float kTl1OETF1 = 3.996 / 2; // Trapezoid 1
378 const float kTl1OETF2 = 3.75 / 2; // Trapezoid 2
379 const float kTl1OETF3 = 3.01 / 2; // Trapezoid 3
380 const float 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 float kHxOutVFrame = 1.85 / 2;
392 const float kHyOutVFrame = 46.23 / 2;
393 const float kHzOutVFrame = kHzFrameThickness;
394
395 // OutVFrame corner parameters - trapezoid
396 const float kHzOCTF = kHzFrameThickness;
397 const float kHOCTF = 1.85 / 2;
398 const float kBlOCTF = 0.;
399 const float kTlOCTF = 3.66 / 2;
400 const float kAlpOCTF = 44.67;
401
402 // VertEarthFaceCu parameters - single trapezoid
403 const float kHzVFC = kHzVertEarthFaceCu;
404 const float kHVFC = 0.6;
405 const float kBlVFC = 46.11 / 2;
406 const float kTlVFC = 48.236 / 2;
407 const float kAlpVFC = 41.54;
408
409 // VertEarthSteel parameters - single trapezoid
410 const float kHzVES = kHzVertBarSteel;
411 const float kHVES = 0.6;
412 const float kBlVES = 30.486 / 2;
413 const float kTlVES = 32.777 / 2;
414 const float kAlpVES = 43.67;
415
416 // VertEarthProfCu parameters - single trapezoid
417 const float kHzVPC = kHzVertEarthProfCu;
418 const float kHVPC = 0.2;
419 const float kBlVPC = 29.287 / 2;
420 const float kTlVPC = 30.091 / 2;
421 const float kAlpVPC = 45.14;
422
423 // SuppLateralPositionner - single cuboid
424 const float kHxSLP = 1.4;
425 const float kHySLP = 2.5;
426 const float kHzSLP = kHzLateralPosnAl;
427
428 // LateralPositionner - squared off U bend, face view
429 const float kHxLPF = 2.6;
430 const float kHyLPF = 1.5;
431 const float kHzLPF = kHzLateralPosnInoxFace;
432
433 // LateralPositionner - squared off U bend, profile view
434 const float kHxLPP = 0.425 / 2;
435 const float kHyLPP = 1.5;
436 const float kHzLPP = kHzLatPosInoxProfM; // middle layer
437 const float kHzLPNF = kHzLatPosInoxProfNF; // near and far layers
438
439 // VertCradle, 3 layers (copies), each composed of 4 trapezoids (redefined with TGeoXtru shape)
440 const float kH1VC1 = 10.25 / 2; // all cradles
441 const float kBl1VC1 = 3.7 / 2; // VertCradleA
442 const float kBl1VC2 = 6.266 / 2; // VertCradleB
443 const float kBl1VC3 = 7.75 / 2; // VertCradleC
444
445 // VertCradleD
446 const float kHzVC4 = kHzVerticalCradleAl;
447 const float kHVC4 = 10.27 / 2;
448 const float kBlVC4 = 8.273 / 2;
449 const float kTlVC4 = 7.75 / 2;
450 const float kAlpVC4 = -1.46;
451
452 // LateralSightSupport - single trapezoid
453 const float kHzVSS = kHzLateralSightAl;
454 const float kHVSS = 2.5;
455 const float kBlVSS = 7.747 / 2;
456 const float kTlVSS = 7.188 / 2;
457 const float kAlpVSS = -3.2;
458
459 // LateralSight (reference point) - 3 per quadrant, only 1 programmed for now
460 const float kVSInRad = 0.6;
461 const float kVSOutRad = 1.3;
462 const float kVSLen = kHzFrameThickness;
463
464 // InHFrame parameters
465 const float kHxInHFrame = 75.8 / 2;
466 const float kHyInHFrame = 1.85 / 2;
467 const float kHzInHFrame = kHzFrameThickness;
468
469 // Flat 7.5mm horizontal section
470 const float kHxH1mm = 1.85 / 2;
471 const float kHyH1mm = 0.75 / 2;
472 const float kHzH1mm = kHzFrameThickness;
473
474 // InArcFrame parameters
475 const float kIAF = 15.7;
476 const float kOAF = 17.55;
477 const float kHzAF = kHzFrameThickness;
478 const float kAFphi1 = 0.;
479 const float kAFphi2 = 90.;
480
481 // ScrewsInFrame parameters HEAD
482 const float kSCRUHMI = 0.;
483 const float kSCRUHMA = 0.69 / 2;
484 const float kSCRUHLE = 0.2;
485 // ScrewsInFrame parameters MIDDLE
486 const float kSCRUMMI = 0.;
487 const float kSCRUMMA = 0.39 / 2;
488 const float kSCRUMLE = kHzFrameThickness;
489 // ScrewsInFrame parameters NUT
490 const float kSCRUNMI = 0.;
491 const float kSCRUNMA = 0.78 / 2;
492 const float kSCRUNLE = 0.4;
493
494 const int npar = 11;
495 float 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 float x = kHxInVFrame;
881 float y = 2 * (kHyInHFrame + kHyH1mm) + kIAF + kHyInVFrame;
882 float 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 float kMidVXPos = x;
887 const float kMidVYPos = y;
888 const float 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
896 x = kHxTFA;
897 y = 2 * (kHyInHFrame + kHyH1mm + kHyInVFrame) + kIAF + kHyTFA;
898 z = kHzOuterFrameInox;
899 Mlayer->AddNode(gGeoManager->GetVolume("SQ02"), 1, new TGeoTranslation(x, y, -z));
900 Mlayer->AddNode(gGeoManager->GetVolume("SQ03"), 1, new TGeoTranslation(x, y, z));
901
902 // TopFrameAnode - place 2 layers of 2 trapezoids (SQ04 - SQ07)
903 x += kHxTFA + 2 * kH1FAA;
904 z = kHzOuterFrameInox;
905 Mlayer->AddNode(gGeoManager->GetVolume("SQ04toSQ06"), 1, new TGeoTranslation(x, y, -z));
906 Mlayer->AddNode(gGeoManager->GetVolume("SQ05toSQ07"), 1, new TGeoTranslation(x, y, z));
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 float 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 float kMidOVXPos = x;
976 const float kMidOVYPos = y;
977 const float 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 float kVertCradleX = 97.29;
1036 const float kVertCradleXshift = 1.39311;
1037 const float 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 float kMidHXPos = x;
1078 const float kMidHYPos = y;
1079 const float 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 float kMidArcXPos = x;
1093 const float kMidArcYPos = y;
1094 const float kMidArcZPos = z;
1095
1096 // ScrewsInFrame - in sensitive volume
1097 const int kNScrews = 64;
1098
1099 float scruX[kNScrews], scruY[kNScrews];
1100 // screw volumes
1101 auto vol43 = gGeoManager->GetVolume("SQ43"), vol44 = gGeoManager->GetVolume("SQ44"), vol45 = gGeoManager->GetVolume("SQ45");
1102
1103 const float kSpecScrewPos = -2.23;
1104
1105 // screws on IHEpoxyFrame
1106 const int kNScrewsIH = 14; // number of screws on the IHEpoxyFrame
1107 const float 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 float 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, float halfLength, float halfHeight, int nHoles)
1243{
1245
1246 auto segment = new TGeoVolumeAssembly(Form("S%d", iSegment));
1247
1248 // variables
1249 float 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 float 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 float 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 float x[kNQuadrants] = {1, -1, -1, 1};
1555 float 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 float 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
const float kHzBergCopper
const float kMotherIR1
const float kHzSpacer5A
const char * kQuadrantMLayerName
void createFrame(int chamber)
void createDaughterBoard()
const float kLateralXPosShift
const float kPadYOffsetBP
const float kHzPadPlane
const float kHzSpacer7A
const float kDeltaQuadLHC
const char * kQuadrantFLayerName
const float kMotherThick2
const float kHyKapton
const float kPhiTrap
const float kThetaTrap
const float kMotherOR2
const float kOffsetX
const float kPadXOffsetBP
const float kHySpacer6
const float kHxBergPlastic
const char * kHoleName
const float kHyDaughter
const int kDaughterCopyNoOffset
TGeoMedium * assertMedium(int imed)
const float kHxDaughter
const float kHySpacer5A
void placeInnerLayers(int chamber)
const float kHyHole
const float kHxBoxSpacer
const float kHzFoam
const float kMotherThick1
const char * kQuadrantNLayerName
const float kMotherPhiU
void createStation1Geometry(TGeoVolume &topVolume)
const float kHxHole
const float kHzSnPb
const float kHzDaughter
void createInnerLayers()
const float kHzFR4
const float kHzBergPlastic
const float kHxBergCopper
const int kFR4BoxNameOffset
const char * kDaughterName
TGeoVolume * createQuadrant()
const float kOffsetY
const float kHyBergCopper
void createSpacer()
const float kDeltaFilleEtamX
const float kRSpacer7A
const float kHyBergPlastic
const int kFoamBoxNameOffset
TGeoVolume * createPlaneSegment(int iSegment, float halfLength, float halfHeight, int nHoles)
const float kTotalHzPlane
const float kMotherIR2
const float kMotherOR1
const float kHxKapton
const float kDeltaFilleEtamY
const float kChamberZPos[2]
Constants.
@ Aluminium
Definition Materials.h:39
@ Plastic
Definition Materials.h:35
@ St1Rohacell
Definition Materials.h:38
const float kMotherPhiL
const char * kQuadrantMFLayerName
const float kNearFarLHC
const float kFrameOffset
const float kLateralYPosShift
const float kHzSpacer6
const float kHzKapton
std::vector< TGeoVolume * > getStation1SensitiveVolumes()
const float kHzGas
const float kQuadrantZPos
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...