CMS 3D CMS Logo

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 >

List of all members.

Public Member Functions

 CandCombinerBase (const edm::ParameterSet &cfg)

Protected Attributes

std::vector< int > dauCharge_
 daughter charges
std::vector
< cand::parser::ConjInfo
labels_
 label vector
int pdgId_
 which pdgId to set
bool setLongLived_
 set long lived flag
bool setMassConstraint_
 set mass constraint flag
bool setPdgId_
 set pdgId flag

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(), Exception, spr::find(), newFWLiteAna::found, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), reco::ParticleMasses::kPlus, label, labels_, edm::errors::LogicError, geometryXMLtoCSV::parser, pdgId_, 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"); }
      }

Member Data Documentation

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

daughter charges

Definition at line 108 of file CandCombiner.h.

Referenced by CandCombinerBase().