LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ChannelStatus.h
Go to the documentation of this file.
1 
14 #ifndef IOVDATA_CHANNELSTATUS_H
15 #define IOVDATA_CHANNELSTATUS_H 1
16 
17 #include "ChData.h"
18 
19 namespace lariov {
20 
21  enum chStatus {
23  kDEAD = 1,
24  kLOWNOISE = 2,
25  kNOISY = 3,
26  kGOOD = 4,
28  };
29 
33  class ChannelStatus : public ChData {
34 
35  public:
37  ChannelStatus(unsigned int ch) : ChData(ch) {}
38 
40  ~ChannelStatus() = default;
41 
42  bool IsDead() const { return fStatus == kDEAD ? true : false; }
43  bool IsLowNoise() const { return fStatus == kLOWNOISE ? true : false; }
44  bool IsNoisy() const { return fStatus == kNOISY ? true : false; }
45  bool IsPresent() const { return fStatus == kDISCONNECTED ? false : true; }
46  bool IsGood() const { return fStatus == kGOOD ? true : false; }
47  chStatus Status() const { return fStatus; }
48 
49  void SetStatus(chStatus status) { fStatus = status; }
50 
51  static chStatus GetStatusFromInt(int status)
52  {
53  switch (status) {
54  case kDISCONNECTED: return kDISCONNECTED; break;
55  case kDEAD: return kDEAD; break;
56  case kLOWNOISE: return kLOWNOISE; break;
57  case kNOISY: return kNOISY; break;
58  case kGOOD: return kGOOD; break;
59  default: return kUNKNOWN;
60  };
61 
62  return kUNKNOWN;
63  }
64 
65  private:
67  }; //end class
68 } //end namespace lariov
69 
70 #endif
71  //end doxygen group
bool IsNoisy() const
Definition: ChannelStatus.h:44
bool IsPresent() const
Definition: ChannelStatus.h:45
chStatus Status() const
Definition: ChannelStatus.h:47
bool IsLowNoise() const
Definition: ChannelStatus.h:43
static chStatus GetStatusFromInt(int status)
Definition: ChannelStatus.h:51
bool IsDead() const
Definition: ChannelStatus.h:42
bool IsGood() const
Definition: ChannelStatus.h:46
Filters for channels, events, etc.
ChannelStatus(unsigned int ch)
Constructor.
Definition: ChannelStatus.h:37
Class def header for a class ChData.
~ChannelStatus()=default
Default destructor.
void SetStatus(chStatus status)
Definition: ChannelStatus.h:49