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 &)
 
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),
25  fCollector.consumes<reco::VertexCollection>(fConfig.getParameter<edm::InputTag>("vertexCollection"))),
26  minVtxNdof_(fConfig.getParameter<int>("minVtxNdof")) {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 46 of file L1OffsetCorrectorImpl.cc.

46  {
49  desc.add<edm::InputTag>("vertexCollection");
50  desc.add<int>("minVtxNdof");
51  iDescriptions.addDefault(desc);
52 }

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

◆ make()

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

Definition at line 27 of file L1OffsetCorrectorImpl.cc.

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 }

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

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().

personalPlayback.level
level
Definition: personalPlayback.py:22
JetCorrectorImplMakerBase::JetCorrectorImplMakerBase
JetCorrectorImplMakerBase(edm::ParameterSet const &)
Definition: JetCorrectorImplMakerBase.cc:38
L1OffsetCorrectorImplMaker::minVtxNdof_
int minVtxNdof_
Definition: L1OffsetCorrectorImpl.h:31
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< reco::VertexCollection >
L1OffsetCorrectorImpl
Definition: L1OffsetCorrectorImpl.h:35
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
pvSelector_cfi.NPV
NPV
Definition: pvSelector_cfi.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
hcaldqm::fEvent
Definition: DQTask.h:32
JetCorrectorImplMakerBase::addToDescription
static void addToDescription(edm::ParameterSetDescription &iDescription)
Definition: JetCorrectorImplMakerBase.cc:72
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
L1OffsetCorrectorImplMaker::verticesToken_
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
Definition: L1OffsetCorrectorImpl.h:30
Exception
Definition: hltDiff.cc:246
JetCorrectorImplMakerBase::getCalculator
std::shared_ptr< FactorizedJetCorrectorCalculator const > getCalculator(edm::EventSetup const &, std::function< void(std::string const &)> levelCheck)
Definition: JetCorrectorImplMakerBase.cc:54
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15