#include <ConstrainedFitCandProducer.h>
Public Member Functions | |
ConstrainedFitCandProducer (const edm::ParameterSet &) | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
Fitter | fitter_ |
int | pdgId_ |
bool | setLongLived_ |
bool | setMassConstraint_ |
bool | setPdgId_ |
edm::InputTag | src_ |
Definition at line 20 of file ConstrainedFitCandProducer.h.
ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 44 of file ConstrainedFitCandProducer.h.
References spr::find(), newFWLiteAna::found, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::pdgId_, ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setLongLived_, ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setMassConstraint_, and ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setPdgId_.
: src_(cfg.template getParameter<edm::InputTag>("src")), setLongLived_(false), setMassConstraint_(false), setPdgId_(false), fitter_(reco::modules::make<Fitter>(cfg)) { produces<OutputCollection>(); std::string alias( cfg.getParameter<std::string>("@module_label")); const std::string setLongLived("setLongLived"); std::vector<std::string> vBoolParams = cfg.template getParameterNamesForType<bool>(); bool found = find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end(); if(found) setLongLived_ = cfg.template getParameter<bool>("setLongLived"); const std::string setMassConstraint("setMassConstraint"); found = find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end(); if(found) setMassConstraint_ = cfg.template getParameter<bool>("setMassConstraint"); const std::string setPdgId("setPdgId"); std::vector<std::string> vIntParams = cfg.getParameterNamesForType<int>(); found = find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end(); if(found) { setPdgId_ = true; pdgId_ = cfg.getParameter<int>("setPdgId"); } }
void ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 83 of file ConstrainedFitCandProducer.h.
References reco::fitHelper::add(), trackerHits::c, clone(), edm::Event::getByLabel(), init, and edm::Event::put().
{ Init::init(fitter_, evt, es); edm::Handle<InputCollection> cands; evt.getByLabel(src_, cands); std::auto_ptr<OutputCollection> fitted(new OutputCollection); fitted->reserve(cands->size()); for(typename InputCollection::const_iterator c = cands->begin(); c != cands->end(); ++ c) { std::auto_ptr<reco::VertexCompositeCandidate> clone(new reco::VertexCompositeCandidate(*c)); fitter_.set(*clone); if(setLongLived_) clone->setLongLived(); if(setMassConstraint_) clone->setMassConstraint(); if(setPdgId_) clone->setPdgId(pdgId_); reco::fitHelper::add(fitted, clone); } evt.put(fitted); }
Fitter ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::fitter_ [private] |
Definition at line 30 of file ConstrainedFitCandProducer.h.
int ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::pdgId_ [private] |
Definition at line 29 of file ConstrainedFitCandProducer.h.
Referenced by ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer().
bool ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setLongLived_ [private] |
Definition at line 26 of file ConstrainedFitCandProducer.h.
Referenced by ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer().
bool ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setMassConstraint_ [private] |
Definition at line 27 of file ConstrainedFitCandProducer.h.
Referenced by ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer().
bool ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::setPdgId_ [private] |
Definition at line 28 of file ConstrainedFitCandProducer.h.
Referenced by ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer().
edm::InputTag ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::src_ [private] |
Definition at line 25 of file ConstrainedFitCandProducer.h.