00001 #ifndef RecoLocalCalo_EcalRecProducers_EcalUncalibRecHitRecWorkerGlobal_hh 00002 #define RecoLocalCalo_EcalRecProducers_EcalUncalibRecHitRecWorkerGlobal_hh 00003 00014 #include "RecoLocalCalo/EcalRecProducers/interface/EcalUncalibRecHitWorkerBaseClass.h" 00015 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecWeightsAlgo.h" 00016 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecChi2Algo.h" 00017 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRatioMethodAlgo.h" 00018 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitLeadingEdgeAlgo.h" 00019 #include "FWCore/Framework/interface/ESHandle.h" 00020 #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" 00021 #include "CondFormats/EcalObjects/interface/EcalPedestals.h" 00022 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h" 00023 #include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" 00024 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h" 00025 #include "SimCalorimetry/EcalSimAlgos/interface/EBShape.h" 00026 #include "SimCalorimetry/EcalSimAlgos/interface/EEShape.h" 00027 00028 00029 namespace edm { 00030 class Event; 00031 class EventSetup; 00032 class ParameterSet; 00033 } 00034 00035 class EcalUncalibRecHitWorkerGlobal : public EcalUncalibRecHitWorkerBaseClass { 00036 00037 public: 00038 EcalUncalibRecHitWorkerGlobal(const edm::ParameterSet&); 00039 virtual ~EcalUncalibRecHitWorkerGlobal() {}; 00040 00041 void set(const edm::EventSetup& es); 00042 bool run(const edm::Event& evt, const EcalDigiCollection::const_iterator & digi, EcalUncalibratedRecHitCollection & result); 00043 00044 protected: 00045 00046 double pedVec[3]; 00047 double pedRMSVec[3]; 00048 double gainRatios[3]; 00049 00050 edm::ESHandle<EcalPedestals> peds; 00051 edm::ESHandle<EcalGainRatios> gains; 00052 00053 template < class C > int isSaturated(const C & digi); 00054 00055 double timeCorrectionEB(float ampliEB); 00056 double timeCorrectionEE(float ampliEE); 00057 00058 // weights method 00059 edm::ESHandle<EcalWeightXtalGroups> grps; 00060 edm::ESHandle<EcalTBWeights> wgts; 00061 const EcalWeightSet::EcalWeightMatrix* weights[2]; 00062 const EcalWeightSet::EcalChi2WeightMatrix* chi2mat[2]; 00063 EcalUncalibRecHitRecWeightsAlgo<EBDataFrame> weightsMethod_barrel_; 00064 EcalUncalibRecHitRecWeightsAlgo<EEDataFrame> weightsMethod_endcap_; 00065 const EEShape testbeamEEShape; // used in the chi2 00066 const EBShape testbeamEBShape; // can be replaced by simple shape arrays of float in the future 00067 00068 // ratio method 00069 std::vector<double> EBtimeFitParameters_; 00070 std::vector<double> EEtimeFitParameters_; 00071 std::vector<double> EBamplitudeFitParameters_; 00072 std::vector<double> EEamplitudeFitParameters_; 00073 std::pair<double,double> EBtimeFitLimits_; 00074 std::pair<double,double> EEtimeFitLimits_; 00075 bool doEBtimeCorrection_; 00076 bool doEEtimeCorrection_; 00077 std::vector<double> EBtimeCorrAmplitudeBins_; 00078 std::vector<double> EBtimeCorrShiftBins_; 00079 std::vector<double> EEtimeCorrAmplitudeBins_; 00080 std::vector<double> EEtimeCorrShiftBins_; 00081 EcalUncalibRecHitRatioMethodAlgo<EBDataFrame> ratioMethod_barrel_; 00082 EcalUncalibRecHitRatioMethodAlgo<EEDataFrame> ratioMethod_endcap_; 00083 00084 double EBtimeConstantTerm_; 00085 double EBtimeNconst_; 00086 double EEtimeConstantTerm_; 00087 double EEtimeNconst_; 00088 double outOfTimeThreshG12pEB_; 00089 double outOfTimeThreshG12mEB_; 00090 double outOfTimeThreshG61pEB_; 00091 double outOfTimeThreshG61mEB_; 00092 double outOfTimeThreshG12pEE_; 00093 double outOfTimeThreshG12mEE_; 00094 double outOfTimeThreshG61pEE_; 00095 double outOfTimeThreshG61mEE_; 00096 double amplitudeThreshEB_; 00097 double amplitudeThreshEE_; 00098 double ebSpikeThresh_; 00099 00100 // leading edge method 00101 edm::ESHandle<EcalTimeCalibConstants> itime; 00102 std::vector<double> ebPulseShape_; 00103 std::vector<double> eePulseShape_; 00104 EcalUncalibRecHitLeadingEdgeAlgo<EBDataFrame> leadingEdgeMethod_barrel_; 00105 EcalUncalibRecHitLeadingEdgeAlgo<EEDataFrame> leadingEdgeMethod_endcap_; 00106 00107 // chi2 method 00108 bool kPoorRecoFlagEB_; 00109 bool kPoorRecoFlagEE_; 00110 double chi2ThreshEB_; 00111 double chi2ThreshEE_; 00112 std::vector<double> EBchi2Parameters_; 00113 std::vector<double> EEchi2Parameters_; 00114 }; 00115 00116 #endif