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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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_
 combiner utility More...
 
RoleNames names_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 128 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 131 of file CandCombiner.h.

133  combiner_(reco::modules::make<Selector>(cfg, consumesCollector()),
134  reco::modules::make<PairSelector>(cfg),
135  Setup(cfg),
136  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
137  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
138  dauCharge_),
139  names_(cfg) {
140  produces<OutputCollection>();
141  }

◆ ~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 143 of file CandCombiner.h.

143 {}

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 147 of file CandCombiner.h.

147  {
148  Init::init(combiner_.setup(), evt, es);
149  int n = labels_.size();
150  std::vector<edm::Handle<CandidateView> > colls(n);
151  for (int i = 0; i < n; ++i)
152  evt.getByToken(tokens_[i], colls[i]);
153 
154  std::unique_ptr<OutputCollection> out = combiner_.combine(colls, names_.roles());
156  typename OutputCollection::iterator i = out->begin(), e = out->end();
157  for (; i != e; ++i) {
158  names_.set(*i);
159  if (setLongLived_)
160  i->setLongLived();
161  if (setMassConstraint_)
162  i->setMassConstraint();
163  if (setPdgId_)
164  i->setPdgId(pdgId_);
165  }
166  }
167  evt.put(std::move(out));
168  }

References MillePedeFileConverter_cfg::e, edm::Event::getByToken(), mps_fire::i, init, 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_.

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

combiner utility

Definition at line 170 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 172 of file CandCombiner.h.

init
int init
Definition: HydjetWrapper.h:64
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::modules::CandCombinerBase::setMassConstraint_
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:115
reco::modules::CandCombinerBase::setPdgId_
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:117
bmtfDigis_cfi.Setup
Setup
Definition: bmtfDigis_cfi.py:5
reco::modules::CandCombinerBase::labels_
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:108
reco::modules::RoleNames::set
void set(reco::CompositeCandidate &c) const
Definition: CandCombiner.h:52
reco::modules::CandCombinerBase::CandCombinerBase
CandCombinerBase(const edm::ParameterSet &cfg)
Definition: CandCombiner.h:66
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
reco::modules::CandCombinerBase::pdgId_
int pdgId_
which pdgId to set
Definition: CandCombiner.h:119
reco::modules::CandCombinerBase::dauCharge_
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:111
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
looper.cfg
cfg
Definition: looper.py:297
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::modules::CandCombiner::combiner_
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
Definition: CandCombiner.h:170
reco::modules::CandCombinerBase::setLongLived_
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:113
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::modules::RoleNames::roles
const std::vector< std::string > roles() const
Definition: CandCombiner.h:51
reco::modules::CandCombiner::names_
RoleNames names_
Definition: CandCombiner.h:172
reco::modules::CandCombinerBase::tokens_
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
Definition: CandCombiner.h:109
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37