CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/RecoTauTag/HLTProducers/src/PFTauToJetProducer.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/HLTProducers/interface/PFTauToJetProducer.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 PFTauToJetProducer::PFTauToJetProducer(const edm::ParameterSet& iConfig)
00011 {
00012 
00013   tauSrc_ = iConfig.getParameter<edm::InputTag>("Source");
00014   produces<reco::CaloJetCollection>();
00015 }
00016 
00017 PFTauToJetProducer::~PFTauToJetProducer(){ }
00018 
00019 void PFTauToJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iES)
00020 {
00021 
00022   using namespace reco;
00023   using namespace edm;
00024   using namespace std;
00025   CaloJet::Specific specific;
00026   
00027   CaloJetCollection * jetCollectionTmp = new CaloJetCollection;
00028   edm::Handle<PFTauCollection> tauJets;
00029     iEvent.getByLabel( tauSrc_, tauJets );
00030     PFTauCollection::const_iterator i = tauJets->begin();
00031     for(;i !=tauJets->end(); i++ ) {
00032       //      cout <<"Tau Tracks " << i->signalPFChargedHadrCands().size()<<std::endl;
00033       CaloJet jet(i->p4(),i->vertex(),specific);
00034       jet.setPdgId(15);
00035       jetCollectionTmp->push_back(jet);
00036       
00037     }
00038 
00039   
00040 
00041   auto_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp);
00042   iEvent.put(selectedTaus);
00043 
00044 
00045 }