00001 #include "PhysicsTools/PatUtils/interface/SmearedJetProducerT.h" 00002 00003 #include "DataFormats/JetReco/interface/CaloJet.h" 00004 #include "DataFormats/JetReco/interface/PFJet.h" 00005 00006 #include "JetMETCorrections/Type1MET/interface/JetCorrExtractorT.h" 00007 00008 #include "RecoMET/METAlgorithms/interface/SignAlgoResolutions.h" 00009 #include "RecoMET/METAlgorithms/interface/SigInputObj.h" 00010 #include "RecoMET/METAlgorithms/interface/significanceAlgo.h" 00011 00012 namespace SmearedJetProducer_namespace 00013 { 00014 template <> 00015 class JetResolutionExtractorT<reco::PFJet> 00016 { 00017 public: 00018 00019 JetResolutionExtractorT(const edm::ParameterSet& cfg) 00020 : jetResolutions_(cfg) 00021 {} 00022 ~JetResolutionExtractorT() {} 00023 00024 double operator()(const reco::PFJet& jet) const 00025 { 00026 metsig::SigInputObj pfJetResolution = jetResolutions_.evalPFJet(&jet); 00027 if ( pfJetResolution.get_energy() > 0. ) { 00028 return jet.energy()*(pfJetResolution.get_sigma_e()/pfJetResolution.get_energy()); 00029 } else { 00030 return 0.; 00031 } 00032 } 00033 00034 metsig::SignAlgoResolutions jetResolutions_; 00035 }; 00036 } 00037 00038 typedef SmearedJetProducerT<reco::CaloJet, JetCorrExtractorT<reco::CaloJet> > SmearedCaloJetProducer; 00039 typedef SmearedJetProducerT<reco::PFJet, JetCorrExtractorT<reco::PFJet> > SmearedPFJetProducer; 00040 00041 #include "FWCore/Framework/interface/MakerMacros.h" 00042 00043 DEFINE_FWK_MODULE(SmearedCaloJetProducer); 00044 DEFINE_FWK_MODULE(SmearedPFJetProducer);