File indexing completed on 2024-04-06 12:07:28
0001 #ifndef DQM_HcalCommon_Flag_h
0002 #define DQM_HcalCommon_Flag_h
0003
0004 #include "DQM/HcalCommon/interface/HcalCommonHeaders.h"
0005
0006 namespace hcaldqm {
0007 namespace flag {
0008
0009
0010
0011
0012
0013 enum State {
0014 fNONE = 0,
0015 fNCDAQ = 1,
0016 fNA = 2,
0017 fGOOD = 3,
0018 fPROBLEMATIC = 4,
0019 fBAD = 5,
0020 fRESERVED = 6,
0021 nState = 7
0022 };
0023
0024 struct Flag {
0025 Flag() : _name("SOMEFLAG"), _state(fNA) {}
0026 Flag(std::string const &name, State s = fNA) : _name(name), _state(s) {}
0027 Flag(Flag const &f) : _name(f._name), _state(f._state) {}
0028
0029
0030
0031
0032 Flag operator+(Flag const &f) {
0033 return Flag(_name != f._name ? "SOMEFLAG" : _name, (State)(std::max(_state, f._state)));
0034 }
0035
0036
0037
0038
0039 Flag &operator+=(Flag const &f) {
0040 _state = (State)(std::max(_state, f._state));
0041 return *this;
0042 }
0043
0044
0045
0046
0047 bool operator==(Flag const &f) { return (_state == f._state && _name == f._name); }
0048
0049
0050
0051
0052 Flag &operator=(Flag const &f) {
0053 _name = f._name;
0054 _state = f._state;
0055 return *this;
0056 }
0057
0058
0059 void reset() { _state = fNA; }
0060
0061 std::string _name;
0062 State _state;
0063 };
0064 }
0065 }
0066
0067 #endif