CMS 3D CMS Logo

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

#include <L1JPTOffsetCorrectorImpl.h>

Inheritance diagram for L1JPTOffsetCorrectorImplMaker:
JetCorrectorImplMakerBase

Public Member Functions

 L1JPTOffsetCorrectorImplMaker (edm::ParameterSet const &, edm::ConsumesCollector)
 
std::unique_ptr< reco::JetCorrectorImplmake (edm::Event const &, edm::EventSetup const &)
 
- Public Member Functions inherited from JetCorrectorImplMakerBase
 JetCorrectorImplMakerBase (edm::ParameterSet const &)
 
virtual ~JetCorrectorImplMakerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &iDescriptions)
 
- Static Public Member Functions inherited from JetCorrectorImplMakerBase
static void addToDescription (edm::ParameterSetDescription &iDescription)
 

Private Attributes

edm::EDGetTokenT< reco::JetCorrectoroffsetCorrectorToken_
 
bool useOffset_
 

Additional Inherited Members

- Protected Member Functions inherited from JetCorrectorImplMakerBase
std::shared_ptr< FactorizedJetCorrectorCalculator const > getCalculator (edm::EventSetup const &, std::function< void(std::string const &)> levelCheck)
 

Detailed Description

Definition at line 24 of file L1JPTOffsetCorrectorImpl.h.

Constructor & Destructor Documentation

L1JPTOffsetCorrectorImplMaker::L1JPTOffsetCorrectorImplMaker ( edm::ParameterSet const &  fConfig,
edm::ConsumesCollector  fCollector 
)

Definition at line 23 of file L1JPTOffsetCorrectorImpl.cc.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), offsetCorrectorToken_, JetCorrectionServices_cff::offsetService, and useOffset_.

25  : JetCorrectorImplMakerBase(fConfig), useOffset_(false) {
26  auto const& offsetService = fConfig.getParameter<edm::InputTag>("offsetService");
27  if (not offsetService.label().empty()) {
28  useOffset_ = true;
30  }
31 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::JetCorrector > offsetCorrectorToken_
JetCorrectorImplMakerBase(edm::ParameterSet const &)

Member Function Documentation

void L1JPTOffsetCorrectorImplMaker::fillDescriptions ( edm::ConfigurationDescriptions iDescriptions)
static

Definition at line 49 of file L1JPTOffsetCorrectorImpl.cc.

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

49  {
51  addToDescription(desc);
52  desc.add<edm::InputTag>("offsetService");
53  iDescriptions.addDefault(desc);
54 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void addToDescription(edm::ParameterSetDescription &iDescription)
std::unique_ptr< reco::JetCorrectorImpl > L1JPTOffsetCorrectorImplMaker::make ( edm::Event const &  fEvent,
edm::EventSetup const &  fSetup 
)

Definition at line 33 of file L1JPTOffsetCorrectorImpl.cc.

References Exception, edm::Event::getByToken(), JetCorrectorImplMakerBase::getCalculator(), personalPlayback::level, hltrates_dqm_sourceclient-live_cfg::offset, offsetCorrectorToken_, AlCaHLTBitMon_QueryRunRegistry::string, and useOffset_.

34  {
35  reco::JetCorrector const* offset = nullptr;
36  if (useOffset_) {
38  fEvent.getByToken(offsetCorrectorToken_, hOffset);
39  offset = &(*hOffset);
40  }
41  auto calculator = getCalculator(fSetup, [](std::string const& level) {
42  if (level != "L1JPTOffset") {
43  throw cms::Exception("L1OffsetCorrector") << " correction level: " << level << " is not L1JPTOffset";
44  }
45  });
46  return std::unique_ptr<reco::JetCorrectorImpl>(new L1JPTOffsetCorrectorImpl(calculator, offset));
47 }
edm::EDGetTokenT< reco::JetCorrector > offsetCorrectorToken_
std::shared_ptr< FactorizedJetCorrectorCalculator const > getCalculator(edm::EventSetup const &, std::function< void(std::string const &)> levelCheck)

Member Data Documentation

edm::EDGetTokenT<reco::JetCorrector> L1JPTOffsetCorrectorImplMaker::offsetCorrectorToken_
private

Definition at line 32 of file L1JPTOffsetCorrectorImpl.h.

Referenced by L1JPTOffsetCorrectorImplMaker(), and make().

bool L1JPTOffsetCorrectorImplMaker::useOffset_
private

Definition at line 33 of file L1JPTOffsetCorrectorImpl.h.

Referenced by L1JPTOffsetCorrectorImplMaker(), and make().