Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-16 00:05:54

0001 #include "RecoTauTag/HLTProducers/interface/PFJetToCaloProducer.h"
0002 #include "DataFormats/VertexReco/interface/Vertex.h"
0003 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0004 #include "Math/GenVector/VectorUtil.h"
0005 //
0006 // class decleration
0007 //
0008 
0009 PFJetToCaloProducer::PFJetToCaloProducer(const edm::ParameterSet& iConfig) {
0010   tauSrc_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("Source"));
0011   produces<reco::CaloJetCollection>();
0012 }
0013 
0014 PFJetToCaloProducer::~PFJetToCaloProducer() {}
0015 
0016 void PFJetToCaloProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iES) const {
0017   using namespace reco;
0018   using namespace edm;
0019   using namespace std;
0020 
0021   std::unique_ptr<reco::CaloJetCollection> selectedTaus(new CaloJetCollection);
0022 
0023   edm::Handle<PFJetCollection> tauJets;
0024   iEvent.getByToken(tauSrc_, tauJets);
0025 
0026   CaloJet::Specific specific;
0027   for (PFJetCollection::const_iterator i = tauJets->begin(); i != tauJets->end(); ++i) {
0028     CaloJet jet(i->p4(), i->vertex(), specific);
0029     jet.setPdgId(15);
0030     selectedTaus->push_back(jet);
0031   }
0032 
0033   iEvent.put(std::move(selectedTaus));
0034 }
0035 
0036 #include "FWCore/Framework/interface/MakerMacros.h"
0037 DEFINE_FWK_MODULE(PFJetToCaloProducer);