15 : pileupInfoInputTag_(ps.getParameter<
edm::
InputTag>(
"PileupInfoInputTag")),
16 bunchSpacingInputTag_(ps.getParameter<
edm::
InputTag>(
"BunchSpacingInputTag")),
17 cfPlaybackInputTag_(ps.getParameter<
edm::
InputTag>(
"CFPlaybackInputTag")),
19 producesCollector.
produces<std::vector<PileupSummaryInfo>>();
20 producesCollector.
produces<
int>(
"bunchSpacing");
24 producesCollector.
produces<std::vector<reco::GenParticle>>(
tag.label());
32 auto it = std::find_if(
33 pileupInfoHandle->begin(), pileupInfoHandle->end(), [](
const auto&
s) {
return s.getBunchCrossing() == 0; });
34 if (
it == pileupInfoHandle->end()) {
35 throw cms::Exception(
"LogicError") <<
"Did not find PileupSummaryInfo in bunch crossing 0";
38 return it->getTrueNumInteractions();
42 LogDebug(
"PreMixingPileupCopy") <<
"\n===============> adding pileup Info from event " << pep.
principal().
id();
53 if (pileupInfoHandle.
isValid()) {
63 if (genPUProtonsHandle.
isValid()) {
67 edm::LogWarning(
"PreMixingPileupCopy") <<
"Missing product with label: " <<
tag.label();
86 e.put(std::make_unique<int>(
bsStorage_),
"bunchSpacing");
std::vector< std::vector< reco::GenParticle > > genPUProtons_
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
void putPileupInfo(edm::Event &e)
CrossingFramePlaybackInfoNew crossingFramePlaybackStorage_
edm::InputTag cfPlaybackInputTag_
std::vector< std::string > genPUProtons_labels_
void addPileupInfo(PileUpEventPrincipal const &pep)
edm::EventPrincipal const & principal()
std::vector< PileupSummaryInfo > pileupSummaryStorage_
std::vector< edm::InputTag > genPUProtonsInputTags_
edm::InputTag bunchSpacingInputTag_
float getTrueNumInteractions(PileUpEventPrincipal const &pep) const
Log< level::Warning, false > LogWarning
edm::InputTag pileupInfoInputTag_
EventID const & id() const
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
PreMixingPileupCopy(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)