Skip to content

Commit 6bb8039

Browse files
committed
Remove stale overlap argument, and add local offset in z. In contrast to previous layout, to encapsulate the staves with face at local z=0 in air, we need to shift the staves and sensors locally since the mother volume is always around local z=0. Shift the layer volume by the same amount when adding it to get the right global position.
1 parent 6871f81 commit 6bb8039

3 files changed

Lines changed: 79 additions & 48 deletions

File tree

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FT3Module
5656

5757
void createModule_staveGeo(
5858
double mZ, int layerNumber, int direction, double Rin,
59-
double Rout, double overlap, TGeoVolume* motherVolume);
59+
double Rout, double z_offset_local, TGeoVolume* motherVolume);
6060

6161
private:
6262
static void create_layout(
@@ -66,7 +66,7 @@ class FT3Module
6666

6767
void create_layout_staveGeo(
6868
double mZ, int layerNumber, int direction, double Rin,
69-
double Rout, double overlap, TGeoVolume* motherVolume);
69+
double Rout, double z_offset_local, TGeoVolume* motherVolume);
7070

7171
// Helper functions
7272
void fill_stave(PosNegPositionTypes& y_positions, double Rin, double Rout,
@@ -77,28 +77,28 @@ class FT3Module
7777
unsigned* volume_count, double staveLength,
7878
std::array<std::array<double, 3>, 4> staveTriangles,
7979
std::pair<double, double>& absAllowedYRange,
80-
double x_mid, double y_mid, double z_stave_shift_abs);
80+
double x_mid, double y_mid, double z_stave_shift_forward);
8181
void addDetectorVolume(
8282
TGeoVolume* motherVolume, std::string volumeName, int color, unsigned* volume_count,
8383
double x_mid, double y_mid, double z_mid,
8484
double x_half_length, double y_half_length, double z_half_length);
8585

8686
void add2x1GlueVolume(
87-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
88-
double x_mid, double y_mid, double z_mid,
87+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
88+
unsigned* volume_count, double x_mid, double y_mid, double z_mid,
8989
std::string element_glued_to);
9090

9191
void add2x1CopperVolume(
92-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
93-
double x_mid, double y_mid, double z_mid);
92+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
93+
unsigned* volume_count, double x_mid, double y_mid, double z_mid);
9494

9595
void add2x1KaptonVolume(
96-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
97-
double x_mid, double y_mid, double z_mid);
96+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
97+
unsigned* volume_count, double x_mid, double y_mid, double z_mid);
9898

9999
void addSingleSensorVolume(
100-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
101-
double active_x_mid, double y_mid, double z_mid, bool isLeft);
100+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
101+
unsigned* volume_count, double active_x_mid, double y_mid, double z_mid, bool isLeft);
102102
};
103103

104104
#endif // FT3MODULE_H

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "FT3Simulation/FT3Layer.h"
1818
#include "FT3Base/GeometryTGeo.h"
1919
#include "FT3Base/FT3BaseParam.h"
20+
#include "FT3Simulation/FT3ModuleConstants.h"
2021

2122
#include <TGeoManager.h> // for TGeoManager, gGeoManager
2223
#include <TGeoMatrix.h> // for TGeoCombiTrans, TGeoRotation, etc
@@ -412,6 +413,8 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
412413

413414
TGeoMedium* medAir = gGeoManager->GetMedium("FT3_AIR$");
414415
TGeoVolume* layerVol = nullptr;
416+
// shift stave volumes into layer volume, since nominal z_{stave face} = 0
417+
double z_local_offset = 0;
415418
if (ft3Params.layoutFT3 == kSegmented) {
416419
// Add a little additional room in radius
417420
TGeoTube* layer = new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
@@ -425,19 +428,29 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
425428
// need a thicker air layer to encompass the staves (4.5cm high, 1.2cm offsets)
426429
// stave face is at z=0 (or +-z_offset_stave), meaning that volumes are at
427430
// ~-+1cm < z < ~+-6cm, the +- referring forward/backward discs
428-
TGeoTube* layer = new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 6);
431+
double z_layer_thickness = // need to shift internally with this
432+
o2::ft3::ModuleConstants::staveTriangleHeight +
433+
o2::ft3::ModuleConstants::z_offsetStave +
434+
o2::ft3::ModuleConstants::siliconThickness +
435+
o2::ft3::ModuleConstants::copperThickness +
436+
o2::ft3::ModuleConstants::kaptonThickness +
437+
o2::ft3::ModuleConstants::epoxyThickness * 2 +
438+
0.5; // add some extra room to ensure all volumes are encapsulated
439+
z_local_offset = z_layer_thickness / 2.0;
440+
TGeoTube* layer = new TGeoTube(mInnerRadius - 12, mOuterRadius + 5, z_layer_thickness / 2);
429441
layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
430442
if (ft3Params.drawReferenceCircles) {
431443
std::string referenceCirclesName = "ReferenceCircles_Dir" + std::to_string(mDirection)
432444
+ "_Layer" + std::to_string(mLayerNumber);
433445
createReferenceCircles(layerVol, referenceCirclesName); // for visualization purposes
434446
}
447+
// need the -0.5 added to local offset to ensure all sensor modules are inside the layer
435448
module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
436-
mOuterRadius, 0., layerVol);
449+
mOuterRadius, z_local_offset, layerVol);
437450
}
438451
// Finally put everything in the mother volume
439452
auto* FwdDiskRotation = new TGeoRotation("FwdDiskRotation", 0, 0, 180);
440-
auto* FwdDiskCombiTrans = new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
453+
auto* FwdDiskCombiTrans = new TGeoCombiTrans(0, 0, mZ + z_local_offset, FwdDiskRotation);
441454

