Skip to content

Commit 7ea4b89

Browse files
committed
Remove all instances of old slab geometry and work only with staves.
1 parent c74d18e commit 7ea4b89

4 files changed

Lines changed: 80 additions & 109 deletions

File tree

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,19 @@ class FT3Module
5252
double Rout, double overlap, const std::string& face,
5353
const std::string& layout_type, TGeoVolume* motherVolume);
5454

55-
void createModule_scopingV3(
55+
void createModule_staveGeo(
5656
double mZ, int layerNumber, int direction, double Rin,
57-
double Rout, double overlap, TGeoVolume* motherVolume,
58-
bool useStaves);
57+
double Rout, double overlap, TGeoVolume* motherVolume);
5958

6059
private:
6160
static void create_layout(
6261
double mZ, int layerNumber, int direction, double Rin,
6362
double Rout, double overlap, const std::string& face,
6463
const std::string& layout_type, TGeoVolume* motherVolume);
6564

66-
void create_layout_scopingV3(
65+
void create_layout_staveGeo(
6766
double mZ, int layerNumber, int direction, double Rin,
68-
double Rout, double overlap, TGeoVolume* motherVolume,
69-
bool useStaves);
67+
double Rout, double overlap, TGeoVolume* motherVolume);
7068

7169
// Helper functions
7270
void fill_stave(PosNegPositionTypes& y_positions, double Rout,
@@ -83,20 +81,20 @@ class FT3Module
8381

8482
void add2x1GlueVolume(
8583
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
86-
std::string side_str, double x_mid, double y_mid, double z_mid,
84+
double x_mid, double y_mid, double z_mid,
8785
std::string element_glued_to);
8886

8987
void add2x1CopperVolume(
9088
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
91-
std::string side_str, double x_mid, double y_mid, double z_mid);
89+
double x_mid, double y_mid, double z_mid);
9290

9391
void add2x1KaptonVolume(
9492
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
95-
std::string side_str, double x_mid, double y_mid, double z_mid);
93+
double x_mid, double y_mid, double z_mid);
9694

9795
void addSingleSensorVolume(
9896
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
99-
double active_x_mid, double y_mid, double z_mid, std::string side_str, bool isLeft);
97+
double active_x_mid, double y_mid, double z_mid, bool isLeft);
10098
};
10199

102100
#endif // FT3MODULE_H

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,23 @@ namespace o2::ft3::ModuleConstants
5656
const unsigned kSensorsPerStack = 1;
5757
const double sensor_stack_height = kSensorsPerStack * sensor2x1_height +
5858
(kSensorsPerStack - 1) * sensor2x1_gap;
59-
60-
// OLD VERSION: RECTANGULAR STAVES
61-
const double carbonFiberThickness = 0.01;
62-
const double foamSpacingThickness = 1.0;
63-
6459
/*
6560
* Constants for staves are written for both positive
6661
* and negative x even though they are just mirrored now,
6762
* because there might be design changes in the future
6863
* that require a non-mirrored layout, making it easier to
6964
* change here if so required, even though it looks uglier now.
70-
*/
71-
// First define midpoints of staves that would overlap with inner disc
72-
// EXCEPTION: Assumed mirrored around x-axis
65+
*
66+
* The second element in the mapping pair is whether the stave
67+
* with a certain ID should be mirrored around the x-axis.
68+
*/
7369
// map from Stave ID (1-indexed from other documents) to midpoint
7470
// Do NOT add any zero midpoints, this is taken off separately
75-
const std::map<int, double> staveID_to_y_midpoint = {
76-
{-2, 39.0},
77-
{-1, 41.4},
78-
{1, 41.4},
79-
{2, 39.0}
71+
const std::map<int, std::pair<double, bool>> staveID_to_y_midpoint = {
72+
{-2, {39.0, true}},
73+
{-1, {41.4, true}},
74+
{1, {41.4, true}},
75+
{2, {39.0, true}}
8076
};
8177
// lengths of staves, their midpoint, and their face
8278
const std::vector<double> y_lengths = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
405405
module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
406406
module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
407407
} else if (ft3Params.layoutFT3 == kSegmentedStave) {
408-
module.createModule_scopingV3(0., mLayerNumber, mDirection, mInnerRadius,
409-
mOuterRadius, 0., layerVol);
408+
module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
409+
mOuterRadius, 0., layerVol);
410410
}
411411
// Finally put everything in the mother volume
412412
auto* FwdDiskRotation = new TGeoRotation("FwdDiskRotation", 0, 0, 180);

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

