From 305db67d3e1ef3c4bb6f0509f1691069de4a88eb Mon Sep 17 00:00:00 2001 From: Daniel Battistini Date: Tue, 13 May 2025 16:56:38 +0200 Subject: [PATCH] Fix the thickness of logical volumes for kTurboStaves and kStaggered configurations of the tracker --- .../TRK/simulation/include/TRKSimulation/TRKLayer.h | 3 +++ Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h index ef355ec36ce2f..ba894f6d7a92b 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h @@ -45,6 +45,9 @@ class TRKLayer void createLayer(TGeoVolume* motherVolume); private: + // TGeo objects outside logical volumes can cause errors. Only used in case of kStaggered and kTurboStaves layouts + static constexpr float mLogicalVolumeThickness = 1; + int mLayerNumber; std::string mLayerName; float mInnerRadius; diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx index e6b00f6e96425..a95418afbba25 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx @@ -120,7 +120,7 @@ TGeoVolume* TRKLayer::createStave(std::string type, double width) staveVol->AddNode(chipVol, 1, nullptr); } else if (type == "staggered") { double width = mModuleWidth * 2; // Each stave has two modules (based on the LOI design) - stave = new TGeoBBox(width / 2, mChipThickness / 2, mZ / 2); + stave = new TGeoBBox(width / 2, mLogicalVolumeThickness / 2, mZ / 2); TGeoVolume* chipVolLeft = createChip("flat", mModuleWidth); TGeoVolume* chipVolRight = createChip("flat", mModuleWidth); staveVol = new TGeoVolume(staveName.c_str(), stave, medAir); @@ -152,7 +152,11 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume) chipName = o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mLayerNumber), sensName = Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mLayerNumber); - TGeoTube* layer = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2); + double layerThickness = mChipThickness; + if (mLayout != eLayout::kCylinder) { + layerThickness = mLogicalVolumeThickness; + } + TGeoTube* layer = new TGeoTube(mInnerRadius - 0.333 * layerThickness, mInnerRadius + 0.667 * layerThickness, mZ / 2); TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir); layerVol->SetLineColor(kYellow);