CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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{
55  return flag_;
56  }
57 
62  static std::string flagName(const int& flag){
63  return (flag==(flag&0x7))?srfNames[flag]:"Invalid";
64  }
65 
70  return flagName(flag_);
71  }
72 
73 protected:
76  unsigned char flag_;
77 
78 private:
81  static const char* const srfNames[];
82 };
83 
84 #endif //ECALSRFLAG not defined
85 
static const int SRF_SUPPRESS
Definition: EcalSrFlag.h:15
int value() const
Definition: EcalSrFlag.h:44
unsigned char flag_
Definition: EcalSrFlag.h:76
static const char *const srfNames[]
Definition: EcalSrFlag.h:81
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:62
virtual ~EcalSrFlag()
Definition: EcalSrFlag.h:34
void setValue(const int &flag)
Definition: EcalSrFlag.h:49
static const int SRF_FULL
Definition: EcalSrFlag.h:24
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
Definition: DetId.h:18
std::string flagName() const
Definition: EcalSrFlag.h:69