Skip to content

Commit 06af656

Browse files
authored
fix: Propagate layer log level to ITK or disc splitter. (acts-project#1977)
Propagate the layer log level to the ITK or disc splitter, rather than a hard coded log level. This addresses acts-project#1975.
1 parent c8918b4 commit 06af656

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace {
4444
/// @param config The input config
4545
/// @return Vector of layer builder configs
4646
std::vector<Acts::TGeoLayerBuilder::Config> makeLayerBuilderConfigs(
47-
const TGeoDetector::Config& config) {
47+
const TGeoDetector::Config& config, const Acts::Logger& logger) {
4848
std::vector<Acts::TGeoLayerBuilder::Config> detLayerConfigs;
4949

5050
// iterate over all configured detector volumes
@@ -117,14 +117,18 @@ std::vector<Acts::TGeoLayerBuilder::Config> makeLayerBuilderConfigs(
117117
cdsConfig.discPhiSegments = volume.discNPhiSegments;
118118
cdsConfig.discRadialSegments = volume.discNRSegments;
119119
layerBuilderConfig.detectorElementSplitter =
120-
std::make_shared<const Acts::TGeoCylinderDiscSplitter>(cdsConfig);
120+
std::make_shared<const Acts::TGeoCylinderDiscSplitter>(
121+
cdsConfig,
122+
logger.clone("TGeoCylinderDiscSplitter", config.layerLogLevel));
121123
} else if (volume.itkModuleSplit) {
122124
ActsExamples::TGeoITkModuleSplitter::Config itkConfig;
123125
itkConfig.barrelMap = volume.barrelMap;
124126
itkConfig.discMap = volume.discMap;
125127
itkConfig.splitPatterns = volume.splitPatterns;
126128
layerBuilderConfig.detectorElementSplitter =
127-
std::make_shared<ActsExamples::TGeoITkModuleSplitter>(itkConfig);
129+
std::make_shared<ActsExamples::TGeoITkModuleSplitter>(
130+
itkConfig,
131+
logger.clone("TGeoITkModuleSplitter", config.layerLogLevel));
128132
}
129133

130134
detLayerConfigs.push_back(layerBuilderConfig);
@@ -213,7 +217,7 @@ std::shared_ptr<const Acts::TrackingGeometry> buildTGeoDetector(
213217
// Import the file from
214218
TGeoManager::Import(config.fileName.c_str());
215219

216-
auto layerBuilderConfigs = makeLayerBuilderConfigs(config);
220+
auto layerBuilderConfigs = makeLayerBuilderConfigs(config, logger);
217221

218222
// Remember the layer builders to collect the detector elements
219223
std::vector<std::shared_ptr<const Acts::TGeoLayerBuilder>> tgLayerBuilders;

0 commit comments

Comments
 (0)