CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init > Class Template Reference

#include <NamedCandCombiner.h>

Inheritance diagram for reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >:
reco::modules::NamedCandCombinerBase edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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

Detailed Description

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
class reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >

Definition at line 107 of file NamedCandCombiner.h.


Constructor & Destructor Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
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>();
      }
template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
virtual reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::~NamedCandCombiner ( ) [inline, virtual]

destructor

Definition at line 122 of file NamedCandCombiner.h.

{ }

Member Function Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
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);
      }

Member Data Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
::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.