Skip to content

Commit

Permalink
fix: Propagate layer log level to ITK or disc splitter. (#1977)
Browse files Browse the repository at this point in the history
Propagate the layer log level to the ITK or disc splitter, rather than a hard coded log level. This addresses #1975.
  • Loading branch information
goetzgaycken committed Mar 22, 2023
1 parent c8918b4 commit 06af656
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Examples/Detectors/TGeoDetector/src/TGeoDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace {
/// @param config The input config
/// @return Vector of layer builder configs
std::vector<Acts::TGeoLayerBuilder::Config> makeLayerBuilderConfigs(
const TGeoDetector::Config& config) {
const TGeoDetector::Config& config, const Acts::Logger& logger) {
std::vector<Acts::TGeoLayerBuilder::Config> detLayerConfigs;

// iterate over all configured detector volumes
Expand Down Expand Up @@ -117,14 +117,18 @@ std::vector<Acts::TGeoLayerBuilder::Config> makeLayerBuilderConfigs(
cdsConfig.discPhiSegments = volume.discNPhiSegments;
cdsConfig.discRadialSegments = volume.discNRSegments;
layerBuilderConfig.detectorElementSplitter =
std::make_shared<const Acts::TGeoCylinderDiscSplitter>(cdsConfig);
std::make_shared<const Acts::TGeoCylinderDiscSplitter>(
cdsConfig,
logger.clone("TGeoCylinderDiscSplitter", config.layerLogLevel));
} else if (volume.itkModuleSplit) {
ActsExamples::TGeoITkModuleSplitter::Config itkConfig;
itkConfig.barrelMap = volume.barrelMap;
itkConfig.discMap = volume.discMap;
itkConfig.splitPatterns = volume.splitPatterns;
layerBuilderConfig.detectorElementSplitter =
std::make_shared<ActsExamples::TGeoITkModuleSplitter>(itkConfig);
std::make_shared<ActsExamples::TGeoITkModuleSplitter>(
itkConfig,
logger.clone("TGeoITkModuleSplitter", config.layerLogLevel));
}

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

auto layerBuilderConfigs = makeLayerBuilderConfigs(config);
auto layerBuilderConfigs = makeLayerBuilderConfigs(config, logger);

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

0 comments on commit 06af656

Please sign in to comment.