CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/RecoTauTag/HLTProducers/src/PFJetToCaloProducer.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/HLTProducers/interface/PFJetToCaloProducer.h"
00002 #include "DataFormats/VertexReco/interface/Vertex.h"
00003 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00004 #include "Math/GenVector/VectorUtil.h"
00005 //
00006 // class decleration
00007 //
00008 
00009 
00010 PFJetToCaloProducer::PFJetToCaloProducer(const edm::ParameterSet& iConfig)
00011 {
00012 
00013   tauSrc_ = iConfig.getParameter<edm::InputTag>("Source");
00014   produces<reco::CaloJetCollection>();
00015 }
00016 
00017 PFJetToCaloProducer::~PFJetToCaloProducer(){ }
00018 
00019 void PFJetToCaloProducer::produce(edm::Event& iEvent, const edm::EventSetup& iES)
00020 {
00021   using namespace reco;
00022   using namespace edm;
00023   using namespace std;
00024   
00025   std::auto_ptr<reco::CaloJetCollection> selectedTaus(new CaloJetCollection);
00026 
00027   edm::Handle<PFJetCollection> tauJets;
00028   iEvent.getByLabel( tauSrc_, tauJets );
00029 
00030   CaloJet::Specific specific;
00031   for (PFJetCollection::const_iterator i = tauJets->begin(); i != tauJets->end(); ++i ) {
00032       CaloJet jet(i->p4(), i->vertex(), specific);
00033       jet.setPdgId(15);
00034       selectedTaus->push_back(jet);
00035   }
00036 
00037   iEvent.put(selectedTaus);
00038 }