Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-25 23:07:21

0001 #ifndef ZDCSIMPLERECALGO_RUN3_H
0002 #define ZDCSIMPLERECALGO_RUN3_H 1
0003 
0004 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
0005 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
0006 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
0007 #include "DataFormats/HcalDigi/interface/ZDCDataFrame.h"
0008 #include "DataFormats/HcalDigi/interface/HcalCalibDataFrame.h"
0009 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0010 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
0011 #include "DataFormats/HcalRecHit/interface/HORecHit.h"
0012 #include "DataFormats/HcalRecHit/interface/ZDCRecHit.h"
0013 #include "DataFormats/HcalRecHit/interface/HcalCalibRecHit.h"
0014 #include "CalibFormats/HcalObjects/interface/HcalCoder.h"
0015 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
0016 #include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
0017 #include "CondFormats/HcalObjects/interface/HcalPedestal.h"
0018 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentCorrection.h"
0019 #include <memory>
0020 
0021 #include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
0022 
0023 /** \class ZdcSimpleRecAlgo_Run3
0024 
0025    This class reconstructs RecHits from Digis for ZDC  by addition
0026    of selected time samples, pedestal subtraction, and gain application. The
0027    time of the hit is reconstructed using a weighted peak bin calculation
0028    supplemented by precise time lookup table. A consumer of this class also
0029    has the option of correcting the reconstructed time for energy-dependent
0030    time slew associated with the QIE.
0031 
0032    A sencon method based on a based on a event by event substraction is also
0033    implelented. signal = (S4 + S5 - 2*(S1+S2+S3 + S7+S8+S9+S10))*(ft-Gev constant)
0034    where SN is the signal in the nth time slice
0035     
0036    \author E. Garcia CSU &  J. Gomez UMD
0037 */
0038 
0039 class ZdcSimpleRecAlgo_Run3 {
0040 public:
0041   /** Simple constructor for PMT-based detectors */
0042   ZdcSimpleRecAlgo_Run3(int recoMethod);
0043   void initCorrectionMethod(const int method, const int ZdcSection);
0044   void initTemplateFit(const std::vector<unsigned int>& bxTs,
0045                        const std::vector<double>& chargeRatios,
0046                        const int nTs,
0047                        const int ZdcSection);
0048   void initRatioSubtraction(const float ratio, const float frac, const int ZdcSection);
0049 
0050   ZDCRecHit reco0(const QIE10DataFrame& digi,
0051                   const HcalCoder& coder,
0052                   const HcalCalibrations& calibs,
0053                   const HcalPedestal& effPeds,
0054                   const std::vector<unsigned int>& myNoiseTS,
0055                   const std::vector<unsigned int>& mySignalTS) const;
0056   // reco method currently used to match L1 Trigger LUT energy formula
0057   ZDCRecHit reconstruct(const QIE10DataFrame& digi,
0058                         const std::vector<unsigned int>& myNoiseTS,
0059                         const std::vector<unsigned int>& mySignalTS,
0060                         const HcalCoder& coder,
0061                         const HcalCalibrations& calibs,
0062                         const HcalPedestal& effPeds) const;
0063 
0064 private:
0065   int recoMethod_;
0066   int nTs_;
0067   std::map<int, std::vector<double>> templateFitValues_;  // Values[ZdcSection][Ts]
0068   std::map<int, bool> templateFitValid_;                  // Values[ZdcSection]
0069   std::map<int, float> ootpuRatio_;                       // Values[ZdcSection]
0070   std::map<int, float> ootpuFrac_;                        // Values[ZdcSection]
0071   std::map<int, int> correctionMethod_;                   // Values[ZdcSection]
0072 };
0073 
0074 #endif