forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometry.h
More file actions
553 lines (459 loc) · 26.7 KB
/
Geometry.h
File metadata and controls
553 lines (459 loc) · 26.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file Geometry.h
/// \brief Base definition of FV0 geometry.
///
/// \author Maciej Slupecki, University of Jyvaskyla, Finland
/// \author Andreas Molander, University of Helsinki, Finland
#ifndef ALICEO2_FV0_GEOMETRY_H_
#define ALICEO2_FV0_GEOMETRY_H_
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsCommonDataFormats/DetID.h"
#include <Rtypes.h>
#include <TGeoPhysicalNode.h>
#include <vector>
#include <array>
#include <TGeoMatrix.h>
#include <TGeoVolume.h>
#include <TVirtualMC.h>
class TGeoPNEntry;
namespace o2
{
namespace fv0
{
struct Point3Dsimple {
float x;
float y;
float z;
void SetCoordinates(float x, float y, float z)
{
this->x = x;
this->y = y;
this->z = z;
};
};
/// FV0 Geometry
class Geometry
{
public:
/// Geometry type options possible to be initialized. The type of the geometry will specify which components are
/// created. Geometry types
/// -> eUnitialized => no parts
/// -> eOnlySensitive => only sensitive detector parts
/// -> eRough => sensitive parts and rough structural elements
/// -> eFull => complete, detailed geometry (including screws, etc.)
enum EGeoType {
eUninitialized,
eOnlySensitive,
eRough,
eFull
};
/// Geometry components possible to be enabled/disabled. Only enabled components will be created.
enum EGeoComponent {
eScintillator,
ePlastics,
ePmts,
eFibers,
eScrews,
eRods,
eContainer
};
/// Default constructor.
/// It must be kept public for root persistency purposes,
/// but should never be called by the outside world
Geometry() : mGeometryType(eUninitialized), mLeftTransformation(nullptr), mRightTransformation(nullptr){};
/// Copy constructor.
Geometry(const Geometry& geometry);
/// Access to geometry instance
/// \param initType The geometry type to be initialized - if the geometry already exists this parameter is ignored
static Geometry* instance(EGeoType initType = eUninitialized);
~Geometry();
/// Get the unique ID of the current scintillator cell during simulation.
/// The ID is a number starting from 0 at the first cell right of the y-axis
/// and continues clockwise one ring at a time.
/// \param fMC The virtual Monte Carlo interface.
/// \return The ID of the current scintillator cell during simulation.
int getCurrentCellId(const TVirtualMC* fMC) const;
/// Get the names of all the sensitive volumes of the geometry.
/// \return The names of all the sensitive volumes of the geometry.
const std::vector<std::string>& getSensitiveVolumeNames() const { return mSensitiveVolumeNames; };
/// Enable or disable a geometry component. To be called before the geometry is built. A disabled component will not
/// be added to the geometry. The enabled components are by default specified by the geometry type.
/// \param component The geometry component to be enabled/disabled.
/// \param enable Setting the enabled state. Default is true.
/// \return The enabled state of the geometry component.
bool enableComponent(EGeoComponent component, bool enable = true);
/// Build the geometry.
void buildGeometry() const;
/// Utility functions to be accessed externally
/// Sets the input parameters to the position of the geometrical center of sensitive detector
/// \param x x [cm].
/// \param y y [cm].
/// \param z z [cm].
void getGlobalPosition(float& x, float& y, float& z);
Point3Dsimple& getCellCenter(UInt_t cellId);
Point3Dsimple& getReadoutCenter(UInt_t cellId);
static constexpr int getNumberOfReadoutChannels() { return sNumberOfReadoutChannels; };
/// Helper function to check if the cellId belongs to ring 5.
/// \param cellId Id of the cell in range from 0 to 39.
/// \return True if cellId belongs to ring 5.
bool isRing5(UInt_t cellId);
static constexpr o2::detectors::DetID::ID getDetID() { return o2::detectors::DetID::FV0; }
TGeoPNEntry* getPNEntry(int index) const
{
/// Get a pointer to the TGeoPNEntry of a chip identified by 'index'
/// Returns NULL in case of invalid index, missing TGeoManager or invalid symbolic name
return o2::base::GeometryManager::getPNEntry(getDetID(), index);
}
static std::string getDetectorRightSymName()
{
return sDetectorRightName + "_0";
}
static std::string getDetectorLeftSymName()
{
return sDetectorLeftName + "_1";
}
/// Get the density of the PMTs.
static constexpr float getPmtDensity()
{
return sDensityPmt;
}
private:
explicit Geometry(EGeoType initType);
inline static const std::string sDetectorName = "FV0";
inline static const std::string sDetectorRightName = sDetectorName + "RIGHT";
inline static const std::string sDetectorLeftName = sDetectorName + "LEFT";
// General geometry constants
static constexpr float sEpsilon = 0.01; ///< Used to make one spatial dimension infinitesimally larger than other
static constexpr float sDzScintillator = 4; ///< Thickness of the scintillator
static constexpr float sDzPlastic = 1; ///< Thickness of the fiber plastics
static constexpr float sXGlobal = 0; ///< Global x-position of the geometrical center of scintillators
static constexpr float sYGlobal = 0; ///< Global y-position of the geometrical center of scintillators
// FT0 starts at z=328
static constexpr float sZGlobal = 320 - sDzScintillator / 2; ///< Global z-pos of geometrical center of scintillators
static constexpr float sDxHalvesSeparation = 0; ///< Separation between the left and right side of the detector
static constexpr float sDyHalvesSeparation = 0; ///< y-position of the right detector part relative to the left part
static constexpr float sDzHalvesSeparation = 0; ///< z-position of the right detector part relative to the left part
/// Cell and scintillator constants
static constexpr int sNumberOfCellSectors = 4; ///< Number of cell sectors for one half of the detector
static constexpr int sNumberOfCellRings = 5; ///< Number of cell rings
static constexpr int sNumberOfCells = sNumberOfCellRings * sNumberOfCellSectors * 2; ///< Number of cells
static constexpr int sNumberOfReadoutChannels = sNumberOfCells + sNumberOfCellSectors * 2; ///< Number of ch (2 ch per cell in r5)
/// Look-up tables converting cellId to the ring and sector number
static constexpr int sCellToRing[sNumberOfCells] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4};
static constexpr int sCellToSector[sNumberOfCells] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7};
/// Average cell ring radii.
static constexpr float sCellRingRadii[sNumberOfCellRings + 1]{4.01, 7.3, 12.9, 21.25, 38.7, 72.115};
static constexpr char sCellTypes[sNumberOfCellSectors]{'a', 'b', 'b', 'a'}; ///< Ordered cell types per half a ring
/// Separation between the scintillator cells; paint thickness + half of separation gap.
static constexpr float sDrSeparationScint = 0.03 + 0.04;
/// Shift of the inner radius origin of the scintillators.
static constexpr float sXShiftInnerRadiusScintillator = -0.15;
/// Extension of the scintillator holes for the metal rods
static constexpr float sDxHoleExtensionScintillator = 0.2;
static constexpr float sDrHoleSmallScintillator = 0.265; ///< Radius of the small scintillator screw hole
static constexpr float sDrHoleLargeScintillator = 0.415; ///< Radius of the large scintillator screw hole
// Container constants
static constexpr float sDzContainer = 30; ///< Depth of the metal container
static constexpr float sDrContainerHole = 4.05; ///< Radius of the beam hole in the metal container
static constexpr float sXShiftContainerHole = -0.15; ///< x-shift of the beam hole in the metal container
static constexpr float sDrMaxContainerBack = 83.1; ///< Outer radius of the container backplate
static constexpr float sDzContainerBack = 1; ///< Thickness of the container backplate
static constexpr float sDrMinContainerFront = 45.7; ///< Inner radius of the container frontplate
static constexpr float sDrMaxContainerFront = 83.1; ///< Outer radius of the container frontplate
static constexpr float sDzContainerFront = 1; ///< Thickness of the container frontplate
static constexpr float sDxContainerStand = 40; ///< Width of the container stand
static constexpr float sDyContainerStand = 3; ///< Height of the container stand at its center in x
static constexpr float sDrMinContainerCone = 24.3; ///< Inner radius at bottom of container frontplate cone
static constexpr float sDzContainerCone = 16.2; ///< Depth of the container frontplate cone
static constexpr float sThicknessContainerCone = 0.6; ///< Thickness of the container frontplate cone
static constexpr float sXYThicknessContainerCone = 0.975; ///< Radial thickness in the xy-plane of container cone
static constexpr float sDrMinContainerOuterShield = 82.5; ///< Inner radius of outer container shield
static constexpr float sDrMaxContainerOuterShield = 82.65; ///< Outer radius of outer container shield
static constexpr float sDrMinContainerInnerShield = 4; ///< Inner radius of the inner container shield
static constexpr float sDrMaxContainerInnerShield = 4.05; ///< Outer radius of inner container shield
static constexpr float sDxContainerCover = 0.15; ///< Thickness of the container cover
static constexpr float sDxContainerStandBottom = 38.5; ///< Width of the bottom of the container stand
static constexpr float sDyContainerStandBottom = 2; ///< Thickness of the bottom of the container stand
// PMT constants
static constexpr int sNumberOfPMTs = 24; ///< Number of PMTs for one half of the detector.
static constexpr int sNumberOfPMTsPerSector = 6; ///< Number of PMTs for one sector,
static constexpr float sDrPmt = 3.75; ///< PMT radius
static constexpr float sDzPmt = 12.199; ///< PMT length
static constexpr float sMPmt = 376.77; ///< PMT mass
static constexpr float sDensityPmt = sMPmt / (M_PI * sDrPmt * sDrPmt * sDzPmt); ///< PMT density
// Fiber constants
static constexpr int sNumberOfPMTFiberVolumes = 5; ///< Number of different fiber equivalent volumes in front of the PMTs
/// The order of cells from which the fibers arrive to the PMTs in one sector.
static constexpr int sPMTFiberCellOrder[sNumberOfPMTsPerSector] = {2, 5, 4, 3, 5, 1};
// Local position constants
/// x-position of the right half of the scintillator.
static constexpr float sXScintillator = sDxContainerCover;
/// z-position of the scintillator cells.
static constexpr float sZScintillator = 0;
/// z-position of the plastic cells.
static constexpr float sZPlastic = sZScintillator + sDzScintillator / 2 + sDzPlastic / 2;
/// z-position of the container backplate.
static constexpr float sZContainerBack = sZScintillator - sDzScintillator / 2 - sDzContainerBack / 2;
/// z-position of the container frontplate.
static constexpr float sZContainerFront = sZContainerBack - sDzContainerBack / 2 + sDzContainer - sDzContainerFront / 2;
/// z-position of the center of the container.
static constexpr float sZContainerMid = (sZContainerBack + sZContainerFront) / 2;
/// z-position of the fiber volumes.
static constexpr float sZFiber = (sZPlastic + sZContainerFront) / 2;
/// z-position of the container frontplate cone.
static constexpr float sZCone = sZContainerFront + sDzContainerFront / 2 - sDzContainerCone / 2;
/// x shift of all screw holes.
static constexpr float sXShiftScrews = sXScintillator;
/// x-positions of the PMTs in the right half of the detector.
static constexpr float sXPmt[sNumberOfPMTs] = {8.023, 16.612, 24.987, 33.042, 40.671, 47.778, 59.646, 64.73, 68.982, 72.348, 74.783, 76.257, 76.330, 74.931, 72.569, 69.273, 65.088, 60.065, 48.3, 41.238, 33.645, 25.62, 17.265, 8.688};
/// y-positions of the PMTs in one half of the detector.
static constexpr float sYPmt[sNumberOfPMTs] = {76.33, 74.931, 72.569, 69.273, 65.088, 60.065, 48.3, 41.238, 33.645, 25.62, 17.265, 8.688, -8.023, -16.612, -24.987, -33.042, -40.671, -47.778, -59.646, -64.73, -68.982, -72.348, -74.783, -76.257};
/// z-position of the PMTs.
static constexpr float sZPmt = sZContainerBack + sDzContainerBack / 2 + sDzPmt / 2;
// Screw and rod dimensions
/// Number of the different screw types.
static constexpr int sNumberOfScrewTypes = 6;
/// Radii of the thinner part of the screw types.
static constexpr float sDrMinScrewTypes[sNumberOfScrewTypes]{0.25, 0.25, 0.4, 0.4, 0.4, 0.4};
/// Radii of the thicker part of the screw types.
static constexpr float sDrMaxScrewTypes[sNumberOfScrewTypes]{0, 0.5, 0.6, 0.6, 0.6, 0};
/// Length of the thinner part of the screw types.
static constexpr float sDzMaxScrewTypes[sNumberOfScrewTypes]{6.02, 13.09, 13.1, 23.1, 28.3, 5};
/// Length of the thicker part of the screw types.
static constexpr float sDzMinScrewTypes[sNumberOfScrewTypes]{0, 6.78, 6.58, 15.98, 21.48, 0};
/// z shift of the screws. 0 means they are aligned with the scintillator.
static constexpr float sZShiftScrew = 0;
/// Number of the different rod types.
static constexpr int sNumberOfRodTypes = 4;
/// Width of the thinner part of the rod types.
static constexpr float sDxMinRodTypes[sNumberOfRodTypes]{0.366, 0.344, 0.344, 0.344};
/// Width of the thicker part of the rod types.
static constexpr float sDxMaxRodTypes[sNumberOfRodTypes]{0.536, 0.566, 0.566, 0.716};
/// Height of the thinner part of the rod types.
static constexpr float sDyMinRodTypes[sNumberOfRodTypes]{0.5, 0.8, 0.8, 0.8};
/// Height of the thicker part of the rod types.
static constexpr float sDyMaxRodTypes[sNumberOfRodTypes]{0.9, 1.2, 1.2, 1.2};
/// Length of the thinner part of the rod types.
static constexpr float sDzMaxRodTypes[sNumberOfRodTypes]{12.5, 12.5, 22.5, 27.7};
/// Length of the thicker part of the rod types.
static constexpr float sDzMinRodTypes[sNumberOfRodTypes]{7.45, 7.45, 17.45, 22.65};
/// z shift of the rods. 0 means they are aligned with the scintillators.
static constexpr float sZShiftRod = -0.05;
// Strings for volume names, etc.
inline static const std::string sScintillatorName = "SCINT";
inline static const std::string sPlasticName = "PLAST";
inline static const std::string sSectorName = "SECTOR";
inline static const std::string sCellName = "CELL";
inline static const std::string sScintillatorSectorName = sScintillatorName + sSectorName;
inline static const std::string sScintillatorCellName = sScintillatorName + sCellName;
inline static const std::string sPlasticSectorName = sPlasticName + sSectorName;
inline static const std::string sPlasticCellName = sPlasticName + sCellName;
inline static const std::string sPmtName = "PMT";
inline static const std::string sFiberName = "FIBER";
inline static const std::string sScrewName = "SCREW";
inline static const std::string sScrewHolesCSName = "FV0SCREWHOLES";
inline static const std::string sRodName = "ROD";
inline static const std::string sRodHolesCSName = "FV0RODHOLES";
inline static const std::string sContainerName = "CONTAINER";
/// Initialize the geometry.
void initializeGeometry();
/// Initialize maps with geometry information.
void initializeMaps();
/// Initialize vectors with geometry information.
void initializeVectors();
/// Initialize common transformations.
void initializeTransformations();
/// Initialize the cell ring radii.
void initializeCellRingRadii();
/// Initialize sector transformations.
void initializeSectorTransformations();
/// Initialize fiber volume radii.
void initializeFiberVolumeRadii();
/// Initialize fiber mediums.
void initializeFiberMedium();
/// Initialize the radii of the screw and rod positions.
void initializeScrewAndRodRadii();
/// Initialize the screw type medium.
void initializeScrewTypeMedium();
/// Initialize the rod type medium.
void initializeRodTypeMedium();
/// Add a screw property set to the collection of total screws.
/// \param screwTypeID The screw type ID.
/// \param iRing The ring number.
/// \param phi Azimuthal angle of the screw location.
void addScrewProperties(int screwTypeID, int iRing, float phi);
/// Add a rod property set to the collection of total rods.
/// \param rodTypeID The rod type ID.
/// \param iRing The ring number.
void addRodProperties(int rodTypeID, int iRing);
/// Initialize the position and dimension for every screw and rod.
void initializeScrewAndRodPositionsAndDimensions();
/// Initialize the sensitive volumes.
void initializeSensVols();
/// Initialize the non-sensitive volumes.
void initializeNonSensVols();
/// Initialize a composite shape of all screw holes. This shape is removed
/// from all volumes that the screws are passing through to avoid overlaps.
void initializeScrewHoles();
/// Initialize a composite shape of all rod holes. This shape is removed
/// from all volumes that the rods are passing through to avoid overlaps.
void initializeRodHoles();
/// Initialize cell volumes with a specified thickness and medium.
/// \param cellType The type of the cells.
/// \param zThicknes The thickness of the cells.
/// \param medium The medium of the cells.
/// \param isSensitive Specifies if the cells are sensitive volumes.
void initializeCells(const std::string& cellType, const float zThickness, const TGeoMedium* medium, bool isSensitive);
/// Initialize scintillator cell volumes.
void initializeScintCells();
/// Initialize plastic cell volumes for optical fiber support.
void initializePlasticCells();
/// Initialize PMTs.
void initializePmts();
/// Initialize volumes equivalent to the optical fibers.
void initializeFibers();
/// Initialize the screw volumes.
void initializeScrews();
/// Initialize the rod volumes.
void initializeRods();
/// Initialize the metal container volume.
void initializeMetalContainer();
/// Assemble the sensitive volumes.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleSensVols(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the nonsensitive volumes.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleNonSensVols(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the scintillator sectors.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleScintSectors(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the plastice sectors.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assemblePlasticSectors(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the PMTs.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assemblePmts(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the optical fibers.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleFibers(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the screwss.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleScrews(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the rods.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleRods(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Assemble the metal container.
/// \param vFV0Right The right FV0 volume.
/// \param vFV0Left The left FV0 volume.
void assembleMetalContainer(TGeoVolume* vFV0Right, TGeoVolume* vFV0Left) const;
/// Build sector assembly of specified type.
/// \param cellName The type of the cells in the sector assembly.
/// \return The sector assembly.
TGeoVolumeAssembly* buildSectorAssembly(const std::string& cellName) const;
/// Build a sector of specified type and number.
/// \param cellType The type of the cells in the sector.
/// \param iSector The numbering of the sector.
/// \return The sector.
TGeoVolumeAssembly* buildSector(const std::string& cellType, int iSector) const;
/// Create the shape for a specified screw.
/// \param shapeName The name of the shape.
/// \param screwTypeID The number of the screw type.
/// \param xEpsilon Shrinks or expands the x dimensions of the screw shape.
/// \param yEpsilon Shrinks or expands the y dimensions of the screw shape.
/// \param zEpsilon Shrinks or expands the z dimensions of the screw shape.
/// \return The screw shape.
TGeoShape* createScrewShape(const std::string& shapeName, int screwTypeID, float xEpsilon = 0, float yEpsilon = 0,
float zEpsilon = 0) const;
/// Create the shape for a specified rod.
/// \param shapeName The name of the shape.
/// \param rodTypeID The number of the rod type.
/// \param xEpsilon Shrinks or expands the x dimensions of the rod shape.
/// \param yEpsilon Shrinks or expands the y dimensions of the rod shape.
/// \param zEpsilon Shrinks or expands the z dimensions of the rod shape.
/// \return The rod shape.
TGeoShape* createRodShape(const std::string& shapeName, int rodTypeID, float xEpsilon = 0, float yEpsilon = 0,
float zEpsilon = 0) const;
/// Helper function for creating and registering a TGeoTranslation.
/// \param name The name of the translation.
/// \param dx Translation dx.
/// \param dy Translation dy.
/// \param dz Translation dz.
/// \return The newly created and registered TGeoTranslation.
TGeoTranslation* createAndRegisterTrans(const std::string& name, double dx = 0, double dy = 0, double dz = 0) const;
/// Helper function for creating and registering a TGeoRotation.
/// \param name The name of the rotation.
/// \param dx Translation phi.
/// \param dy Translation theta.
/// \param dz Translation psi.
/// \return The newly created and registered TGeoRotation.
TGeoRotation* createAndRegisterRot(const std::string& name, double phi = 0, double theta = 0, double psi = 0) const;
/// Helper function for creating volume names.
/// \param volumeType A string that will be included in the volume name.
/// \param number A number, e.g. an ID, that is included in the name. A negative number is omitted.
/// \return The volume name.
const std::string createVolumeName(const std::string& volumeType, int number = -1) const;
/// Utility methods
void initializeCellCenters(); ///< To be called in constructor to initialize mCellCenter
void initializeReadoutCenters(); ///< To be called in constructor to initialize mReadoutCenter
std::vector<std::string> mSensitiveVolumeNames; ///< The names of all the sensitive volumes
/// Average ring radii
///
/// index 0 -> ring 1 min, index 1 -> ring 1 max and ring 2 min, ... index 5 -> ring 5 max
std::vector<float> mRAvgRing;
std::vector<float> mRMinScintillator; ///< Inner radii of scintillator rings (.at(0) -> ring 1, .at(4) -> ring 5)
std::vector<float> mRMaxScintillator; ///< Outer radii of scintillator rings (.at(0) -> ring 1, .at(4) -> ring 5)
std::vector<float> mRMinFiber; ///< Inner radii of fiber volumes (.at(0) -> fiber 1)
std::vector<float> mRMaxFiber; ///< Outer radii of fiber volumes (.at(0) -> fiber 1)
/// Medium of the fiber volumes
/// .at(n) -> medium of the n:th fiber starting from the middle.
std::vector<TGeoMedium*> mMediumFiberRings;
std::vector<TGeoMedium*> mMediumFiberPMTs;
std::vector<float> mRScrewAndRod; ///< Radii of the screw and rod positions
std::vector<float> mDrMinScrews; ///< Radii of the thinner part of the screws
std::vector<float> mDrMaxScrews; ///< Radii of the thicker part of the screws
std::vector<float> mDzMaxScrews; ///< Length of the thinner part of the screws
std::vector<float> mDzMinScrews; ///< Length of the thicker part of the screws
std::vector<float> mRScrews; ///< Radial distance to the screw locations
std::vector<int> mScrewTypeIDs; ///< The type ID of each screw (.at(n) -> type ID of screw no. n)
std::vector<float> mDxMinRods; ///< Width of the thinner part of the rods
std::vector<float> mDxMaxRods; ///< Width of the thicker part of the rods
std::vector<float> mDyMinRods; ///< Height of the thinner part of the rods
std::vector<float> mDyMaxRods; ///< Height of the thicker part of the rods
std::vector<float> mDzMaxRods; ///< Length of the thinner part of the rods
std::vector<float> mDzMinRods; ///< Length of the thicker part of the rods
std::vector<int> mRodTypeIDs; ///< The type ID of each rod (.at(n) -> type ID of rod no. n)
std::vector<TGeoMatrix*> mSectorTrans; ///< Transformations of sectors (.at(0) -> sector 1)
std::vector<std::vector<float>> mScrewPos; ///< xyz-coordinates of all the screws
std::vector<std::vector<float>> mRodPos; ///< xyz-coordinates of all the rods
std::vector<TGeoMedium*> mMediumScrewTypes; ///< Medium of the screw types
std::vector<TGeoMedium*> mMediumRodTypes; ///< Medium of the rod types
const int mGeometryType; ///< The type of the geometry.
std::map<EGeoComponent, bool> mEnabledComponents; ///< Map of the enabled state of all geometry components
TGeoMatrix* mLeftTransformation; ///< Transformation for the left part of the detector
TGeoMatrix* mRightTransformation; ///< Transformation for the right part of the detector
/// Utility arrays derived from constants
std::array<Point3Dsimple, sNumberOfCells> mCellCenter; ///< Center of each scintillator cell
std::array<Point3Dsimple, sNumberOfReadoutChannels> mReadoutCenter; ///< Similar to mCellCenter, cells in r5 are additionally divided
static Geometry* sInstance; ///< \brief Singleton instance
ClassDefNV(Geometry, 1);
};
} // namespace fv0
} // namespace o2
#endif