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::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init > Class Template Reference

#include <NamedCandCombiner.h>

Inheritance diagram for reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >:
reco::modules::NamedCandCombinerBase edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 NamedCandCombiner (const edm::ParameterSet &cfg)
 constructor from parameter settypedef More...
 
virtual ~NamedCandCombiner ()
 destructor More...
 
- Public Member Functions inherited from reco::modules::NamedCandCombinerBase
 NamedCandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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

::NamedCandCombiner< Selector,
PairSelector, Cloner, Setup > 
combiner_
 combiner utility More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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::NamedCandCombinerBase
std::vector< int > dauCharge_
 daughter charges More...
 
std::vector
< cand::parser::ConjInfo
labels_
 label vector More...
 
std::string name_
 Name of this candidate. More...
 
int pdgId_
 which pdgId to set More...
 
std::vector< std::string > roles_
 
bool setLongLived_
 set long lived flag More...
 
bool setMassConstraint_
 set mass constraint flag More...
 
bool setPdgId_
 set pdgId flag More...
 
std::vector< EDGetTokenT
< CandidateView > > 
tokens_
 

Detailed Description

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

Definition at line 110 of file NamedCandCombiner.h.

Constructor & Destructor Documentation

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

constructor from parameter settypedef

Definition at line 113 of file NamedCandCombiner.h.

113  :
114  NamedCandCombinerBase( cfg ),
115  combiner_( name_,
116  reco::modules::make<Selector>( cfg ),
117  reco::modules::make<PairSelector>( cfg ),
118  Setup( cfg ),
119  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
120  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
121  dauCharge_ ) {
122  produces<reco::NamedCompositeCandidateCollection>();
123  }
T getParameter(std::string const &) const
std::string name_
Name of this candidate.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
NamedCandCombinerBase(const edm::ParameterSet &cfg)
std::vector< int > dauCharge_
daughter charges
::NamedCandCombiner< Selector, PairSelector, Cloner, Setup > combiner_
combiner utility
template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
virtual reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::~NamedCandCombiner ( )
inlinevirtual

destructor

Definition at line 125 of file NamedCandCombiner.h.

125 { }

Member Function Documentation

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

process an event

Implements edm::EDProducer.

Definition at line 129 of file NamedCandCombiner.h.

References trackerHits::c, cuy::cv, alignCSCRings::e, edm::Event::getByToken(), i, init, reco::modules::NamedCandCombinerBase::labels_, n, reco::modules::NamedCandCombinerBase::name_, dbtoconf::out, reco::modules::NamedCandCombinerBase::pdgId_, edm::PtrVector< T >::push_back(), edm::Event::put(), alignCSCRings::r, dt_dqm_sourceclient_common_cff::reco, reco::modules::NamedCandCombinerBase::roles_, reco::modules::NamedCandCombinerBase::setLongLived_, reco::modules::NamedCandCombinerBase::setMassConstraint_, reco::modules::NamedCandCombinerBase::setPdgId_, and reco::modules::NamedCandCombinerBase::tokens_.

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

129  {
130  using namespace std;
131  using namespace reco;
132  Init::init(combiner_.setup(), evt, es);
133  int n = labels_.size();
134  std::vector<edm::Handle<CandidateView> > colls(n);
135  for(int i = 0; i < n; ++i) {
136  evt.getByToken(tokens_[i], colls[i]);
137  }
138  std::vector<CandidatePtrVector> cv;
139  for(typename std::vector<edm::Handle<CandidateView> >::const_iterator c = colls.begin();
140  c != colls.end(); ++ c) {
142  CandidateView::size_type n_view = (*c)->size();
143  for ( CandidateView::size_type iview = 0; iview < n_view; ++iview ) {
144  CandidatePtr ri( *c, iview );
145  r.push_back( ri );
146  }
147  cv.push_back(r);
148  }
149  std::auto_ptr<NamedCompositeCandidateCollection> out = combiner_.combine(cv, roles_);
151  typename NamedCompositeCandidateCollection::iterator i = out->begin(), e = out->end();
152  for(; i != e; ++i) {
153  i->setName( name_ );
154  i->setRoles( roles_ );
155  i->applyRoles();
156  if(setLongLived_) i->setLongLived();
157  if(setMassConstraint_) i->setMassConstraint();
158  if(setPdgId_) i->setPdgId(pdgId_);
159  }
160  }
161  evt.put(out);
162  }
int i
Definition: DBlmapReader.cc:9
std::string name_
Name of this candidate.
bool setMassConstraint_
set mass constraint flag
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:138
int init
Definition: HydjetWrapper.h:62
std::vector< std::string > roles_
std::vector< cand::parser::ConjInfo > labels_
label vector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
unsigned int size_type
Definition: View.h:85
dictionary cv
Definition: cuy.py:362
tuple out
Definition: dbtoconf.py:99
bool setLongLived_
set long lived flag
::NamedCandCombiner< Selector, PairSelector, Cloner, Setup > combiner_
combiner utility
std::vector< EDGetTokenT< CandidateView > > tokens_

Member Data Documentation

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

combiner utility

Definition at line 164 of file NamedCandCombiner.h.