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::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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 41 of file NamedCandCombiner.h.

Constructor & Destructor Documentation

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

Definition at line 42 of file NamedCandCombiner.h.

References edm::errors::Configuration, dauCharge_, cand::parser::decayParser(), edm::hlt::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_, and setPdgId_.

42  :
43  setLongLived_(false),
44  setMassConstraint_(false),
45  setPdgId_(false) {
46  using namespace cand::parser;
47  using namespace std;
48  string decay(cfg.getParameter<string>("decay"));
49  if(decayParser(decay, labels_))
50  for(vector<ConjInfo>::iterator label = labels_.begin();
51  label != labels_.end(); ++label)
52  if(label->mode_ == ConjInfo::kPlus)
53  dauCharge_.push_back( 1 );
54  else if (label->mode_ == ConjInfo::kMinus)
55  dauCharge_.push_back(-1);
56  else
57  dauCharge_.push_back(0);
58  else
60  "failed to parse \"" + decay + "\"");
61 
62  int lists = labels_.size();
63  if(lists != 2 && lists != 3)
65  "invalid number of collections");
66  bool found;
67  const string setLongLived("setLongLived");
68  vector<string> vBoolParams = cfg.getParameterNamesForType<bool>();
69  found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
70  if(found) setLongLived_ = cfg.getParameter<bool>("setLongLived");
71  const string setMassConstraint("setMassConstraint");
72  found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
73  if(found) setMassConstraint_ = cfg.getParameter<bool>("setMassConstraint");
74  const string setPdgId("setPdgId");
75  vector<string> vIntParams = cfg.getParameterNamesForType<int>();
76  found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
77  if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); }
78 
79  name_ = cfg.getParameter<std::string>( "name" );
80  roles_= cfg.getParameter<std::vector<std::string> > ( "roles" );
81  }
T getParameter(std::string const &) const
std::string name_
Name of this candidate.
bool setMassConstraint_
set mass constraint flag
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:7
std::vector< std::string > roles_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:195
std::vector< cand::parser::ConjInfo > labels_
label vector
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
bool setLongLived_
set long lived flag

Member Data Documentation

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

daughter charges

Definition at line 86 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