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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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 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  combiner_(reco::modules::make<Selector>(cfg, consumesCollector()),
135  reco::modules::make<PairSelector>(cfg),
136  Setup(cfg),
137  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
138  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
139  dauCharge_),
140  names_(cfg) {
141  produces<OutputCollection>();
142  }

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

144 {}

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

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

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

init
int init
Definition: HydjetWrapper.h:64
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::modules::CandCombinerBase::setMassConstraint_
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:116
reco::modules::CandCombinerBase::setPdgId_
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:118
bmtfDigis_cfi.Setup
Setup
Definition: bmtfDigis_cfi.py:5
reco::modules::CandCombinerBase::labels_
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:109
reco::modules::RoleNames::set
void set(reco::CompositeCandidate &c) const
Definition: CandCombiner.h:53
reco::modules::CandCombinerBase::CandCombinerBase
CandCombinerBase(const edm::ParameterSet &cfg)
Definition: CandCombiner.h:67
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
reco::modules::CandCombinerBase::pdgId_
int pdgId_
which pdgId to set
Definition: CandCombiner.h:120
reco::modules::CandCombinerBase::dauCharge_
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:112
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
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:171
reco::modules::CandCombinerBase::setLongLived_
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:114
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::modules::RoleNames::roles
const std::vector< std::string > roles() const
Definition: CandCombiner.h:52
reco::modules::CandCombiner::names_
RoleNames names_
Definition: CandCombiner.h:173
reco::modules::CandCombinerBase::tokens_
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
Definition: CandCombiner.h:110
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37