CMS 3D CMS Logo

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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::ConjInfolabels_
 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:186
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 
)
inlineprivate

process an event

Definition at line 129 of file NamedCandCombiner.h.

References EnergyCorrector::c, cuy::cv, MillePedeFileConverter_cfg::e, edm::Event::getByToken(), mps_fire::i, init, gen::n, MillePedeFileConverter_cfg::out, edm::PtrVector< T >::push_back(), edm::Event::put(), and alignCSCRings::r.

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  }
unsigned int size_type
Definition: View.h:90
std::string name_
Name of this candidate.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool setMassConstraint_
set mass constraint flag
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:141
int init
Definition: HydjetWrapper.h:67
cv
Definition: cuy.py:362
std::vector< std::string > roles_
std::vector< cand::parser::ConjInfo > labels_
label vector
bool setLongLived_
set long lived flag
fixed size matrix
::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.