diff --git a/TopQuarkAnalysis/TopPairBSM/src/BoostedJetMerger.cc b/TopQuarkAnalysis/TopPairBSM/src/BoostedJetMerger.cc deleted file mode 100644 index 157789a0ea7eb..0000000000000 --- a/TopQuarkAnalysis/TopPairBSM/src/BoostedJetMerger.cc +++ /dev/null @@ -1,159 +0,0 @@ -// -*- C++ -*- -// -// Package: BoostedJetMerger -// Class: BoostedJetMerger -// -// \class BoostedJetMerger BoostedJetMerger.cc TopQuarkAnalysis/TopPairBSM/plugins/BoostedJetMerger.cc -// Description: Class to "deswizzle" information from various pat::Jet collections. -// -// Original Author: "Salvatore Rappoccio" -// Created: Thu May 1 11:37:48 CDT 2008 -// $Id: BoostedJetMerger.cc,v 1.1 2013/03/07 20:13:55 srappocc Exp $ -// -// - - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/PatCandidates/interface/Jet.h" - -// -// class decleration -// - - -/// Predicate to use for find_if. -/// This checks whether a given edm::Ptr -/// (as you would get from the reco::BasicJet daughters) -/// to see if it matches the original object ref of -/// another pat::Jet (which is to find the corrected / btagged -/// pat::Jet that corresponds to the subjet in question). -struct FindCorrectedSubjet { - // Input the daughter you're interested in checking - FindCorrectedSubjet( edm::Ptr const & da ) : - da_(da) {} - - // Predicate operator to compare an input pat::Jet to. - bool operator()( pat::Jet const & subjet ) const { - edm::Ptr subjetOrigRef = subjet.originalObjectRef(); - if ( da_ == subjetOrigRef ) { - return true; - } - else return false; - } - - edm::Ptr da_; -}; - -class BoostedJetMerger : public edm::EDProducer { - public: - explicit BoostedJetMerger(const edm::ParameterSet&); - ~BoostedJetMerger(); - - private: - virtual void beginJob(const edm::EventSetup&) ; - virtual void produce(edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // ----------member data --------------------------- - - // data labels - edm::InputTag jetLabel_; - edm::InputTag subjetLabel_; -}; - - - -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - -// -// constructors and destructor -// -BoostedJetMerger::BoostedJetMerger(const edm::ParameterSet& iConfig) : - jetLabel_(iConfig.getParameter("jetSrc")), - subjetLabel_(iConfig.getParameter("subjetSrc")) -{ - //register products - produces > (); -} - - -BoostedJetMerger::~BoostedJetMerger() -{ -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -BoostedJetMerger::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - - std::auto_ptr< std::vector > outputs( new std::vector ); - - edm::Handle< edm::View > jetHandle; - edm::Handle< edm::View > subjetHandle; - - iEvent.getByLabel( jetLabel_, jetHandle ); - iEvent.getByLabel( subjetLabel_, subjetHandle ); - - for ( edm::View::const_iterator ijetBegin = jetHandle->begin(), - ijetEnd = jetHandle->end(), ijet = ijetBegin; ijet != ijetEnd; ++ijet ) { - - outputs->push_back( *ijet ); - std::vector< edm::Ptr > nextSubjets; - - for ( unsigned int isubjet = 0; isubjet < ijet->numberOfDaughters(); ++isubjet ) { - edm::Ptr const & subjet = ijet->daughterPtr(isubjet); - edm::View::const_iterator ifound = find_if( subjetHandle->begin(), - subjetHandle->end(), - FindCorrectedSubjet(subjet) ); - if ( ifound != subjetHandle->end() ) { - nextSubjets.push_back( subjetHandle->ptrAt( ifound - subjetHandle->begin() ) ); - - } - } - outputs->back().clearDaughters(); - for ( std::vector< edm::Ptr >::const_iterator nextSubjet = nextSubjets.begin(), - nextSubjetEnd = nextSubjets.end(); nextSubjet != nextSubjetEnd; ++nextSubjet ) { - outputs->back().addDaughter( *nextSubjet ); - } - - - } - - iEvent.put(outputs); - -} - -// ------------ method called once each job just before starting event loop ------------ -void -BoostedJetMerger::beginJob(const edm::EventSetup&) -{ -} - -// ------------ method called once each job just after ending the event loop ------------ -void -BoostedJetMerger::endJob() { -} - -//define this as a plug-in -DEFINE_FWK_MODULE(BoostedJetMerger);