@@ -321,10 +321,10 @@ void FT3Module::addDetectorVolume(
321321 */
322322void 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 */
341341void 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 */
358358void 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 */
390389void 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