CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SCEnergyCorrectorDRNProducer Class Reference
Inheritance diagram for SCEnergyCorrectorDRNProducer:
TritonEDProducerT< G, Capabilities > SonicEDProducer< TritonClient, edm::GlobalCache< G >, Capabilities... > SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > > edm::stream::EDProducer< edm::ExternalWork, Capabilities... >

Public Member Functions

void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, Input &input) override
 
void beginLuminosityBlock (const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup, Output const &iOutput) override
 
 SCEnergyCorrectorDRNProducer (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from TritonEDProducerT< G, Capabilities >
void endStream () final
 
 TritonEDProducerT (edm::ParameterSet const &cfg)
 
virtual void tritonEndStream ()
 
- Public Member Functions inherited from SonicEDProducer< TritonClient, edm::GlobalCache< G >, Capabilities... >
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) final
 
virtual void produce (edm::Event &iEvent, edm::EventSetup const &iSetup, Output const &iOutput)=0
 
 SonicEDProducer (edm::ParameterSet const &cfg)
 
 ~SonicEDProducer () override=default
 
- Public Member Functions inherited from SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > >
void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder holder) final
 
virtual void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, Input &iInput)=0
 
void beginStream (edm::StreamID) override
 
 SonicAcquirer (edm::ParameterSet const &cfg)
 
 ~SonicAcquirer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork, Capabilities... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from TritonEDProducerT< G, Capabilities >
static void globalEndJob (G *)
 
static std::unique_ptr< G > initializeGlobalCache (edm::ParameterSet const &pset)
 

Private Attributes

SCEnergyCorrectorDRN energyCorrector_
 
edm::EDGetTokenT< reco::SuperClusterCollectioninputSCToken_
 

Additional Inherited Members

- Public Types inherited from SonicEDProducer< TritonClient, edm::GlobalCache< G >, Capabilities... >
typedef TritonClient ::Output Output
 
- Public Types inherited from SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > >
typedef TritonClient ::Input Input
 
- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork, Capabilities... >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > >
void makeClient ()
 
- Protected Attributes inherited from SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > >
std::unique_ptr< TritonClientclient_
 
edm::ParameterSet clientPset_
 
std::string debugName_
 
std::chrono::time_point< std::chrono::high_resolution_clock > t_dispatch_
 
bool verbose_
 

Detailed Description

Definition at line 43 of file SCEnergyCorrectorDRNProducer.cc.

Constructor & Destructor Documentation

◆ SCEnergyCorrectorDRNProducer()

SCEnergyCorrectorDRNProducer::SCEnergyCorrectorDRNProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 59 of file SCEnergyCorrectorDRNProducer.cc.

60  : TritonEDProducer<>(iConfig),
61  energyCorrector_(iConfig.getParameterSet("correctorCfg"), consumesCollector()),
62  inputSCToken_(consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("inputSCs"))) {
63  produces<reco::SuperClusterCollection>();
64 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > inputSCToken_

Member Function Documentation

◆ acquire()

void SCEnergyCorrectorDRNProducer::acquire ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
Input input 
)
override

Definition at line 71 of file SCEnergyCorrectorDRNProducer.cc.

References SonicAcquirer< TritonClient, edm::stream::EDProducer< edm::ExternalWork, Capabilities... > >::client_, energyCorrector_, iEvent, SCEnergyCorrectorDRNProducer_cfi::inputSCs, inputSCToken_, SCEnergyCorrectorDRN::makeInput(), and SCEnergyCorrectorDRN::setEvent().

71  {
72  const auto& inputSCs = iEvent.get(inputSCToken_);
73 
74  if (inputSCs.empty()) {
75  client_->setBatchSize(0);
76  return;
77  } else {
78  client_->setBatchSize(1);
79  }
80 
83 }
void setEvent(const edm::Event &e)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::SuperClusterCollection > inputSCToken_
void makeInput(const edm::Event &iEvent, TritonInputMap &iInput, const reco::SuperClusterCollection &inputSCs) const

◆ beginLuminosityBlock()

void SCEnergyCorrectorDRNProducer::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
override

Definition at line 66 of file SCEnergyCorrectorDRNProducer.cc.

References energyCorrector_, and SCEnergyCorrectorDRN::setEventSetup().

67  {
69 }
void setEventSetup(const edm::EventSetup &es)

◆ fillDescriptions()

void SCEnergyCorrectorDRNProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 105 of file SCEnergyCorrectorDRNProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, TritonClient::fillPSetDescription(), ProducerED_cfi::InputTag, and SCEnergyCorrectorDRN::makePSetDescription().

105  {
109  desc.add<edm::InputTag>("inputSCs", edm::InputTag("particleFlowSuperClusterECAL"));
110  descriptions.add("scEnergyCorrectorDRNProducer", desc);
111 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static edm::ParameterSetDescription makePSetDescription()
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)

◆ produce()

void SCEnergyCorrectorDRNProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup,
Output const &  iOutput 
)
override

Definition at line 85 of file SCEnergyCorrectorDRNProducer.cc.

References pfMETCorrectionType0_cfi::correction, energyCorrector_, SCEnergyCorrectorDRN::getOutput(), mps_fire::i, iEvent, SCEnergyCorrectorDRNProducer_cfi::inputSCs, inputSCToken_, and eostools::move().

85  {
86  const auto& inputSCs = iEvent.get(inputSCToken_);
87  if (inputSCs.empty())
88  return;
89 
90  const auto& serverout = energyCorrector_.getOutput(iOutput);
91 
92  auto corrSCs = std::make_unique<reco::SuperClusterCollection>();
93  unsigned i = 0;
94  for (const auto& inputSC : inputSCs) {
95  float corrEn = correction(serverout[0][0 + 6 * i]) * inputSC.rawEnergy();
96  corrSCs->push_back(inputSC);
97  corrSCs->back().setEnergy(corrEn);
98  corrSCs->back().setCorrectedEnergy(corrEn);
99  ++i;
100  }
101 
102  auto scHandle = iEvent.put(std::move(corrSCs));
103 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::SuperClusterCollection > inputSCToken_
TritonOutput< float > getOutput(const TritonOutputMap &iOutput)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ energyCorrector_

SCEnergyCorrectorDRN SCEnergyCorrectorDRNProducer::energyCorrector_
private

Definition at line 55 of file SCEnergyCorrectorDRNProducer.cc.

Referenced by acquire(), beginLuminosityBlock(), and produce().

◆ inputSCToken_

edm::EDGetTokenT<reco::SuperClusterCollection> SCEnergyCorrectorDRNProducer::inputSCToken_
private

Definition at line 56 of file SCEnergyCorrectorDRNProducer.cc.

Referenced by acquire(), and produce().