Skip to content

Commit dd0a7fa

Browse files
sawenzelclaude
andcommitted
Count the surface tier by what the cascade emits
This fixes a misleading line printed when a conversion uses both --csg and --exact-surfaces. - The count came from every part exact-surface extraction succeeded on, not from the parts geom.C carries as surface solids, so it overstated the tier by the parts CSG took. - On the OTR stave it said 137/137 where the macro holds 63 LoadSurfaces calls and the tier table says 63. - The parts that were extracted and then outranked by CSG are now reported separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 68b85b0 commit dd0a7fa

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎Detectors/CADSupport/tools/O2_CADtoTGeo.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4809,9 +4809,15 @@ def emit_root_macro(
48094809
materials_cpp, medium_var_map = emit_materials_cpp(used_materials, in_field=in_field)
48104810

48114811
# --- emit C++ macro ---
4812-
if surface_files:
4813-
print(f"Emitting {len(surface_files)}/{len(logical_volumes)} logical volumes as exact O2BVHSurfaceSolid "
4814-
f"(macro requires the ALICE O2 environment)")
4812+
# What the cascade actually hands to each tier, not what its extraction managed: a part
4813+
# recognised as CSG ships as CSG even though its surface sidecar was written too.
4814+
surface_lids = [lid for lid in surface_files
4815+
if lid not in flat_files and lid not in csg_files]
4816+
if surface_lids:
4817+
outranked = len(surface_files) - len(surface_lids)
4818+
note = f", {outranked} more extracted but carried as CSG" if outranked else ""
4819+
print(f"Emitting {len(surface_lids)}/{len(logical_volumes)} logical volumes as exact "
4820+
f"O2BVHSurfaceSolid{note} (macro requires the ALICE O2 environment)")
48154821

48164822
# The tessellated fallback's shape class; "tgeo" navigates as bounding boxes.
48174823
if mesh_solid not in ("o2", "tgeo"):

0 commit comments

Comments
 (0)