CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DataFormats/EcalDigi/interface/EcalSrFlag.h

Go to the documentation of this file.
00001 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 8; -*-
00002 //$Id: EcalSrFlag.h,v 1.5 2009/10/22 13:06:37 ferriff Exp $
00003 
00004 #ifndef ECALSRFLAG
00005 #define ECALSRFLAG
00006 
00007 #include "DataFormats/DetId/interface/DetId.h"
00008 
00011 class EcalSrFlag {
00012 public:
00016   static const int SRF_SUPPRESS = 0;
00019   static const int SRF_ZS1 = 1;
00022   static const int SRF_ZS2 = 2;
00025   static const int SRF_FULL = 3;
00030   static const int SRF_FORCED_MASK = 0x4;
00031 
00032 public:
00035   virtual ~EcalSrFlag() {};    
00036 
00040   virtual const DetId& id() const=0;
00041 
00045   int value() const{ return flag_;}
00046 
00050   void setValue(const int& flag) { flag_ = (unsigned char) flag; }
00051 
00055   operator int() const{
00056     return flag_;
00057   }
00058 
00063   static std::string flagName(const int& flag){
00064     return (flag==(flag&0x7))?srfNames[flag]:"Invalid";
00065   }
00066 
00070   std::string flagName() const{
00071     return flagName(flag_);
00072   }
00073   
00074 protected:
00077   unsigned char flag_;
00078   
00079 private:
00082   static const char* srfNames[];
00083 };
00084   
00085 #endif //ECALSRFLAG not defined
00086