Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:47

0001 // -*- C++ -*-
0002 //
0003 // Package:    HcalRecAlgos
0004 // Class:      HcalSeverityLevelComputer
0005 //
0006 /*
0007  Description: delivers the severity level for HCAL cells
0008 */
0009 //
0010 // Original Author:  Radek Ofierzynski
0011 //
0012 //
0013 
0014 #ifndef HCALSEVERITYLEVELCOMPUTER_H
0015 #define HCALSEVERITYLEVELCOMPUTER_H
0016 
0017 #include "FWCore/Framework/interface/EventSetup.h"
0018 
0019 #include "DataFormats/DetId/interface/DetId.h"
0020 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 #include "FWCore/Framework/interface/ModuleFactory.h"
0023 
0024 class HcalSeverityLevelComputer {
0025 public:
0026   HcalSeverityLevelComputer(const edm::ParameterSet&);
0027   ~HcalSeverityLevelComputer();
0028 
0029   // gives back severity level based on evaluation of the RecHit flag and cell's channel status
0030   int getSeverityLevel(const DetId& myid, const uint32_t& myflag, const uint32_t& mystatus) const;
0031 
0032   // gives back boolean whether the RecHit is a recovered one, based on RecHit flag
0033   bool recoveredRecHit(const DetId& myid, const uint32_t& myflag) const;
0034 
0035   // gives back whether channel should be / is dropped, based on channel status
0036   bool dropChannel(const uint32_t& mystatus) const;
0037 
0038 private:
0039   class HcalSeverityDefinition {
0040   public:
0041     int sevLevel;
0042     uint32_t chStatusMask;
0043     uint32_t HBHEFlagMask, HOFlagMask, HFFlagMask, ZDCFlagMask, CalibFlagMask;
0044     HcalSeverityDefinition()
0045         : sevLevel(0),
0046           chStatusMask(0),
0047           HBHEFlagMask(0),
0048           HOFlagMask(0),
0049           HFFlagMask(0),
0050           ZDCFlagMask(0),
0051           CalibFlagMask(0) {}
0052   };
0053 
0054   std::vector<HcalSeverityDefinition> SevDef;
0055   HcalSeverityDefinition* RecoveredRecHit_;
0056   HcalSeverityDefinition* DropChannel_;
0057 
0058   bool getChStBit(HcalSeverityDefinition& mydef, const std::string& mybit);
0059   bool getRecHitFlag(HcalSeverityDefinition& mydef, const std::string& mybit, int phase_);
0060   void setBit(const unsigned bitnumber, uint32_t& where);
0061   void setAllRHMasks(const unsigned bitnumber, HcalSeverityDefinition& mydef);
0062 
0063   friend std::ostream& operator<<(std::ostream& s, const HcalSeverityLevelComputer::HcalSeverityDefinition& def);
0064 };
0065 
0066 #endif