1 #ifndef SimGeneral_PremixingModule_PreMixingDigiSimLinkWorker_h
2 #define SimGeneral_PremixingModule_PreMixingDigiSimLinkWorker_h
15 template <
typename DigiSimLinkCollection>
26 std::vector<PileupSummaryInfo>
const& ps,
27 int bunchSpacing)
override;
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>
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,
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~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_
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
std::unique_ptr< DigiSimLinkCollection > merged_