Lines changed: 61 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ void FT3Module::addDetectorVolume(
321321
*/
322322
void FT3Module::add2x1GlueVolume(
323323
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
324-
std::string side_str, double x_mid, double y_mid, double z_mid,
324+
double x_mid, double y_mid, double z_mid,
325325
std::string element_glued_to)
326326
{
327-
std::string glue_name = "FT3glue_" + element_glued_to + "_" + side_str + "_"
327+
std::string glue_name = "FT3glue_" + element_glued_to + "_"
328328
+ std::to_string(layerNumber) + "_" + std::to_string(direction)
329329
+ "_" + std::to_string(*volume_count);
330330
addDetectorVolume(
@@ -340,9 +340,9 @@ void FT3Module::add2x1GlueVolume(
340340
*/
341341
void FT3Module::add2x1CopperVolume(
342342
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
343-
std::string side_str, double x_mid, double y_mid, double z_mid)
343+
double x_mid, double y_mid, double z_mid)
344344
{
345-
std::string copper_name = "FT3Copper_" + side_str + "_" + std::to_string(layerNumber) + "_"
345+
std::string copper_name = "FT3Copper_" + std::to_string(layerNumber) + "_"
346346
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
347347
addDetectorVolume(
348348
motherVolume, copper_name, Constants::CuColor, volume_count,
@@ -357,9 +357,9 @@ void FT3Module::add2x1CopperVolume(
357357
*/
358358
void FT3Module::add2x1KaptonVolume(
359359
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
360-
std::string side_str, double x_mid, double y_mid, double z_mid)
360+
double x_mid, double y_mid, double z_mid)
361361
{
362-
std::string kapton_name = "FT3Kapton_" + side_str + "_" + std::to_string(layerNumber) + "_"
362+
std::string kapton_name = "FT3Kapton_" + std::to_string(layerNumber) + "_"
363363
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
364364
addDetectorVolume(
365365
motherVolume, kapton_name, Constants::kaptonColor, volume_count,
@@ -384,17 +384,16 @@ void FT3Module::add2x1KaptonVolume(
384384
* x_mid: the x position of the center of the sensor volume
385385
* y_mid: the y position of the center of the sensor volume
386386
* z_mid: the z position of the center of the sensor volume
387-
* side_str: string indicating whether the sensor is on the front or back
388387
* isLeft: whether the sensor is on the left or right in the 2x1 layout
389388
*/
390389
void FT3Module::addSingleSensorVolume(
391390
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
392-
double active_x_mid, double y_mid, double z_mid, std::string side_str, bool isLeft)
391+
double active_x_mid, double y_mid, double z_mid, bool isLeft)
393392
{
394393
TGeoVolume* sensor;
395394
TGeoManager* geoManager = gGeoManager;
396395
// ACTIVE AREA
397-
std::string sensor_name = "FT3Sensor_" + side_str + "_" + std::to_string(layerNumber) + "_"
396+
std::string sensor_name = "FT3Sensor_" + std::to_string(layerNumber) + "_"
398397
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
399398
sensor = geoManager->MakeBox(sensor_name.c_str(), siliconMed, Constants::active_width / 2,
400399
Constants::single_sensor_height / 2, Constants::siliconThickness / 2);
@@ -414,7 +413,7 @@ void FT3Module::addSingleSensorVolume(
414413
double inactive_x_mid = isLeft ? (active_x_mid - Constants::active_width / 2 - Constants::inactive_width / 2)
415414
: (active_x_mid + Constants::active_width / 2 + Constants::inactive_width / 2);
416415
std::string sensor_inactive_name =
417-
"FT3Sensor_Inactive_" + side_str + "_" + std::to_string(layerNumber) + "_"
416+
"FT3Sensor_Inactive_" + std::to_string(layerNumber) + "_"
418417
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
419418
sensor = geoManager->MakeBox(sensor_inactive_name.c_str(), siliconMed, Constants::inactive_width / 2,
420419
Constants::single_sensor_height / 2, Constants::siliconThickness / 2);
@@ -432,11 +431,11 @@ void FT3Module::addSingleSensorVolume(
432431
(*volume_count)++;
433432
}
434433

435-
void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int direction,
434+
void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction,
436435
double Rin, double Rout, double overlap,
437-
TGeoVolume* motherVolume, bool useStaves)
436+
TGeoVolume* motherVolume)
438437
{
439-
LOG(info) << "FT3Module: create_layout_scopingV3 - Layer "
438+
LOG(info) << "FT3Module: create_layout_staveGeo - Layer "
440439
<< layerNumber << ", Direction " << direction;
441440

442441
FT3Module::initialize_materials();
@@ -445,31 +444,18 @@ void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int directio
445444
// First let's define some constants used throughout
446445
/*
447446
* we build the volume from the outside in, starting with the silicon,
448-
* then glue & materials towards the stave/slab. Depending on whether it's front or back,
449-
* the distance from the center will be mirrored so that we get the following:
450-
*
451-
* Front (ordered in z, since the forward direction is to the right):
452-
* | SILICON SENSOR | GLUE | COPPER | KAPTON | GLUE | CARBON SLAB |
453-
*
454-
* Back (ordered in z, since the forward direction is to the right):
455-
* | CARBON SLAB | GLUE | KAPTON | COPPER | GLUE | SILICON SENSOR |
447+
* then glue & materials towards the stave. Depending on direction,
448+
* the distance from the center will be mirrored.
456449
*
457-
* Note that we do not place stave and support structure material here, that is
458-
* assumed to have been placed by the Layer creation.
459-
*
460-
* kSegmentedStave: With triangular carbon staves we have the same order:
461450
* | SILICON SENSOR | GLUE | COPPER | KAPTON | GLUE | CARBON STAVE |
451+
* ----------------------------------------------------------------> z
452+
*
453+
* Naturally, this will be mirrored for layers in the backwards direction,
454+
* such that the face of the sensors always face the interaction region.
462455
*
463-
* Thus, we can use same constant names for staves and slabs,
464-
* as the material order is the same
456+
* Currently, we stipulate that the default stave face is at local z=0.
465457
*/
466-
double z_offset_to_carbon_face;
467-
if (useStaves) {
468-
z_offset_to_carbon_face = 0; // stave placed behind the sensor at local z=0
469-
} else {
470-
z_offset_to_carbon_face =
471-
Constants::foamSpacingThickness / 2.0 + Constants::carbonFiberThickness;
472-
}
458+
double z_offset_to_carbon_face = 0;
473459
double z_offset_to_glue_Ka =
474460
z_offset_to_carbon_face + Constants::epoxyThickness / 2;
475461
double z_offset_to_kapton =
@@ -495,37 +481,37 @@ void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int directio
495481
const int staveID = Constants::staveIdxToID(i_stave);
496482

497483
double y_midpoint = 0.;
484+
bool mirrorStaveAroundX = false;
498485
// default positive and negative starting points has a gap around x-axis
499486
std::pair<double, double> y_start{0., -Constants::sensor2x1_gap};
500487
auto y_midpoint_it = Constants::staveID_to_y_midpoint.find(staveID);
501488
if ( y_midpoint_it != Constants::staveID_to_y_midpoint.end() ) {
502489
// there is a defined midpoint for this stave, use this for starting points
503-
y_midpoint = y_midpoint_it->second; // avoid double map lookup
490+
y_midpoint = y_midpoint_it->second.first; // avoid double map lookup
491+
mirrorStaveAroundX = y_midpoint_it->second.second;
504492
double y_start_pos = y_midpoint - Constants::y_lengths[i_stave] / 2;
505493
y_start = {y_start_pos, -y_start_pos};
506494
}
507-
// only add stave volume if using staves, assume floating otherwise
508-
if (useStaves) {
509-
// Get whether the stave is shifted backward or not
510-
double z_stave_shift_abs = Constants::staveOnFront[i_stave] ? 0 : Constants::z_offsetStave;
511-
// now create the stave volume
512-
std::string stave_volume_name =
513-
"Stave_" + std::to_string(i_stave) + "_" + std::to_string(layerNumber) +
514-
"_" + std::to_string(direction);
495+
496+
// Get whether the stave is shifted backward or not
497+
double z_stave_shift_abs = Constants::staveOnFront[i_stave] ? 0 : Constants::z_offsetStave;
498+
// now create the stave volume
499+
std::string stave_volume_name =
500+
"Stave_" + std::to_string(i_stave) + "_" + std::to_string(layerNumber) +
501+
"_" + std::to_string(direction);
502+
addStaveVolume(
503+
motherVolume, stave_volume_name, direction, &volume_count,
504+
Constants::y_lengths[i_stave], Constants::x_midpoints[i_stave],
505+
y_midpoint, mZ + z_stave_shift_abs
506+
);
507+
if (y_midpoint > Rin) {
508+
// stave midpoint is beyond nominal inner radius,
509+
// so we can reasonably expect to mirror sensors around the x-axis
515510
addStaveVolume(
516-
motherVolume, stave_volume_name, direction, &volume_count,
511+
motherVolume, stave_volume_name + "_mirrored", direction, &volume_count,
517512
Constants::y_lengths[i_stave], Constants::x_midpoints[i_stave],
518-
y_midpoint, mZ + z_stave_shift_abs
513+
-y_midpoint, mZ + z_stave_shift_abs
519514
);
520-
if (y_midpoint > Rin) {
521-
// stave midpoint is beyond nominal inner radius,
522-
// so we can reasonably expect to mirror sensors around the x-axis
523-
addStaveVolume(
524-
motherVolume, stave_volume_name + "_mirrored", direction, &volume_count,
525-
Constants::y_lengths[i_stave], Constants::x_midpoints[i_stave],
526-
-y_midpoint, mZ + z_stave_shift_abs
527-
);
528-
}
529515
}
530516

531517
double x_left = Constants::x_midpoints[i_stave] - Constants::sensor2x1_width / 2;
@@ -565,33 +551,25 @@ void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int directio
565551
* Declare an offset multiplier for the z offsets, used for distinguishing
566552
* sensors facing either forward or backward.
567553
*
568-
* In the new stave layout, all sensors face inward, and isFront
569-
* refers to whether a stave is shifted backwards or not. Thus, we decide
570-
* the offset multiplier only with direction
571-
*
572-
* When using the old slab layout, due to mirroring forward and backward,
573-
* we can simply use isFront, as it is set oppositely depending on forward
574-
* or backward direction earlier, and isFront refers to the face direction.
554+
* In the stave layout, all sensors face inward, and isFront
555+
* refers to whether a stave is shifted backwards or not. Thus,
556+
* we decide the offset multiplier only with direction, to
557+
* keep the face facing inwards.
575558
*/
576559
bool isFront;
577560
if (direction == 1) { // direction = 1 is forward
578561
isFront = Constants::staveOnFront[i_stave];
579562
} else {
580563
isFront = !(Constants::staveOnFront[i_stave]);
581564
}
565+
int z_offset_multiplier = (direction == 1) ? -1 : 1;
582566

583-
int z_offset_multiplier;
584-
if (useStaves) {
585-
z_offset_multiplier = (direction == 1) ? -1 : 1;
586-
} else {
587-
z_offset_multiplier = isFront ? -1 : 1;
588-
}
589-
590-
// Get whether the stave is shifted for staggering or not (only when using stave layout)
567+
// Get whether the stave is shifted for staggering or not
591568
double z_stave_shift = 0;
592-
if (useStaves && !Constants::staveOnFront[i_stave]) {
569+
if (!Constants::staveOnFront[i_stave]) {
593570
// in forward direction, shifting backwards means +z shift
594-
z_stave_shift = (direction == 1) ? Constants::z_offsetStave : -Constants::z_offsetStave;
571+
z_stave_shift = (direction == 1) ? Constants::z_offsetStave
572+
: -Constants::z_offsetStave;
595573
}
596574

597575
for (unsigned i_y_pos = 0; i_y_pos < y_positionsPosNeg[i_stave].first.size(); i_y_pos++) {
@@ -606,43 +584,42 @@ void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int directio
606584
(Constants::sensor2x1_height + Constants::sensor2x1_gap) * i_sens +
607585
Constants::sensor2x1_height / 2; // and add half height to get the middle of the sensor
608586

609-
std::string side_str = isFront ? "front" : "back";
610587
// ------------ (1) Silicon sensor ------------
611588
// left single sensor of the 2x1
612589
double z_mid = z_offset_to_silicon * z_offset_multiplier + z_stave_shift;
613590
addSingleSensorVolume(
614591
motherVolume, layerNumber, direction, &volume_count,
615-
x_mid - Constants::active_width / 2, y_mid, z_mid, side_str, true
592+
x_mid - Constants::active_width / 2, y_mid, z_mid, true
616593
);
617594
// right single sensor of the 2x1
618595
addSingleSensorVolume(
619596
motherVolume, layerNumber, direction, &volume_count,
620-
x_mid + Constants::active_width / 2, y_mid, z_mid, side_str, false
597+
x_mid + Constants::active_width / 2, y_mid, z_mid, false
621598
);
622599

623600
// ------------ (2) Epoxy glue layer between silicon and copper (FPC) ------------
624601
z_mid = z_offset_to_glue_Si * z_offset_multiplier + z_stave_shift;
625602
add2x1GlueVolume(
626603
motherVolume, layerNumber, direction, &volume_count,
627-
side_str, x_mid, y_mid, z_mid, "SiCu"
604+
x_mid, y_mid, z_mid, "SiCu"
628605
);
629606
// ------------ (3) Copper layer (FPC) ------------
630607
z_mid = z_offset_to_copper * z_offset_multiplier + z_stave_shift;
631608
add2x1CopperVolume(
632609
motherVolume, layerNumber, direction, &volume_count,
633-
side_str, x_mid, y_mid, z_mid
610+
x_mid, y_mid, z_mid
634611
);
635612
// ------------ (4) Kapton layer (FPC) ------------
636613
z_mid = z_offset_to_kapton * z_offset_multiplier + z_stave_shift;
637614
add2x1KaptonVolume(
638615
motherVolume, layerNumber, direction, &volume_count,
639-
side_str, x_mid, y_mid, z_mid
616+
x_mid, y_mid, z_mid
640617
);
641618
// ------------ (5) Epoxy glue layer between stave and Kapton ------------
642619
z_mid = z_offset_to_glue_Ka * z_offset_multiplier + z_stave_shift;
643620
add2x1GlueVolume(
644621
motherVolume, layerNumber, direction, &volume_count,
645-
side_str, x_mid, y_mid, z_mid, "CarbonKapton"
622+
x_mid, y_mid, z_mid, "CarbonKapton"
646623
);
647624
} // sensors in stack
648625
} // for i_y_sign (writing of positive or negative y positions)
@@ -1311,12 +1288,12 @@ void FT3Module::createModule(double mZ, int layerNumber, int direction, double R
13111288
LOG(debug) << "FT3Module: done createModule";
13121289
}
13131290

1314-
void FT3Module::createModule_scopingV3(double mZ, int layerNumber, int direction,
1291+
void FT3Module::createModule_staveGeo(double mZ, int layerNumber, int direction,
13151292
double Rin, double Rout, double overlap,
1316-
TGeoVolume* motherVolume, bool useStaves) {
1317-
LOG(debug) << "FT3Module: createModule_scopingV3 - Layer " << layerNumber
1293+
TGeoVolume* motherVolume) {
1294+
LOG(debug) << "FT3Module: createModule_staveGeo - Layer " << layerNumber
13181295
<< " at z=" << mZ << ", Direction " << direction;
1319-
create_layout_scopingV3(mZ, layerNumber, direction, Rin, Rout,
1320-
overlap, motherVolume, useStaves);
1321-
LOG(debug) << "FT3Module: done createModule_scopingV3";
1296+
create_layout_staveGeo(mZ, layerNumber, direction, Rin, Rout,
1297+
overlap, motherVolume);
1298+
LOG(debug) << "FT3Module: done createModule_staveGeo";
13221299
}

0 commit comments

Comments
 (0)