CMS 3D CMS Logo

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

#include <CandCombiner.h>

Inheritance diagram for reco::modules::CandCombinerBase:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >

Public Member Functions

 CandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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)
 

Protected Attributes

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_
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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)
 

Detailed Description

Definition at line 67 of file CandCombiner.h.

Constructor & Destructor Documentation

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

Definition at line 68 of file CandCombiner.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, diffTwoXMLs::label, edm::errors::LogicError, cand::parser::ConjInfo::tag_, and edm::vector_transform().

68  :
69  setLongLived_(false),
70  setMassConstraint_(false),
71  setPdgId_(false) {
72  using namespace cand::parser;
73  using namespace std;
74  string decay(cfg.getParameter<string>("decay"));
76  for(vector<ConjInfo>::iterator label = labels_.begin();
77  label != labels_.end(); ++label)
78  if(label->mode_ == ConjInfo::kPlus)
79  dauCharge_.push_back(1);
80  else if (label->mode_ == ConjInfo::kMinus)
81  dauCharge_.push_back(-1);
82  else
83  dauCharge_.push_back(0);
84  else
86  "failed to parse \"" + decay + "\"");
87 
88  int lists = labels_.size();
89  if(lists != 2 && lists != 3)
91  "invalid number of collections");
92  bool found;
93  const string setLongLived("setLongLived");
94  vector<string> vBoolParams = cfg.getParameterNamesForType<bool>();
95  found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
96  if(found) setLongLived_ = cfg.getParameter<bool>("setLongLived");
97  const string setMassConstraint("setMassConstraint");
98  found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
99  if(found) setMassConstraint_ = cfg.getParameter<bool>("setMassConstraint");
100  const string setPdgId("setPdgId");
101  vector<string> vIntParams = cfg.getParameterNamesForType<int>();
102  found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
103  if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); }
104  tokens_ = edm::vector_transform( labels_, [this](ConjInfo const & cI){return consumes<CandidateView>(cI.tag_);} );
105  }
T getParameter(std::string const &) const
const double kPlus
Definition: ParticleMasses.h:8
int pdgId_
which pdgId to set
Definition: CandCombiner.h:119
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
edm::InputTag tag_
Definition: decayParser.h:38
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
Definition: CandCombiner.h:109
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
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
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:111
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:115

Member Data Documentation

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

daughter charges

Definition at line 111 of file CandCombiner.h.

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

label vector

Definition at line 108 of file CandCombiner.h.

int reco::modules::CandCombinerBase::pdgId_
protected

which pdgId to set

Definition at line 119 of file CandCombiner.h.

bool reco::modules::CandCombinerBase::setLongLived_
protected

set long lived flag

Definition at line 113 of file CandCombiner.h.

bool reco::modules::CandCombinerBase::setMassConstraint_
protected

set mass constraint flag

Definition at line 115 of file CandCombiner.h.

bool reco::modules::CandCombinerBase::setPdgId_
protected

set pdgId flag

Definition at line 117 of file CandCombiner.h.

std::vector<edm::EDGetTokenT<CandidateView> > reco::modules::CandCombinerBase::tokens_
protected

Definition at line 109 of file CandCombiner.h.