@@ -51,48 +51,46 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
5151
5252 if (use_plane_xs) {
5353 // Use plane-based cross section
54-
54+
5555 // Get plane definition from XML (in world frame)
56- double plane_x = getAttrOrDefault<double >(slice_coll, _Unicode (plane_x), 0.0 );
57- double plane_y = getAttrOrDefault<double >(slice_coll, _Unicode (plane_y), 0.0 );
58- double plane_z = getAttrOrDefault<double >(slice_coll, _Unicode (plane_z), 0.0 );
59- double plane_yrot = getAttrOrDefault<double >(slice_coll, _Unicode (plane_yrot), 0.0 );
60-
56+ double plane_x = getAttrOrDefault<double >(slice_coll, _Unicode (plane_x), 0.0 );
57+ double plane_y = getAttrOrDefault<double >(slice_coll, _Unicode (plane_y), 0.0 );
58+ double plane_z = getAttrOrDefault<double >(slice_coll, _Unicode (plane_z), 0.0 );
59+ double plane_yrot = getAttrOrDefault<double >(slice_coll, _Unicode (plane_yrot), 0.0 );
60+
6161 // Get the mother volume's transformation to world frame
62- const auto & mother_matrix = mother.nominal ().worldTransformation ();
62+ const auto & mother_matrix = mother.nominal ().worldTransformation ();
6363 const Double_t* translation = mother_matrix.GetTranslation ();
64- const Double_t* rotation = mother_matrix.GetRotationMatrix ();
65-
64+ const Double_t* rotation = mother_matrix.GetRotationMatrix ();
65+
6666 // Build Transform3D from TGeoMatrix
67- Transform3D mother_to_world (
68- rotation[0 ], rotation[1 ], rotation[2 ], translation[0 ],
69- rotation[3 ], rotation[4 ], rotation[5 ], translation[1 ],
70- rotation[6 ], rotation[7 ], rotation[8 ], translation[2 ]
71- );
72-
67+ Transform3D mother_to_world (rotation[0 ], rotation[1 ], rotation[2 ], translation[0 ],
68+ rotation[3 ], rotation[4 ], rotation[5 ], translation[1 ],
69+ rotation[6 ], rotation[7 ], rotation[8 ], translation[2 ]);
70+
7371 // Transform the plane position and rotation from world frame to mother's local frame
7472 Position plane_pos_world (plane_x, plane_y, plane_z);
7573 RotationY plane_rot_world (plane_yrot);
7674 Transform3D plane_transform_world (plane_rot_world, plane_pos_world);
77-
75+
7876 // Apply inverse transformation to get plane in mother's local coordinates
7977 disk_transform = mother_to_world.Inverse () * plane_transform_world;
80-
78+
8179 // Get maximum dimension for cutting box
8280 double max_dim = getAttrOrDefault<double >(slice_coll, _Unicode (max_dimension), 1.0 * m);
83-
81+
8482 // Create a thin box perpendicular to the plane normal
8583 Box cutting_box (max_dim, max_dim, sensitive_thickness / 2 );
8684
8785 // Create intersection of cutting box with mother volume (reversed order to preserve rotation)
8886 // Apply the inverse transform to the second operand (mother) to express it in the box frame
89- sensitive_solid = IntersectionSolid (cutting_box, mother_vol. solid (), disk_transform. Inverse ());
90-
87+ sensitive_solid =
88+ IntersectionSolid (cutting_box, mother_vol. solid (), disk_transform. Inverse ());
9189
9290 } else {
9391 // Use cone segment (default behavior)
9492 ConeSegment mother_shape = mother_vol.solid ();
95-
93+
9694 // Get the parameters of the mother volume
9795 double rOuter1 = mother_shape.rMax1 ();
9896 double rOuter2 = mother_shape.rMax2 ();
@@ -107,7 +105,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
107105 }
108106
109107 sensitive_solid = ConeSegment (sensitive_thickness / 2 , 0.0 , rOuter2, 0.0 , rEnd);
110- disk_transform = Transform3D (Rotation3D (), Position (0.0 , 0.0 , zPos));
108+ disk_transform = Transform3D (Rotation3D (), Position (0.0 , 0.0 , zPos));
111109 }
112110
113111 Volume v_start_disk (" v_start_disk_" + motherName, sensitive_solid, m_Vacuum);
0 commit comments