Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:18:41

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