@@ -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
370370void 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 */
396396void 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 */
415417void 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 */
432436void 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 */
463469void 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
508519void 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
14041422void 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