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