CMS 3D CMS Logo

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 >

List of all members.

Public Member Functions

 NamedCandCombinerBase (const edm::ParameterSet &cfg)

Protected Attributes

std::vector< int > dauCharge_
 daughter charges
std::vector
< cand::parser::ConjInfo
labels_
 label vector
std::string name_
 Name of this candidate.
int pdgId_
 which pdgId to set
std::vector< std::string > roles_
bool setLongLived_
 set long lived flag
bool setMassConstraint_
 set mass constraint flag
bool setPdgId_
 set pdgId flag

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(), Exception, spr::find(), newFWLiteAna::found, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), reco::ParticleMasses::kPlus, label, labels_, edm::errors::LogicError, name_, geometryXMLtoCSV::parser, pdgId_, roles_, setLongLived_, setMassConstraint_, and setPdgId_.

                                                           :
        setLongLived_(false), 
        setMassConstraint_(false),
        setPdgId_(false) {
        using namespace cand::parser;
        using namespace std;
        string decay(cfg.getParameter<string>("decay"));
        if(decayParser(decay, labels_))
          for(vector<ConjInfo>::iterator label = labels_.begin();
               label != labels_.end(); ++label)
        if(label->mode_ == ConjInfo::kPlus)
          dauCharge_.push_back( 1 );
        else if (label->mode_ == ConjInfo::kMinus)
          dauCharge_.push_back(-1);
        else
          dauCharge_.push_back(0);
        else
          throw edm::Exception(edm::errors::Configuration,
                               "failed to parse \"" + decay + "\"");
        
        int lists = labels_.size();
        if(lists != 2 && lists != 3)
          throw edm::Exception(edm::errors::LogicError,
                               "invalid number of collections");
        bool found;
        const string setLongLived("setLongLived");
        vector<string> vBoolParams = cfg.getParameterNamesForType<bool>();
        found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
        if(found) setLongLived_ = cfg.getParameter<bool>("setLongLived");
        const string setMassConstraint("setMassConstraint");
        found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
        if(found) setMassConstraint_ = cfg.getParameter<bool>("setMassConstraint");
        const string setPdgId("setPdgId");
        vector<string> vIntParams = cfg.getParameterNamesForType<int>();
        found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
        if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); }

        name_ = cfg.getParameter<std::string>( "name" );
        roles_= cfg.getParameter<std::vector<std::string> > ( "roles" );
      }

Member Data Documentation

daughter charges

Definition at line 86 of file NamedCandCombiner.h.

Referenced by NamedCandCombinerBase().

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