Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:25

0001 #ifndef HCALSIMPLERECALGO_H
0002 #define HCALSIMPLERECALGO_H 1
0003 
0004 #include <memory>
0005 
0006 #include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
0007 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
0008 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
0009 #include "DataFormats/HcalDigi/interface/ZDCDataFrame.h"
0010 #include "DataFormats/HcalDigi/interface/HcalCalibDataFrame.h"
0011 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
0012 #include "DataFormats/HcalRecHit/interface/HORecHit.h"
0013 #include "DataFormats/HcalRecHit/interface/ZDCRecHit.h"
0014 #include "DataFormats/HcalRecHit/interface/HcalCalibRecHit.h"
0015 #include "CalibFormats/HcalObjects/interface/HcalCoder.h"
0016 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
0017 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h"
0018 #include "CondFormats/HcalObjects/interface/AbsOOTPileupCorrection.h"
0019 
0020 #include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h"
0021 
0022 /** \class HcalSimpleRecAlgo
0023 
0024    This class reconstructs RecHits from Digis for HBHE, HF, and HO by addition
0025    of selected time samples, pedestal subtraction, and gain application. The
0026    time of the hit is reconstructed using a weighted peak bin calculation
0027    supplemented by precise time lookup table. A consumer of this class also
0028    has the option of correcting the reconstructed time for energy-dependent
0029    time slew associated with the QIE.
0030     
0031    \author J. Mans - Minnesota
0032 */
0033 
0034 class HcalSimpleRecAlgo {
0035 public:
0036   /** Full featured constructor for HB/HE and HO (HPD-based detectors) */
0037   HcalSimpleRecAlgo(bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs, edm::ConsumesCollector iC);
0038 
0039   void beginRun(edm::EventSetup const& es);
0040   void endRun();
0041 
0042   void initPulseCorr(int toadd);
0043 
0044   // set RecoParams channel-by-channel.
0045   void setRecoParams(
0046       bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS);
0047 
0048   // usage of leak correction
0049   void setLeakCorrection();
0050 
0051   // set OOT pileup corrections
0052   void setHFPileupCorrection(std::shared_ptr<AbsOOTPileupCorrection> corr);
0053   void setHOPileupCorrection(std::shared_ptr<AbsOOTPileupCorrection> corr);
0054 
0055   // Set bunch crossing information.
0056   // This object will not manage the pointer.
0057   void setBXInfo(const BunchXParameter* info, unsigned lenInfo);
0058 
0059   HFRecHit reconstruct(
0060       const HFDataFrame& digi, int first, int toadd, const HcalCoder& coder, const HcalCalibrations& calibs) const;
0061   HFRecHit reconstructQIE10(
0062       const QIE10DataFrame& digi, int first, int toadd, const HcalCoder& coder, const HcalCalibrations& calibs) const;
0063 
0064   HORecHit reconstruct(
0065       const HODataFrame& digi, int first, int toadd, const HcalCoder& coder, const HcalCalibrations& calibs) const;
0066   HcalCalibRecHit reconstruct(const HcalCalibDataFrame& digi,
0067                               int first,
0068                               int toadd,
0069                               const HcalCoder& coder,
0070                               const HcalCalibrations& calibs) const;
0071 
0072 private:
0073   bool correctForTimeslew_;
0074   bool correctForPulse_;
0075   float phaseNS_;
0076   const edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> delayToken_;
0077   std::unique_ptr<HcalPulseContainmentManager> pulseCorr_;
0078   int runnum_;  // data run numer
0079   bool setLeakCorrection_;
0080   int pileupCleaningID_;
0081   const BunchXParameter* bunchCrossingInfo_;
0082   unsigned lenBunchCrossingInfo_;
0083   std::shared_ptr<AbsOOTPileupCorrection> hbhePileupCorr_;
0084   std::shared_ptr<AbsOOTPileupCorrection> hfPileupCorr_;
0085   std::shared_ptr<AbsOOTPileupCorrection> hoPileupCorr_;
0086 
0087   HcalPulseShapes theHcalPulseShapes_;
0088 
0089   int puCorrMethod_;
0090 
0091   const HcalTimeSlew* hcalTimeSlew_delay_;
0092 };
0093 
0094 #endif