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