Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    BoostedJetMerger
0004 // Class:      BoostedJetMerger
0005 //
0006 // \class BoostedJetMerger BoostedJetMerger.h PhysicsTools/PatUtils/interface/BoostedJetMerger.h
0007 // Description: Class to "deswizzle" information from various pat::Jet collections.
0008 //
0009 // Original Author:  "Salvatore Rappoccio"
0010 //         Created:  Thu May  1 11:37:48 CDT 2008
0011 // $Id: BoostedJetMerger.cc,v 1.1 2013/03/07 20:13:55 srappocc Exp $
0012 //
0013 //
0014 
0015 // system include files
0016 #include <memory>
0017 
0018 // user include files
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 #include "FWCore/Framework/interface/stream/EDProducer.h"
0021 
0022 #include "FWCore/Framework/interface/Event.h"
0023 #include "FWCore/Framework/interface/MakerMacros.h"
0024 
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 #include "DataFormats/PatCandidates/interface/Jet.h"
0027 
0028 //
0029 // class decleration
0030 //
0031 
0032 /// Predicate to use for find_if.
0033 /// This checks whether a given edm::Ptr<reco::Candidate>
0034 /// (as you would get from the reco::BasicJet daughters)
0035 /// to see if it matches the original object ref of
0036 /// another pat::Jet (which is to find the corrected / btagged
0037 /// pat::Jet that corresponds to the subjet in question).
0038 struct FindCorrectedSubjet {
0039   // Input the daughter you're interested in checking
0040   FindCorrectedSubjet(edm::Ptr<reco::Candidate> const& da) : da_(da) {}
0041 
0042   // Predicate operator to compare an input pat::Jet to.
0043   bool operator()(pat::Jet const& subjet) const {
0044     const edm::Ptr<reco::Candidate>& subjetOrigRef = subjet.originalObjectRef();
0045     if (da_ == subjetOrigRef) {
0046       return true;
0047     } else
0048       return false;
0049   }
0050 
0051   edm::Ptr<reco::Candidate> da_;
0052 };
0053 
0054 class BoostedJetMerger : public edm::stream::EDProducer<> {
0055 public:
0056   explicit BoostedJetMerger(const edm::ParameterSet&);
0057   ~BoostedJetMerger() override;
0058 
0059 private:
0060   void produce(edm::Event&, const edm::EventSetup&) override;
0061 
0062   // ----------member data ---------------------------
0063 
0064   // data labels
0065   edm::EDGetTokenT<edm::View<pat::Jet> > jetToken_;
0066   edm::EDGetTokenT<edm::View<pat::Jet> > subjetToken_;
0067 };