20 #include <TGeoManager.h>
26 dd4hep::except(
"dd4hep:GlobalAlignment",
"Attempt to access invalid alignment object. [Invalid Handle]");
35 m_element =
new TGeoPhysicalNode(path.c_str());
40 CheckHandle verify_handle(*
this);
41 return ptr()->GetLevel();
46 CheckHandle verify_handle(*
this);
47 return ptr()->GetNode(0);
52 CheckHandle verify_handle(*
this);
53 TGeoNode* n = ptr()->GetNode(level);
55 except(
"dd4hep:GlobalAlignment",
56 "The object chain of %s is too short. [Invalid index]", placement().name());
62 CheckHandle verify_handle(*
this);
63 Int_t ind = ptr()->GetLevel()-level_up;
65 return ptr()->GetMother(level_up);
67 except(
"dd4hep:GlobalAlignment",
68 "This object %s has not enough mothers. [Invalid index]", placement().name());
74 CheckHandle verify_handle(*
this);
80 CheckHandle verify_handle(*
this);
82 TGeoHMatrix* matrix = ptr()->GetMatrix(level);
83 matrix->LocalToMaster((Double_t*)&localPoint,(Double_t*)&result);
89 CheckHandle verify_handle(*
this);
91 TGeoHMatrix* matrix = ptr()->GetMatrix(level);
92 matrix->MasterToLocal((Double_t*)&globalPoint,(Double_t*)&result);
98 CheckHandle verify_handle(*
this);
104 CheckHandle verify_handle(*
this);
111 CheckHandle verify_handle(*
this);
112 TGeoPhysicalNode* n = ptr();
114 TGeoHMatrix matrix(n->GetOriginalMatrix()->Inverse());
115 matrix.Multiply(n->GetNode()->GetMatrix());
122 CheckHandle verify_handle(*
this);
123 TGeoPhysicalNode* n = ptr();
125 TGeoHMatrix matrix(n->GetNode()->GetMatrix()->Inverse());
126 matrix.Multiply(n->GetOriginalMatrix());