442455
LOG(info) << "Inserting " << layerVol->GetName() << " inside " << motherVolume->GetName();
443456
motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);

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

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void FT3Module::addStaveVolume(
267267
unsigned* volume_count, double staveLength,
268268
std::array<std::array<double, 3>, 4> staveTriangles,
269269
std::pair<double, double>& absAllowedYRange,
270-
double x_mid, double y_mid, double z_stave_shift_abs)
270+
double x_mid, double y_mid, double z_stave_shift_forward)
271271
{
272272
// The allowed y range is assumed to be non-negative.
273273
if (absAllowedYRange.first < 0 || absAllowedYRange.second < 0 ||
@@ -343,7 +343,7 @@ void FT3Module::addStaveVolume(
343343
* the starting point is the upper y value, since that is the bottom
344344
* of the mirrored stave -- by the outer radius
345345
*/
346-
double z_shift = (direction == 1) ? z_stave_shift_abs : -z_stave_shift_abs;
346+
double z_shift = (direction == 1) ? z_stave_shift_forward : -z_stave_shift_forward;
347347
TGeoCombiTrans* combiTrans =
348348
new TGeoCombiTrans(x_mid, y_lower, z_shift, rot);
349349
motherVolume->AddNode(staveVolume,
@@ -368,8 +368,8 @@ void FT3Module::addStaveVolume(
368368
*/
369369

370370
void FT3Module::addDetectorVolume(
371-
TGeoVolume* motherVolume, std::string volumeName, int color, unsigned* volume_count,
372-
double x_mid, double y_mid, double z_mid,
371+
TGeoVolume* motherVolume, std::string volumeName, int color,
372+
unsigned* volume_count, double x_mid, double y_mid, double z_mid,
373373
double x_half_length, double y_half_length, double z_half_length)
374374
{
375375
TGeoManager* geoManager = gGeoManager;
@@ -394,13 +394,15 @@ void FT3Module::addDetectorVolume(
394394
* immediately for a whole 2x1 layout, under both the active and inactive region.
395395
*/
396396
void FT3Module::add2x1GlueVolume(
397-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
398-
double x_mid, double y_mid, double z_mid,
397+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
398+
unsigned* volume_count, double x_mid, double y_mid, double z_mid,
399399
std::string element_glued_to)
400400
{
401401
std::string glue_name = "FT3glue_" + element_glued_to + "_"
402-
+ std::to_string(layerNumber) + "_" + std::to_string(direction)
403-
+ "_" + std::to_string(*volume_count);
402+
+ std::to_string(layerNumber) + "_"
403+
+ std::to_string(direction) + "_"
404+
+ std::to_string(stave_idx) + "_"
405+
+ std::to_string(*volume_count);
404406
addDetectorVolume(
405407
motherVolume, glue_name, Constants::glueColor, volume_count,
406408
x_mid, y_mid, z_mid,
@@ -413,11 +415,13 @@ void FT3Module::add2x1GlueVolume(
413415
* As with the glue, this is a whole 2x1 layout volume.
414416
*/
415417
void FT3Module::add2x1CopperVolume(
416-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
417-
double x_mid, double y_mid, double z_mid)
418+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
419+
unsigned* volume_count, double x_mid, double y_mid, double z_mid)
418420
{
419421
std::string copper_name = "FT3Copper_" + std::to_string(layerNumber) + "_"
420-
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
422+
+ std::to_string(direction) + "_"
423+
+ std::to_string(stave_idx) + "_"
424+
+ std::to_string(*volume_count);
421425
addDetectorVolume(
422426
motherVolume, copper_name, Constants::CuColor, volume_count,
423427
x_mid, y_mid, z_mid,
@@ -430,11 +434,13 @@ void FT3Module::add2x1CopperVolume(
430434
* As with copper and glue, this is a whole 2x1 layout volume.
431435
*/
432436
void FT3Module::add2x1KaptonVolume(
433-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
434-
double x_mid, double y_mid, double z_mid)
437+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
438+
unsigned* volume_count, double x_mid, double y_mid, double z_mid)
435439
{
436440
std::string kapton_name = "FT3Kapton_" + std::to_string(layerNumber) + "_"
437-
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
441+
+ std::to_string(direction) + "_"
442+
+ std::to_string(stave_idx) + "_"
443+
+ std::to_string(*volume_count);
438444
addDetectorVolume(
439445
motherVolume, kapton_name, Constants::kaptonColor, volume_count,
440446
x_mid, y_mid, z_mid,
@@ -461,14 +467,17 @@ void FT3Module::add2x1KaptonVolume(
461467
* isLeft: whether the sensor is on the left or right in the 2x1 layout
462468
*/
463469
void FT3Module::addSingleSensorVolume(
464-
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned* volume_count,
465-
double active_x_mid, double y_mid, double z_mid, bool isLeft)
470+
TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
471+
unsigned* volume_count, double active_x_mid, double y_mid, double z_mid,
472+
bool isLeft)
466473
{
467474
TGeoVolume* sensor;
468475
TGeoManager* geoManager = gGeoManager;
469476
// ACTIVE AREA
470477
std::string sensor_name = "FT3Sensor_" + std::to_string(layerNumber) + "_"
471-
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
478+
+ std::to_string(direction) + "_"
479+
+ std::to_string(stave_idx) + "_"
480+
+ std::to_string(*volume_count);
472481
sensor = geoManager->MakeBox(sensor_name.c_str(), siliconMed, Constants::active_width / 2,
473482
Constants::single_sensor_height / 2, Constants::siliconThickness / 2);
474483
sensor->SetLineColor(Constants::SiColor);
@@ -488,7 +497,9 @@ void FT3Module::addSingleSensorVolume(
488497
: (active_x_mid + Constants::active_width / 2 + Constants::inactive_width / 2);
489498
std::string sensor_inactive_name =
490499
"FT3Sensor_Inactive_" + std::to_string(layerNumber) + "_"
491-
+ std::to_string(direction) + "_" + std::to_string(*volume_count);
500+
+ std::to_string(direction) + "_"
501+
+ std::to_string(stave_idx) + "_"
502+
+ std::to_string(*volume_count);
492503
sensor = geoManager->MakeBox(sensor_inactive_name.c_str(), siliconMed, Constants::inactive_width / 2,
493504
Constants::single_sensor_height / 2, Constants::siliconThickness / 2);
494505
sensor->SetLineColor(Constants::SiInactiveColor);
@@ -506,8 +517,8 @@ void FT3Module::addSingleSensorVolume(
506517
}
507518

508519
void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction,
509-
double Rin, double Rout, double overlap,
510-
TGeoVolume* motherVolume)
520+
double Rin, double Rout, double z_offset_local,
521+
TGeoVolume* motherVolume)
511522
{
512523
LOG(debug) << "FT3Module: create_layout_staveGeo - Layer "
513524
<< layerNumber << ", Direction " << direction;
@@ -527,9 +538,13 @@ void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction
527538
* Naturally, this will be mirrored for layers in the backwards direction,
528539
* such that the face of the sensors always face the interaction region.
529540
*
530-
* Currently, we stipulate that the default stave face is at local z=0.
541+
* Currently, we stipulate that the default stave face is at local z
542+
* that is slightly shifted by the air thickness encapsulating the layer
543+
* to avoid overlaps with the air and services. All offsets are
544+
* calculated for backward direction (since that is a positive shift),
545+
* and then flipped for forward.
531546
*/
532-
double z_offset_to_carbon_face = 0;
547+
double z_offset_to_carbon_face = z_offset_local;
533548
double z_offset_to_glue_Ka =
534549
z_offset_to_carbon_face + Constants::epoxyThickness / 2;
535550
double z_offset_to_kapton =
@@ -632,21 +647,24 @@ void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction
632647
}
633648

634649
// Get whether the stave is shifted backward or not before creating
635-
double z_stave_shift_abs = Constants::staveOnFront[i_stave] ? 0 : Constants::z_offsetStave;
650+
double z_stave_shift_abs =
651+
Constants::staveOnFront[i_stave] ? 0 : Constants::z_offsetStave;
652+
double z_stave_shift_forward = // move staves more inward to fit in layer volume
653+
-z_offset_to_carbon_face + z_stave_shift_abs;
636654
std::string stave_volume_name =
637655
"Stave_" + std::to_string(i_stave) + "_" + std::to_string(layerNumber) +
638656
"_" + std::to_string(direction);
639657
addStaveVolume(
640658
motherVolume, stave_volume_name, direction, &volume_count,
641659
Constants::y_lengths[i_stave], staveTriangles, absAllowedYRange,
642-
Constants::x_midpoints[i_stave], y_midpoint, mZ + z_stave_shift_abs
660+
Constants::x_midpoints[i_stave], y_midpoint, z_stave_shift_forward
643661
);
644662
// Now create the mirrored stave
645663
if (mirrorStaveAroundX) {
646664
addStaveVolume(
647665
motherVolume, stave_volume_name + "_mirrored", direction, &volume_count,
648666
Constants::y_lengths[i_stave], staveTriangles, absAllowedYRange,
649-
Constants::x_midpoints[i_stave], -y_midpoint, mZ + z_stave_shift_abs
667+
Constants::x_midpoints[i_stave], -y_midpoint, z_stave_shift_forward
650668
);
651669
}
652670

@@ -700,36 +718,36 @@ void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction
700718
// left single sensor of the 2x1
701719
double z_mid = z_offset_to_silicon * z_offset_multiplier + z_stave_shift;
702720
addSingleSensorVolume(
703-
motherVolume, layerNumber, direction, &volume_count,
721+
motherVolume, layerNumber, direction, i_stave, &volume_count,
704722
x_mid - Constants::active_width / 2, y_mid, z_mid, true
705723
);
706724
// right single sensor of the 2x1
707725
addSingleSensorVolume(
708-
motherVolume, layerNumber, direction, &volume_count,
726+
motherVolume, layerNumber, direction, i_stave, &volume_count,
709727
x_mid + Constants::active_width / 2, y_mid, z_mid, false
710728
);
711729
// ------------ (2) Epoxy glue layer between silicon and copper (FPC) ------------
712730
z_mid = z_offset_to_glue_Si * z_offset_multiplier + z_stave_shift;
713731
add2x1GlueVolume(
714-
motherVolume, layerNumber, direction, &volume_count,
732+
motherVolume, layerNumber, direction, i_stave, &volume_count,
715733
x_mid, y_mid, z_mid, "SiCu"
716734
);
717735
// ------------ (3) Copper layer (FPC) ------------
718736
z_mid = z_offset_to_copper * z_offset_multiplier + z_stave_shift;
719737
add2x1CopperVolume(
720-
motherVolume, layerNumber, direction, &volume_count,
738+
motherVolume, layerNumber, direction, i_stave, &volume_count,
721739
x_mid, y_mid, z_mid
722740
);
723741
// ------------ (4) Kapton layer (FPC) ------------
724742
z_mid = z_offset_to_kapton * z_offset_multiplier + z_stave_shift;
725743
add2x1KaptonVolume(
726-
motherVolume, layerNumber, direction, &volume_count,
744+
motherVolume, layerNumber, direction, i_stave, &volume_count,
727745
x_mid, y_mid, z_mid
728746
);
729747
// ------------ (5) Epoxy glue layer between stave and Kapton ------------
730748
z_mid = z_offset_to_glue_Ka * z_offset_multiplier + z_stave_shift;
731749
add2x1GlueVolume(
732-
motherVolume, layerNumber, direction, &volume_count,
750+
motherVolume, layerNumber, direction, i_stave, &volume_count,
733751
x_mid, y_mid, z_mid, "CarbonKapton"
734752
);
735753
// increment to next sensor: (height + gap of one sensor)
@@ -1402,11 +1420,11 @@ void FT3Module::createModule(double mZ, int layerNumber, int direction, double R
14021420
}
14031421

14041422
void FT3Module::createModule_staveGeo(double mZ, int layerNumber, int direction,
1405-
double Rin, double Rout, double overlap,
1406-
TGeoVolume* motherVolume) {
1423+
double Rin, double Rout, double z_offset_local,
1424+
TGeoVolume* motherVolume) {
14071425
LOG(debug) << "FT3Module: createModule_staveGeo - Layer " << layerNumber
14081426
<< " at z=" << mZ << ", Direction " << direction;
14091427
create_layout_staveGeo(mZ, layerNumber, direction, Rin, Rout,
1410-
overlap, motherVolume);
1428+
z_offset_local, motherVolume);
14111429
LOG(debug) << "FT3Module: done createModule_staveGeo";
14121430
}

0 commit comments

Comments
 (0)