Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:05

0001 #include "JetMETCorrections/Type1MET/interface/JetCleanerForType1METT.h"
0002 
0003 #include "DataFormats/PatCandidates/interface/Jet.h"
0004 
0005 #include "PhysicsTools/PatUtils/interface/PATJetCorrExtractor.h"
0006 
0007 namespace JetCleanerForType1MET_namespace {
0008   template <>
0009   class InputTypeCheckerT<pat::Jet, PATJetCorrExtractor> {
0010   public:
0011     void operator()(const pat::Jet& jet) const {
0012       // check that pat::Jet is of PF-type
0013       if (!jet.isPFJet())
0014         throw cms::Exception("InvalidInput") << "Input pat::Jet is not of PF-type !!\n";
0015     }
0016     bool isPatJet(const pat::Jet& jet) const { return true; }
0017   };
0018 
0019   template <>
0020   class RawJetExtractorT<pat::Jet> {
0021   public:
0022     RawJetExtractorT() {}
0023     reco::Candidate::LorentzVector operator()(const pat::Jet& jet) const {
0024       if (jet.jecSetsAvailable())
0025         return jet.correctedP4("Uncorrected");
0026       else
0027         return jet.p4();
0028     }
0029   };
0030 }  // namespace JetCleanerForType1MET_namespace
0031 
0032 typedef JetCleanerForType1METT<pat::Jet, PATJetCorrExtractor> PATJetCleanerForType1MET;
0033 
0034 #include "FWCore/Framework/interface/MakerMacros.h"
0035 
0036 DEFINE_FWK_MODULE(PATJetCleanerForType1MET);