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::L1JPTOffsetCorrectorImplMaker ( edm::ParameterSet const &  fConfig,
edm::ConsumesCollector  fCollector 
)

Definition at line 23 of file L1JPTOffsetCorrectorImpl.cc.

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 }

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

Member Function Documentation

◆ fillDescriptions()

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

◆ make()

std::unique_ptr< reco::JetCorrectorImpl > L1JPTOffsetCorrectorImplMaker::make ( edm::Event const &  fEvent,
edm::EventSetup const &  fSetup 
)

Definition at line 33 of file L1JPTOffsetCorrectorImpl.cc.

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 }

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

Member Data Documentation

◆ offsetCorrectorToken_

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

Definition at line 32 of file L1JPTOffsetCorrectorImpl.h.

Referenced by L1JPTOffsetCorrectorImplMaker(), and make().

◆ useOffset_

bool L1JPTOffsetCorrectorImplMaker::useOffset_
private

Definition at line 33 of file L1JPTOffsetCorrectorImpl.h.

Referenced by L1JPTOffsetCorrectorImplMaker(), and make().

personalPlayback.level
level
Definition: personalPlayback.py:22
JetCorrectorImplMakerBase::JetCorrectorImplMakerBase
JetCorrectorImplMakerBase(edm::ParameterSet const &)
Definition: JetCorrectorImplMakerBase.cc:38
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
L1JPTOffsetCorrectorImpl
Definition: L1JPTOffsetCorrectorImpl.h:37
reco::JetCorrector
Definition: JetCorrector.h:35
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< reco::JetCorrector >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1JPTOffsetCorrectorImplMaker::useOffset_
bool useOffset_
Definition: L1JPTOffsetCorrectorImpl.h:33
hcaldqm::fEvent
Definition: DQTask.h:32
JetCorrectorImplMakerBase::addToDescription
static void addToDescription(edm::ParameterSetDescription &iDescription)
Definition: JetCorrectorImplMakerBase.cc:72
Exception
Definition: hltDiff.cc:246
JetCorrectionServices_cff.offsetService
offsetService
Definition: JetCorrectionServices_cff.py:39
JetCorrectorImplMakerBase::getCalculator
std::shared_ptr< FactorizedJetCorrectorCalculator const > getCalculator(edm::EventSetup const &, std::function< void(std::string const &)> levelCheck)
Definition: JetCorrectorImplMakerBase.cc:54
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
L1JPTOffsetCorrectorImplMaker::offsetCorrectorToken_
edm::EDGetTokenT< reco::JetCorrector > offsetCorrectorToken_
Definition: L1JPTOffsetCorrectorImpl.h:32