File indexing completed on 2024-04-06 12:19:22
0001 #ifndef NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
0002 #define NPSTAT_STORABLEMULTIVARIATEFUNCTOR_HH_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <string>
0015 #include <iostream>
0016 #include <typeinfo>
0017
0018 #include "Alignment/Geners/interface/ClassId.hh"
0019 #include "JetMETCorrections/InterpolationTables/interface/AbsMultivariateFunctor.h"
0020
0021 namespace npstat {
0022
0023 class StorableMultivariateFunctor : public AbsMultivariateFunctor {
0024 public:
0025 inline StorableMultivariateFunctor() {}
0026
0027
0028 inline explicit StorableMultivariateFunctor(const std::string& descr)
0029 : AbsMultivariateFunctor(), description_(descr) {}
0030
0031 inline ~StorableMultivariateFunctor() override {}
0032
0033
0034 inline const std::string& description() const { return description_; }
0035
0036
0037 inline void setDescription(const std::string& newDescription) { description_ = newDescription; }
0038
0039
0040
0041
0042
0043 void validateDescription(const std::string& description) const;
0044
0045
0046
0047
0048
0049
0050 inline bool operator==(const StorableMultivariateFunctor& r) const {
0051 return (typeid(*this) == typeid(r)) && this->isEqual(r);
0052 }
0053 inline bool operator!=(const StorableMultivariateFunctor& r) const { return !(*this == r); }
0054
0055
0056
0057
0058 virtual gs::ClassId classId() const = 0;
0059 virtual bool write(std::ostream& of) const = 0;
0060
0061
0062
0063 static inline const char* classname() { return "npstat::StorableMultivariateFunctor"; }
0064 static inline unsigned version() { return 1; }
0065 static StorableMultivariateFunctor* read(const gs::ClassId& id, std::istream& in);
0066
0067 protected:
0068
0069
0070
0071
0072
0073
0074
0075 virtual bool isEqual(const StorableMultivariateFunctor&) const = 0;
0076
0077 private:
0078 std::string description_;
0079 };
0080 }
0081
0082 #endif