]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONVGeometryBuilder.cxx
added proper handling of EMCAL calibration events
[u/mrichter/AliRoot.git] / MUON / AliMUONVGeometryBuilder.cxx
index 9a4d3ddd37c439c441bcd690cb94cc91bd296785..74f3538b363799a18459e60d0b611dacd2b79592 100644 (file)
@@ -447,13 +447,17 @@ void  AliMUONVGeometryBuilder::RebuildSVMaps(Bool_t withEnvelopes) const
       if ( ! withEnvelopes && geometry->IsVirtual() ) {
          std::string vName = geometry->GetTransformer()->GetVolumeName().Data();
         std::string vPath = ComposePath(vName, 1).Data();
-        path0.erase(path0.find(vPath), vPath.size());
+         std::string::size_type vPathPos = path0.find(vPath);
+         if ( vPathPos != std::string::npos )
+           path0.erase(vPathPos, vPath.size());
       }  
        
       if ( ! withEnvelopes && envelope->IsVirtual()) {
          std::string eName = envelope->GetName();
         std::string ePath = ComposePath(eName, envelope->GetCopyNo()).Data();
-        path0.erase(path0.find(ePath), ePath.size());
+         std::string::size_type ePathPos = path0.find(ePath);
+         if ( ePathPos != std::string::npos )
+           path0.erase(ePathPos, ePath.size());
       }
 
       if ( ! envelope->IsVirtual() )