#include <TauAnalysis/RecoTracksMixer/src/RecoTracksMixer.cc>
Public Member Functions | |
RecoTracksMixer (const edm::ParameterSet &) | |
~RecoTracksMixer () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | _tracks1 |
edm::InputTag | _tracks2 |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 39 of file RecoTracksMixer.cc.
RecoTracksMixer::RecoTracksMixer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 66 of file RecoTracksMixer.cc.
: _tracks1(iConfig.getParameter< edm::InputTag > ("trackCol1")), _tracks2(iConfig.getParameter< edm::InputTag > ("trackCol2")) { produces<reco::TrackCollection>(); }
RecoTracksMixer::~RecoTracksMixer | ( | ) |
Definition at line 75 of file RecoTracksMixer.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void RecoTracksMixer::beginJob | ( | void | ) | [private, virtual] |
void RecoTracksMixer::endJob | ( | void | ) | [private, virtual] |
void RecoTracksMixer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 90 of file RecoTracksMixer.cc.
References _tracks1, _tracks2, edm::Event::getByLabel(), and edm::Event::put().
{ using namespace edm; std::vector< edm::Handle<reco::TrackCollection> > cols; edm::Handle<reco::TrackCollection> tks1; iEvent.getByLabel( _tracks1, tks1); edm::Handle<reco::TrackCollection> tks2; iEvent.getByLabel( _tracks2, tks2); cols.push_back(tks1); cols.push_back(tks2); std::auto_ptr< reco::TrackCollection > newCol(new reco::TrackCollection ); //std::cout << "##########################################\n"; //int i = 0; std::vector< edm::Handle<reco::TrackCollection> >::iterator it = cols.begin(); for(;it != cols.end(); ++it) { //std::cout << " col " << i++ << std::endl; for ( reco::TrackCollection::const_iterator itT = (*it)->begin() ; itT != (*it)->end(); ++itT) { /* std::cout << " " << itT->vx() << " " << itT->vy() << " " << itT->vz() << " " << itT->pt() << std::endl;*/ newCol->push_back(*itT); } } iEvent.put(newCol); }
edm::InputTag RecoTracksMixer::_tracks1 [private] |
Definition at line 48 of file RecoTracksMixer.cc.
Referenced by produce().
edm::InputTag RecoTracksMixer::_tracks2 [private] |
Definition at line 49 of file RecoTracksMixer.cc.
Referenced by produce().