CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CandCombiner (const edm::ParameterSet &cfg)
 constructor from parameter settypedef More...
 
virtual ~CandCombiner ()
 destructor More...
 
- Public Member Functions inherited from reco::modules::CandCombinerBase
 CandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)
 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::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from reco::modules::CandCombinerBase
std::vector< int > dauCharge_
 daughter charges More...
 
std::vector
< cand::parser::ConjInfo
labels_
 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...
 

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

129  :
130  CandCombinerBase(cfg),
131  combiner_(reco::modules::make<Selector>(cfg),
132  reco::modules::make<PairSelector>(cfg),
133  Setup(cfg),
134  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
135  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
136  dauCharge_),
137  names_(cfg) {
138  produces<OutputCollection>();
139  }
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:187
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
Definition: CandCombiner.h:167
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:108
CandCombinerBase(const edm::ParameterSet &cfg)
Definition: CandCombiner.h:67
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>
virtual reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::~CandCombiner ( )
inlinevirtual

destructor

Definition at line 141 of file CandCombiner.h.

141 { }

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 
)
inlineprivatevirtual

process an event

Implements edm::EDProducer.

Definition at line 145 of file CandCombiner.h.

References alignCSCRings::e, edm::Event::getByLabel(), i, init, reco::modules::CandCombinerBase::labels_, n, dbtoconf::out, reco::modules::CandCombinerBase::pdgId_, edm::Event::put(), L1Trigger_dataformats::reco, reco::modules::CandCombinerBase::setLongLived_, reco::modules::CandCombinerBase::setMassConstraint_, and reco::modules::CandCombinerBase::setPdgId_.

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

145  {
146  using namespace std;
147  using namespace reco;
148  Init::init(combiner_.setup(), evt, es);
149  int n = labels_.size();
150  vector<edm::Handle<CandidateView> > colls(n);
151  for(int i = 0; i < n; ++i)
152  evt.getByLabel(labels_[i].tag_, colls[i]);
153 
154  auto_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_) i->setLongLived();
160  if(setMassConstraint_) i->setMassConstraint();
161  if(setPdgId_) i->setPdgId(pdgId_);
162  }
163  }
164  evt.put(out);
165  }
const std::vector< std::string > roles() const
Definition: CandCombiner.h:52
int i
Definition: DBlmapReader.cc:9
int init
Definition: HydjetWrapper.h:63
int pdgId_
which pdgId to set
Definition: CandCombiner.h:116
void set(reco::CompositeCandidate &c) const
Definition: CandCombiner.h:53
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple out
Definition: dbtoconf.py:99
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:114
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:110
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:106
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
Definition: CandCombiner.h:167
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:112

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