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::CandCombinerBase Struct Reference

#include <CandCombiner.h>

Inheritance diagram for reco::modules::CandCombinerBase:
edm::EDProducer edm::ProducerBase 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::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...
 
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...
 

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 66 of file CandCombiner.h.

Constructor & Destructor Documentation

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

Definition at line 67 of file CandCombiner.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, geometryXMLtoCSV::parser, pdgId_, setLongLived_, setMassConstraint_, and setPdgId_.

67  :
68  setLongLived_(false),
69  setMassConstraint_(false),
70  setPdgId_(false) {
71  using namespace cand::parser;
72  using namespace std;
73  string decay(cfg.getParameter<string>("decay"));
74  if(decayParser(decay, labels_))
75  for(vector<ConjInfo>::iterator label = labels_.begin();
76  label != labels_.end(); ++label)
77  if(label->mode_ == ConjInfo::kPlus)
78  dauCharge_.push_back(1);
79  else if (label->mode_ == ConjInfo::kMinus)
80  dauCharge_.push_back(-1);
81  else
82  dauCharge_.push_back(0);
83  else
85  "failed to parse \"" + decay + "\"");
86 
87  int lists = labels_.size();
88  if(lists != 2 && lists != 3)
90  "invalid number of collections");
91  bool found;
92  const string setLongLived("setLongLived");
93  vector<string> vBoolParams = cfg.getParameterNamesForType<bool>();
94  found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
95  if(found) setLongLived_ = cfg.getParameter<bool>("setLongLived");
96  const string setMassConstraint("setMassConstraint");
97  found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
98  if(found) setMassConstraint_ = cfg.getParameter<bool>("setMassConstraint");
99  const string setPdgId("setPdgId");
100  vector<string> vIntParams = cfg.getParameterNamesForType<int>();
101  found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
102  if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); }
103  }
T getParameter(std::string const &) const
int pdgId_
which pdgId to set
Definition: CandCombiner.h:116
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 > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:195
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
bool setPdgId_
set pdgId flag
Definition: CandCombiner.h:114
bool setLongLived_
set long lived flag
Definition: CandCombiner.h:110
std::vector< cand::parser::ConjInfo > labels_
label vector
Definition: CandCombiner.h:106
std::vector< int > dauCharge_
daughter charges
Definition: CandCombiner.h:108
bool setMassConstraint_
set mass constraint flag
Definition: CandCombiner.h:112

Member Data Documentation

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

daughter charges

Definition at line 108 of file CandCombiner.h.

Referenced by CandCombinerBase().

std::vector<cand::parser::ConjInfo> reco::modules::CandCombinerBase::labels_
protected
int reco::modules::CandCombinerBase::pdgId_
protected
bool reco::modules::CandCombinerBase::setLongLived_
protected
bool reco::modules::CandCombinerBase::setMassConstraint_
protected
bool reco::modules::CandCombinerBase::setPdgId_
protected