CMS 3D CMS Logo

EcalSrFlag.h
Go to the documentation of this file.
1 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 8; -*-
2 
3 #ifndef ECALSRFLAG
4 #define ECALSRFLAG
5 
7 
10 class EcalSrFlag {
11 public:
15  static const int SRF_SUPPRESS = 0;
18  static const int SRF_ZS1 = 1;
21  static const int SRF_ZS2 = 2;
24  static const int SRF_FULL = 3;
29  static const int SRF_FORCED_MASK = 0x4;
30 
31 public:
34  virtual ~EcalSrFlag() {}
35 
39  virtual const DetId& id() const = 0;
40 
44  int value() const { return flag_; }
45 
49  void setValue(const int& flag) { flag_ = (unsigned char)flag; }
50 
54  operator int() const { return flag_; }
55 
60  static std::string flagName(const int& flag) { return (flag == (flag & 0x7)) ? srfNames[flag] : "Invalid"; }
61 
65  std::string flagName() const { return flagName(flag_); }
66 
67 protected:
70  unsigned char flag_;
71 
72 private:
75  static const char* const srfNames[];
76 };
77 
78 #endif //ECALSRFLAG not defined
static const int SRF_SUPPRESS
Definition: EcalSrFlag.h:15
unsigned char flag_
Definition: EcalSrFlag.h:70
static const char *const srfNames[]
Definition: EcalSrFlag.h:75
static const int SRF_ZS2
Definition: EcalSrFlag.h:21
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:29
virtual const DetId & id() const =0
static std::string flagName(const int &flag)
Definition: EcalSrFlag.h:60
virtual ~EcalSrFlag()
Definition: EcalSrFlag.h:34
std::string flagName() const
Definition: EcalSrFlag.h:65
void setValue(const int &flag)
Definition: EcalSrFlag.h:49
static const int SRF_FULL
Definition: EcalSrFlag.h:24
int value() const
Definition: EcalSrFlag.h:44
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
Definition: DetId.h:17