]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
following coverity, fix for case of invalid DET string passed to GetNalignable
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 12:32:27 +0000 (12:32 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 12:32:27 +0000 (12:32 +0000)
STEER/AliGeomManager.cxx

index 3f018c4c524b84584f9d8021e2b4b4b3540c51bc..3c262c23e23efefc46e420a9a780d3cc8856e32e 100644 (file)
@@ -1533,8 +1533,9 @@ void AliGeomManager::CheckOverlapsOverPNs(Double_t threshold)
 //_____________________________________________________________________________
 Int_t AliGeomManager::GetNalignable(const char* module)
 {
-  // Get number of declared alignable volumes for given detector in current geometry
-  //
+  // Get number of declared alignable volumes in current geometry
+  // for the given detector "module" passed as a vaild detector name
+  // if the detector name is invalid return -1
   
   // return the detector index corresponding to detector
   Int_t index = -1 ;
@@ -1542,6 +1543,7 @@ Int_t AliGeomManager::GetNalignable(const char* module)
     if ( strcmp(module, fgkDetectorName[index]) == 0 )
       break ;
   }
+  if(index==fgkNDetectors) return -1;
   return fgNalignable[index];
 }