rivet is hosted by Hepforge, IPPP Durham
Exceptions.hh
Go to the documentation of this file.
00001 #ifndef RIVET_EXCEPTIONS_HH
00002 #define RIVET_EXCEPTIONS_HH
00003 
00004 #include <string>
00005 #include <exception>
00006 #include <stdexcept>
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief Generic runtime Rivet error.
00012   class Error : public std::runtime_error {
00013   public:
00014     Error(const std::string& what) : std::runtime_error(what) {}
00015   };
00016 
00017 
00018   /// @brief Rivet::Exception is a synonym for Rivet::Error.
00019   typedef Error Exception;
00020 
00021 
00022   /// @brief Error for e.g. use of invalid bin ranges.
00023   class RangeError : public Error {
00024   public:
00025     RangeError(const std::string& what) : Error(what) {}
00026   };
00027 
00028 
00029   /// @brief Error specialisation for places where alg logic has failed.
00030   class LogicError : public Error {
00031   public:
00032     LogicError(const std::string& what) : Error(what) {}
00033   };
00034 
00035 
00036   /// @brief Error specialisation for failures relating to particle ID codes.
00037   class PidError : public Error {
00038   public:
00039     PidError(const std::string& what) : Error(what) {}
00040   };
00041 
00042 
00043   /// @brief Errors relating to event/bin weights
00044   /// Arises in computing statistical quantities because e.g. the bin
00045   /// weight is zero or negative.
00046   class WeightError : public Error {
00047   public:
00048     WeightError(const std::string& what) : Error(what) {}
00049   };
00050 
00051 
00052 }
00053 
00054 #endif