26 std::vector<PileupSummaryInfo>
const& ps,
27 int bunchSpacing)
override;
34 std::unique_ptr<PCrossingFrame<T> >
merged_;
42 pileupTag_(ps.getParameter<edm::
InputTag>(
"pileInputTag")),
43 collectionDM_(ps.getParameter<std::
string>(
"collectionDM")) {
54 const auto& cf = *hcf;
55 if (!cf.getPileups().empty()) {
56 throw cms::Exception(
"LogicError") <<
"Got CrossingFrame from signal with pileup content?";
59 merged_ = std::make_unique<PCrossingFrame<T> >(cf);
67 const auto& cf = *hcf;
68 if (!cf.getSignals().empty()) {
69 throw cms::Exception(
"LogicError") <<
"Got PCrossingFrame from pileup with signal content?";
72 merged_->setAllExceptSignalFrom(cf);
78 std::vector<PileupSummaryInfo>
const& ps,
80 auto orphanHandle = iEvent.
put(
std::move(merged_), collectionDM_);
81 const auto& pcf = *orphanHandle;
83 const auto bx = pcf.getBunchRange();
84 auto cf = std::make_unique<CrossingFrame<T> >(
85 bx.first,
bx.second, pcf.getBunchSpace(), pcf.getSubDet(), pcf.getMaxNbSources());
86 cf->addSignals(&(pcf.getSignals()), pcf.getEventID());
87 cf->setPileups(pcf.getPileups());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~PreMixingCrossingFrameWorker() override=default
std::unique_ptr< PCrossingFrame< T > > merged_
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
edm::EDGetTokenT< CrossingFrame< T > > signalToken_
std::string collectionDM_
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
PreMixingCrossingFrameWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
#define DEFINE_PREMIXING_WORKER(TYPE)