From 32afd3b04aa2d6c58bf425641657fff1cb521fbb Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Wed, 16 Sep 2026 18:47:07 +0200 Subject: [PATCH] Place the space-frame sectors explicitly instead of dividing BBMO This replaces the phi division of the space-frame mother BBMO by 18 explicit placements of the sector volume BBCE, so that the sector contents survive the conversion to Geant4. - Geant4 divides a polyhedra in phi by its number of sides and ignores the requested width and offset, and its cell frame sits at the start of a sector where TGeo's sits at the centre. - Both conversion routes, ROOT's GDML writer and VGM, are affected, so the 18 FTOS service boxes placed in BBCE were absent from the Geant4 geometry. - The TGeo geometry is unchanged: same node count, same BBCE shape and content, same global placements, no new overlaps. - With this, the ray-by-ray mass thickness of the two Geant4 geometries agrees with TGeo to 9e-8 relative, against 5e-5 before. https://its.cern.ch/jira/browse/O2-7153 --- Detectors/Passive/src/FrameStructure.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Detectors/Passive/src/FrameStructure.cxx b/Detectors/Passive/src/FrameStructure.cxx index ac9f273275769..47ba9a588ef54 100644 --- a/Detectors/Passive/src/FrameStructure.cxx +++ b/Detectors/Passive/src/FrameStructure.cxx @@ -1789,7 +1789,21 @@ void FrameStructure::ConstructGeometry() ppgon[9] = ppgon[6]; vmc->Gsvolu("BBMO", "PGON", kAir, ppgon, 10); - vmc->Gsdvn("BBCE", "BBMO", 18, 2); + + // The 18 sectors, placed one by one rather than made with a phi division. + // Geant4 has no faithful representation of a phi division of a polyhedra: it + // divides by the number of sides and ignores the requested width and offset, + // so the sector contents end up half a sector away from where TGeo puts them. + const int kNSectors = 18; + const float kSectorDphi = 360. / kNSectors; + TGeoPgon* shBBCE = new TGeoPgon(-kSectorDphi / 2., kSectorDphi, 1, 2); + shBBCE->DefineSection(0, -kBBMdz / 2., kBBMRin, kBBMRou); + shBBCE->DefineSection(1, kBBMdz / 2., kBBMRin, kBBMRou); + TGeoVolume* voBBCE = new TGeoVolume("BBCE", shBBCE, kMedAir); + TGeoVolume* voBBMO = gGeoManager->GetVolume("BBMO"); + for (i = 0; i < kNSectors; i++) { + voBBMO->AddNode(voBBCE, i + 1, new TGeoRotation("", (i + 0.5) * kSectorDphi, 0., 0.)); + } // CBL //////////////////////////////////////////////////////// //