Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-12 23:42:05

0001 #ifndef HCALHITRECONSTRUCTOR_H
0002 #define HCALHITRECONSTRUCTOR_H 1
0003 
0004 #include <memory>
0005 
0006 #include "FWCore/Framework/interface/stream/EDProducer.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/Utilities/interface/ESGetToken.h"
0009 #include "DataFormats/Common/interface/Handle.h"
0010 
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0015 
0016 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h"
0017 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHFStatusBitFromRecHits.h"
0018 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHFStatusBitFromDigis.h"
0019 #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
0020 
0021 #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
0022 #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h"
0023 #include "CondFormats/HcalObjects/interface/HcalRecoParams.h"
0024 #include "CondFormats/HcalObjects/interface/HcalRecoParam.h"
0025 #include "CondFormats/HcalObjects/interface/HcalFlagHFDigiTimeParams.h"
0026 
0027 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalTimingCorrector.h"
0028 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalADCSaturationFlag.h"
0029 #include "RecoLocalCalo/HcalRecAlgos/interface/HFTimingTrustFlag.h"
0030 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_S9S1algorithm.h"
0031 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_PETalgorithm.h"
0032 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0033 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
0034 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
0035 
0036 /** \class HcalHitReconstructor
0037     
0038     \author J. Temple & E. Yazgan
0039     ** Based on HcalSimpleReconstructor.h by J. Mans
0040     */
0041 
0042 class HcalTopology;
0043 class HcalRecNumberingRecord;
0044 class HcalRecoParamsRcd;
0045 class HcalFlagHFDigiTimeParams;
0046 class HcalFlagHFDigiTimeParamsRcd;
0047 class HcalDbRecord;
0048 class HcalChannelQualityRcd;
0049 class HcalSeverityLevelComputer;
0050 class HcalSeverityLevelComputerRcd;
0051 
0052 class HcalHitReconstructor : public edm::stream::EDProducer<> {
0053 public:
0054   explicit HcalHitReconstructor(const edm::ParameterSet& ps);
0055   ~HcalHitReconstructor() override;
0056 
0057   void beginRun(edm::Run const& r, edm::EventSetup const& es) final;
0058   void endRun(edm::Run const& r, edm::EventSetup const& es) final;
0059   void produce(edm::Event& e, const edm::EventSetup& c) override;
0060 
0061   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0062 
0063 private:
0064   typedef void (HcalSimpleRecAlgo::*SetCorrectionFcn)(std::shared_ptr<AbsOOTPileupCorrection>);
0065 
0066   HcalSimpleRecAlgo reco_;
0067   HcalADCSaturationFlag* saturationFlagSetter_;
0068   HFTimingTrustFlag* HFTimingTrustFlagSetter_;
0069   HcalHFStatusBitFromDigis* hfdigibit_;
0070   HcalHF_S9S1algorithm* hfS9S1_;
0071   HcalHF_S9S1algorithm* hfS8S1_;
0072   HcalHF_PETalgorithm* hfPET_;
0073 
0074   DetId::Detector det_;
0075   int subdet_;
0076   HcalOtherSubdetector subdetOther_;
0077   const edm::InputTag inputLabel_;
0078   edm::EDGetTokenT<HODigiCollection> tok_ho_;
0079   edm::EDGetTokenT<HFDigiCollection> tok_hf_;
0080   edm::EDGetTokenT<HcalCalibDigiCollection> tok_calib_;
0081   //std::vector<std::string> channelStatusToDrop_;
0082   bool correctTiming_;        // turn on/off Ken Rossato's algorithm to fix timing
0083   bool setNoiseFlags_;        // turn on/off basic noise flags
0084   bool setSaturationFlags_;   // turn on/off flag indicating ADC saturation
0085   bool setTimingTrustFlags_;  // turn on/off HF timing uncertainty flag
0086   bool setNegativeFlags_;     // turn on/off HBHE negative noise flags
0087   bool dropZSmarkedPassed_;   // turn on/off dropping of zero suppression marked and passed digis
0088 
0089   int firstAuxTS_;
0090 
0091   // legacy parameters for config-set values compatibility
0092   int firstSample_;
0093   int samplesToAdd_;
0094   bool tsFromDB_;
0095   bool recoParamsFromDB_;
0096   bool digiTimeFromDB_;
0097 
0098   // switch on/off leakage (to pre-sample) correction
0099   bool useLeakCorrection_;
0100 
0101   // Labels related to OOT pileup corrections
0102   std::string dataOOTCorrectionName_;
0103   std::string dataOOTCorrectionCategory_;
0104   std::string mcOOTCorrectionName_;
0105   std::string mcOOTCorrectionCategory_;
0106   SetCorrectionFcn setPileupCorrection_;
0107 
0108   std::unique_ptr<HcalRecoParams> paramTS_;                     // firstSample & sampleToAdd from DB
0109   std::unique_ptr<HcalFlagHFDigiTimeParams> hFDigiTimeParams_;  // HF DigiTime parameters
0110 
0111   std::string corrName_, cat_;
0112 
0113   // ES tokens
0114   edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> htopoToken_;
0115   edm::ESGetToken<HcalRecoParams, HcalRecoParamsRcd> paramsToken_;
0116   edm::ESGetToken<HcalFlagHFDigiTimeParams, HcalFlagHFDigiTimeParamsRcd> digiTimeToken_;
0117   edm::ESGetToken<HcalDbService, HcalDbRecord> conditionsToken_;
0118   edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> qualToken_;
0119   edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> sevToken_;
0120 };
0121 
0122 #endif