CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MassKinFitterCandProducer Class Reference

#include <MassKinFitterCandProducer.h>

Inheritance diagram for MassKinFitterCandProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper MassKinFitterCandCustomProducer

List of all members.

Public Member Functions

 MassKinFitterCandProducer (const edm::ParameterSet &, CandMassKinFitter *=0)

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

std::auto_ptr< CandMassKinFitterfitter_
edm::InputTag src_

Detailed Description

Definition at line 12 of file MassKinFitterCandProducer.h.


Constructor & Destructor Documentation

MassKinFitterCandProducer::MassKinFitterCandProducer ( const edm::ParameterSet cfg,
CandMassKinFitter f = 0 
) [explicit]

Definition at line 8 of file MassKinFitterCandProducer.cc.

References fitter_, and edm::ParameterSet::getParameter().

                                                                                                       :
  src_(cfg.getParameter<edm::InputTag>("src")),
  fitter_(f) {
  if(f == 0) fitter_.reset(new CandMassKinFitter(cfg.getParameter<double>("mass")));
  produces<reco::CandidateCollection>();
}

Member Function Documentation

void MassKinFitterCandProducer::produce ( edm::Event evt,
const edm::EventSetup es 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 15 of file MassKinFitterCandProducer.cc.

References trackerHits::c, clone(), fitter_, edm::Event::getByLabel(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, and src_.

                                                                                  {
  using namespace edm; 
  using namespace reco;
  Handle<CandidateCollection> cands;
  evt.getByLabel(src_, cands);
  std::auto_ptr<CandidateCollection> refitted( new CandidateCollection );
  for( CandidateCollection::const_iterator c = cands->begin(); c != cands->end(); ++ c ) {
    Candidate * clone = c->clone();
    fitter_->set( * clone );
    refitted->push_back( clone );
  }
  evt.put( refitted );
}

Member Data Documentation

Definition at line 17 of file MassKinFitterCandProducer.h.

Referenced by MassKinFitterCandProducer(), and produce().

Definition at line 16 of file MassKinFitterCandProducer.h.

Referenced by produce().