CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::JetCorrectorImpl
make (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::JetCorrector
offsetCorrectorToken_
 
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 25 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_, and useOffset_.

23  :
25  useOffset_(false)
26 {
27  auto const& offsetService = fConfig.getParameter<edm::InputTag>("offsetService");
28  if(not offsetService.label().empty()) {
29  useOffset_ =true;
30  offsetCorrectorToken_ = fCollector.consumes<reco::JetCorrector>(offsetService);
31  }
32 }
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 53 of file L1JPTOffsetCorrectorImpl.cc.

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

54 {
56  addToDescription(desc);
57  desc.add<edm::InputTag>("offsetService");
58  iDescriptions.addDefault(desc);
59 }
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 35 of file L1JPTOffsetCorrectorImpl.cc.

References edm::hlt::Exception, edm::Event::getByToken(), JetCorrectorImplMakerBase::getCalculator(), testEve_cfg::level, HLT_25ns14e33_v1_cff::offset, offsetCorrectorToken_, AlCaHLTBitMon_QueryRunRegistry::string, and useOffset_.

35  {
36  reco::JetCorrector const* offset = nullptr;
37  if(useOffset_) {
39  fEvent.getByToken(offsetCorrectorToken_,hOffset);
40  offset = &(*hOffset);
41  }
42  auto calculator = getCalculator(fSetup,
43  [](std::string const& level)
44  {
45  if ( level != "L1JPTOffset") {
46  throw cms::Exception("L1OffsetCorrector")<<" correction level: "<<level<<" is not L1JPTOffset";
47  }
48  });
49  return std::unique_ptr<reco::JetCorrectorImpl>( new L1JPTOffsetCorrectorImpl(calculator,offset) );
50 }
edm::EDGetTokenT< reco::JetCorrector > offsetCorrectorToken_
tuple level
Definition: testEve_cfg.py:34
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().