CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MassKinFitterCandProducer Class Reference

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

List of all members.

Public Member Functions

 MassKinFitterCandProducer (const edm::ParameterSet &)

Private Member Functions

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

Private Attributes

CandMassKinFitter fitter_
edm::InputTag src_

Detailed Description

Definition at line 11 of file MassKinFitterCandProducer.cc.


Constructor & Destructor Documentation

MassKinFitterCandProducer::MassKinFitterCandProducer ( const edm::ParameterSet cfg) [explicit]

Definition at line 28 of file MassKinFitterCandProducer.cc.

                                                                                  :
  src_( cfg.getParameter<edm::InputTag>( "src" ) ),
  fitter_( 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 34 of file MassKinFitterCandProducer.cc.

References trackerHits::c, clone(), fitter_, edm::Event::getByLabel(), edm::Event::put(), dt_offlineAnalysis_common_cff::reco, CandMassKinFitter::set(), 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.cc.

Referenced by produce().

Definition at line 16 of file MassKinFitterCandProducer.cc.

Referenced by produce().