CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    HcalRecAlgos
00004 // Class:      HcalSeverityLevelComputer
00005 // 
00006 /*
00007  Description: delivers the severity level for HCAL cells
00008 */
00009 //
00010 // Original Author:  Radek Ofierzynski
00011 //
00012 //
00013 
00014 #ifndef HCALSEVERITYLEVELCOMPUTER_H
00015 #define HCALSEVERITYLEVELCOMPUTER_H
00016 
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 
00019 #include "DataFormats/DetId/interface/DetId.h"
00020 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
00021 #include "FWCore/Framework/interface/MakerMacros.h"
00022 #include "FWCore/Framework/interface/ModuleFactory.h"
00023 
00024 
00025 class HcalSeverityLevelComputer
00026 {
00027 
00028  public:
00029   HcalSeverityLevelComputer( const edm::ParameterSet& );
00030   ~HcalSeverityLevelComputer();
00031   
00032   // gives back severity level based on evaluation of the RecHit flag and cell's channel status
00033   int getSeverityLevel(const DetId& myid, const uint32_t& myflag, const uint32_t& mystatus) const;
00034 
00035   // gives back boolean whether the RecHit is a recovered one, based on RecHit flag
00036   bool recoveredRecHit(const DetId& myid, const uint32_t& myflag) const;
00037 
00038   // gives back whether channel should be / is dropped, based on channel status
00039   bool dropChannel(const uint32_t& mystatus) const;
00040   
00041  private:
00042   class HcalSeverityDefinition
00043   {
00044   public:
00045     int sevLevel;
00046     uint32_t chStatusMask;
00047     uint32_t HBHEFlagMask, HOFlagMask, HFFlagMask, ZDCFlagMask, CalibFlagMask;
00048   HcalSeverityDefinition():
00049     sevLevel(0), chStatusMask(0),
00050       HBHEFlagMask(0), HOFlagMask(0), HFFlagMask(0), ZDCFlagMask(0), CalibFlagMask(0)
00051       {}
00052     
00053   };
00054 
00055   std::vector<HcalSeverityDefinition> SevDef;
00056   HcalSeverityDefinition* RecoveredRecHit_;
00057   HcalSeverityDefinition* DropChannel_;
00058  
00059   bool getChStBit(HcalSeverityDefinition& mydef, const std::string& mybit);
00060   bool getRecHitFlag(HcalSeverityDefinition& mydef, const std::string& mybit);
00061   void setBit (const unsigned bitnumber, uint32_t& where);
00062   void setAllRHMasks(const unsigned bitnumber, HcalSeverityDefinition& mydef);
00063 
00064   friend std::ostream& operator<<(std::ostream& s, const HcalSeverityLevelComputer::HcalSeverityDefinition& def);
00065 
00066 
00067 };
00068 
00069 
00070 #endif