diff --git a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3Module.h b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3Module.h index a0abf221eb35b..6f29884f293bd 100644 --- a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3Module.h +++ b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3Module.h @@ -59,6 +59,12 @@ class FT3Module double Rout, double z_offset_local, const Constants::StaveConfig& staveConfig, TGeoVolume* motherVolume); + // Middle disks (StaveConfig::isFlatCorrugated): flat lanes on two z planes, built + // straight from the tabulated fills, with no triangular carbon staves + void create_layout_flatLanes( + int layerNumber, int direction, double z_offset_local, + const Constants::StaveConfig& staveConfig, TGeoVolume* motherVolume); + // Walk every stave of a layer, create its volumes and work out where its // modules go, leaving the positions in y_positionsPosNeg void build_staves_exact( @@ -124,9 +130,23 @@ class FT3Module TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx, unsigned volume_count, double x_mid, double y_mid, double z_mid, double moduleHeight); + // Box of one material for the flat lanes (glue, FPC copper and kapton, carbon plate, flat of the + // corrugated sheet). Half lengths are in x, y, z of the layer. + void addLaneBox( + TGeoVolume* motherVolume, const std::string& name, Materials::MaterialID material, + unsigned volume_count, double x_mid, double y_mid, double z_mid, + double x_half_length, double y_half_length, double z_half_length); + + // Wall of the corrugated sheet: a slanted slab between two flats, extruded along y from y_lo to + // y_hi. xa, xb are the x of its two vertical end faces and zLo/zHi the z of its two surfaces there. + void addLaneSheetWall( + TGeoVolume* motherVolume, const std::string& name, unsigned volume_count, + double xa, double zaLo, double zaHi, double xb, double zbLo, double zbHi, + double y_lo, double y_hi); + void addSingleSensorVolume( TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx, unsigned volume_count, double active_x_mid, double y_mid, double z_mid, bool isLeft); }; -#endif // FT3MODULE_H +#endif // FT3MODULE_H \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3ModuleConstants.h b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3ModuleConstants.h index f06d8d50c86b3..6f699f2f460cc 100644 --- a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3ModuleConstants.h +++ b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/include/FT3Simulation/FT3ModuleConstants.h @@ -124,12 +124,38 @@ const double staveMaterialBudget = // for the eff. thickness, we use the CarbonFiber X0 = 27 cm from FT3Materials.h const double effectiveCarbonThickness_Stave = staveMaterialBudget * 27.0; // ~187 um +/* + * Flat (middle) disks. Every lane is a flat stack, from the silicon backwards (away from the IP): + * silicon | glue | FPC (copper, then kapton) | glue | carbon plate | glue | corrugated sheet + * The plate is one continuous strip per fill, wider than the FPC by flatLaneOverhang on each + * side. The overhang of the plate rests, through a layer of glue, on the flats of one + * continuous corrugated carbon sheet that runs across all lanes (see FT3Module::create_layout_flatLanes). + * The FPC (and its two layers of glue) is a module wide, 54.4 mm: the silicon with its periphery, plus the + * 2.1 mm bond area on each side. The flats of the sheet reach under the overhang of the plate, through + * the same depth as the FPC, so the FPC must end before them. + */ +// The FPC and the sensors are the same on all disks, so the flat lanes use the same copper and kapton as the staves +const double flatLaneFpcCopperThickness = copperThickness; +const double flatLaneFpcKaptonThickness = kaptonThickness; +const double flatLaneFpcThickness = flatLaneFpcCopperThickness + flatLaneFpcKaptonThickness; // 360 um +const double flatLaneGlueThickness = epoxyThickness; // between all layers of the stack +const double flatLaneCarbonBaseThickness = 0.06; // the plate: 0.6 mm +const double flatLaneSheetThickness = 0.06; // the corrugated sheet: 0.6 mm +const double flatLaneOverhang = 0.29; // plate beyond the FPC, each side (2.9 mm) +const double flatLaneSheetReach = 0.06; // the flats of the sheet reach this far under the overhang +const double flatLaneSheetMinClearance = 0.005; // the sheet must stay 50 um clear of the silicon +// distance from the silicon back face to the front face of the plate (towards the sheet side) +const double flatLaneStackToPlate = 2 * flatLaneGlueThickness + flatLaneFpcThickness; +// everything behind the silicon mid-plane, up to the back of the plate +const double flatLaneStackBehindSilicon = siliconThickness / 2 + flatLaneStackToPlate + flatLaneCarbonBaseThickness; const double staveOpeningAngle = 60 * TMath::DegToRad(); const double sinTheta = TMath::Sin(staveOpeningAngle / 2); const double cosTheta = TMath::Cos(staveOpeningAngle / 2); const double alpha = TMath::Pi() / 2 - staveOpeningAngle / 2; // bottom angles const double staveSensorGap = 0.21; // 2.1mm bonding region on each side: 54.4mm stave width const double staveWidth = sensor1x2_width + 2 * staveSensorGap; +const double flatLaneFpcWidth = staveWidth; // FPC and its glue: 54.4 mm +const double flatLanePlateWidth = flatLaneFpcWidth + 2 * flatLaneOverhang; // the plate: 60.2 mm /* * The stave is created from two carbon legs, and the FPC is its face -- being glued * onto carbon wings that stick out: @@ -211,6 +237,19 @@ struct StaveConfig { * split by the beam pipe. */ const std::vector>& exactStaveFills; + /* + * Flat corrugated lanes (middle disks) instead of triangular staves: every stave is a + * flat lane of modules on one of two z planes, corrugationDepth apart (staveOnFront picks + * the plane: true is the plane closer to the interaction point), and neighbouring lanes + * overlap in x. For such a config staveTriangleHeight and z_offsetStave do not apply. + * laneSensorGap and laneStackGap are the gaps used to place the modules of a flat lane: + * between sensors inside a stack, and between stacks along the lane. + * All of these default to the triangular-stave behaviour used by the outer disks. + */ + const bool isFlatCorrugated = false; + const double corrugationDepth = 0.; + const double laneSensorGap = sensor1x2_gap; + const double laneStackGap = moduleGap; }; namespace OT_StavePositions @@ -292,28 +331,95 @@ const std::vector> exactStaveFills = { namespace ML_StavePositions { -// Use prelim numbers for now, these will change! TODO +/* + * Middle disks: flat corrugated lanes instead of triangular staves. + * Layout from the sensor table coords_custom.txt: Rin 9, Rout 37 cm (envelope; the + * nearest corner of an active area is at 9.87 cm and the furthest at 36.35 cm, or 9.72 and + * 36.49 cm with the inactive rims of the sensors), 20 lanes of Nx2 + * modules of 23.5 x 29 mm active sensors, 0.2 mm between all sensors (so the stack gap + * equals the sensor gap), 644 sensors per disk. Lanes alternate between two z planes + * 6 mm apart (747 and 753 mm for a disk centred on 750 mm), with a lane pitch of 34.475 mm + * (overlap in x) except for the two innermost lanes, 37.8 mm apart. The six lanes that + * the beam pipe cuts (IDs +-1, +-2, +-3) have two fills. + * + * Sensors face the interaction point on both planes; see FT3Module::create_layout_flatLanes. + */ +const double sensorGap = 0.02; // between the L and R sensors of a 1x2 module and between stacked modules +const double stackGap = 0.02; // same as sensorGap in this layout +const double corrugationDepth = 0.6; // distance between the two sensor planes +/* + * Cut lanes are built as two pieces on +-y_midpoint. The flat-lane builder reads the + * positions from exactStaveFills and does not use these two tables, they are kept + * consistent with the layout for the code that does. + */ const std::map> staveID_to_y_midpoint = { - {-3, {19.1, true}}, - {-2, {21.8, true}}, - {-1, {22.5, true}}, - {1, {22.5, true}}, - {2, {21.8, true}}, - {3, {19.1, true}}}; + {-3, {20.7895, true}}, + {-2, {21.291, true}}, + {-1, {21.6417, true}}, + {1, {21.6417, true}}, + {2, {21.291, true}}, + {3, {20.7895, true}}}; +// Length of one piece for a cut lane, otherwise the whole lane, in lane order. const std::vector y_lengths = { - 30.5, 44.5, 53.6, 60.0, 64.6, 29.5, 25.8, 25.0, - 25.0, 25.8, 29.5, 64.6, 60.0, 53.6, 44.5, 30.5}; -const unsigned nStaves = 16; // y_lengths, staveOnFront and exactStaveFills follow this -const double x_midpoint_spacing = 4.5; -const std::vector x_midpoints = makeStaveXMidpoints(nStaves, x_midpoint_spacing); -const double maxToleranceInner = 0.; // default not allowed inwards -const double maxToleranceOuter = 3.4; // leave 1mm for layer air encapsulation -const std::vector staveOnFront = makeStaveOnFront(nStaves); -// TODO: fill from the disk optimiser output, see OT_StavePositions above. -const std::vector> exactStaveFills = {}; + 17.5, 32.1, 43.78, 49.62, + 55.46, 61.3, 64.22, 26.26, + 23.34, 23.34, 23.34, 23.34, + 26.26, 64.22, 61.3, 55.46, + 49.62, 43.78, 32.1, 17.5}; +const unsigned nStaves = 20; // y_lengths, x_midpoints, staveOnFront and exactStaveFills follow this +const double x_midpoint_spacing = 3.4475; +// Lane pitch is x_midpoint_spacing except between the two innermost lanes (+-1.89 cm), so the midpoints are tabulated +const std::vector x_midpoints = { + -32.9175, -29.47, -26.0225, -22.575, + -19.1275, -15.68, -12.2325, -8.785, + -5.3375, -1.89, 1.89, 5.3375, + 8.785, 12.2325, 15.68, 19.1275, + 22.575, 26.0225, 29.47, 32.9175}; +const double maxToleranceInner = 0.; // the sensors stay inside the nominal radii +const double maxToleranceOuter = 0.; +/* + * Front = the plane closer to the interaction point, as in the triangular-stave builder: for a + * forward disk that is the 747 mm plane (the outward-facing lanes); the other lanes are on the + * 753 mm plane (the inward-facing lanes). The first lane starts on the front plane and the + * lanes then alternate. + */ +const std::vector staveOnFront = [] { + std::vector onFront(nStaves); + for (unsigned i = 0; i < nStaves; i++) { + onFront[i] = (i % 2 == 0); + } + return onFront; +}(); +/* + * One entry per lane in x_midpoints order, one fill per piece. yStart is the bottom edge of the + * lowest sensor; the modules follow upwards, 0.2 mm apart, so every fill is a single stack. + */ +const std::vector> exactStaveFills = { + {{-8.75, {6}}}, // ID -10 (753 mm) + {{-16.05, {11}}}, // ID -9 (747 mm) + {{-21.89, {15}}}, // ID -8 (753 mm) + {{-24.81, {17}}}, // ID -7 (747 mm) + {{-27.73, {19}}}, // ID -6 (753 mm) + {{-30.65, {21}}}, // ID -5 (747 mm) + {{-32.11, {22}}}, // ID -4 (753 mm) + {{-33.9195, {9}}, {7.6595, {9}}}, // ID -3 (747 mm) + {{-32.961, {8}}, {9.621, {8}}}, // ID -2 (753 mm) + {{-33.3117, {8}}, {9.9717, {8}}}, // ID -1 (747 mm) + {{-33.3117, {8}}, {9.9717, {8}}}, // ID +1 (753 mm) + {{-32.961, {8}}, {9.621, {8}}}, // ID +2 (747 mm) + {{-33.9195, {9}}, {7.6595, {9}}}, // ID +3 (753 mm) + {{-32.11, {22}}}, // ID +4 (747 mm) + {{-30.65, {21}}}, // ID +5 (753 mm) + {{-27.73, {19}}}, // ID +6 (747 mm) + {{-24.81, {17}}}, // ID +7 (753 mm) + {{-21.89, {15}}}, // ID +8 (747 mm) + {{-16.05, {11}}}, // ID +9 (753 mm) + {{-8.75, {6}}}, // ID +10 (747 mm) +}; } // namespace ML_StavePositions -// Get stave configuration based on tracker type +// Get stave configuration based on tracker type: the inner (middle) disks are flat corrugated +// lanes (the middle disks), the outer disks are triangular staves inline StaveConfig getStaveConfig(bool isInnerDisk) { if (isInnerDisk) { @@ -326,7 +432,11 @@ inline StaveConfig getStaveConfig(bool isInnerDisk) ML_StavePositions::maxToleranceInner, ML_StavePositions::maxToleranceOuter, ML_StavePositions::staveOnFront, - ML_StavePositions::exactStaveFills}; + ML_StavePositions::exactStaveFills, + true, // isFlatCorrugated: the middle disks have flat corrugated lanes + ML_StavePositions::corrugationDepth, + ML_StavePositions::sensorGap, + ML_StavePositions::stackGap}; } else { return StaveConfig{ false, // isML @@ -377,4 +487,4 @@ inline double eosCardEnvelopeExtension(bool isML) } // namespace o2::ft3::ModuleConstants -#endif // FT3MODULECONSTANTS_H +#endif // FT3MODULECONSTANTS_H \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/Detector.cxx index 8407482dbd4ec..067c63cc60a04 100644 --- a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/Detector.cxx @@ -254,8 +254,9 @@ void Detector::buildFT3ScopingV3() { // Build the FT3 detector according to v3 layout // https://indico.cern.ch/event/1596309/contributions/6728167/attachments/3190117/5677220/2025-12-10-AW-ALICE3planning.pdf - // Middle disks inner radius 10 cm - // Outer disks inner radius 20 cm + // Middle disks (layers 0-2): flat corrugated lanes: Rin 9 cm, Rout 37 cm + // (ML_StavePositions in FT3ModuleConstants.h) + // Outer disks (layers 3-5) inner radius 20 cm LOG(info) << "Building FT3 Detector: v3 scoping version"; @@ -263,16 +264,16 @@ void Detector::buildFT3ScopingV3() const float sensorThickness = 30.e-4; const float layersx2X0 = 1.e-2; using LayerConfig = std::array; // {z_layer, r_in, r_out, Layerx2X0} - const std::array layersConfigCSide{LayerConfig{77., 10.0, 35., layersx2X0}, - LayerConfig{100., 10.0, 35., layersx2X0}, - LayerConfig{122., 10.0, 35., layersx2X0}, + const std::array layersConfigCSide{LayerConfig{77., 9.0, 37., layersx2X0}, + LayerConfig{100., 9.0, 37., layersx2X0}, + LayerConfig{122., 9.0, 37., layersx2X0}, LayerConfig{150., 20.0, 68.f, layersx2X0}, LayerConfig{180., 20.0, 68.f, layersx2X0}, LayerConfig{220., 20.0, 68.f, layersx2X0}}; - const std::array layersConfigASide{LayerConfig{77., 10.0, 35., layersx2X0}, - LayerConfig{100., 10.0, 35., layersx2X0}, - LayerConfig{122., 10.0, 35., layersx2X0}, + const std::array layersConfigASide{LayerConfig{77., 9.0, 37., layersx2X0}, + LayerConfig{100., 9.0, 37., layersx2X0}, + LayerConfig{122., 9.0, 37., layersx2X0}, LayerConfig{150., 20.0, 68.f, layersx2X0}, LayerConfig{180., 20.0, 68.f, layersx2X0}, LayerConfig{220., 20.0, 68.f, layersx2X0}}; @@ -669,4 +670,4 @@ Hit* Detector::addHit(int trackID, int detID, const TVector3& startPos, const TV return &(mHits->back()); } -ClassImp(o2::ft3::Detector); +ClassImp(o2::ft3::Detector); \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Layer.cxx b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Layer.cxx index c6d186a0d7536..fa426c09b75c6 100644 --- a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Layer.cxx +++ b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Layer.cxx @@ -205,7 +205,10 @@ void FT3Layer::createReferenceCircles(TGeoVolume* motherVolume, const std::strin motherVolume->AddNode(innerCircleVol, 1, new TGeoTranslation(0, 0, z_position)); motherVolume->AddNode(outerCircleVol, 1, new TGeoTranslation(0, 0, z_position)); - motherVolume->AddNode(outerCircleEdgeVol, 1, new TGeoTranslation(0, 0, z_position)); + // the outer edge circle marks the OT tolerance, outside the middle-disk air volume + if (!mIsMiddleLayer) { + motherVolume->AddNode(outerCircleEdgeVol, 1, new TGeoTranslation(0, 0, z_position)); + } } void FT3Layer::createLayer(TGeoVolume* motherVolume) @@ -404,28 +407,34 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume) TGeoMedium* medAir = getMedium(Materials::MaterialID::Air); TGeoVolume* layerVol = nullptr; - // set up stave config, differs between ML and OT disks + // set up stave config: middle layers (flat lanes), outer disks (triangular staves) const Constants::StaveConfig& staveConfig = Constants::getStaveConfig(mIsMiddleLayer); // need a thicker air layer to encompass the staves (4.5cm high, 1.2cm offsets) // stave face is at z=0 (or +-z_offset_stave), meaning that volumes are at // ~-+1cm < z < ~+-6cm, the +- referring forward/backward discs - double z_layer_thickness = // need to shift internally with this - o2::ft3::ModuleConstants::staveHeight + - o2::ft3::ModuleConstants::z_offsetStave(staveConfig.x_midpoint_spacing) + - o2::ft3::ModuleConstants::siliconThickness + - o2::ft3::ModuleConstants::copperThickness + - o2::ft3::ModuleConstants::kaptonThickness + - o2::ft3::ModuleConstants::epoxyThickness * 2 + - 0.5; // add some extra room to ensure all volumes are encapsulated + // Middle layers: flat corrugated lanes, so two sensor planes corrugationDepth apart, + // each with its glue, FPC and carbon plate behind it, centred on the layer. The corrugated sheet + // lies between the two planes, so it needs no extra room; the end-of-stave cards are added through + // the envelope extension below. + const double flatLayerThickness = + staveConfig.corrugationDepth + + 2 * o2::ft3::ModuleConstants::flatLaneStackBehindSilicon + + o2::ft3::ModuleConstants::siliconThickness + // front half of the silicon on each plane + 0.5; // add some extra room to ensure all volumes are encapsulated + + double z_layer_thickness = // need to shift internally with this + mIsMiddleLayer ? flatLayerThickness : o2::ft3::ModuleConstants::staveHeight + o2::ft3::ModuleConstants::z_offsetStave(staveConfig.x_midpoint_spacing) + o2::ft3::ModuleConstants::siliconThickness + o2::ft3::ModuleConstants::copperThickness + o2::ft3::ModuleConstants::kaptonThickness + o2::ft3::ModuleConstants::epoxyThickness * 2 + 0.5; // add some extra room to ensure all volumes are encapsulated // shift stave volumes into layer volume, since nominal z_{stave face} = 0 - double z_local_offset = z_layer_thickness / 2.0; + // (the flat middle-disk lanes are symmetric about the layer centre, so no shift there) + double z_local_offset = mIsMiddleLayer ? 0. : z_layer_thickness / 2.0; // ensure staves fully encapsulated in the layer volume, // but don't cross out of max nominal radii of 38.5cm & 71.5cm respectively (3.5cm tolerance) // Allow 3, 9cm outward, inward for OT: + // Middle layers: no tolerance in or out, the lanes sit inside the nominal radii for now double innerRadiusForAirTube = mIsMiddleLayer ? mInnerRadius : mInnerRadius - 9.0; - double outerRadiusForAirTube = mIsMiddleLayer ? mOuterRadius + 2.5 : mOuterRadius + 3.0; + double outerRadiusForAirTube = mIsMiddleLayer ? mOuterRadius : mOuterRadius + 3.0; // MvL: try 70.5 // 2.5 cm tolerance instead const double rInEnv = innerRadiusForAirTube - 0.2; const double rOutEnv = outerRadiusForAirTube; @@ -468,4 +477,4 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume) } else { LOG(fatal) << "Unknown FT3 layout option: " << static_cast(ft3Params.layoutFT3); } -} +} \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Module.cxx b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Module.cxx index 3e3318bbecd5f..ea8948c8121f1 100644 --- a/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Module.cxx +++ b/Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Module.cxx @@ -428,6 +428,59 @@ void FT3Module::addNx2KaptonVolume( (moduleHeight + Constants::moduleGap) / 2, Constants::kaptonThickness / 2); } +/* + * Box of one material for the flat (middle disk) lanes: glue, FPC copper and kapton, the carbon + * plate, and the flats of the corrugated sheet. Unlike the outer-disk helpers above, the width is a + * parameter, since the plate, the FPC and the glue of a flat lane are wider than a triangular stave. + */ +void FT3Module::addLaneBox( + TGeoVolume* motherVolume, const std::string& name, Materials::MaterialID material, + unsigned volume_count, double x_mid, double y_mid, double z_mid, + double x_half_length, double y_half_length, double z_half_length) +{ + addDetectorVolume( + motherVolume, name, Materials::materials.at(material).colour, getMedium(material), volume_count, + x_mid, y_mid, z_mid, x_half_length, y_half_length, z_half_length); +} + +/* + * One wall of the corrugated sheet: a slab that goes from one flat to the next. Its cross section in + * the xz plane is a quadrilateral with vertical end faces at x = xa and x = xb, which are the edges of + * the two flats, so that it joins them face to face without overlap. The z of its two surfaces at + * each end are the surfaces of the flat there. It is extruded along y from y_lo to y_hi. + */ +void FT3Module::addLaneSheetWall( + TGeoVolume* motherVolume, const std::string& name, unsigned volume_count, + double xa, double zaLo, double zaHi, double xb, double zbLo, double zbHi, + double y_lo, double y_hi) +{ + // The extruded shape is lifted into the xz plane with RotateX(-90), as for the staves: local y + // becomes -z, local z (the extrusion) becomes y. So the polygon is drawn in (x, -z). + std::vector vx = {xa, xb, xb, xa}; + std::vector vy = {-zaLo, -zbLo, -zbHi, -zaHi}; + double area2 = 0; // twice the signed area: positive for counter-clockwise + for (unsigned i = 0; i < 4; i++) { + const unsigned j = (i + 1) % 4; + area2 += vx[i] * vy[j] - vx[j] * vy[i]; + } + if (area2 > 0) { // TGeoXtru wants the vertices clockwise + std::reverse(vx.begin(), vx.end()); + std::reverse(vy.begin(), vy.end()); + } + TGeoXtru* shape = new TGeoXtru(2); + shape->SetName((name + "_shape").c_str()); + shape->DefinePolygon(4, vx.data(), vy.data()); + shape->DefineSection(0, 0); + shape->DefineSection(1, y_hi - y_lo); + const Materials::MaterialID mat = Materials::MaterialID::CarbonFiber; + TGeoVolume* vol = new TGeoVolume(name.c_str(), shape, getMedium(mat)); + vol->SetLineColor(Materials::materials.at(mat).colour); + vol->SetFillColorAlpha(Materials::materials.at(mat).colour, 0.4); + TGeoRotation* rot = new TGeoRotation(); + rot->RotateX(-90); + motherVolume->AddNode(vol, volume_count, new TGeoCombiTrans(0., y_lo, 0., rot)); +} + /* * This function adds a single sensor (currently 2.5x2.9cm) to the given mother volume * at the given (x,y,z) position of the module. @@ -794,6 +847,351 @@ void FT3Module::build_staves_greedy( LOG(info) << totalModuleInfoStr; } +/* + * Flat lanes of the middle disks, built straight from the tabulated fills: every lane is a + * strip of Nx2 modules on one of two z planes, corrugationDepth apart. Lanes alternate between the + * planes and neighbouring lanes overlap in x. + * + * staveOnFront picks the plane: true is the plane closer to the interaction point (the near + * plane), false the one further away. The sensors of all lanes face the interaction point, with + * everything else behind the silicon, away from it. Behind the silicon of every module: + * + * IP <-- | SILICON | GLUE | FPC (Cu, kapton) | GLUE | CARBON PLATE | GLUE | SHEET flat + * + * The FPC and its glue are flatLaneFpcWidth wide (54.4 mm, as on the outer disks) and cover one module each (with half a module gap on + * each side); the plate is one continuous strip per fill that runs under all modules of the fill and + * is flatLaneOverhang wider than the FPC on each side. For the far plane this means that + * the materials stick out a little beyond the far plane, where the rear plate is. + * + * The corrugated sheet is one continuous carbon sheet across all lanes. Its flats are centred in + * the gap between two plates of the same plane (so on the lane of the other plane) and + * reach flatLaneSheetReach under the overhang of those plates, to which they are glued. + * They sit on the side of the plates that faces the middle of the disk, and + * walls (slanted slabs) join the flat of one lane to the next. The sheet never touches a + * module: the flats lie in the gaps between the modules of a plane, and the walls pass in front of + * the modules of the far plane with a clearance that is checked below. Each piece of the sheet + * follows the y range of the lanes it supports or connects, so it stops with them. + * + * The module positions are read straight from exactStaveFills and placed with the lane's own gaps + * (laneSensorGap, laneStackGap), which differ from the outer-disk constants that + * Constants::getStackHeight and fill_stave_exact use. + * + * With FT3Base.addDiskEosCards, each lane gets one end-of-stave card at its top (+y) tip, and the + * lanes that the beam pipe cuts in two get a second one at the bottom (-y) tip of their lower piece. + */ +void FT3Module::create_layout_flatLanes( + int layerNumber, int direction, double z_offset_local, + const Constants::StaveConfig& staveConfig, TGeoVolume* motherVolume) +{ + LOG(debug) << "FT3Module: create_layout_flatLanes - Direction " + << direction << ", Layer " << layerNumber; + + const unsigned nLanes = staveConfig.x_midpoints.size(); + if (staveConfig.exactStaveFills.size() != nLanes || staveConfig.staveOnFront.size() != nLanes) { + LOG(fatal) << "FT3 flat-lane disk needs one tabulated fill and one front/back flag per lane, got " + << staveConfig.exactStaveFills.size() << " fills and " << staveConfig.staveOnFront.size() + << " flags for " << nLanes << " lanes"; + } + for (unsigned i = 1; i < nLanes; i++) { + if (staveConfig.x_midpoints[i] <= staveConfig.x_midpoints[i - 1] || + staveConfig.staveOnFront[i] == staveConfig.staveOnFront[i - 1]) { + LOG(fatal) << "FT3 flat-lane disk needs lanes ordered in x that alternate between the two planes"; + } + } + + auto& ft3Params = o2::ft3::FT3BaseParam::Instance(); + const double sensorGap = staveConfig.laneSensorGap; + const double stackGap = staveConfig.laneStackGap; + const double halfDepth = staveConfig.corrugationDepth / 2; + + const double si = Constants::siliconThickness; + const double glue = Constants::flatLaneGlueThickness; + const double cu = Constants::flatLaneFpcCopperThickness; + const double kap = Constants::flatLaneFpcKaptonThickness; + const double plate = Constants::flatLaneCarbonBaseThickness; + const double sheet = Constants::flatLaneSheetThickness; + const double plateHalfWidth = Constants::flatLanePlateWidth / 2; + const double fpcHalfWidth = Constants::flatLaneFpcWidth / 2; + const double moduleHalfWidth = Constants::sensor1x2_width / 2; + const double reach = Constants::flatLaneSheetReach; + if (fpcHalfWidth > plateHalfWidth - reach || fpcHalfWidth < moduleHalfWidth) { + LOG(fatal) << "FT3 flat-lane disk: the FPC must be wider than the module and end before the flats of the sheet"; + } + + // unit z vector pointing towards the interaction point (forward disks sit at +z) + const double towardsIP = (direction == 1) ? -1.0 : 1.0; + // everything but the silicon sits behind it, away from the interaction point + const double behind = -towardsIP; + // Depth t is the distance from the near plane towards the far plane, behind the interaction point, so + // the silicon of the near plane is at t = -halfDepth and that of the far plane at +halfDepth. + // z in the layer frame is behind * (t - z_offset_local); the layer is shifted away from the + // interaction point by z_offset_local, which is 0 for flat disks. + auto zOf = [&](double t) { return behind * (t - z_offset_local); }; + + // silicon mid-plane of the far plane (in the layer frame). The end-of-stave cards of all lanes start + // behind it, so that the cards of the near-plane lanes clear the modules of the far-plane lanes, + // which overlap them in x + const double z_far_si = towardsIP * (-halfDepth + z_offset_local); + + // distances from the silicon mid-plane to the middle of each material behind it + const double dGlueSiFpc = si / 2 + glue / 2; + const double dCopper = si / 2 + glue + cu / 2; + const double dKapton = si / 2 + glue + cu + kap / 2; + const double dGlueFpcPlate = si / 2 + glue + cu + kap + glue / 2; + const double dPlateFront = si / 2 + Constants::flatLaneStackToPlate; // front face of the plate + const double dPlate = dPlateFront + plate / 2; + const double dPlateBack = dPlateFront + plate; + + const std::string tag = std::to_string(direction) + "_" + std::to_string(layerNumber) + "_"; + using Interval = std::pair; + std::vector> plateY(nLanes); // y range of the plate of every fill of every lane + std::vector laneX(nLanes); + + unsigned nModulesTotal = 0; + for (unsigned i_lane = 0; i_lane < nLanes; i_lane++) { + const double x_mid = staveConfig.x_midpoints[i_lane]; + laneX[i_lane] = x_mid; + const bool onNearPlane = staveConfig.staveOnFront[i_lane]; + // t of the silicon mid-plane + const double t_si = onNearPlane ? -halfDepth : halfDepth; + const double z_si = zOf(t_si); + + unsigned sensor_count = 0; // reset for each lane + unsigned fill_idx = 0; + double y_tip = -1e9; // top end of the lane + double y_bottomTip = 1e9; // bottom end of the lane + for (const auto& fill : staveConfig.exactStaveFills[i_lane]) { + // yStart is the bottom edge of the first sensor of the fill + double y_bottom = fill.yStart; + for (unsigned nSensorsInStack : fill.stackHeights) { + double y_mid = y_bottom + Constants::sensor1x2_height / 2; + for (unsigned i_sens = 0; i_sens < nSensorsInStack; i_sens++) { + const std::string mod = tag + std::to_string(i_lane) + "_" + std::to_string(sensor_count); + // (1) Silicon sensors: left and right of the 1x2 + addSingleSensorVolume( + motherVolume, layerNumber, direction, i_lane, sensor_count, + x_mid - sensorGap / 2 - Constants::active_width / 2, y_mid, z_si, true); + addSingleSensorVolume( + motherVolume, layerNumber, direction, i_lane, sensor_count + 1, + x_mid + sensorGap / 2 + Constants::active_width / 2, y_mid, z_si, false); + // The FPC layers and the glue cover the module and, as on the outer disks, reach half a + // module gap into the gap on each side, so that those of neighbouring modules touch + const double hy = (Constants::sensor1x2_height + Constants::moduleGap) / 2; + // (2) glue between silicon and FPC + addLaneBox(motherVolume, "FT3glue_SiFPC_" + mod, Materials::MaterialID::Epoxy, sensor_count, + x_mid, y_mid, z_si + behind * dGlueSiFpc, fpcHalfWidth, hy, glue / 2); + // (3) FPC: copper, then kapton + addLaneBox(motherVolume, "FT3Copper_" + mod, Materials::MaterialID::Copper, sensor_count, + x_mid, y_mid, z_si + behind * dCopper, fpcHalfWidth, hy, cu / 2); + addLaneBox(motherVolume, "FT3Kapton_" + mod, Materials::MaterialID::Kapton, sensor_count, + x_mid, y_mid, z_si + behind * dKapton, fpcHalfWidth, hy, kap / 2); + // (4) glue between FPC and plate + addLaneBox(motherVolume, "FT3glue_FPCPlate_" + mod, Materials::MaterialID::Epoxy, sensor_count, + x_mid, y_mid, z_si + behind * dGlueFpcPlate, fpcHalfWidth, hy, glue / 2); + y_mid += Constants::sensor1x2_height + sensorGap; + sensor_count += 2; // same count for each material in the glued stack + nModulesTotal++; + } + // next stack starts a stack gap above the top of this one + y_bottom += nSensorsInStack * Constants::single_sensor_height + + (nSensorsInStack - 1) * sensorGap + stackGap; + } + // (5) Carbon plate: one strip under the whole fill, from the bottom of its first stack to + // the top of its last one (y_bottom is now one stack gap above the top). The glue reaches + // half a module gap beyond the first and the last module, so the plate does as well. + const double y_lo = fill.yStart - Constants::moduleGap / 2; + const double y_hi = y_bottom - stackGap + Constants::moduleGap / 2; + addLaneBox(motherVolume, "FT3CarbonStrip_" + tag + std::to_string(i_lane) + "_" + std::to_string(fill_idx), + Materials::MaterialID::CarbonFiber, fill_idx, x_mid, (y_lo + y_hi) / 2, + z_si + behind * dPlate, plateHalfWidth, (y_hi - y_lo) / 2, plate / 2); + plateY[i_lane].emplace_back(y_lo, y_hi); + y_tip = std::max(y_tip, y_hi); + y_bottomTip = std::min(y_bottomTip, y_lo); + fill_idx++; + } + // (6) End-of-stave card at the top (+y) tip of the lane, one per lane. Same card as on the outer + // disks (Constants::getEosCardParams), starting z_far_si + zGap behind the far plane. A lane that the + // beam pipe cuts in two (two fills) is not connected through the hole, so its lower piece needs a + // card as well, at its bottom (-y) tip. + if (ft3Params.addDiskEosCards) { + const std::string cardName = "FT3_EOSdiskCard_" + tag + std::to_string(i_lane); + addEndOfStaveCard(motherVolume, cardName + "_pos", direction, i_lane, x_mid, y_tip, z_far_si, + true, ft3Params.ft3EosCardCuThicknessML); + if (staveConfig.exactStaveFills[i_lane].size() > 1) { + addEndOfStaveCard(motherVolume, cardName + "_neg", direction, nLanes + i_lane, x_mid, y_bottomTip, z_far_si, + true, ft3Params.ft3EosCardCuThicknessML); + } + } + } + + // (7) The corrugated sheet. Edges of the flat of every lane: it runs from under the overhang of the + // plate of the previous lane to under that of the next one (the outermost lanes mirror their one + // neighbour about their own x). + std::vector flatLeft(nLanes), flatRight(nLanes); + for (unsigned k = 0; k < nLanes; k++) { + double l = (k > 0) ? laneX[k - 1] + plateHalfWidth - reach : 0.; + double r = (k + 1 < nLanes) ? laneX[k + 1] - plateHalfWidth + reach : 0.; + if (k == 0) { + l = 2 * laneX[k] - r; + } + if (k + 1 == nLanes) { + r = 2 * laneX[k] - l; + } + flatLeft[k] = l; + flatRight[k] = r; + if (r <= l) { + LOG(fatal) << "FT3 flat-lane disk: the plates next to lane " << k << " are too wide for a sheet flat between them"; + } + } + // depth range of the flat of a lane: it is of the other plane than the lane itself. The flat in the + // far plane sits on the middle side of the far plates (smaller t), the one in the near plane on + // the middle side of the near plates (larger t), each a glue layer away from the plate. + auto flatT = [&](unsigned k) -> Interval { + if (staveConfig.staveOnFront[k]) { // lane on the near plane: its flat supports far plates + const double hi = halfDepth + dPlateFront - glue; + return {hi - sheet, hi}; + } + const double lo = -halfDepth + dPlateBack + glue; + return {lo, lo + sheet}; + }; + auto mergeIntervals = [](std::vector v) { + std::sort(v.begin(), v.end()); + std::vector out; + for (const auto& iv : v) { + if (!out.empty() && iv.first <= out.back().second + 1e-9) { + out.back().second = std::max(out.back().second, iv.second); + } else { + out.push_back(iv); + } + } + return out; + }; + auto yOfLanes = [&](std::initializer_list lanes) { + std::vector v; + for (int l : lanes) { + if (l >= 0 && l < static_cast(nLanes)) { + v.insert(v.end(), plateY[l].begin(), plateY[l].end()); + } + } + return mergeIntervals(v); + }; + + // The sheet is cut to the annulus the plates occupy (inner and outer radius of the plate + // corners), so it does not stick out of the disk at the outer lanes or into the hole of the beam pipe. + // A piece spanning [xlo, xhi] is clipped conservatively: to the outer circle at its largest |x|, and + // outside the inner circle at its smallest |x|. + double rPlateIn = 1e9, rPlateOut = 0; + for (unsigned l = 0; l < nLanes; l++) { + for (const auto& y : plateY[l]) { + const double x0 = laneX[l] - plateHalfWidth, x1 = laneX[l] + plateHalfWidth; + const double nx = (x0 <= 0 && x1 >= 0) ? 0. : std::min(std::fabs(x0), std::fabs(x1)); + const double ny = (y.first <= 0 && y.second >= 0) ? 0. : std::min(std::fabs(y.first), std::fabs(y.second)); + rPlateIn = std::min(rPlateIn, std::hypot(nx, ny)); + rPlateOut = std::max(rPlateOut, std::hypot(std::max(std::fabs(x0), std::fabs(x1)), std::max(std::fabs(y.first), std::fabs(y.second)))); + } + } + auto clipToDisk = [&](const std::vector& in, double xlo, double xhi) { + const double xMax = std::max(std::fabs(xlo), std::fabs(xhi)); + const double xMin = (xlo <= 0 && xhi >= 0) ? 0. : std::min(std::fabs(xlo), std::fabs(xhi)); + const double yOut = rPlateOut > xMax ? std::sqrt(rPlateOut * rPlateOut - xMax * xMax) : 0.; + const double yIn = rPlateIn > xMin ? std::sqrt(rPlateIn * rPlateIn - xMin * xMin) : 0.; + std::vector out; + for (const auto& iv : in) { + const double lo = std::max(iv.first, -yOut), hi = std::min(iv.second, yOut); + if (hi <= lo) { + continue; + } + // remove (-yIn, yIn) + if (lo < -yIn) { + out.emplace_back(lo, std::min(hi, -yIn)); + } + if (hi > yIn) { + out.emplace_back(std::max(lo, yIn), hi); + } + } + return out; + }; + + unsigned nSheetPieces = 0; + for (unsigned k = 0; k < nLanes; k++) { + const Interval t = flatT(k); + const double zMid = zOf((t.first + t.second) / 2); + unsigned piece = 0; + // flat: lies on the plates of lanes k-1 and k+1 + std::vector flatY = clipToDisk(yOfLanes({static_cast(k) - 1, static_cast(k) + 1}), flatLeft[k], flatRight[k]); + for (const auto& y : flatY) { + addLaneBox(motherVolume, "FT3SheetFlat_" + tag + std::to_string(k) + "_" + std::to_string(piece++), + Materials::MaterialID::CarbonFiber, nSheetPieces++, + (flatLeft[k] + flatRight[k]) / 2, (y.first + y.second) / 2, zMid, + (flatRight[k] - flatLeft[k]) / 2, (y.second - y.first) / 2, sheet / 2); + } + // glue between the plates of lanes k-1, k+1 and the flat, under their overhang, where they touch + const double tGlueLo = staveConfig.staveOnFront[k] ? halfDepth + dPlateFront - glue : -halfDepth + dPlateBack; + for (int j : {static_cast(k) - 1, static_cast(k) + 1}) { + if (j < 0 || j >= static_cast(nLanes)) { + continue; + } + const double xa = (j < static_cast(k)) ? laneX[j] + plateHalfWidth - reach : laneX[j] - plateHalfWidth; + unsigned fillIdx = 0; + for (const auto& y : plateY[j]) { + for (const auto& f : flatY) { + const double ylo = std::max(y.first, f.first), yhi = std::min(y.second, f.second); + if (yhi <= ylo) { + continue; + } + addLaneBox(motherVolume, "FT3glue_PlateSheet_" + tag + std::to_string(k) + "_" + std::to_string(j) + "_" + std::to_string(fillIdx++), + Materials::MaterialID::Epoxy, nSheetPieces++, xa + reach / 2, (ylo + yhi) / 2, + zOf(tGlueLo + glue / 2), reach / 2, (yhi - ylo) / 2, glue / 2); + } + } + } + } + // walls: from the right edge of the flat of lane k to the left edge of the flat of lane k+1 + double minClearance = 1e9; + for (unsigned k = 0; k + 1 < nLanes; k++) { + const double xa = flatRight[k], xb = flatLeft[k + 1]; + if (xb <= xa) { + LOG(fatal) << "FT3 flat-lane disk: no room for a sheet wall between lanes " << k << " and " << k + 1; + } + const Interval ta = flatT(k), tb = flatT(k + 1); + unsigned piece = 0; + for (const auto& y : clipToDisk(yOfLanes({static_cast(k), static_cast(k) + 1}), xa, xb)) { + addLaneSheetWall(motherVolume, "FT3SheetWall_" + tag + std::to_string(k) + "_" + std::to_string(piece++), nSheetPieces++, + xa, zOf(ta.first), zOf(ta.second), xb, zOf(tb.first), zOf(tb.second), y.first, y.second); + } + // clearance of this wall to the far-plane modules it passes: it must stay in front of (towards the + // middle from) the silicon, and in front of the glue under the silicon where the FPC sticks out + // beyond the silicon + for (unsigned j = 0; j < nLanes; j++) { + if (staveConfig.staveOnFront[j]) { + continue; + } + for (const auto& [halfWidth, frontFace] : {std::pair{moduleHalfWidth, halfDepth - si / 2}, + std::pair{fpcHalfWidth, halfDepth + si / 2}}) { + const double lo = std::max(xa, laneX[j] - halfWidth); + const double hi = std::min(xb, laneX[j] + halfWidth); + if (hi < lo) { + continue; // the wall does not pass this module + } + for (double xe : {lo, hi}) { + const double f = (xe - xa) / (xb - xa); + const double tTop = ta.second + f * (tb.second - ta.second); // side of the wall facing the far plane + minClearance = std::min(minClearance, frontFace - tTop); + } + } + } + } + if (minClearance < Constants::flatLaneSheetMinClearance) { + LOG(fatal) << "FT3 flat-lane disk: the corrugated sheet comes within " << minClearance + << " cm of the silicon of the far plane (needs " << Constants::flatLaneSheetMinClearance + << "); reduce flatLaneSheetReach or the thickness of the FPC"; + } + LOG(info) << "Flat-lane layout for layer " << layerNumber << " in direction " << direction + << ": " << nLanes << " lanes, " << nModulesTotal << " 1x2 modules, " << nSheetPieces + << " pieces of corrugated sheet and glue, closest approach of the sheet to the far-plane silicon and FPC " + << minClearance * 10 << " mm"; +} + void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction, double Rin, double Rout, double z_offset_local, const Constants::StaveConfig& staveConfig, @@ -802,6 +1200,12 @@ void FT3Module::create_layout_staveGeo(double mZ, int layerNumber, int direction LOG(debug) << "FT3Module: create_layout_staveGeo - Direction " << direction << ", Layer " << layerNumber; + // Middle disks: flat lanes on two z planes, no triangular carbon staves + if (staveConfig.isFlatCorrugated) { + create_layout_flatLanes(layerNumber, direction, z_offset_local, staveConfig, motherVolume); + return; + } + auto& ft3Params = o2::ft3::FT3BaseParam::Instance(); // First let's define some constants used throughout @@ -1631,4 +2035,4 @@ void FT3Module::createModule_staveGeo(double mZ, int layerNumber, int direction, create_layout_staveGeo(mZ, layerNumber, direction, Rin, Rout, z_offset_local, staveConfig, motherVolume); LOG(debug) << "FT3Module: done createModule_staveGeo"; -} +} \ No newline at end of file