18 #include "TGeoVolume.h"
22 const TGeoMatrix& gmatrix) {
24 if (state.
volume !=
nullptr) {
25 std::string volumeName = state.
volume->GetName();
31 auto daugthers = state.
volume->GetNodes();
33 TIter iObj(daugthers);
35 TGeoNode* node =
dynamic_cast<TGeoNode*
>(obj);
36 if (node !=
nullptr) {
39 select(state, options, gmatrix);
42 }
else if (state.
node !=
nullptr) {
44 std::string nodeName = state.
node->GetName();
45 std::string nodeVolName = state.
node->GetVolume()->GetName();
47 const TGeoMatrix* nmatrix = state.
node->GetMatrix();
48 TGeoHMatrix
transform = TGeoCombiTrans(gmatrix) * TGeoCombiTrans(*nmatrix);
49 std::string suffix =
"_transform";
50 transform.SetName((nodeName + suffix).c_str());
55 const Double_t* rotation = transform.GetRotationMatrix();
56 const Double_t* translation = transform.GetTranslation();
60 options.
unit * translation[2]);
61 Vector3D cx(rotation[0], rotation[3], rotation[6]);
62 Vector3D cy(rotation[1], rotation[4], rotation[7]);
63 Vector3D cz(rotation[2], rotation[5], rotation[8]);
69 dynamic_cast<TGeoBBox*
>(state.
node->GetVolume()->GetShape());
73 double dx = options.
unit * shape->GetDX();
74 double dy = options.
unit * shape->GetDY();
75 double dz = options.
unit * shape->GetDZ();
76 for (
auto x : std::vector<double>{-
dx, dx}) {
77 for (
auto y : std::vector<double>{-
dy, dy}) {
78 for (
auto z : std::vector<double>{-
dz, dz}) {
82 if (val < check.second.first or val > check.second.second) {
101 select(state, options, transform);