CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MassKinFitterCandProducer Class Reference

#include <MassKinFitterCandProducer.h>

Inheritance diagram for MassKinFitterCandProducer:
edm::stream::EDProducer<> MassKinFitterCandCustomProducer

Public Member Functions

 MassKinFitterCandProducer (const edm::ParameterSet &, CandMassKinFitter *=nullptr)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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

Private Attributes

std::unique_ptr
< CandMassKinFitter
fitter_
 
edm::EDGetTokenT
< reco::CandidateCollection
srcToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 14 of file MassKinFitterCandProducer.h.

Constructor & Destructor Documentation

MassKinFitterCandProducer::MassKinFitterCandProducer ( const edm::ParameterSet cfg,
CandMassKinFitter f = nullptr 
)
explicit

Definition at line 9 of file MassKinFitterCandProducer.cc.

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

10  : srcToken_(consumes<reco::CandidateCollection>(cfg.getParameter<edm::InputTag>("src"))), fitter_(f) {
11  if (f == nullptr)
12  fitter_ = std::make_unique<CandMassKinFitter>(cfg.getParameter<double>("mass"));
13  produces<reco::CandidateCollection>();
14 }
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< CandMassKinFitter > fitter_

Member Function Documentation

void MassKinFitterCandProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 16 of file MassKinFitterCandProducer.cc.

References c, HLT_FULL_cff::cands, clone(), fitter_, edm::Event::getByToken(), eostools::move(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, and srcToken_.

16  {
17  using namespace edm;
18  using namespace reco;
21  auto refitted = std::make_unique<CandidateCollection>();
22  for (CandidateCollection::const_iterator c = cands->begin(); c != cands->end(); ++c) {
23  Candidate* clone = c->clone();
24  fitter_->set(*clone);
25  refitted->push_back(clone);
26  }
27  evt.put(std::move(refitted));
28 }
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EventSetup & c
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
def move
Definition: eostools.py:511
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
std::unique_ptr< CandMassKinFitter > fitter_

Member Data Documentation

std::unique_ptr<CandMassKinFitter> MassKinFitterCandProducer::fitter_
private

Definition at line 20 of file MassKinFitterCandProducer.h.

Referenced by MassKinFitterCandProducer(), and produce().

edm::EDGetTokenT<reco::CandidateCollection> MassKinFitterCandProducer::srcToken_
private

Definition at line 19 of file MassKinFitterCandProducer.h.

Referenced by produce().