CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SCEnergyCorrectorProducer Class Reference
Inheritance diagram for SCEnergyCorrectorProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SCEnergyCorrectorProducer (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

SCEnergyCorrectorSemiParm energyCorrector_
 
const edm::EDGetTokenT< reco::SuperClusterCollectioninputSCToken_
 
const bool writeFeatures_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 17 of file SCEnergyCorrectorProducer.cc.

Constructor & Destructor Documentation

◆ SCEnergyCorrectorProducer()

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

Definition at line 32 of file SCEnergyCorrectorProducer.cc.

33  : energyCorrector_(iConfig.getParameterSet("correctorCfg"), consumesCollector()),
34  inputSCToken_(consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("inputSCs"))),
35  writeFeatures_(iConfig.getParameter<bool>("writeFeatures")) {
36  produces<reco::SuperClusterCollection>();
37  if (writeFeatures_) {
38  produces<edm::ValueMap<std::vector<float>>>("features");
39  }
40 }

References writeFeatures_.

Member Function Documentation

◆ beginLuminosityBlock()

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

Definition at line 42 of file SCEnergyCorrectorProducer.cc.

42  {
44 }

References energyCorrector_, and SCEnergyCorrectorSemiParm::setEventSetup().

◆ fillDescriptions()

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

Definition at line 71 of file SCEnergyCorrectorProducer.cc.

71  {
74  desc.add<bool>("writeFeatures", false);
75  desc.add<edm::InputTag>("inputSCs", edm::InputTag("particleFlowSuperClusterECAL"));
76  descriptions.add("scEnergyCorrectorProducer", desc);
77 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and SCEnergyCorrectorSemiParm::makePSetDescription().

◆ produce()

void SCEnergyCorrectorProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 46 of file SCEnergyCorrectorProducer.cc.

46  {
48 
49  auto inputSCs = iEvent.get(inputSCToken_);
50  auto corrSCs = std::make_unique<reco::SuperClusterCollection>();
51  std::vector<std::vector<float>> scFeatures;
52  for (const auto& inputSC : inputSCs) {
53  corrSCs->push_back(inputSC);
54  energyCorrector_.modifyObject(corrSCs->back());
55  if (writeFeatures_) {
56  scFeatures.emplace_back(energyCorrector_.getRegData(corrSCs->back()));
57  }
58  }
59 
60  auto scHandle = iEvent.put(std::move(corrSCs));
61 
62  if (writeFeatures_) {
63  auto valMap = std::make_unique<edm::ValueMap<std::vector<float>>>();
64  edm::ValueMap<std::vector<float>>::Filler filler(*valMap);
65  filler.insert(scHandle, scFeatures.begin(), scFeatures.end());
66  filler.fill();
67  iEvent.put(std::move(valMap), "features");
68  }
69 }

References energyCorrector_, trigObjTnPSource_cfi::filler, SCEnergyCorrectorSemiParm::getRegData(), iEvent, inputSCToken_, SCEnergyCorrectorSemiParm::modifyObject(), eostools::move(), SCEnergyCorrectorSemiParm::setEvent(), and writeFeatures_.

Member Data Documentation

◆ energyCorrector_

SCEnergyCorrectorSemiParm SCEnergyCorrectorProducer::energyCorrector_
private

Definition at line 27 of file SCEnergyCorrectorProducer.cc.

Referenced by beginLuminosityBlock(), and produce().

◆ inputSCToken_

const edm::EDGetTokenT<reco::SuperClusterCollection> SCEnergyCorrectorProducer::inputSCToken_
private

Definition at line 28 of file SCEnergyCorrectorProducer.cc.

Referenced by produce().

◆ writeFeatures_

const bool SCEnergyCorrectorProducer::writeFeatures_
private

Definition at line 29 of file SCEnergyCorrectorProducer.cc.

Referenced by produce(), and SCEnergyCorrectorProducer().

SCEnergyCorrectorSemiParm::setEventSetup
void setEventSetup(const edm::EventSetup &es)
Definition: SCEnergyCorrectorSemiParm.cc:96
SCEnergyCorrectorSemiParm::getRegData
std::vector< float > getRegData(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:165
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
SCEnergyCorrectorProducer::inputSCToken_
const edm::EDGetTokenT< reco::SuperClusterCollection > inputSCToken_
Definition: SCEnergyCorrectorProducer.cc:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SCEnergyCorrectorProducer::writeFeatures_
const bool writeFeatures_
Definition: SCEnergyCorrectorProducer.cc:29
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
SCEnergyCorrectorSemiParm::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: SCEnergyCorrectorSemiParm.cc:90
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ValueMap
Definition: ValueMap.h:107
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SCEnergyCorrectorSemiParm::modifyObject
void modifyObject(reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:154
edm::InputTag
Definition: InputTag.h:15
SCEnergyCorrectorProducer::energyCorrector_
SCEnergyCorrectorSemiParm energyCorrector_
Definition: SCEnergyCorrectorProducer.cc:27
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
SCEnergyCorrectorSemiParm::setEvent
void setEvent(const edm::Event &e)
Definition: SCEnergyCorrectorSemiParm.cc:108