Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 09:16:29

0001 // -*- C++ -*-
0002 //
0003 // This file is part of YODA -- Yet more Objects for Data Analysis
0004 // Copyright (C) 2008-2025 The YODA collaboration (see AUTHORS for details)
0005 //
0006 #ifndef YODA_Exception_h
0007 #define YODA_Exception_h
0008 
0009 #include <string>
0010 #include <exception>
0011 #include <stdexcept>
0012 
0013 namespace YODA {
0014 
0015 
0016   /// @brief Generic unspecialised YODA runtime error.
0017   ///
0018   /// NB. We don't use "Error" because that's a useful stats word to have
0019   /// available!
0020   class Exception : public std::runtime_error {
0021   public:
0022     Exception(const std::string& what);
0023   };
0024 
0025 
0026   /// Error for general binning problems.
0027   class BinningError : public Exception {
0028   public:
0029     BinningError(const std::string& what);
0030   };
0031 
0032 
0033   /// Error for e.g. use of invalid bin ranges.
0034   class RangeError : public Exception {
0035   public:
0036     RangeError(const std::string& what);
0037   };
0038 
0039 
0040   /// Error for places where it should not have been possible to get to!
0041   class LogicError : public Exception {
0042   public:
0043     LogicError(const std::string& what);
0044   };
0045 
0046 
0047   /// @brief Errors relating to event/bin weights
0048   ///
0049   /// Arises in computing statistical quantities because e.g. the bin
0050   /// weight is zero or negative.
0051   class WeightError : public Exception {
0052   public:
0053     WeightError(const std::string& what);
0054   };
0055 
0056 
0057   /// Errors relating to insufficient (effective) statistics
0058   //class LowStatsError : public Exception {
0059   //public:
0060   //  LowStatsError(const std::string& what);
0061   //};
0062 
0063 
0064   /// Error for unfound or broken AnalysisObject annotations
0065   class AnnotationError : public Exception {
0066   public:
0067     AnnotationError(const std::string& what);
0068   };
0069 
0070 
0071   /// Error for file reading errors
0072   class ReadError : public Exception {
0073   public:
0074     ReadError(const std::string& what);
0075   };
0076 
0077 
0078   /// Error for file writing errors
0079   class WriteError : public Exception {
0080   public:
0081     WriteError(const std::string& what);
0082   };
0083 
0084 
0085   /// Error for problems introduced outside YODA, to put it nicely.
0086   class UserError : public Exception {
0087   public:
0088     UserError(const std::string& what);
0089   };
0090 
0091 
0092 }
0093 
0094 #endif