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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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

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.

132  :
133  CandCombinerBase(cfg),
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  }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
Definition: CandCombiner.h:168
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:111
CandCombinerBase(const edm::ParameterSet &cfg)
Definition: CandCombiner.h:68
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

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.

References MillePedeFileConverter_cfg::e, edm::Event::getByToken(), mps_fire::i, init, eostools::move(), gen::n, MillePedeFileConverter_cfg::out, edm::Event::put(), and tokens_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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_) i->setLongLived();
161  if(setMassConstraint_) i->setMassConstraint();
162  if(setPdgId_) i->setPdgId(pdgId_);
163  }
164  }
165  evt.put(std::move(out));
166  }
const std::vector< std::string > roles() const
Definition: CandCombiner.h:53
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int init
Definition: HydjetWrapper.h:67
int pdgId_
which pdgId to set
Definition: CandCombiner.h:119
void set(reco::CompositeCandidate &c) const
Definition: CandCombiner.h:54
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
Definition: CandCombiner.h:109
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:117
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:113
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:108
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
Definition: CandCombiner.h:168
def move(src, dest)
Definition: eostools.py:510
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:115

Member Data Documentation

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

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