From 54403c56f99473f8c51ca5169adb7d37735f347e Mon Sep 17 00:00:00 2001 From: scannito Date: Thu, 26 Feb 2026 15:08:51 +0100 Subject: [PATCH] Fix extrusions and overlaps b/n staves --- .../include/TRKSimulation/TRKLayer.h | 19 ++++++++++++------- .../ALICE3/TRK/simulation/src/TRKLayer.cxx | 15 +++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h index 0a7a45e87bfd8..39dd7752cc010 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h @@ -51,21 +51,26 @@ class TRKLayer private: // TGeo objects outside logical volumes can cause errors. Only used in case of kStaggered and kTurboStaves layouts - static constexpr float mLogicalVolumeThickness = 1; + static constexpr float mLogicalVolumeThickness = 1.3; + // User defined parameters for the layer, to be set in the constructor int mLayerNumber; - eLayout mLayout; std::string mLayerName; float mInnerRadius; float mOuterRadius; int mNumberOfModules; float mX2X0; - float mChipWidth; - float mChipLength; float mChipThickness; - float mDeadzoneWidth; - float mSensorThickness; - int mHalfNumberOfChips; + + // Fixed parameters for the layer, to be set based on the specifications of the chip and module + eLayout mLayout = kCylinder; + float mChipWidth = constants::moduleMLOT::chip::width; + float mChipLength = constants::moduleMLOT::chip::length; + float mDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut; + float mSensorThickness = constants::moduleMLOT::silicon::thickness; + int mHalfNumberOfChips = 4; + + static constexpr float Si_X0 = 9.5f; ClassDef(TRKLayer, 2); }; diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx index 82b6fbd40af59..53cc6ab11850d 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx @@ -26,17 +26,15 @@ namespace o2 namespace trk { TRKLayer::TRKLayer(int layerNumber, std::string layerName, float rInn, float rOut, int numberOfModules, float layerX2X0) - : mLayerNumber(layerNumber), mLayout(kCylinder), mLayerName(layerName), mInnerRadius(rInn), mOuterRadius(rOut), mNumberOfModules(numberOfModules), mX2X0(layerX2X0), mChipWidth(constants::moduleMLOT::chip::width), mChipLength(constants::moduleMLOT::chip::length), mDeadzoneWidth(constants::moduleMLOT::chip::passiveEdgeReadOut), mSensorThickness(constants::moduleMLOT::silicon::thickness), mHalfNumberOfChips(4) + : mLayerNumber(layerNumber), mLayerName(layerName), mInnerRadius(rInn), mOuterRadius(rOut), mNumberOfModules(numberOfModules), mX2X0(layerX2X0) { - float Si_X0 = 9.5f; mChipThickness = mX2X0 * Si_X0; LOGP(info, "Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}", mLayerNumber, mInnerRadius, mOuterRadius, getZ(), mX2X0); } TRKLayer::TRKLayer(int layerNumber, std::string layerName, float rInn, int numberOfModules, float thick) - : mLayerNumber(layerNumber), mLayout(kCylinder), mLayerName(layerName), mInnerRadius(rInn), mNumberOfModules(numberOfModules), mChipThickness(thick), mChipWidth(constants::moduleMLOT::chip::width), mChipLength(constants::moduleMLOT::chip::length), mDeadzoneWidth(constants::moduleMLOT::chip::passiveEdgeReadOut), mSensorThickness(constants::moduleMLOT::silicon::thickness), mHalfNumberOfChips(4) + : mLayerNumber(layerNumber), mLayerName(layerName), mInnerRadius(rInn), mNumberOfModules(numberOfModules), mChipThickness(thick) { - float Si_X0 = 9.5f; mOuterRadius = rInn + thick; mX2X0 = mChipThickness / Si_X0; LOGP(info, "Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}", mLayerNumber, mInnerRadius, mOuterRadius, getZ(), mX2X0); @@ -300,12 +298,9 @@ TGeoVolume* TRKLayer::createStave(std::string type) } else if (type == "staggered") { double overlap = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1; // 1.5mm outer-edge + 1mm deadzone + 1mm (true)overlap double shift = overlap / 2; - double halfstaveWidth = constants::OT::halfstave::width; - double staveWidth = constants::OT::width - overlap; - stave = new TGeoBBox(staveWidth / 2, mLogicalVolumeThickness / 2, staveLength / 2); - staveVol = new TGeoVolume(staveName.c_str(), stave, medAir); + staveVol = new TGeoVolumeAssembly(staveName.c_str()); // Put the half staves in the correct position TGeoVolume* halfStaveVolLeft = createHalfStave("flat"); @@ -379,7 +374,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume) // Put the staves in the correct position and orientation TGeoCombiTrans* trans = new TGeoCombiTrans(); double theta = 360. * iStave / nStaves; - TGeoRotation* rot = new TGeoRotation("rot", theta - 90 + 3, 0, 0); + TGeoRotation* rot = new TGeoRotation("rot", theta - 90 + 4, 0, 0); trans->SetRotation(rot); trans->SetTranslation(mInnerRadius * std::cos(2. * TMath::Pi() * iStave / nStaves), mInnerRadius * std::sin(2 * TMath::Pi() * iStave / nStaves), 0); @@ -413,7 +408,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume) // Put the staves in the correct position and orientation TGeoCombiTrans* trans = new TGeoCombiTrans(); double theta = 360. * iStave / nStaves; - TGeoRotation* rot = new TGeoRotation("rot", theta - 90 + 3, 0, 0); + TGeoRotation* rot = new TGeoRotation("rot", theta - 90, 0, 0); trans->SetRotation(rot); trans->SetTranslation(mInnerRadius * std::cos(2. * TMath::Pi() * iStave / nStaves), mInnerRadius * std::sin(2 * TMath::Pi() * iStave / nStaves), 0);