DQM
HcalCommon
interface
Flag.h
Go to the documentation of this file.
1
#ifndef DQM_HcalCommon_Flag_h
2
#define DQM_HcalCommon_Flag_h
3
4
#include "
DQM/HcalCommon/interface/HcalCommonHeaders.h
"
5
6
namespace
hcaldqm
{
7
namespace
flag
{
8
//
9
// State Definition. In the increasing order of worsiness.
10
// States(as flags) can be added
11
// s1 + s2 = max(s1,s2) - that allows to set the worse of the 2
12
//
13
enum
State
{
14
fNONE
= 0,
// No State - can't have... not used....
15
fNCDAQ
= 1,
// not @cDAQ
16
fNA
= 2,
// Not Applicable
17
fGOOD
= 3,
// GOOD
18
fPROBLEMATIC
= 4,
// problem
19
fBAD
= 5,
// bad
20
fRESERVED
= 6,
// reserved
21
nState
= 7
22
};
23
24
struct
Flag
{
25
Flag
() :
_name
(
"SOMEFLAG"
),
_state
(
fNA
) {}
26
Flag
(
std::string
const
&
name
,
State
s
=
fNA
) :
_name
(
name
),
_state
(
s
) {}
27
Flag
(
Flag
const
&
f
) :
_name
(
f
.
_name
),
_state
(
f
.
_state
) {}
28
29
//
30
// add 2 flags
31
//
32
Flag
operator+
(
Flag
const
&
f
) {
33
return
Flag
(
_name
!=
f
._name ?
"SOMEFLAG"
:
_name
, (
State
)(
std::max
(
_state
,
f
._state)));
34
}
35
36
//
37
// add 2 flags and save
38
//
39
Flag
&
operator+=
(
Flag
const
&
f
) {
40
_state
= (
State
)(
std::max
(
_state
,
f
._state));
41
return
*
this
;
42
}
43
44
//
45
// compare 2 flags
46
//
47
bool
operator==
(
Flag
const
&
f
) {
return
(
_state
==
f
._state &&
_name
==
f
._name); }
48
49
//
50
// Assignment
51
//
52
Flag
&
operator=
(
Flag
const
&
f
) {
53
_name
=
f
._name;
54
_state
=
f
._state;
55
return
*
this
;
56
}
57
58
// reset the state to NA
59
void
reset
() {
_state
=
fNA
; }
60
61
std::string
_name
;
62
State
_state
;
63
};
64
}
// namespace flag
65
}
// namespace hcaldqm
66
67
#endif
hcaldqm::flag::Flag::Flag
Flag(Flag const &f)
Definition:
Flag.h:27
hcaldqm::flag::nState
Definition:
Flag.h:21
hcaldqm::flag::fNONE
Definition:
Flag.h:14
hcaldqm::flag::Flag::_name
std::string _name
Definition:
Flag.h:61
RemoveAddSevLevel.flag
flag
Definition:
RemoveAddSevLevel.py:117
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
hcaldqm::flag::Flag::_state
State _state
Definition:
Flag.h:62
hcaldqm::flag::Flag
Definition:
Flag.h:24
hcaldqm::flag::fBAD
Definition:
Flag.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
hcaldqm::flag::State
State
Definition:
Flag.h:13
hcaldqm::flag::fNA
Definition:
Flag.h:16
hcaldqm::flag::fGOOD
Definition:
Flag.h:17
hcaldqm::flag::Flag::reset
void reset()
Definition:
Flag.h:59
hcaldqm::flag::Flag::operator+
Flag operator+(Flag const &f)
Definition:
Flag.h:32
hcaldqm::flag::Flag::Flag
Flag()
Definition:
Flag.h:25
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
hcaldqm::flag::Flag::Flag
Flag(std::string const &name, State s=fNA)
Definition:
Flag.h:26
hcaldqm::flag::fRESERVED
Definition:
Flag.h:20
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
hcaldqm::flag::fNCDAQ
Definition:
Flag.h:15
hcaldqm::flag::Flag::operator==
bool operator==(Flag const &f)
Definition:
Flag.h:47
hcaldqm
Definition:
Constants.h:8
HcalCommonHeaders.h
hcaldqm::flag::Flag::operator=
Flag & operator=(Flag const &f)
Definition:
Flag.h:52
hcaldqm::flag::Flag::operator+=
Flag & operator+=(Flag const &f)
Definition:
Flag.h:39
hcaldqm::flag::fPROBLEMATIC
Definition:
Flag.h:18
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
Generated for CMSSW Reference Manual by
1.8.14