12 auto merged = std::make_unique<CSCStripDigiCollection>();
15 const CSCDetId &layerId = elem.first;
20 std::vector<CSCStripDigi> NewDigiList;
22 std::vector<int> StripList;
23 std::vector<CSCStripDigiCollection::const_iterator> StripPointer;
26 StripList.push_back((*dtdigi).getStrip());
27 StripPointer.push_back(dtdigi);
31 std::vector<int> DuplicateList;
33 std::vector<CSCStripDigiCollection::const_iterator>::const_iterator StripPtr = StripPointer.begin();
35 for (std::vector<int>::const_iterator istrip = StripList.begin(); istrip != StripList.end(); ++istrip) {
36 const int CurrentStrip = *(istrip);
38 if (CurrentStrip > PrevStrip) {
39 PrevStrip = CurrentStrip;
42 dupl_count =
std::count(StripList.begin(), StripList.end(), CurrentStrip);
44 std::vector<int>::const_iterator duplicate = istrip;
46 std::vector<CSCStripDigiCollection::const_iterator>::const_iterator DuplPointer = StripPtr;
48 for (; duplicate != StripList.end(); ++duplicate) {
49 if ((*duplicate) == CurrentStrip) {
50 DuplicateList.push_back(CurrentStrip);
52 std::vector<int> pileup_adc = (**DuplPointer).getADCCounts();
53 std::vector<int> signal_adc = (**StripPtr).getADCCounts();
55 std::vector<int>::const_iterator minplace;
57 minplace = std::min_element(pileup_adc.begin(), pileup_adc.end());
59 int minvalue = (*minplace);
61 std::vector<int> new_adc;
63 std::vector<int>::const_iterator newsig = signal_adc.begin();
65 for (std::vector<int>::const_iterator ibin = pileup_adc.begin(); ibin != pileup_adc.end(); ++ibin) {
66 new_adc.push_back((*newsig) + (*ibin) - minvalue);
72 NewDigiList.push_back(newDigi);
77 NewDigiList.push_back(**StripPtr);
86 check =
std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
88 NewDigiList.push_back(**StripPtr);
95 merged->put(stripRange, layerId);
127 std::vector<PileupSummaryInfo>
const &ps,
128 int bunchSpacing)
override {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
std::unique_ptr< DigiCollection > accumulated_
void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
const uint16_t range(const Frame &aFrame)
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
PreMixingMuonWorker< CSCStripDigiCollection > stripWorker_
PreMixingCSCWorker(const edm::ParameterSet &ps, edm::ProducesCollector 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
PreMixingMuonWorker< CSCWireDigiCollection > wireWorker_
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
~PreMixingCSCWorker() override=default
std::string collectionDM_
#define DEFINE_PREMIXING_WORKER(TYPE)
PreMixingMuonWorker< CSCComparatorDigiCollection > comparatorWorker_