CMS 3D CMS Logo

LowPtGsfElectronFinalizer.cc
Go to the documentation of this file.
10 
12 public:
14 
15  void produce(edm::Event&, const edm::EventSetup&) override;
16 
18 
19 private:
21  std::unique_ptr<ModifyObjectValueBase> regression_;
22 
24 };
25 
26 using edm::InputTag;
28 
30  : previousGsfElectrons_{consumes<GsfElectronCollection>(cfg.getParameter<InputTag>("previousGsfElectronsTag"))},
31  putToken_{produces<GsfElectronCollection>()} {
32  auto const& iconf = cfg.getParameterSet("regressionConfig");
33  auto const& mname = iconf.getParameter<std::string>("modifierName");
34  auto cc = consumesCollector();
35  regression_ = ModifyObjectValueFactory::get()->create(mname, iconf, cc);
36 }
37 
39  // Setup regression for event
40  regression_->setEvent(event);
41  regression_->setEventContent(setup);
42 
43  // Create new modified electron collection
44  reco::GsfElectronCollection outputElectrons;
45  for (auto const& electron : event.get(previousGsfElectrons_)) {
46  outputElectrons.emplace_back(electron);
47  auto& newElectron = outputElectrons.back();
48  regression_->modifyObject(newElectron);
49  }
50 
51  // Emplace modified electrons to event
52  event.emplace(putToken_, std::move(outputElectrons));
53 }
54 
57  desc.add<edm::InputTag>("previousGsfElectronsTag", {});
59  psd.setUnknown();
60  desc.add<edm::ParameterSetDescription>("regressionConfig", psd);
61  descriptions.addWithDefaultLabel(desc);
62 }
63 
ConfigurationDescriptions.h
MessageLogger.h
LowPtGsfElectronFinalizer::putToken_
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
Definition: LowPtGsfElectronFinalizer.cc:23
LowPtGsfElectronFinalizer::regression_
std::unique_ptr< ModifyObjectValueBase > regression_
Definition: LowPtGsfElectronFinalizer.cc:21
edm::EDGetTokenT< reco::GsfElectronCollection >
edm::EDPutTokenT< reco::GsfElectronCollection >
LowPtGsfElectronFinalizer::previousGsfElectrons_
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
Definition: LowPtGsfElectronFinalizer.cc:20
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EDProducer.h
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
LowPtGsfElectronFinalizer
Definition: LowPtGsfElectronFinalizer.cc:11
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ModifyObjectValueBase.h
metsig::electron
Definition: SignAlgoResolutions.h:48
ParameterSetDescription.h
GsfElectron.h
LowPtGsfElectronFinalizer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: LowPtGsfElectronFinalizer.cc:38
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
LowPtGsfElectronFinalizer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: LowPtGsfElectronFinalizer.cc:55
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
cc
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EventSetup.h
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
LowPtGsfElectronFinalizer::LowPtGsfElectronFinalizer
LowPtGsfElectronFinalizer(const edm::ParameterSet &)
Definition: LowPtGsfElectronFinalizer.cc:29
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87