Skip to content

Commit 0a64b97

Browse files
committed
Fix Specs.h and use that in geometry building
1 parent 135bdf7 commit 0a64b97

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ constexpr int nCols{static_cast<int>(length / chip::pitchZ)};
100100

101101
namespace ML
102102
{
103-
constexpr int nLayers{3}; // number of layers in the ML
103+
constexpr int nLayers{5}; // number of layers in the ML
104104
constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave
105105
// constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave
106106
constexpr double length{124 * cm}; // length of the stave, hardcoded to fit the implemented geometry
@@ -118,7 +118,7 @@ constexpr double length{258 * cm}; // len
118118
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the halfstave
119119
constexpr int nCols{static_cast<int>(length / moduleMLOT::chip::pitchZ)}; // number of columns in the halfstave
120120
} // namespace halfstave
121-
constexpr int nLayers{5}; // number of layers in the OT
121+
constexpr int nLayers{3}; // number of layers in the OT
122122
constexpr double width{halfstave::width * 2}; // width of the stave
123123
constexpr double length{halfstave::length}; // length of the stave
124124
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the stave

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <TRKBase/GeometryTGeo.h>
1313
#include <TGeoManager.h>
1414
#include "TRKBase/SegmentationChip.h"
15+
#include "TRKBase/Specs.h"
1516
#include <TMath.h>
1617

1718
#include <limits>
@@ -64,7 +65,7 @@ GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache(detectors
6465
void GeometryTGeo::Build(int loadTrans)
6566
{
6667
///// current geometry organization:
67-
///// total elements = x staves (*2 half staves if staggered geometry) * 8 layers ML+OT + 4 petal cases * (3 layers + 6 disks)
68+
///// total elements = x staves (*2 half staves if staggered geometry) * ML+OT layers + 4 petal cases * (3 layers + 6 disks)
6869
///// indexing from 0 to 35: VD petals -> layers -> disks
6970
///// indexing from 36 to y: MLOT staves
7071

@@ -1130,7 +1131,7 @@ void GeometryTGeo::Print(Option_t*) const
11301131
std::cout << "Detector ID: " << sInstance.get()->getDetID() << std::endl;
11311132

11321133
LOGF(info, "Summary of GeometryTGeo: %s", getName());
1133-
LOGF(info, "Number of layers ML + OL: %d", mNumberOfLayersMLOT);
1134+
LOGF(info, "Number of layers ML + OT: %d", mNumberOfLayersMLOT);
11341135
LOGF(info, "Number of active parts VD: %d", mNumberOfActivePartsVD);
11351136
LOGF(info, "Number of layers VD: %d", mNumberOfLayersVD);
11361137
LOGF(info, "Number of petals VD: %d", mNumberOfPetalsVD);
@@ -1142,7 +1143,7 @@ void GeometryTGeo::Print(Option_t*) const
11421143
LOGF(info, "Number of staves and half staves per layer MLOT: ");
11431144
for (int i = 0; i < mNumberOfLayersMLOT; i++) {
11441145
std::string mlot = "";
1145-
mlot = (i < 4) ? "ML" : "OT";
1146+
mlot = (i < constants::ML::nLayers) ? "ML" : "OT";
11461147
LOGF(info, "Layer: %d, %s, %d staves, %d half staves per stave", i, mlot.c_str(), mNumberOfStaves[i], mNumberOfHalfStaves[i]);
11471148
}
11481149
LOGF(info, "Number of modules per stave (half stave) in each ML(OT) layer: ");

Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "DetectorsBase/Stack.h"
1515

16+
#include "TRKBase/Specs.h"
1617
#include "TRKBase/TRKBaseParam.h"
1718
#include "TRKSimulation/Hit.h"
1819
#include "TRKSimulation/VDGeometryBuilder.h"
@@ -99,7 +100,7 @@ void Detector::configMLOT()
99100
case kCylindrical: {
100101
const std::vector<float> length{128.35f, 128.35f, 128.35f, 128.35f, 128.35f, 256.7f, 256.7f, 256.7f};
101102
LOGP(warning, "Loading cylindrical configuration for ALICE3 TRK");
102-
for (int i{0}; i < 8; ++i) {
103+
for (int i{0}; i < constants::ML::nLayers + constants::OT::nLayers; ++i) {
103104
std::string name = GeometryTGeo::getTRKLayerPattern() + std::to_string(i);
104105
mLayers.push_back(std::make_unique<TRKCylindricalLayer>(i, name, rInn[i], length[i], thick, MatBudgetParamMode::Thickness));
105106
}
@@ -115,9 +116,9 @@ void Detector::configMLOT()
115116
const std::vector<float> stagOffsets{0.f, 0.f, 0.f, 1.17f, 0.89f};
116117

117118
LOGP(warning, "Loading segmented configuration for ALICE3 TRK");
118-
for (int i{0}; i < 8; ++i) {
119+
for (int i{0}; i < constants::ML::nLayers + constants::OT::nLayers; ++i) {
119120
std::string name = GeometryTGeo::getTRKLayerPattern() + std::to_string(i);
120-
if (i < 5) {
121+
if (i < constants::ML::nLayers) {
121122
mLayers.push_back(std::make_unique<TRKMLLayer>(i, name, rInn[i], stagOffsets[i], tiltAngles[i], nStaves[i], nMods[i], thick, MatBudgetParamMode::Thickness));
122123
} else {
123124
mLayers.push_back(std::make_unique<TRKOTLayer>(i, name, rInn[i], tiltAngles[i], nStaves[i], nMods[i], thick, MatBudgetParamMode::Thickness));
@@ -202,8 +203,8 @@ void Detector::configFromFile(std::string fileName)
202203
// Default mode is Thickness
203204
MatBudgetParamMode mode = MatBudgetParamMode::Thickness;
204205

205-
if (layerCount < 5) {
206-
// ML layers (0 to 4) require stagOffset (index 5)
206+
if (layerCount < constants::ML::nLayers) {
207+
// ML layers require stagOffset (index 5)
207208
if (tmpBuff.size() < 6) {
208209
LOGP(fatal, "Invalid configuration for ML layer {}: stagOffset is missing.", layerCount);
209210
}
@@ -215,7 +216,7 @@ void Detector::configFromFile(std::string fileName)
215216

216217
mLayers.push_back(std::make_unique<TRKMLLayer>(layerCount, name, rInn, stagOffset, tiltAngle, nStaves, nMods, thick, mode));
217218
} else {
218-
// OT layers (5+) do NOT have stagOffset. The optional mode is at index 5.
219+
// OT layers do NOT have stagOffset. The optional mode is at index 5.
219220
if (tmpBuff.size() >= 6) {
220221
mode = static_cast<MatBudgetParamMode>(static_cast<int>(tmpBuff[5]));
221222
}

0 commit comments

Comments
 (0)