CMS 3D CMS Logo

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< CandMassKinFitterfitter_
 
edm::EDGetTokenT< reco::CandidateCollectionsrcToken_
 

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::MassKinFitterCandProducer ( const edm::ParameterSet cfg,
CandMassKinFitter f = nullptr 
)
explicit

Definition at line 9 of file MassKinFitterCandProducer.cc.

References looper::cfg, f, and fitter_.

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_
double f[11][100]
std::unique_ptr< CandMassKinFitter > fitter_

Member Function Documentation

◆ produce()

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

Definition at line 16 of file MassKinFitterCandProducer.cc.

References HltBtagPostValidation_cff::c, HLT_2023v12_cff::cands, clone(), fitter_, edm::Event::getByToken(), eostools::move(), edm::Event::put(), 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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:536
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
fixed size matrix
HLT enums.
std::unique_ptr< CandMassKinFitter > fitter_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ fitter_

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

Definition at line 20 of file MassKinFitterCandProducer.h.

Referenced by MassKinFitterCandProducer(), and produce().

◆ srcToken_

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

Definition at line 19 of file MassKinFitterCandProducer.h.

Referenced by produce().