forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTRKLayer.h
More file actions
157 lines (126 loc) · 5.55 KB
/
TRKLayer.h
File metadata and controls
157 lines (126 loc) · 5.55 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
// 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.
#ifndef ALICEO2_TRK_LAYER_H
#define ALICEO2_TRK_LAYER_H
#include "TRKBase/Specs.h"
#include "TRKBase/TRKBaseParam.h"
#include <TGeoManager.h>
#include <Rtypes.h>
#include <string>
#include <utility>
namespace o2
{
namespace trk
{
enum class MatBudgetParamMode {
Thickness,
X2X0
};
class TRKCylindricalLayer
{
public:
TRKCylindricalLayer() = default;
TRKCylindricalLayer(int layerNumber, std::string layerName, float rInn, float length, float thickOrX2X0, MatBudgetParamMode mode);
virtual ~TRKCylindricalLayer() = default;
auto getInnerRadius() const { return mInnerRadius; }
auto getOuterRadius() const { return mOuterRadius; }
auto getZ() const { return mLength; }
auto getx2X0() const { return mX2X0; }
auto getChipThickness() const { return mChipThickness; }
auto getNumber() const { return mLayerNumber; }
auto getName() const { return mLayerName; }
virtual TGeoVolume* createSensor();
virtual TGeoVolume* createMetalStack();
virtual void createLayer(TGeoVolume* motherVolume);
protected:
// User defined parameters for the layer, to be set in the constructor
int mLayerNumber;
std::string mLayerName;
float mInnerRadius;
float mOuterRadius;
float mLength;
float mX2X0;
float mChipThickness;
// Fixed parameters for the layer, to be set based on the specifications of the chip and module
static constexpr double sSensorThickness = constants::moduleMLOT::silicon::thickness;
static constexpr float Si_X0 = 9.5f;
ClassDef(TRKCylindricalLayer, 0);
};
class TRKSegmentedLayer : public TRKCylindricalLayer
{
public:
TRKSegmentedLayer() = default;
TRKSegmentedLayer(int layerNumber, std::string layerName, float rInn, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
~TRKSegmentedLayer() override = default;
TGeoVolume* createSensor() override;
TGeoVolume* createDeadzone();
TGeoVolume* createMetalStack() override;
TGeoVolume* createChip();
TGeoVolume* createModule();
virtual TGeoVolume* createStave() = 0;
void createLayer(TGeoVolume* motherVolume) override = 0;
protected:
float mTiltAngle;
int mNumberOfModules;
int mNumberOfStaves;
bool mIsFlipped = false;
// Fixed parameters for the layer, to be set based on the specifications of the chip and module
static constexpr double sChipWidth = constants::moduleMLOT::chip::width;
static constexpr double sChipLength = constants::moduleMLOT::chip::length;
static constexpr double sDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut;
static constexpr double sModuleLength = constants::moduleMLOT::length;
static constexpr double sModuleWidth = constants::moduleMLOT::width;
static constexpr int sHalfNumberOfChips = 4;
// TGeo objects outside logical volumes can cause errors
static constexpr float sLogicalVolumeThickness = 1.3;
// For the segmented layers, because of tilting and staggering the bounding radii can be different
// from the inner radius and inner radius + thickness.
// This function calculates the bounding radii based on the geometry of the stave and the tilt angle,
// to ensure that the layer volume is large enough to contain all the staves without overlaps.
virtual std::pair<float, float> getBoundingRadii(double staveWidth) const;
ClassDefOverride(TRKSegmentedLayer, 0);
};
class TRKMLLayer : public TRKSegmentedLayer
{
public:
TRKMLLayer() = default;
TRKMLLayer(int layerNumber, std::string layerName, float rInn, float staggerOffset, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
~TRKMLLayer() override = default;
TGeoVolume* createStave() override;
void createLayer(TGeoVolume* motherVolume) override;
private:
float mStaggerOffset;
static constexpr double sStaveWidth = constants::ML::width;
static constexpr int sFlippedLayerNumber = 3;
// Override to account for the staggering offset present in specific ML layers
std::pair<float, float> getBoundingRadii(double staveWidth) const override;
ClassDefOverride(TRKMLLayer, 0);
};
class TRKOTLayer : public TRKSegmentedLayer
{
public:
TRKOTLayer() = default;
TRKOTLayer(int layerNumber, std::string layerName, float rInn, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
~TRKOTLayer() override = default;
TGeoVolume* createStave() override;
TGeoVolume* createHalfStave();
void createLayer(TGeoVolume* motherVolume) override;
private:
static constexpr double sHalfStaveWidth = constants::OT::halfstave::width;
static constexpr double sInStaveOverlap = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1; // 1.5mm outer-edge + 1mm deadzone + 1mm (true) overlap
static constexpr double sStaveWidth = constants::OT::width - sInStaveOverlap;
// Override to account for the staggering offset present in OT layers
std::pair<float, float> getBoundingRadii(double staveWidth) const override;
ClassDefOverride(TRKOTLayer, 0)
};
} // namespace trk
} // namespace o2
#endif // ALICEO2_TRK_LAYER_H