Skip to content

Commit 94251b3

Browse files
committed
Add option to draw reference circles onto the layer -- strictly for visualisation purposes
1 parent 95d7c9b commit 94251b3

4 files changed

Lines changed: 43 additions & 7 deletions

File tree

Detectors/Upgrades/ALICE3/FT3/base/include/FT3Base/FT3BaseParam.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ struct FT3BaseParam : public o2::conf::ConfigurableParamHelper<FT3BaseParam> {
4646
// What to place over x=0 line in case of full outer-outer stave: Gap or Sensor
4747
bool placeSensorInMiddleOfStave = false;
4848

49+
// Draw reference circles at inner and outer radius of the layer, for visualisation
50+
bool drawReferenceCircles = false;
51+
4952
O2ParamDef(FT3BaseParam, "FT3Base");
5053
};
5154

Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/FT3Layer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class FT3Layer : public TObject
6464
// create layer for disk support
6565
void createSeparationLayer(TGeoVolume* motherVolume, const std::string& separationLayerName);
6666
void createSeparationLayer_waterCooling(TGeoVolume* motherVolume, const std::string& separationLayerName);
67+
void createReferenceCircles(TGeoVolume* motherVolume, const std::string& name);
6768

6869
static TGeoMaterial* carbonFiberMat;
6970
static TGeoMedium* medCarbonFiber;

Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,24 @@ void FT3Layer::createSeparationLayer(TGeoVolume* motherVolume, const std::string
226226
motherVolume->AddNode(carbonFiberLayerVol2, 1, new TGeoTranslation(0, 0, 0 + zSeparation));
227227
}
228228

229+
void FT3Layer::createReferenceCircles(TGeoVolume* motherVolume, const std::string& name) {
230+
231+
// create reference circles at the inner and outer radius of the layer, for visualization purposes
232+
TGeoTube* innerCircle = new TGeoTube(mInnerRadius - 0.1, mInnerRadius + 0.1, 0.01);
233+
TGeoTube* outerCircle = new TGeoTube(mOuterRadius - 0.1, mOuterRadius + 0.1, 0.01);
234+
235+
TGeoVolume* innerCircleVol = new TGeoVolume((mLayerName + "_InnerCircle").c_str(), innerCircle, gGeoManager->GetMedium("FT3_AIR$"));
236+
TGeoVolume* outerCircleVol = new TGeoVolume((mLayerName + "_OuterCircle").c_str(), outerCircle, gGeoManager->GetMedium("FT3_AIR$"));
237+
238+
innerCircleVol->SetLineColor(kRed);
239+
outerCircleVol->SetLineColor(kBlue);
240+
241+
double z_position = mDirection ? 0.5 : -0.5;
242+
243+
motherVolume->AddNode(innerCircleVol, 1, new TGeoTranslation(0, 0, z_position));
244+
motherVolume->AddNode(outerCircleVol, 1, new TGeoTranslation(0, 0, z_position));
245+
}
246+
229247
void FT3Layer::createLayer(TGeoVolume* motherVolume)
230248
{
231249
auto& ft3Params = FT3BaseParam::Instance();
@@ -393,16 +411,27 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
393411
std::string separationLayerName = "FT3SeparationLayer" + std::to_string(mDirection) + std::to_string(mLayerNumber);
394412

395413
TGeoMedium* medAir = gGeoManager->GetMedium("FT3_AIR$");
396-
TGeoTube* layer = new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5); // Add a little additional room in radius; Try with 1.5 cm thickness
397-
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
398-
layerVol->SetLineColor(kYellow + 2);
399-
414+
TGeoVolume* layerVol = nullptr;
400415
if (ft3Params.layoutFT3 == kSegmented) {
416+
// Add a little additional room in radius
417+
TGeoTube* layer = new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
418+
layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
419+
layerVol->SetLineColor(kYellow + 2);
401420
// createSeparationLayer_waterCooling(motherVolume, separationLayerName);
402421
createSeparationLayer(layerVol, separationLayerName);
403422
module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
404423
module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
405424
} else if (ft3Params.layoutFT3 == kSegmentedStave) {
425+
// need a thicker air layer to encompass the staves (4.5cm high, 1.2cm offsets)
426+
// stave face is at z=0 (or +-z_offset_stave), meaning that volumes are at
427+
// ~-+1cm < z < ~+-6cm, the +- referring forward/backward discs
428+
TGeoTube* layer = new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 6);
429+
layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
430+
if (ft3Params.drawReferenceCircles) {
431+
std::string referenceCirclesName = "ReferenceCircles_Dir" + std::to_string(mDirection)
432+
+ "_Layer" + std::to_string(mLayerNumber);
433+
createReferenceCircles(layerVol, referenceCirclesName); // for visualization purposes
434+
}
406435
module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
407436
mOuterRadius, 0., layerVol);
408437
}

Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Module.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ void FT3Module::fill_stave(PosNegPositionTypes& y_positions, double Rin, double
195195
}
196196
// fill in the sensors on negative y
197197
while ( (y_bottom - sensorStackHeight) >= -max_sensor_y_abs ) {
198-
LOG(info) << "\t\tPlacing " << kSensorStack << " sensors at y = " << y_bottom
199-
<< " to " << (y_bottom - sensorStackHeight)
200-
<< " with x_left = " << x_left;
201198
y_positions.second.emplace_back(y_bottom, kSensorStack);
202199
y_bottom -= sensorAbsStackYShift;
203200
}
@@ -353,6 +350,9 @@ void FT3Module::addStaveVolume(
353350
*volume_count,
354351
combiTrans);
355352
(*volume_count)++;
353+
LOG(info) << "\t\tPlacing stave at x = " << x_mid
354+
<< ", y = " << y_lower << " to " << y_upper
355+
<< ", z shift = " << z_shift;
356356

357357
// if the stave needs to be split, reuse the same volume on opposite side
358358
if (splitStave) {
@@ -362,6 +362,9 @@ void FT3Module::addStaveVolume(
362362
*volume_count,
363363
combiTransSplit);
364364
(*volume_count)++;
365+
LOG(info) << "\t\tPlacing split stave at x = " << x_mid
366+
<< ", y = " << -y_upper << " to " << -y_lower
367+
<< ", z shift = " << z_shift;
365368
}
366369
}
367370

0 commit comments

Comments
 (0)