Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-10 02:34:56

0001 #ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitTimingCCAlgo_HH
0002 #define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitTimingCCAlgo_HH
0003 
0004 /** \class EcalUncalibRecHitTimingCCAlgo
0005   *  CrossCorrelation algorithm for timing reconstruction
0006   *
0007   *  \author N. Minafra, J. King, C. Rogan
0008   */
0009 
0010 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecAbsAlgo.h"
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 
0013 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
0014 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
0015 #include "DataFormats/EcalDigi/interface/EcalConstants.h"
0016 #include "RecoLocalCalo/EcalRecAlgos/interface/EigenMatrixTypes.h"
0017 
0018 class EcalUncalibRecHitTimingCCAlgo {
0019 public:
0020   EcalUncalibRecHitTimingCCAlgo(const float startTime, const float stopTime);
0021   double computeTimeCC(const EcalDataFrame& dataFrame,
0022                        const std::vector<double>& amplitudes,
0023                        const EcalPedestals::Item* aped,
0024                        const EcalMGPAGainRatio* aGain,
0025                        const FullSampleVector& fullpulse,
0026                        const float targetTimePrecision,
0027                        const bool correctForOOT = true,
0028                        const bool correctForSlew = true) const;
0029 
0030 private:
0031   const float startTime_;
0032   const float stopTime_;
0033 
0034   static constexpr int TIME_WHEN_NOT_CONVERGING = 100;
0035   static constexpr int MAX_NUM_OF_ITERATIONS = 60;
0036   static constexpr int MIN_NUM_OF_ITERATIONS = 2;
0037   static constexpr float GLOBAL_TIME_SHIFT = 100;
0038   static constexpr float GOLDEN_RATIO = 0.61803399;
0039   static constexpr float ONE_MINUS_GOLDEN_RATIO = 1.0 - GOLDEN_RATIO;
0040 
0041   FullSampleVector interpolatePulse(const FullSampleVector& fullpulse, const float t = 0) const;
0042   float computeCC(const std::vector<float>& samples,
0043                   const std::vector<float>& weights,
0044                   const FullSampleVector& sigmalTemplate,
0045                   const float t) const;
0046 };
0047 
0048 #endif