]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibParamNF.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibParamNF.cxx
index 600ed1396d92e1356059859b6e3dea8f354f0693..6c3ea29f9de37e0c4b93a18aaa0be059cc9133b2 100644 (file)
@@ -23,6 +23,8 @@
 #include "TMath.h"
 #include "TString.h"
 
+#include <limits.h>
+
 //-----------------------------------------------------------------------------
 /// \class AliMUONCalibParamNF
 ///
@@ -31,6 +33,8 @@
 /// \author Laurent Aphecetche
 //-----------------------------------------------------------------------------
 
+using std::cout;
+using std::endl;
 /// \cond CLASSIMP
 ClassImp(AliMUONCalibParamNF)
 /// \endcond
@@ -108,8 +112,7 @@ AliMUONCalibParamNF::CopyTo(AliMUONCalibParamNF& destination) const
 {
 /// Copy *this to destination
 
-  const TObject& o = static_cast<const TObject&>(*this);
-  o.Copy(destination);
+  TObject::Copy(destination);
   
   delete[] destination.fValues;
   destination.fN = fN;
@@ -280,6 +283,13 @@ AliMUONCalibParamNF::ValueAsInt(Int_t i, Int_t j) const
 /// Return the value as an int, by rounding the internal float value.
 
   Float_t v = ValueAsFloat(i,j);
+  
+  if ( v >= Float_t(INT_MAX) ) {
+    AliErrorStream() 
+      << "Cannot convert value " << v << " to Int_t." << endl;
+    return 0;
+  }  
+  
   return TMath::Nint(v);
 }