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 "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
19 : input_(config.getParameter<
edm::InputTag>(
"input")),
20 branch_(config.getParameter<
std::string>(
"branch")) {
21 consumes<edm::View<PileupSummaryInfo>>(input_);
22 info_ =
new std::vector<ic::PileupInfo>();
28 void ICPileupInfoProducer::produce(edm::Event& event,
29 const edm::EventSetup& setup) {
30 edm::Handle<edm::View<PileupSummaryInfo> > info_handle;
31 event.getByLabel(input_, info_handle);
33 info_->resize(info_handle->size());
34 for (
unsigned i = 0; i < info_handle->size(); ++i) {
35 PileupSummaryInfo
const& src = info_handle->at(i);
43 void ICPileupInfoProducer::beginJob() {
47 void ICPileupInfoProducer::endJob() {
Stores information on the in-time or out-of-time simulated pileup interactions.
void set_bunch_crossing(int const &bunch_crossing)
Bunch crossing where zero implies in-time and non-zero out-of-time.
DEFINE_FWK_MODULE(ICPileupInfoProducer)
void set_true_num_interactions(float const &true_num_interactions)
True number of interactions used as Poisson mean for sampling.
ICPileupInfoProducer(const edm::ParameterSet &)
void set_num_interactions(int const &num_interactions)
Poisson-sampled number of interactions.