CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init > Class Template Reference

#include <CandCombiner.h>

Inheritance diagram for reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >:
reco::modules::CandCombinerBase edm::stream::EDProducer<>

Public Member Functions

 CandCombiner (const edm::ParameterSet &cfg)
 constructor from parameter settypedef More...
 
 ~CandCombiner () override
 destructor More...
 
- Public Member Functions inherited from reco::modules::CandCombinerBase
 CandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es) override
 process an event More...
 

Private Attributes

::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
 
Init combinerInit_
 combiner utility More...
 
RoleNames names_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Attributes inherited from reco::modules::CandCombinerBase
std::vector< int > dauCharge_
 daughter charges More...
 
std::vector< cand::parser::ConjInfolabels_
 label vector More...
 
int pdgId_
 which pdgId to set More...
 
bool setLongLived_
 set long lived flag More...
 
bool setMassConstraint_
 set mass constraint flag More...
 
bool setPdgId_
 set pdgId flag More...
 
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
 

Detailed Description

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

Definition at line 129 of file CandCombiner.h.

Constructor & Destructor Documentation

◆ CandCombiner()

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::CandCombiner ( const edm::ParameterSet cfg)
inlineexplicit

constructor from parameter settypedef

Definition at line 132 of file CandCombiner.h.

134  combinerInit_(consumesCollector()),
135  combiner_(reco::modules::make<Selector>(cfg, consumesCollector()),
136  reco::modules::make<PairSelector>(cfg),
137  Setup(cfg),
138  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
139  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
140  dauCharge_),
141  names_(cfg) {
142  produces<OutputCollection>();
143  }
Init combinerInit_
combiner utility
Definition: CandCombiner.h:172
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
Definition: CandCombiner.h:173
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:112
CandCombinerBase(const edm::ParameterSet &cfg)
Definition: CandCombiner.h:67

◆ ~CandCombiner()

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::~CandCombiner ( )
inlineoverride

destructor

Definition at line 145 of file CandCombiner.h.

145 {}

Member Function Documentation

◆ produce()

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
void reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivate

process an event

Definition at line 149 of file CandCombiner.h.

References MillePedeFileConverter_cfg::e, edm::Event::getByToken(), mps_fire::i, reco::modules::CandCombinerBase::labels_, eostools::move(), dqmiodumpmetadata::n, MillePedeFileConverter_cfg::out, reco::modules::CandCombinerBase::pdgId_, edm::Event::put(), reco::modules::CandCombinerBase::setLongLived_, reco::modules::CandCombinerBase::setMassConstraint_, reco::modules::CandCombinerBase::setPdgId_, and reco::modules::CandCombinerBase::tokens_.

149  {
150  combinerInit_.init(combiner_.setup(), evt, es);
151  int n = labels_.size();
152  std::vector<edm::Handle<CandidateView> > colls(n);
153  for (int i = 0; i < n; ++i)
154  evt.getByToken(tokens_[i], colls[i]);
155 
156  std::unique_ptr<OutputCollection> out = combiner_.combine(colls, names_.roles());
158  typename OutputCollection::iterator i = out->begin(), e = out->end();
159  for (; i != e; ++i) {
160  names_.set(*i);
161  if (setLongLived_)
162  i->setLongLived();
163  if (setMassConstraint_)
164  i->setMassConstraint();
165  if (setPdgId_)
166  i->setPdgId(pdgId_);
167  }
168  }
169  evt.put(std::move(out));
170  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
int pdgId_
which pdgId to set
Definition: CandCombiner.h:120
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
Definition: CandCombiner.h:110
const std::vector< std::string > roles() const
Definition: CandCombiner.h:52
void set(reco::CompositeCandidate &c) const
Definition: CandCombiner.h:53
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:118
Init combinerInit_
combiner utility
Definition: CandCombiner.h:172
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:114
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:109
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
Definition: CandCombiner.h:173
def move(src, dest)
Definition: eostools.py:511
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:116

Member Data Documentation

◆ combiner_

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
::CandCombiner<Selector, PairSelector, Cloner, OutputCollection, Setup> reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::combiner_
private

Definition at line 173 of file CandCombiner.h.

◆ combinerInit_

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
Init reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::combinerInit_
private

combiner utility

Definition at line 172 of file CandCombiner.h.

◆ names_

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename OutputCollection = reco::CompositeCandidateCollection, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
RoleNames reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::names_
private

Definition at line 175 of file CandCombiner.h.