Skip to content

Commit 2983860

Browse files
committed
Add loop over all sensors in stack so all sensors are added to volume, not just the first in the stack
1 parent d76f582 commit 2983860

1 file changed

Lines changed: 79 additions & 75 deletions

File tree

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

Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -366,84 +366,88 @@ void FT3Module::create_layout_scopingV3(double mZ, int layerNumber, int directio
366366
<< y_positionsPosNeg[i_stave].second.size() << " negative sensor positions.";
367367
for (unsigned i_y_pos = 0; i_y_pos < y_positionsPosNeg[i_stave].first.size(); i_y_pos++) {
368368
for (unsigned i_y_sign = 0; i_y_sign < 2; i_y_sign++) {
369-
// TODO: Make this loop over all sensors in a stack, don't just assume one sensor per stack
370-
TGeoVolume* sensor;
371369
// place sensors at positive and negative y
372370
const auto& positions = (i_y_sign == 0) ? y_positionsPosNeg[i_stave].first
373371
: y_positionsPosNeg[i_stave].second;
374-
double y_mid = positions[i_y_pos].first + Constants::sensor2x1_height / 2;
375-
376-
// get which side we are on: if backward discs we mirror from front so it's the same
377-
// layout from the frame of the particle, regardless which direction
378-
bool isFront;
379-
if (!direction) // direction = 0 is forward
380-
isFront = Constants::staveOnFront[i_stave];
381-
else
382-
isFront = !(Constants::staveOnFront[i_stave]);
383-
/*
384-
* we build the volume from the outside in, starting with the silicon,
385-
* then glue & materials towards the stave. Depending on whether it's front or back,
386-
* the distance from the center will be mirrored so that we get the following:
387-
*
388-
* Front (ordered in z, assuming the forward direction is to the right):
389-
* | SILICON SENSOR | GLUE | COPPER | KAPTON | GLUE | STAVE | SUPPORT STRUCTURE |
390-
*
391-
* Back (ordered in z, assuming the forward direction is to the right):
392-
* | SUPPORT STRUCTURE | STAVE | GLUE | KAPTON | COPPER | GLUE | SILICON SENSOR |
393-
*
394-
* Note that we do not place stave and support structure material here, that is
395-
* assumed to have been placed by the Layer creation.
396-
*/
397-
double z_offset_centre_to_stave = Constants::foamSpacingThickness / 2.0 + Constants::carbonFiberThickness;
398-
double z_offset_stave_to_silicon = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness
399-
+ Constants::epoxyThickness + Constants::siliconThickness / 2;
400-
double z_offset_stave_to_glue_Si = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness
401-
+ Constants::epoxyThickness / 2;
402-
double z_offset_stave_to_copper = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness / 2;
403-
double z_offset_stave_to_kapton = Constants::epoxyThickness + Constants::kaptonThickness / 2;
404-
double z_offset_stave_to_glue_Cu = Constants::epoxyThickness / 2;
405-
406-
// for the front, we have to subtract the z offsets since we are going in
407-
// negative z direction, while it's opposite for the back
408-
int z_offset_multiplier = isFront ? -1 : 1;
409-
std::string side_str = isFront ? "front" : "back";
410-
// ------------ (1) Silicon sensor ------------
411-
// left single sensor of the 2x1
412-
double z_mid = (z_offset_centre_to_stave + z_offset_stave_to_silicon) * z_offset_multiplier;
413-
addSingleSensorVolume(
414-
motherVolume, layerNumber, direction, &sensor_count,
415-
x_mid - Constants::active_width / 2, y_mid, z_mid, side_str, true
416-
);
417-
// right single sensor of the 2x1
418-
addSingleSensorVolume(
419-
motherVolume, layerNumber, direction, &sensor_count,
420-
x_mid + Constants::active_width / 2, y_mid, z_mid, side_str, false
421-
);
422-
423-
// ------------ (2) Epoxy glue layer between silicon and copper (FPC) ------------
424-
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_glue_Si) * z_offset_multiplier;
425-
add2x1GlueVolume(
426-
motherVolume, layerNumber, direction, &sensor_count,
427-
side_str, x_mid, y_mid, z_mid, "SiCu"
428-
);
429-
// ------------ (3) Copper layer (FPC) ------------
430-
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_copper) * z_offset_multiplier;
431-
add2x1CopperVolume(
432-
motherVolume, layerNumber, direction, &sensor_count,
433-
side_str, x_mid, y_mid, z_mid
434-
);
435-
// ------------ (4) Kapton layer (FPC) ------------
436-
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_kapton) * z_offset_multiplier;
437-
add2x1KaptonVolume(
438-
motherVolume, layerNumber, direction, &sensor_count,
439-
side_str, x_mid, y_mid, z_mid
440-
);
441-
// ------------ (5) Epoxy glue layer between stave and FPC copper ------------
442-
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_glue_Cu) * z_offset_multiplier;
443-
add2x1GlueVolume(
444-
motherVolume, layerNumber, direction, &sensor_count,
445-
side_str, x_mid, y_mid, z_mid, "StaveKapton"
446-
);
372+
for (unsigned i_sens = 0; i_sens < positions[i_y_pos].second; i_sens++) {
373+
TGeoVolume* sensor;
374+
double y_mid = // y = y_start + (height + gap of one sensor) * sensor index
375+
positions[i_y_pos].first +
376+
(Constants::sensor2x1_height + Constants::sensor2x1_gap) * i_sens +
377+
Constants::sensor2x1_height / 2; // and add half height to get the middle of the sensor
378+
379+
// get which side we are on: if backward discs we mirror from front so it's the same
380+
// layout from the frame of the particle, regardless which direction
381+
bool isFront;
382+
if (!direction) // direction = 0 is forward
383+
isFront = Constants::staveOnFront[i_stave];
384+
else
385+
isFront = !(Constants::staveOnFront[i_stave]);
386+
/*
387+
* we build the volume from the outside in, starting with the silicon,
388+
* then glue & materials towards the stave. Depending on whether it's front or back,
389+
* the distance from the center will be mirrored so that we get the following:
390+
*
391+
* Front (ordered in z, assuming the forward direction is to the right):
392+
* | SILICON SENSOR | GLUE | COPPER | KAPTON | GLUE | STAVE | SUPPORT STRUCTURE |
393+
*
394+
* Back (ordered in z, assuming the forward direction is to the right):
395+
* | SUPPORT STRUCTURE | STAVE | GLUE | KAPTON | COPPER | GLUE | SILICON SENSOR |
396+
*
397+
* Note that we do not place stave and support structure material here, that is
398+
* assumed to have been placed by the Layer creation.
399+
*/
400+
double z_offset_centre_to_stave = Constants::foamSpacingThickness / 2.0 + Constants::carbonFiberThickness;
401+
double z_offset_stave_to_silicon = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness
402+
+ Constants::epoxyThickness + Constants::siliconThickness / 2;
403+
double z_offset_stave_to_glue_Si = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness
404+
+ Constants::epoxyThickness / 2;
405+
double z_offset_stave_to_copper = Constants::epoxyThickness + Constants::kaptonThickness + Constants::copperThickness / 2;
406+
double z_offset_stave_to_kapton = Constants::epoxyThickness + Constants::kaptonThickness / 2;
407+
double z_offset_stave_to_glue_Cu = Constants::epoxyThickness / 2;
408+
409+
// for the front, we have to subtract the z offsets since we are going in
410+
// negative z direction, while it's opposite for the back
411+
int z_offset_multiplier = isFront ? -1 : 1;
412+
std::string side_str = isFront ? "front" : "back";
413+
// ------------ (1) Silicon sensor ------------
414+
// left single sensor of the 2x1
415+
double z_mid = (z_offset_centre_to_stave + z_offset_stave_to_silicon) * z_offset_multiplier;
416+
addSingleSensorVolume(
417+
motherVolume, layerNumber, direction, &sensor_count,
418+
x_mid - Constants::active_width / 2, y_mid, z_mid, side_str, true
419+
);
420+
// right single sensor of the 2x1
421+
addSingleSensorVolume(
422+
motherVolume, layerNumber, direction, &sensor_count,
423+
x_mid + Constants::active_width / 2, y_mid, z_mid, side_str, false
424+
);
425+
426+
// ------------ (2) Epoxy glue layer between silicon and copper (FPC) ------------
427+
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_glue_Si) * z_offset_multiplier;
428+
add2x1GlueVolume(
429+
motherVolume, layerNumber, direction, &sensor_count,
430+
side_str, x_mid, y_mid, z_mid, "SiCu"
431+
);
432+
// ------------ (3) Copper layer (FPC) ------------
433+
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_copper) * z_offset_multiplier;
434+
add2x1CopperVolume(
435+
motherVolume, layerNumber, direction, &sensor_count,
436+
side_str, x_mid, y_mid, z_mid
437+
);
438+
// ------------ (4) Kapton layer (FPC) ------------
439+
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_kapton) * z_offset_multiplier;
440+
add2x1KaptonVolume(
441+
motherVolume, layerNumber, direction, &sensor_count,
442+
side_str, x_mid, y_mid, z_mid
443+
);
444+
// ------------ (5) Epoxy glue layer between stave and FPC copper ------------
445+
z_mid = (z_offset_centre_to_stave + z_offset_stave_to_glue_Cu) * z_offset_multiplier;
446+
add2x1GlueVolume(
447+
motherVolume, layerNumber, direction, &sensor_count,
448+
side_str, x_mid, y_mid, z_mid, "StaveKapton"
449+
);
450+
} // sensors in stack
447451
} // for i_y_sign (writing of positive or negative y positions)
448452
} // i_y_pos
449453
} // i_stave

0 commit comments

Comments
 (0)