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

Constructor & Destructor Documentation

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

Definition at line 21 of file L1OffsetCorrectorImpl.cc.

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

Member Function Documentation

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

Definition at line 51 of file L1OffsetCorrectorImpl.cc.

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

52 {
54  addToDescription(desc);
55  desc.add<edm::InputTag>("vertexCollection");
56  desc.add<int>("minVtxNdof");
57  iDescriptions.addDefault(desc);
58 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void addToDescription(edm::ParameterSetDescription &iDescription)
std::unique_ptr< reco::JetCorrectorImpl > L1OffsetCorrectorImplMaker::make ( edm::Event const &  fEvent,
edm::EventSetup const &  fSetup 
)

Definition at line 29 of file L1OffsetCorrectorImpl.cc.

References Exception, edm::Event::getByToken(), JetCorrectorImplMakerBase::getCalculator(), hcalDigis_cfi::level, minVtxNdof_, pvSelector_cfi::NPV, AlCaHLTBitMon_QueryRunRegistry::string, and verticesToken_.

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

Member Data Documentation

int L1OffsetCorrectorImplMaker::minVtxNdof_
private

Definition at line 31 of file L1OffsetCorrectorImpl.h.

Referenced by make().

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

Definition at line 30 of file L1OffsetCorrectorImpl.h.

Referenced by make().