CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
reco::modules::NamedCandCombinerBase Struct Reference

#include <NamedCandCombiner.h>

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

Public Member Functions

 NamedCandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Detailed Description

Definition at line 42 of file NamedCandCombiner.h.

Constructor & Destructor Documentation

reco::modules::NamedCandCombinerBase::NamedCandCombinerBase ( const edm::ParameterSet cfg)
inline

Definition at line 43 of file NamedCandCombiner.h.

References edm::errors::Configuration, SelectingProcedure_cff::decay, cand::parser::decayParser(), Exception, spr::find(), runEdmFileComparison::found, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), reco::ParticleMasses::kPlus, label, edm::errors::LogicError, AlCaHLTBitMon_QueryRunRegistry::string, cand::parser::ConjInfo::tag_, tokens_, and edm::vector_transform().

43  :
44  setLongLived_(false),
45  setMassConstraint_(false),
46  setPdgId_(false) {
47  using namespace cand::parser;
48  using namespace std;
49  string decay(cfg.getParameter<string>("decay"));
51  for(vector<ConjInfo>::iterator label = labels_.begin();
52  label != labels_.end(); ++label)
53  if(label->mode_ == ConjInfo::kPlus)
54  dauCharge_.push_back( 1 );
55  else if (label->mode_ == ConjInfo::kMinus)
56  dauCharge_.push_back(-1);
57  else
58  dauCharge_.push_back(0);
59  else
61  "failed to parse \"" + decay + "\"");
62 
63  int lists = labels_.size();
64  if(lists != 2 && lists != 3)
66  "invalid number of collections");
67  bool found;
68  const string setLongLived("setLongLived");
69  vector<string> vBoolParams = cfg.getParameterNamesForType<bool>();
70  found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
71  if(found) setLongLived_ = cfg.getParameter<bool>("setLongLived");
72  const string setMassConstraint("setMassConstraint");
73  found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
74  if(found) setMassConstraint_ = cfg.getParameter<bool>("setMassConstraint");
75  const string setPdgId("setPdgId");
76  vector<string> vIntParams = cfg.getParameterNamesForType<int>();
77  found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
78  if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); }
79  tokens_ = edm::vector_transform( labels_, [this](ConjInfo const & cI){return consumes<CandidateView>(cI.tag_);} );
80 
81  name_ = cfg.getParameter<std::string>( "name" );
82  roles_= cfg.getParameter<std::vector<std::string> > ( "roles" );
83  }
T getParameter(std::string const &) const
std::string name_
Name of this candidate.
bool setMassConstraint_
set mass constraint flag
const double kPlus
Definition: ParticleMasses.h:8
std::vector< int > dauCharge_
daughter charges
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > roles_
edm::InputTag tag_
Definition: decayParser.h:38
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:169
char const * label
std::vector< cand::parser::ConjInfo > labels_
label vector
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
bool setLongLived_
set long lived flag
std::vector< EDGetTokenT< CandidateView > > tokens_

Member Data Documentation

std::vector<int> reco::modules::NamedCandCombinerBase::dauCharge_
protected

daughter charges

Definition at line 89 of file NamedCandCombiner.h.

std::vector<cand::parser::ConjInfo> reco::modules::NamedCandCombinerBase::labels_
protected

label vector

Definition at line 86 of file NamedCandCombiner.h.

std::string reco::modules::NamedCandCombinerBase::name_
protected

Name of this candidate.

Definition at line 99 of file NamedCandCombiner.h.

int reco::modules::NamedCandCombinerBase::pdgId_
protected

which pdgId to set

Definition at line 97 of file NamedCandCombiner.h.

std::vector<std::string> reco::modules::NamedCandCombinerBase::roles_
protected

Definition at line 101 of file NamedCandCombiner.h.

bool reco::modules::NamedCandCombinerBase::setLongLived_
protected

set long lived flag

Definition at line 91 of file NamedCandCombiner.h.

bool reco::modules::NamedCandCombinerBase::setMassConstraint_
protected

set mass constraint flag

Definition at line 93 of file NamedCandCombiner.h.

bool reco::modules::NamedCandCombinerBase::setPdgId_
protected

set pdgId flag

Definition at line 95 of file NamedCandCombiner.h.

std::vector<EDGetTokenT<CandidateView> > reco::modules::NamedCandCombinerBase::tokens_
protected

Definition at line 87 of file NamedCandCombiner.h.