1 #ifndef SimGeneral_PremixingModule_PreMixingDigiSimLinkWorker_h 2 #define SimGeneral_PremixingModule_PreMixingDigiSimLinkWorker_h 15 template <
typename DigiSimLinkCollection>
26 std::vector<PileupSummaryInfo>
const& ps,
34 std::unique_ptr<DigiSimLinkCollection>
merged_;
37 template <
typename DigiSimLinkCollection>
41 : signalToken_(iC.consumes<DigiSimLinkCollection>(ps.getParameter<
edm::
InputTag>(
"labelSig"))),
42 pileupTag_(ps.getParameter<
edm::
InputTag>(
"pileInputTag")),
43 collectionDM_(ps.getParameter<
std::
string>(
"collectionDM")) {
47 template <
typename DigiSimLinkCollection>
51 iEvent.getByToken(signalToken_, digis);
54 merged_ = std::make_unique<DigiSimLinkCollection>(*digis);
56 merged_ = std::make_unique<DigiSimLinkCollection>();
60 template <
typename DigiSimLinkCollection>
66 for (
const auto& detsetSource : *digis) {
67 auto& detsetTarget = merged_->find_or_insert(detsetSource.detId());
68 std::copy(detsetSource.begin(), detsetSource.end(), std::back_inserter(detsetTarget));
73 template <
typename DigiSimLinkCollection>
76 std::vector<PileupSummaryInfo>
const& ps,
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
~PreMixingDigiSimLinkWorker() override=default
edm::EDGetTokenT< DigiSimLinkCollection > signalToken_
PreMixingDigiSimLinkWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
std::string collectionDM_
std::unique_ptr< DigiSimLinkCollection > merged_
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const