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"
19 : input_(config.getParameter<
edm::InputTag>(
"input")),
20 branch_(config.getParameter<
std::string>(
"branch")) {
21 consumes<edm::View<reco::Candidate>>(input_);
22 candidates_ =
new std::vector<ic::Candidate>();
28 void ICCandidateProducer::produce(edm::Event& event,
29 const edm::EventSetup& setup) {
30 edm::Handle<edm::View<reco::Candidate> > cand_handle;
31 event.getByLabel(input_, cand_handle);
36 for (
unsigned i = 0; i < cand_handle->size(); ++i) {
37 reco::Candidate
const& src = cand_handle->at(i);
39 dest.
set_id(cand_hasher_(&src));
48 void ICCandidateProducer::beginJob() {
52 void ICCandidateProducer::endJob() {}
DEFINE_FWK_MODULE(ICCandidateProducer)
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
void set_phi(double const &phi)
Direct access to .
void set_id(std::size_t const &id)
Unique identifier.
void set_charge(int const &charge)
Electric charge.
void set_energy(double const &energy)
Direct access to the energy.
ICCandidateProducer(const edm::ParameterSet &)
void set_pt(double const &pt)
Direct access to the .
void set_eta(double const &eta)
Direct access to .