CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CondFormats/EcalObjects/interface/EcalChannelStatusCode.h

Go to the documentation of this file.
00001 #ifndef CondFormats_EcalObjects_EcalChannelStatusCode_H
00002 #define CondFormats_EcalObjects_EcalChannelStatusCode_H
00003 
00010 #include <iostream>
00011 #include <boost/cstdint.hpp>
00012 
00018 class EcalChannelStatusCode {
00019 
00020   public:
00021     EcalChannelStatusCode();
00022     EcalChannelStatusCode(const EcalChannelStatusCode & codeStatus);
00023     EcalChannelStatusCode(const uint16_t& encodedStatus) : status_(encodedStatus) {};
00024     ~EcalChannelStatusCode();
00025 
00026     //get Methods to be defined according to the final definition
00027 
00028     void print(std::ostream& s) const { s << "status is: " << status_; }
00029 
00030     EcalChannelStatusCode& operator=(const EcalChannelStatusCode& rhs);
00031     uint16_t getStatusCode() const { return status_; }
00032 
00034     uint16_t getDecodedStatusCode() const { return status_&chStatusMask; }
00035 
00036     bool isHVon() const {return status_& HVbitMask;}
00037     bool isLVon() const {return status_& LVbitMask;}
00038     
00039     static const int chStatusMask      = 0x1F;
00040     static const int HVbitMask         = 0x1<<5;
00041     static const int LVbitMask         = 0x1<<6;
00042 
00043   private:
00044     /* bits 1-5 store a status code:
00045         0       channel ok 
00046         1       DAC settings problem, pedestal not in the design range  
00047         2       channel with no laser, ok elsewhere    
00048         3       noisy   
00049         4       very noisy      
00050         5-7     reserved for more categories of noisy channels  
00051         8       channel at fixed gain 6 (or 6 and 1)
00052         9       channel at fixed gain 1         
00053         10      channel at fixed gain 0 (dead of type this)     
00054         11      non responding isolated channel (dead of type other) 
00055         12      channel and one or more neigbors not responding 
00056                 (e.g.: in a dead VFE 5x1 channel)       
00057         13      channel in TT with no data link, TP data ok    
00058         14      channel in TT with no data link and no TP data  
00059 
00060         bit 6 : HV on/off
00061         bit 7 : LV on/off
00062         bit 8 : DAQ in/out       
00063         bit 9 : TP readout on/off        
00064         bit 10: Trigger in/out   
00065         bit 11: Temperature ok/not ok    
00066         bit 12: channel next to a dead channel 
00067      */
00068     uint16_t status_;
00069 };
00070 #endif