diff --git a/geom/inc/TGeoPhysicalNode.h b/geom/inc/TGeoPhysicalNode.h index a12457ae6d38c078d303c3645d9f1c75c7bdf138..d5ba015ce685805e3ff4aca2b371373fe8dd26dd 100644 --- a/geom/inc/TGeoPhysicalNode.h +++ b/geom/inc/TGeoPhysicalNode.h @@ -111,7 +111,7 @@ private: }; TGeoPhysicalNode *fNode; // Physical node to which this applies const TGeoHMatrix *fMatrix; // Additional matrix - const TGeoMatrix *fMatrixOrig; // Original local matrix of the last TGeoNode in the branch + TGeoHMatrix *fGlobalOrig; // Original global matrix for the linked physical node protected: TGeoPNEntry(const TGeoPNEntry& pne) @@ -126,13 +126,14 @@ public: virtual ~TGeoPNEntry(); inline const char *GetPath() const {return GetTitle();} - const TGeoHMatrix *GetMatrix() const {return fMatrix;} - const TGeoMatrix *GetMatrixOrig() const {return fMatrixOrig;} + const TGeoHMatrix *GetMatrix() const {return fMatrix;} + TGeoHMatrix *GetMatrixOrig() const {if (fNode) return fNode->GetOriginalMatrix(); else return NULL;}; + TGeoHMatrix *GetGlobalOrig() const {return fGlobalOrig;} TGeoPhysicalNode *GetPhysicalNode() const {return fNode;} void SetMatrix(const TGeoHMatrix *matrix); void SetPhysicalNode(TGeoPhysicalNode *node); - ClassDef(TGeoPNEntry, 3) // a physical node entry with unique name + ClassDef(TGeoPNEntry, 4) // a physical node entry with unique name }; #endif diff --git a/geom/src/TGeoManager.cxx b/geom/src/TGeoManager.cxx index ed903b649f52df8ada302e4d813bec98645824e6..eeee1fda9dbb1112cd737c2e44dd50d60971bd30 100644 --- a/geom/src/TGeoManager.cxx +++ b/geom/src/TGeoManager.cxx @@ -2939,7 +2939,6 @@ TGeoPhysicalNode *TGeoManager::MakeAlignablePN(TGeoPNEntry *entry) } TGeoPhysicalNode *node = MakePhysicalNode(path); entry->SetPhysicalNode(node); - node->SetMatrixOrig(entry->GetMatrixOrig()); return node; } diff --git a/geom/src/TGeoPhysicalNode.cxx b/geom/src/TGeoPhysicalNode.cxx index 3ddd2f98bd96871d965a8851ee6605f5dea60810..7cf9acc5b90cc2e4a28e4cc3a2ec2328f8f158ef 100644 --- a/geom/src/TGeoPhysicalNode.cxx +++ b/geom/src/TGeoPhysicalNode.cxx @@ -358,7 +358,7 @@ TGeoPNEntry::TGeoPNEntry() else SetBit(kPNEntryOwnMatrix,kFALSE); fNode = 0; fMatrix = 0; - fMatrixOrig = 0; + fGlobalOrig = 0; } //_____________________________________________________________________________ @@ -374,7 +374,8 @@ TGeoPNEntry::TGeoPNEntry(const char *name, const char *path) } gGeoManager->PushPath(); gGeoManager->cd(path); - fMatrixOrig = gGeoManager->GetCurrentNode()->GetMatrix(); + fGlobalOrig = new TGeoHMatrix(); + *fGlobalOrig = gGeoManager->GetCurrentMatrix(); gGeoManager->PopPath(); SetBit(kPNEntryOwnMatrix,kFALSE); fNode = 0; @@ -386,6 +387,7 @@ TGeoPNEntry::~TGeoPNEntry() { // Destructor if (fMatrix && TestBit(kPNEntryOwnMatrix)) delete fMatrix; + delete fGlobalOrig; } //_____________________________________________________________________________ @@ -405,3 +407,4 @@ void TGeoPNEntry::SetMatrix(const TGeoHMatrix *mat) // Set the additional matrix for this node entry. The matrix is owned by user. fMatrix = mat; } +