Skip to content

Commit 706ddd0

Browse files
authored
[ALICE3] IOTOF: Adjust layer radius calculations for stave tilt
1 parent 5768b11 commit 706ddd0

File tree

1 file changed

+15
-11
lines changed
  • Detectors/Upgrades/ALICE3/IOTOF/simulation/src

1 file changed

+15
-11
lines changed

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
155155
case kBarrelSegmented: {
156156
// First we create the volume for the whole layer, which will be used as mother volume for the segments
157157
const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
158-
const double staveSizeX = mStaves.second; // cm
159-
const double staveSizeY = mOuterRadius - mInnerRadius; // cm
160-
const double staveSizeZ = mZLength; // cm
161-
const double deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY); // we increase the size of the layer to account for the tilt of the staves
162-
TGeoTube* layer = new TGeoTube(mInnerRadius - deltaForTilt, mOuterRadius + deltaForTilt, mZLength / 2);
158+
const double staveSizeX = mStaves.second; // cm
159+
const double staveSizeY = mOuterRadius - mInnerRadius; // cm
160+
const double staveSizeZ = mZLength; // cm
161+
const double deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY); // we increase the size of the layer to account for the tilt of the staves
162+
const double radiusMax = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY + avgRadius * 2. * deltaForTilt); // we increase the outer radius to account for the tilt of the staves
163+
const double radiusMin = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY - avgRadius * 2. * deltaForTilt); // we decrease the inner radius to account for the tilt of the staves
164+
TGeoTube* layer = new TGeoTube(radiusMin, radiusMax, mZLength / 2);
163165
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
164166
setLayerStyle(layerVol);
165167

@@ -287,11 +289,13 @@ void OTOFLayer::createLayer(TGeoVolume* motherVolume)
287289
case kBarrelSegmented: {
288290
// First we create the volume for the whole layer, which will be used as mother volume for the segments
289291
const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
290-
const double staveSizeX = mStaves.second; // cm
291-
const double staveSizeY = mOuterRadius - mInnerRadius; // cm
292-
const double staveSizeZ = mZLength; // cm
293-
const double deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY); // we increase the size of the layer to account for the tilt of the staves
294-
TGeoTube* layer = new TGeoTube(mInnerRadius - deltaForTilt, mOuterRadius + deltaForTilt, mZLength / 2);
292+
const double staveSizeX = mStaves.second; // cm
293+
const double staveSizeY = mOuterRadius - mInnerRadius; // cm
294+
const double staveSizeZ = mZLength; // cm
295+
const double deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY); // we increase the size of the layer to account for the tilt of the staves
296+
const double radiusMax = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY + avgRadius * 2. * deltaForTilt); // we increase the outer radius to account for the tilt of the staves
297+
const double radiusMin = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY - avgRadius * 2. * deltaForTilt); // we decrease the inner radius to account for the tilt of the staves
298+
TGeoTube* layer = new TGeoTube(radiusMin, radiusMax, mZLength / 2);
295299
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
296300
setLayerStyle(layerVol);
297301

@@ -445,4 +449,4 @@ void BTOFLayer::createLayer(TGeoVolume* motherVolume)
445449
}
446450

447451
} // namespace iotof
448-
} // namespace o2
452+
} // namespace o2

0 commit comments

Comments
 (0)