CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ChainedJetCorrectorProducer Class Reference

#include <JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc>

Inheritance diagram for ChainedJetCorrectorProducer:
edm::stream::EDProducer<>

Public Member Functions

 ChainedJetCorrectorProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

std::vector< edm::EDGetTokenT< reco::JetCorrector > > correctorTokens_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 120 of file ChainedJetCorrectorProducer.cc.

Constructor & Destructor Documentation

ChainedJetCorrectorProducer::ChainedJetCorrectorProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 145 of file ChainedJetCorrectorProducer.cc.

References edm::ParameterSet::getParameter(), and GlobalPosition_Frontier_DevDB_cff::tag.

146 {
147  //register your products
148  produces<reco::JetCorrector>();
149 
150  auto const& tags = iConfig.getParameter<std::vector<edm::InputTag>>("correctors");
151  correctorTokens_.reserve(tags.size());
152 
153  for(auto const& tag : tags) {
154  correctorTokens_.emplace_back( consumes<reco::JetCorrector>(tag));
155  }
156 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::JetCorrector > > correctorTokens_

Member Function Documentation

void ChainedJetCorrectorProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 184 of file ChainedJetCorrectorProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), and DEFINE_FWK_MODULE.

184  {
185  //The following says we do not know what parameters are allowed so do no validation
186  // Please change this to state exactly what you do use, even if it is no parameters
188  desc.add<std::vector<edm::InputTag>>("correctors");
189  descriptions.addDefault(desc);
190 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void ChainedJetCorrectorProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 165 of file ChainedJetCorrectorProducer.cc.

References mitigatedMETSequence_cff::correctors, edm::Event::getByToken(), eostools::move(), and edm::Event::put().

166 {
167  using namespace edm;
168 
169  std::vector<reco::JetCorrector const*> correctors;
170  correctors.reserve(correctorTokens_.size());
171 
172  for(auto const& token: correctorTokens_) {
174  iEvent.getByToken(token,hCorrector);
175  correctors.emplace_back(&(*hCorrector));
176  }
177 
178  std::unique_ptr<reco::JetCorrector> pCorr( new reco::JetCorrector( std::unique_ptr<reco::JetCorrectorImpl>(new ChainedJetCorrectorImpl(std::move(correctors)) )));
179  iEvent.put(std::move(pCorr));
180 }
std::vector< edm::EDGetTokenT< reco::JetCorrector > > correctorTokens_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
HLT enums.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::vector<edm::EDGetTokenT<reco::JetCorrector> > ChainedJetCorrectorProducer::correctorTokens_
private

Definition at line 130 of file ChainedJetCorrectorProducer.cc.