From bfa3b0cc775f16cdcdbf6ca9c59a9a0df0630ef1 Mon Sep 17 00:00:00 2001 From: Marcello Di Costanzo Date: Tue, 9 Jun 2026 10:55:54 +0200 Subject: [PATCH 1/2] Configurable radii for TOF --- .../ALICE3/IOTOF/simulation/src/Detector.cxx | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx index ab9a68bd401ec..17df5f0af0195 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx @@ -61,7 +61,7 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str const float x2x0, const float sensorThickness) { - const std::pair dInnerTof = {21.f, 129.f}; // Radius and length + std::pair dInnerTof = {21.f, 129.f}; // Radius and length std::pair dOuterTof = {92.f, 680.f}; // Radius and length std::pair radiusRangeDiskTof = {15.f, 100.f}; float zForwardTof = 370.f; @@ -91,6 +91,33 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str dOuterTof.second = 580.f; zForwardTof = 200.f; radiusRangeDiskTof = {20.f, 68.f}; + } else if (pattern.rfind("custom/") == 0) { // custom/itof_radius:23/otof_radius:100/ + if (itofSegmented) { + LOG(fatal) << "Custom IOTOF pattern does not support segmented configuration, exiting"; + } + // Handle custom patterns + TString patternStr(pattern.c_str()); + patternStr.ReplaceAll("custom/", ""); // Remove the "custom/" prefix + TObjArray* tokens = patternStr.Tokenize("/"); + for (int i = 0; i < tokens->GetEntries(); ++i) { + TString token(tokens->At(i)->GetName()); + patternStr.ReplaceAll(token, ""); + if (token.BeginsWith("itof_radius:")) { + token.ReplaceAll("itof_radius:", ""); + dInnerTof.first = token.Atof(); + LOG(info) << "Custom iTOF radius: " << dInnerTof.first << " cm"; + } else if (token.BeginsWith("otof_radius:")) { + token.ReplaceAll("otof_radius:", ""); + dOuterTof.first = token.Atof(); + LOG(info) << "Custom oTOF radius: " << dOuterTof.first << " cm"; + } else { + LOG(fatal) << "Unrecognized token in custom IOTOF pattern: " << token.Data() << ", exiting"; + } + } + patternStr.ReplaceAll("/", ""); + if (!patternStr.IsWhitespace()) { + LOG(fatal) << "Unrecognized part in custom IOTOF pattern: " << patternStr.Data() << ", exiting"; + } } else { LOG(fatal) << "IOTOF layer pattern " << pattern << " not recognized, exiting"; } @@ -216,6 +243,7 @@ void Detector::defineSensitiveVolumes() } else if (pattern == "v3b2a") { } else if (pattern == "v3b2b") { } else if (pattern == "v3b3") { + } else if (pattern.rfind("custom/") == 0) { } else { LOG(fatal) << "IOTOF layer pattern " << pattern << " not recognized, exiting"; } From ffb716c0fa1eb8cc5c3981e05048561f21ea2c17 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 9 Jun 2026 08:58:25 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx index 17df5f0af0195..26ea7f1ae9812 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx @@ -61,7 +61,7 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str const float x2x0, const float sensorThickness) { - std::pair dInnerTof = {21.f, 129.f}; // Radius and length + std::pair dInnerTof = {21.f, 129.f}; // Radius and length std::pair dOuterTof = {92.f, 680.f}; // Radius and length std::pair radiusRangeDiskTof = {15.f, 100.f}; float zForwardTof = 370.f; @@ -95,7 +95,7 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str if (itofSegmented) { LOG(fatal) << "Custom IOTOF pattern does not support segmented configuration, exiting"; } - // Handle custom patterns + // Handle custom patterns TString patternStr(pattern.c_str()); patternStr.ReplaceAll("custom/", ""); // Remove the "custom/" prefix TObjArray* tokens = patternStr.Tokenize("/");