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 Error specialisation for failures relating to analysis info.
00044   class InfoError : public Error {
00045   public:
00046     InfoError(const std::string& what) : Error(what) {}
00047   };
00048 
00049 
00050   /// @brief Errors relating to event/bin weights
00051   ///
00052   /// Arises in computing statistical quantities because e.g. the bin
00053   /// weight is zero or negative.
00054   class WeightError : public Error {
00055   public:
00056     WeightError(const std::string& what) : Error(what) {}
00057   };
00058 
00059 
00060   /// @brief Error specialisation for where the problem is between the chair and computer.
00061   class UserError : public Error {
00062   public:
00063     UserError(const std::string& what) : Error(what) {}
00064   };
00065 
00066 
00067 }
00068 
00069 #endif