Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:13:40

0001 // -*- C++ -*-
0002 //
0003 // This file is part of YODA -- Yet more Objects for Data Analysis
0004 // Copyright (C) 2008-2024 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 modification of a data object where filling has already begun.
0041   class LockError : public Exception {
0042   public:
0043     LockError(const std::string& what);
0044   };
0045 
0046 
0047   /// Error to throw when a slicing is requested on a non-slicable state of an object.
0048   class GridError : public Exception {
0049   public:
0050     GridError(const std::string& what);
0051   };
0052 
0053 
0054   /// Error for places where it should not have been possible to get to!
0055   class LogicError : public Exception {
0056   public:
0057     LogicError(const std::string& what);
0058   };
0059 
0060 
0061   /// @brief Errors relating to event/bin weights
0062   ///
0063   /// Arises in computing statistical quantities because e.g. the bin
0064   /// weight is zero or negative.
0065   class WeightError : public Exception {
0066   public:
0067     WeightError(const std::string& what);
0068   };
0069 
0070 
0071   /// Errors relating to insufficient (effective) statistics
0072   class LowStatsError : public Exception {
0073   public:
0074     LowStatsError(const std::string& what);
0075   };
0076 
0077 
0078   /// Error for unfound or broken AnalysisObject annotations
0079   class AnnotationError : public Exception {
0080   public:
0081     AnnotationError(const std::string& what);
0082   };
0083 
0084 
0085   /// Error for file reading errors
0086   class ReadError : public Exception {
0087   public:
0088     ReadError(const std::string& what);
0089   };
0090 
0091 
0092   /// Error for file writing errors
0093   class WriteError : public Exception {
0094   public:
0095     WriteError(const std::string& what);
0096   };
0097 
0098 
0099   /// Error for problems introduced outside YODA, to put it nicely.
0100   class UserError : public Exception {
0101   public:
0102     UserError(const std::string& what);
0103   };
0104 
0105 
0106 }
0107 
0108 #endif