#include <NamedCandCombiner.h>
Public Member Functions | |
NamedCandCombiner (const edm::ParameterSet &cfg) | |
constructor from parameter settypedef | |
virtual | ~NamedCandCombiner () |
destructor | |
Private Member Functions | |
void | produce (edm::Event &evt, const edm::EventSetup &es) |
process an event | |
Private Attributes | |
::NamedCandCombiner< Selector, PairSelector, Cloner, Setup > | combiner_ |
combiner utility |
Definition at line 107 of file NamedCandCombiner.h.
reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::NamedCandCombiner | ( | const edm::ParameterSet & | cfg | ) | [inline, explicit] |
constructor from parameter settypedef
Definition at line 110 of file NamedCandCombiner.h.
: NamedCandCombinerBase( cfg ), combiner_( name_, reco::modules::make<Selector>( cfg ), reco::modules::make<PairSelector>( cfg ), Setup( cfg ), cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true, cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true, dauCharge_ ) { produces<reco::NamedCompositeCandidateCollection>(); }
virtual reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::~NamedCandCombiner | ( | ) | [inline, virtual] |
void reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, private, virtual] |
process an event
Implements edm::EDProducer.
Definition at line 126 of file NamedCandCombiner.h.
References trackerHits::c, edm::Event::getByLabel(), i, init, reco::modules::NamedCandCombinerBase::labels_, n, reco::modules::NamedCandCombinerBase::name_, dbtoconf::out, reco::modules::NamedCandCombinerBase::pdgId_, edm::PtrVector< T >::push_back(), edm::Event::put(), csvReporter::r, dt_dqm_sourceclient_common_cff::reco, reco::modules::NamedCandCombinerBase::roles_, reco::modules::NamedCandCombinerBase::setLongLived_, reco::modules::NamedCandCombinerBase::setMassConstraint_, and reco::modules::NamedCandCombinerBase::setPdgId_.
{ using namespace std; using namespace reco; Init::init(combiner_.setup(), evt, es); int n = labels_.size(); std::vector<edm::Handle<CandidateView> > colls(n); for(int i = 0; i < n; ++i) { evt.getByLabel(labels_[i].tag_, colls[i]); } std::vector<CandidatePtrVector> cv; for(typename std::vector<edm::Handle<CandidateView> >::const_iterator c = colls.begin(); c != colls.end(); ++ c) { CandidatePtrVector r; CandidateView::size_type n_view = (*c)->size(); for ( CandidateView::size_type iview = 0; iview < n_view; ++iview ) { CandidatePtr ri( *c, iview ); r.push_back( ri ); } cv.push_back(r); } std::auto_ptr<NamedCompositeCandidateCollection> out = combiner_.combine(cv, roles_); if(setLongLived_ || setMassConstraint_ || setPdgId_) { typename NamedCompositeCandidateCollection::iterator i = out->begin(), e = out->end(); for(; i != e; ++i) { i->setName( name_ ); i->setRoles( roles_ ); i->applyRoles(); if(setLongLived_) i->setLongLived(); if(setMassConstraint_) i->setMassConstraint(); if(setPdgId_) i->setPdgId(pdgId_); } } evt.put(out); }
::NamedCandCombiner<Selector, PairSelector, Cloner, Setup> reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::combiner_ [private] |
combiner utility
Definition at line 161 of file NamedCandCombiner.h.