Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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