Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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) const;
0028 
0029 private:
0030   const float startTime_;
0031   const float stopTime_;
0032 
0033   static constexpr int TIME_WHEN_NOT_CONVERGING = 100;
0034   static constexpr int MAX_NUM_OF_ITERATIONS = 60;
0035   static constexpr int MIN_NUM_OF_ITERATIONS = 2;
0036   static constexpr float GLOBAL_TIME_SHIFT = 100;
0037   static constexpr float GOLDEN_RATIO = 0.61803399;
0038   static constexpr float ONE_MINUS_GOLDEN_RATIO = 1.0 - GOLDEN_RATIO;
0039 
0040   FullSampleVector interpolatePulse(const FullSampleVector& fullpulse, const float t = 0) const;
0041   float computeCC(const std::vector<float>& samples, const FullSampleVector& sigmalTemplate, const float t) const;
0042 };
0043 
0044 #endif