Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "RecoTauTag/HLTProducers/interface/PFTauToJetProducer.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 PFTauToJetProducer::PFTauToJetProducer(const edm::ParameterSet& iConfig) {
0010   tauSrc_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>("Source"));
0011   produces<reco::CaloJetCollection>();
0012 }
0013 
0014 PFTauToJetProducer::~PFTauToJetProducer() {}
0015 
0016 void PFTauToJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iES) const {
0017   using namespace reco;
0018   using namespace edm;
0019   using namespace std;
0020   CaloJet::Specific specific;
0021 
0022   CaloJetCollection* jetCollectionTmp = new CaloJetCollection;
0023   edm::Handle<PFTauCollection> tauJets;
0024   iEvent.getByToken(tauSrc_, tauJets);
0025   PFTauCollection::const_iterator i = tauJets->begin();
0026   for (; i != tauJets->end(); i++) {
0027     CaloJet jet(i->p4(), i->vertex(), specific);
0028     jet.setPdgId(15);
0029     jetCollectionTmp->push_back(jet);
0030   }
0031 
0032   unique_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp);
0033   iEvent.put(std::move(selectedTaus));
0034 }
0035 
0036 #include "FWCore/Framework/interface/MakerMacros.h"
0037 DEFINE_FWK_MODULE(PFTauToJetProducer);