CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Attributes

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_
 

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)
 

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, dauCharge_, cand::parser::decayParser(), Exception, spr::find(), newFWLiteAna::found, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), reco::ParticleMasses::kPlus, diffTwoXMLs::label, labels_, edm::errors::LogicError, name_, geometryXMLtoCSV::parser, pdgId_, roles_, setLongLived_, setMassConstraint_, setPdgId_, 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"));
50  if(decayParser(decay, labels_))
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
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:7
std::vector< std::string > roles_
edm::InputTag tag_
Definition: decayParser.h:38
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
std::vector< cand::parser::ConjInfo > labels_
label vector
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
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.

Referenced by NamedCandCombinerBase().

std::vector<cand::parser::ConjInfo> reco::modules::NamedCandCombinerBase::labels_
protected
std::string reco::modules::NamedCandCombinerBase::name_
protected
int reco::modules::NamedCandCombinerBase::pdgId_
protected
std::vector<std::string> reco::modules::NamedCandCombinerBase::roles_
protected
bool reco::modules::NamedCandCombinerBase::setLongLived_
protected
bool reco::modules::NamedCandCombinerBase::setMassConstraint_
protected
bool reco::modules::NamedCandCombinerBase::setPdgId_
protected
std::vector<EDGetTokenT<CandidateView> > reco::modules::NamedCandCombinerBase::tokens_
protected