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 | 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
 
 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
 

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<>
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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 112 of file ChainedJetCorrectorProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 136 of file ChainedJetCorrectorProducer.cc.

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

136  {
137  //register your products
138  produces<reco::JetCorrector>();
139 
140  auto const& tags = iConfig.getParameter<std::vector<edm::InputTag>>("correctors");
141  correctorTokens_.reserve(tags.size());
142 
143  for (auto const& tag : tags) {
144  correctorTokens_.emplace_back(consumes<reco::JetCorrector>(tag));
145  }
146 }
std::vector< edm::EDGetTokenT< reco::JetCorrector > > correctorTokens_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

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

Definition at line 171 of file ChainedJetCorrectorProducer.cc.

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

171  {
172  //The following says we do not know what parameters are allowed so do no validation
173  // Please change this to state exactly what you do use, even if it is no parameters
175  desc.add<std::vector<edm::InputTag>>("correctors");
176  descriptions.addDefault(desc);
177 }
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 153 of file ChainedJetCorrectorProducer.cc.

References HLT_FULL_cff::correctors, correctorTokens_, edm::Event::getByToken(), eostools::move(), edm::Event::put(), and unpackBuffers-CaloStage2::token.

153  {
154  using namespace edm;
155 
156  std::vector<reco::JetCorrector const*> correctors;
157  correctors.reserve(correctorTokens_.size());
158 
159  for (auto const& token : correctorTokens_) {
161  iEvent.getByToken(token, hCorrector);
162  correctors.emplace_back(&(*hCorrector));
163  }
164 
165  std::unique_ptr<reco::JetCorrector> pCorr(new reco::JetCorrector(
166  std::unique_ptr<reco::JetCorrectorImpl>(new ChainedJetCorrectorImpl(std::move(correctors)))));
167  iEvent.put(std::move(pCorr));
168 }
std::vector< edm::EDGetTokenT< reco::JetCorrector > > correctorTokens_
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:539
def move
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 122 of file ChainedJetCorrectorProducer.cc.

Referenced by ChainedJetCorrectorProducer(), and produce().