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