]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Corrected behaviour in case the volume was already misaligned
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Apr 2006 12:58:53 +0000 (12:58 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Apr 2006 12:58:53 +0000 (12:58 +0000)
STEER/AliAlignObj.cxx

index 10c56b0a751c13e58ce6a833bce24360a106bcda..83ebbede468cfc310f3441fbddcff2d325b2c861 100644 (file)
@@ -434,13 +434,20 @@ Bool_t AliAlignObj::ApplyToGeometry()
   }
   
   const char* volpath = GetVolPath();
-  TGeoPhysicalNode* node = (TGeoPhysicalNode*) gGeoManager->MakePhysicalNode(volpath);
-  if (!node) {
+
+  if (gGeoManager->GetListOfPhysicalNodes()->FindObject(volpath)) {
+    AliError(Form("Volume %s has been already misaligned!",volpath));
+    return kFALSE;
+  }
+
+  if (!gGeoManager->cd(volpath)) {
     AliError(Form("Volume path %s not valid!",volpath));
     return kFALSE;
   }
-  if (node->IsAligned()) {
-    AliWarning(Form("Volume %s has been already misaligned!",volpath));
+
+  TGeoPhysicalNode* node = (TGeoPhysicalNode*) gGeoManager->MakePhysicalNode(volpath);
+  if (!node) {
+    AliError(Form("Volume path %s not valid!",volpath));
     return kFALSE;
   }