Skip to content

Commit d2d1a44

Browse files
[Fix] Correct double-width staves for middle layers
1 parent 5710258 commit d2d1a44

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKLayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TRKLayer
4141

4242
TGeoVolume* createSensor(std::string type, double width=-1);
4343
TGeoVolume* createChip(std::string type, double width=-1);
44-
TGeoVolume* createStave(std::string type);
44+
TGeoVolume* createStave(std::string type, double width=-1);
4545
void createLayer(TGeoVolume* motherVolume);
4646

4747
private:

Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ TGeoVolume* TRKLayer::createChip(std::string type, double width)
9090
return chipVol;
9191
}
9292

93-
TGeoVolume* TRKLayer::createStave(std::string type)
93+
TGeoVolume* TRKLayer::createStave(std::string type, double width)
9494
{
9595
TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
9696
std::string staveName = o2::trk::GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber);
@@ -106,7 +106,7 @@ TGeoVolume* TRKLayer::createStave(std::string type)
106106
LOGP(info, "Inserting {} in {} ", chipVol->GetName(), staveVol->GetName());
107107
staveVol->AddNode(chipVol, 1, nullptr);
108108
} else if (type == "flat") {
109-
double width = mModuleWidth * 2; // Each stave has two modules (based on the LOI design)
109+
if (width < 0) LOGP(fatal, "Attempting to create stave with invalid width");
110110
stave = new TGeoBBox(width / 2, mChipThickness / 2, mZ / 2);
111111
chipVol = createChip("flat", width);
112112
staveVol = new TGeoVolume(staveName.c_str(), stave, medAir);
@@ -157,7 +157,9 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
157157
layerVol->AddNode(staveVol, 1, nullptr);
158158
} else if (mLayout == eLayout::kTurboStaves) {
159159
// Compute the number of staves
160-
double width = mModuleWidth * 2; // Each stave has two modules (based on the LOI design)
160+
double width = mModuleWidth; // Each stave has two modules (based on the LOI design)
161+
if (mInnerRadius > 25) width *= 2; // Outer layers have two modules per stave
162+
161163
int nStaves = (int)std::ceil(mInnerRadius * 2 * TMath::Pi() / width);
162164
nStaves += nStaves % 2; // Require an even number of staves
163165

@@ -171,12 +173,12 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
171173
LOGP(info, "Creating a layer with {} staves and {} mm overlap", nStaves, overlap * 10);
172174

173175
for (int iStave = 0; iStave < nStaves; iStave++) {
174-
TGeoVolume* staveVol = createStave("flat");
176+
TGeoVolume* staveVol = createStave("flat", width);
175177

176178
// Put the staves in the correct position and orientation
177179
TGeoCombiTrans* trans = new TGeoCombiTrans();
178180
double theta = 360. * iStave / nStaves;
179-
TGeoRotation* rot = new TGeoRotation("rot", theta + 90 + 2, 0, 0);
181+
TGeoRotation* rot = new TGeoRotation("rot", theta + 90 + 3, 0, 0);
180182
trans->SetRotation(rot);
181183
trans->SetTranslation(mInnerRadius * std::cos(2. * TMath::Pi() * iStave / nStaves), mInnerRadius * std::sin(2 * TMath::Pi() * iStave / nStaves), 0);
182184

0 commit comments

Comments
 (0)