CMS 3D CMS Logo

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

#include <L1OffsetCorrectorImpl.h>

Inheritance diagram for L1OffsetCorrectorImplMaker:
JetCorrectorImplMakerBase

Public Member Functions

 L1OffsetCorrectorImplMaker (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 &, edm::ConsumesCollector iC)
 
 JetCorrectorImplMakerBase (const JetCorrectorImplMakerBase &)=delete
 
const JetCorrectorImplMakerBaseoperator= (const JetCorrectorImplMakerBase &)=delete
 
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

int minVtxNdof_
 
edm::EDGetTokenT< reco::VertexCollectionverticesToken_
 

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 22 of file L1OffsetCorrectorImpl.h.

Constructor & Destructor Documentation

◆ L1OffsetCorrectorImplMaker()

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

Definition at line 21 of file L1OffsetCorrectorImpl.cc.

23  : JetCorrectorImplMakerBase(fConfig, fCollector),
25  fCollector.consumes<reco::VertexCollection>(fConfig.getParameter<edm::InputTag>("vertexCollection"))),
26  minVtxNdof_(fConfig.getParameter<int>("minVtxNdof")) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
JetCorrectorImplMakerBase(edm::ParameterSet const &, edm::ConsumesCollector iC)

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 46 of file L1OffsetCorrectorImpl.cc.

References edm::ConfigurationDescriptions::addDefault(), JetCorrectorImplMakerBase::addToDescription(), and submitPVResolutionJobs::desc.

46  {
49  desc.add<edm::InputTag>("vertexCollection");
50  desc.add<int>("minVtxNdof");
51  iDescriptions.addDefault(desc);
52 }
void addDefault(ParameterSetDescription const &psetDescription)
static void addToDescription(edm::ParameterSetDescription &iDescription)

◆ make()

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

Definition at line 27 of file L1OffsetCorrectorImpl.cc.

References Exception, hcaldqm::fEvent, JetCorrectorImplMakerBase::getCalculator(), personalPlayback::level, minVtxNdof_, pvSelector_cfi::NPV, AlCaHLTBitMon_QueryRunRegistry::string, bphysicsOniaDQM_cfi::vertex, and verticesToken_.

28  {
30  fEvent.getByToken(verticesToken_, recVtxs);
31  int NPV(0);
32  for (auto const& vertex : *recVtxs) {
33  if ((not vertex.isFake()) and (vertex.ndof() > minVtxNdof_)) {
34  NPV++;
35  }
36  }
37 
38  auto calculator = getCalculator(fSetup, [](std::string const& level) {
39  if (level != "L1Offset") {
40  throw cms::Exception("L1OffsetCorrectorImpl") << " correction level: " << level << " is not L1Offset";
41  }
42  });
43  return std::unique_ptr<reco::JetCorrectorImpl>(new L1OffsetCorrectorImpl(calculator, NPV));
44 }
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
std::shared_ptr< FactorizedJetCorrectorCalculator const > getCalculator(edm::EventSetup const &, std::function< void(std::string const &)> levelCheck)

Member Data Documentation

◆ minVtxNdof_

int L1OffsetCorrectorImplMaker::minVtxNdof_
private

Definition at line 31 of file L1OffsetCorrectorImpl.h.

Referenced by make().

◆ verticesToken_

edm::EDGetTokenT<reco::VertexCollection> L1OffsetCorrectorImplMaker::verticesToken_
private

Definition at line 30 of file L1OffsetCorrectorImpl.h.

Referenced by make().