5 #include "FWCore/Framework/interface/Event.h"
6 #include "FWCore/Framework/interface/EventSetup.h"
7 #include "FWCore/Framework/interface/MakerMacros.h"
8 #include "FWCore/ParameterSet/interface/ParameterSet.h"
9 #include "FWCore/Utilities/interface/InputTag.h"
10 #include "DataFormats/Common/interface/Handle.h"
11 #include "DataFormats/Common/interface/View.h"
12 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
20 : input_barrel_(config.getParameter<
edm::InputTag>(
"inputBarrel")),
21 input_endcap_(config.getParameter<
edm::InputTag>(
"inputEndcap")),
22 branch_(config.getParameter<
std::string>(
"branch")) {
23 consumes<edm::View<reco::SuperCluster>>(input_barrel_);
24 consumes<edm::View<reco::SuperCluster>>(input_endcap_);
25 scs_ =
new std::vector<ic::SuperCluster>();
31 void ICSuperClusterProducer::produce(edm::Event& event,
32 const edm::EventSetup& setup) {
33 edm::Handle<edm::View<reco::SuperCluster> > sc_b_handle;
34 edm::Handle<edm::View<reco::SuperCluster> > sc_e_handle;
36 event.getByLabel(input_barrel_, sc_b_handle);
37 event.getByLabel(input_endcap_, sc_e_handle);
40 scs_->resize(sc_b_handle->size() + sc_e_handle->size());
42 for (
unsigned i = 0; i < sc_b_handle->size(); ++i) {
43 reco::SuperCluster
const& src = sc_b_handle->at(i);
51 dest.
set_id(sc_hasher_(&src));
54 for (
unsigned i = 0; i < sc_e_handle->size(); ++i) {
55 reco::SuperCluster
const& src = sc_e_handle->at(i);
63 dest.
set_id(sc_hasher_(&src));
67 void ICSuperClusterProducer::beginJob() {
71 void ICSuperClusterProducer::endJob() {}
void set_raw_energy(double const &raw_energy)
Raw supercluster energy.
Produces an ic::SuperCluster collection from the separate barrel and endcap collections, which must be compatible with an edm::View
void set_vy(double const &y)
The supercluster y-coordinate.
void set_is_barrel(bool const &is_barrel)
True if the supercluster is in the EB, false otherwise.
void set_energy(double const &energy)
Corrected supercluster energy.
~ICSuperClusterProducer()
ICSuperClusterProducer(const edm::ParameterSet &)
void set_vx(double const &x)
The supercluster x-coordinate.
DEFINE_FWK_MODULE(ICSuperClusterProducer)
void set_vz(double const &z)
The supercluster z-coordinate.
void set_id(std::size_t const &id)
Unique identifier.