Skip to content

Commit 2e80e74

Browse files
authored
[ALICE 3] TRKLayer refactoring (#15145)
* TRKLayer refactoring * Naming * Fix * Fix constructors * Andrea's modifications * Naming * Removed header
1 parent 70b4aaa commit 2e80e74

File tree

8 files changed

+392
-446
lines changed

8 files changed

+392
-446
lines changed

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
235235
std::vector<float> mCacheRefXMLOT; /// cache for X of ML and OT
236236
std::vector<float> mCacheRefAlphaMLOT; /// cache for sensor ref alpha ML and OT
237237

238-
eLayout mLayoutML; // Type of segmentation for the middle layers
239-
eLayout mLayoutOT; // Type of segmentation for the outer layers
238+
eMLOTLayout mLayoutMLOT; // ML and OT detector layout design
240239

241240
private:
242241
static std::unique_ptr<o2::trk::GeometryTGeo> sInstance;

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/TRKBaseParam.h

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ namespace o2
1919
{
2020
namespace trk
2121
{
22-
23-
enum eOverallGeom {
24-
kDefaultRadii = 0, // After Upgrade Days March 2024
25-
kModRadii,
26-
};
27-
28-
enum eLayout {
29-
kCylinder = 0,
30-
kTurboStaves,
31-
kStaggered,
32-
};
33-
3422
enum eVDLayout {
3523
kIRIS4 = 0,
3624
kIRISFullCyl,
@@ -39,6 +27,11 @@ enum eVDLayout {
3927
kIRIS4a,
4028
};
4129

30+
enum eMLOTLayout {
31+
kCylindrical = 0,
32+
kSegmented,
33+
};
34+
4235
enum eSrvLayout {
4336
kPeacockv1 = 0,
4437
kLOISymm,
@@ -49,16 +42,12 @@ struct TRKBaseParam : public o2::conf::ConfigurableParamHelper<TRKBaseParam> {
4942
float serviceTubeX0 = 0.02f; // X0 Al2O3
5043
Bool_t irisOpen = false;
5144

52-
eOverallGeom overallGeom = kDefaultRadii; // Overall geometry option, to be used in Detector::buildTRKMiddleOuterLayers
53-
54-
eLayout layoutML = kTurboStaves; // Type of segmentation for the middle layers
55-
eLayout layoutOT = kStaggered; // Type of segmentation for the outer layers
56-
eVDLayout layoutVD = kIRIS4; // VD detector layout design
57-
eSrvLayout layoutSRV = kPeacockv1; // Layout of services
45+
eVDLayout layoutVD = kIRIS4; // VD detector layout design
46+
eMLOTLayout layoutMLOT = kSegmented; // ML and OT detector layout design
47+
eSrvLayout layoutSRV = kPeacockv1; // Layout of services
5848

59-
eLayout getLayoutML() const { return layoutML; }
60-
eLayout getLayoutOT() const { return layoutOT; }
6149
eVDLayout getLayoutVD() const { return layoutVD; }
50+
eMLOTLayout getLayoutMLOT() const { return layoutMLOT; }
6251
eSrvLayout getLayoutSRV() const { return layoutSRV; }
6352

6453
O2ParamDef(TRKBaseParam, "TRKBase");

Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ void GeometryTGeo::Build(int loadTrans)
7676
LOGP(fatal, "Geometry is not loaded");
7777
}
7878

79-
mLayoutML = o2::trk::TRKBaseParam::Instance().getLayoutML();
80-
mLayoutOT = o2::trk::TRKBaseParam::Instance().getLayoutOT();
79+
mLayoutMLOT = o2::trk::TRKBaseParam::Instance().getLayoutMLOT();
8180

82-
LOG(debug) << "Layout ML: " << mLayoutML << ", Layout OL: " << mLayoutOT;
81+
LOG(debug) << "Overall layout ML and OT: " << mLayoutMLOT;
8382

8483
mNumberOfLayersMLOT = extractNumberOfLayersMLOT();
8584
mNumberOfPetalsVD = extractNumberOfPetalsVD();
@@ -403,9 +402,9 @@ TString GeometryTGeo::getMatrixPath(int index) const
403402
TString path = Form("/cave_1/barrel_1/%s_2/", GeometryTGeo::getTRKVolPattern());
404403

405404
// handling cylindrical configuration for ML and/or OT
406-
// needed bercause of the different numbering scheme in the geometry for the cylindrical case wrt the staggered and turbo ones
405+
// needed because of the different numbering scheme in the geometry for the cylindrical case wrt the staggered and turbo ones
407406
if (subDetID == 1) {
408-
if ((layer < 4 && mLayoutML == eLayout::kCylinder) || (layer > 3 && mLayoutOT == eLayout::kCylinder)) {
407+
if ((layer < 4 && mLayoutMLOT == eMLOTLayout::kCylindrical) || (layer > 3 && mLayoutMLOT == eMLOTLayout::kCylindrical)) {
409408
stave = 1;
410409
mod = 1;
411410
chip = 1;

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Detector : public o2::base::DetImpl<Detector>
3232
public:
3333
Detector(bool active);
3434
Detector();
35+
Detector(const Detector& other);
3536
~Detector();
3637

3738
// Factory method
@@ -66,8 +67,7 @@ class Detector : public o2::base::DetImpl<Detector>
6667
return nullptr;
6768
}
6869

69-
void configDefault();
70-
void buildTRKMiddleOuterLayers();
70+
void configMLOT();
7171
void configFromFile(std::string fileName = "alice3_TRK_layout.txt");
7272
void configToFile(std::string fileName = "alice3_TRK_layout.txt");
7373

@@ -88,8 +88,8 @@ class Detector : public o2::base::DetImpl<Detector>
8888
double mEnergyLoss; // energy loss
8989
} mTrackData; //! transient data
9090
GeometryTGeo* mGeometryTGeo; //!
91-
std::vector<o2::trk::Hit>* mHits; // ITSMFT ones for the moment
92-
std::vector<TRKLayer> mLayers;
91+
std::vector<o2::trk::Hit>* mHits; // Derived from ITSMFT
92+
std::vector<std::unique_ptr<TRKCylindricalLayer>> mLayers;
9393
TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker
9494

9595
std::vector<std::string> mFirstOrLastLayers; // Names of the first or last layers

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h

Lines changed: 84 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,57 +22,113 @@ namespace o2
2222
{
2323
namespace trk
2424
{
25-
class TRKLayer
25+
enum class MatBudgetParamMode {
26+
Thickness,
27+
X2X0
28+
};
29+
30+
class TRKCylindricalLayer
2631
{
2732
public:
28-
TRKLayer() = default;
29-
TRKLayer(int layerNumber, std::string layerName, float rInn, float rOut, int numberOfModules, float layerX2X0);
30-
TRKLayer(int layerNumber, std::string layerName, float rInn, int numberOfModules, float thick);
31-
~TRKLayer() = default;
32-
33-
void setLayout(eLayout layout) { mLayout = layout; };
33+
TRKCylindricalLayer() = default;
34+
TRKCylindricalLayer(int layerNumber, std::string layerName, float rInn, float length, float thickOrX2X0, MatBudgetParamMode mode);
35+
virtual ~TRKCylindricalLayer() = default;
3436

3537
auto getInnerRadius() const { return mInnerRadius; }
3638
auto getOuterRadius() const { return mOuterRadius; }
37-
auto getZ() const { return constants::moduleMLOT::length * mNumberOfModules; }
39+
auto getZ() const { return mLength; }
3840
auto getx2X0() const { return mX2X0; }
3941
auto getChipThickness() const { return mChipThickness; }
4042
auto getNumber() const { return mLayerNumber; }
4143
auto getName() const { return mLayerName; }
4244

43-
TGeoVolume* createSensor(std::string type);
44-
TGeoVolume* createDeadzone(std::string type);
45-
TGeoVolume* createMetalStack(std::string type);
46-
TGeoVolume* createChip(std::string type);
47-
TGeoVolume* createModule(std::string type);
48-
TGeoVolume* createStave(std::string type);
49-
TGeoVolume* createHalfStave(std::string type);
50-
void createLayer(TGeoVolume* motherVolume);
51-
52-
private:
53-
// TGeo objects outside logical volumes can cause errors. Only used in case of kStaggered and kTurboStaves layouts
54-
static constexpr float mLogicalVolumeThickness = 1.3;
45+
virtual TGeoVolume* createSensor();
46+
virtual TGeoVolume* createMetalStack();
47+
virtual void createLayer(TGeoVolume* motherVolume);
5548

49+
protected:
5650
// User defined parameters for the layer, to be set in the constructor
5751
int mLayerNumber;
5852
std::string mLayerName;
5953
float mInnerRadius;
6054
float mOuterRadius;
61-
int mNumberOfModules;
55+
float mLength;
6256
float mX2X0;
6357
float mChipThickness;
6458

6559
// Fixed parameters for the layer, to be set based on the specifications of the chip and module
66-
eLayout mLayout = kCylinder;
67-
float mChipWidth = constants::moduleMLOT::chip::width;
68-
float mChipLength = constants::moduleMLOT::chip::length;
69-
float mDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut;
70-
float mSensorThickness = constants::moduleMLOT::silicon::thickness;
71-
int mHalfNumberOfChips = 4;
60+
static constexpr double sSensorThickness = constants::moduleMLOT::silicon::thickness;
7261

7362
static constexpr float Si_X0 = 9.5f;
7463

75-
ClassDef(TRKLayer, 2);
64+
ClassDef(TRKCylindricalLayer, 0);
65+
};
66+
67+
class TRKSegmentedLayer : public TRKCylindricalLayer
68+
{
69+
public:
70+
TRKSegmentedLayer() = default;
71+
TRKSegmentedLayer(int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
72+
~TRKSegmentedLayer() override = default;
73+
74+
TGeoVolume* createSensor() override;
75+
TGeoVolume* createDeadzone();
76+
TGeoVolume* createMetalStack() override;
77+
TGeoVolume* createChip();
78+
TGeoVolume* createModule();
79+
virtual TGeoVolume* createStave() = 0;
80+
void createLayer(TGeoVolume* motherVolume) override = 0;
81+
82+
protected:
83+
int mNumberOfModules;
84+
85+
// Fixed parameters for the layer, to be set based on the specifications of the chip and module
86+
static constexpr double sChipWidth = constants::moduleMLOT::chip::width;
87+
static constexpr double sChipLength = constants::moduleMLOT::chip::length;
88+
static constexpr double sDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut;
89+
static constexpr double sModuleLength = constants::moduleMLOT::length;
90+
static constexpr double sModuleWidth = constants::moduleMLOT::width;
91+
static constexpr int sHalfNumberOfChips = 4;
92+
93+
// TGeo objects outside logical volumes can cause errors
94+
static constexpr float sLogicalVolumeThickness = 1.3;
95+
96+
ClassDefOverride(TRKSegmentedLayer, 0);
97+
};
98+
99+
class TRKMLLayer : public TRKSegmentedLayer
100+
{
101+
public:
102+
TRKMLLayer() = default;
103+
TRKMLLayer(int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
104+
~TRKMLLayer() override = default;
105+
106+
TGeoVolume* createStave() override;
107+
void createLayer(TGeoVolume* motherVolume) override;
108+
109+
private:
110+
static constexpr double sStaveWidth = constants::ML::width;
111+
112+
ClassDefOverride(TRKMLLayer, 0);
113+
};
114+
115+
class TRKOTLayer : public TRKSegmentedLayer
116+
{
117+
public:
118+
TRKOTLayer() = default;
119+
TRKOTLayer(int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
120+
~TRKOTLayer() override = default;
121+
122+
TGeoVolume* createStave() override;
123+
TGeoVolume* createHalfStave();
124+
void createLayer(TGeoVolume* motherVolume) override;
125+
126+
private:
127+
static constexpr double sHalfStaveWidth = constants::OT::halfstave::width;
128+
static constexpr double sInStaveOverlap = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1; // 1.5mm outer-edge + 1mm deadzone + 1mm (true) overlap
129+
static constexpr double sStaveWidth = constants::OT::width - sInStaveOverlap;
130+
131+
ClassDefOverride(TRKOTLayer, 0)
76132
};
77133

78134
} // namespace trk

0 commit comments

Comments
 (0)