Skip to content

Commit d6d1f3c

Browse files
authored
Enhance Layer class with sensor thickness handling
Added sensor thickness parameter and validation checks.
1 parent e2e7eb8 commit d6d1f3c

File tree

1 file changed

+17
-7
lines changed
  • Detectors/Upgrades/ALICE3/IOTOF/simulation/src

1 file changed

+17
-7
lines changed

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@ namespace o2
2828
namespace iotof
2929
{
3030
Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0,
31-
int layout, int nStaves, float staveSize, double staveTiltAngle, int modulesPerStave)
31+
int layout, int nStaves, float staveSize, double staveTiltAngle, int modulesPerStave, float sensorThickness)
3232
: mLayerName(layerName),
3333
mInnerRadius(rInn),
3434
mOuterRadius(rOut),
3535
mZLength(zLength),
3636
mZOffset(zOffset),
37+
mSensorThickness(sensorThickness),
3738
mX2X0(layerX2X0),
3839
mLayout(layout),
3940
mStaves(nStaves, staveSize),
4041
mModulesPerStave(modulesPerStave),
4142
mTiltAngle(staveTiltAngle)
4243
{
43-
const float Si_X0 = 9.5f;
44+
const float Si_X0 = 9.5f; // cm, radiation length of silicon
4445
mChipThickness = mX2X0 * Si_X0;
4546
std::string name = "";
4647
switch (layout) {
@@ -76,6 +77,12 @@ Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float
7677
if ((mTiltAngle < 0.0 || mTiltAngle > 90.0) && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
7778
LOG(fatal) << "Invalid configuration: tilt angle " << mTiltAngle << " is too large, it must be between 0 and 90 degrees";
7879
}
80+
if (mSensorThickness < 0.0f || mSensorThickness > mChipThickness) {
81+
LOG(fatal) << "Invalid configuration: sensor thickness " << mSensorThickness << " cm is out of range (0, " << mChipThickness << ") cm";
82+
}
83+
if (sensorThickness > 0.0f && (layout == kBarrel || layout == kDisk)) {
84+
LOG(fatal) << "Invalid configuration: sensor thickness " << mSensorThickness << " cm is set for non-segmented layout, it should be 0";
85+
}
7986

8087
LOGP(info, "TOF: Creating {} layer: rInner: {} (cm) rOuter: {} (cm) zLength: {} (cm) zOffset: {} x2X0: {}", name.c_str(), mInnerRadius, mOuterRadius, mZLength, mZOffset, mX2X0);
8188
}
@@ -180,10 +187,13 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
180187
setModuleStyle(moduleVol);
181188

182189
// Now we create the volume of the chip, which is the same for all modules
183-
const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
184-
const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
185-
const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
186-
const double chipSizeY = moduleSizeY; // cm
190+
const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
191+
const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
192+
const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
193+
const double chipSizeY = moduleSizeY - mSensorThickness; // cm
194+
if (chipSizeY <= 0) {
195+
LOG(fatal) << "Invalid configuration: sensor thickness " << mSensorThickness << " cm is too large for module size " << moduleSizeY << " cm, it leaves no space for the chip";
196+
}
187197
const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
188198
TGeoBBox* chip = new TGeoBBox(chipSizeX * 0.5, chipSizeY * 0.5, chipSizeZ * 0.5);
189199
TGeoVolume* chipVol = new TGeoVolume(chipName, chip, medSi);
@@ -193,7 +203,7 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
193203
const int sensorsPerChipX = 2; // we assume that each chip is divided in 2 sensors along the x direction
194204
const int sensorsPerChipZ = 2; // we assume that each chip is divided in 2 sensors along the z direction
195205
const double sensorSizeX = chipSizeX / sensorsPerChipX; // cm
196-
const double sensorSizeY = chipSizeY; // cm
206+
const double sensorSizeY = mSensorThickness; // cm
197207
const double sensorSizeZ = chipSizeZ / sensorsPerChipZ; // cm
198208
TGeoBBox* sensor = new TGeoBBox(sensorSizeX * 0.5, sensorSizeY * 0.5, sensorSizeZ * 0.5);
199209
TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);

0 commit comments

Comments
 (0)