CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h

Go to the documentation of this file.
00001 #ifndef GUARD_HCALCALOFLAGLABELS_H
00002 #define GUARD_HCALCALOFLAGLABELS_H
00003 
00004 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00005 #include <string>
00006 
00007 // Create alias names for all status bits
00008 // These aliases are valid for only the _current release_
00009 // Use the HcalCaloFlagTool (below) for full interpretation
00010 namespace HcalCaloFlagLabels
00011 {
00012   //subdetector-specific bits defined here (bits 0-15)
00013   enum HBHEStatusFlag{HBHEHpdHitMultiplicity=0,
00014                       HBHEPulseShape=1,
00015                       HSCP_R1R2=2,
00016                       HSCP_FracLeader=3,
00017                       HSCP_OuterEnergy=4,
00018                       HSCP_ExpFit=5,
00019                       HBHETimingTrustBits=6, // 2-bit counter; not yet in use
00020                       HBHETimingShapedCutsBits=8, // 3-bit counter
00021                       HBHEIsolatedNoise=11,
00022                       HBHEFlatNoise=12,
00023                       HBHESpikeNoise=13,
00024                       HBHETriangleNoise=14
00025   };
00026 
00027   enum HFTimingTrustFlag{HFTimingTrustBits=6};
00028 
00029   enum HOStatusFlag{HOBit=0};
00030 
00031   enum HFStatusFlag{HFLongShort=0,
00032                     HFDigiTime=1,
00033                     HFInTimeWindow=2, // requires hit be within certain time window
00034                     HFS8S1Ratio=3,
00035                     HFPET=4
00036   };
00037 
00038 
00039   enum ZDCStatusFlag{ZDCBit=0};
00040 
00041   enum CalibrationFlag{CalibrationBit=0};
00042 
00043   // Bit definitions that apply to all subdetectors (bits 16-31)
00044   enum CommonFlag {TimingSubtractedBit=16, // latency shift correction, recovered
00045                    TimingAddedBit=17,      // latency shift correction, recovered
00046                    TimingErrorBit=18,      // latency shift error, unrecovered
00047                    ADCSaturationBit=19,
00048                    Fraction2TS=20,
00049                    // The following bits are all user-defined; reverse-order them so that UserDefinedBit0 will be the last removed
00050                    UserDefinedBit2 = 29,
00051                    UserDefinedBit1 = 30,
00052                    UserDefinedBit0 = 31
00053 }; 
00054   
00055 }
00056 
00060 class HcalCaloFlagTool {
00061 public:
00062   HcalCaloFlagTool(const std::string& releaseName);
00063   std::string getFieldName(HcalSubdetector sd, int bit) const;
00064   int getFieldWidth(HcalSubdetector sd, int bit) const;
00065   int getFieldStart(HcalSubdetector sd, const std::string& field) const;
00066   int getFieldWidth(HcalSubdetector sd, const std::string& field) const;
00067   bool hasField(HcalSubdetector sd, const std::string& field) const;
00068   bool hasField(HcalSubdetector sd, int bit) const;
00069 private:
00070   std::string releaseName_;
00071   bool standardFormat_;
00072   int major_, minor_, patch_, subpatch_;
00073 };
00074 
00075 #endif