Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PAT_RAWJETEXTRACTORT_H
0002 #define PAT_RAWJETEXTRACTORT_H
0003 
0004 #include "DataFormats/PatCandidates/interface/Jet.h"
0005 
0006 namespace pat {
0007 
0008   template <typename T>
0009   class RawJetExtractorT {
0010   public:
0011     RawJetExtractorT() {}
0012     reco::Candidate::LorentzVector operator()(const T& jet) const { return jet.p4(); }
0013   };
0014 
0015   template <>
0016   class RawJetExtractorT<pat::Jet> {
0017   public:
0018     reco::Candidate::LorentzVector operator()(const pat::Jet& jet) const {
0019       if (jet.jecSetsAvailable())
0020         return jet.correctedP4("Uncorrected");
0021       else
0022         return jet.p4();
0023     }
0024   };
0025 
0026 }  // namespace pat
0027 #endif