12 auto merged = std::make_unique<CSCStripDigiCollection>();
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);
106 : stripWorker_(ps.getParameter<
edm::
ParameterSet>(
"strip"), producesCollector, iC),
107 wireWorker_(ps.getParameter<
edm::
ParameterSet>(
"wire"), producesCollector, iC),
108 comparatorWorker_(ps.getParameter<
edm::
ParameterSet>(
"comparator"), producesCollector, iC) {}
114 stripWorker_.addSignals(iEvent, iSetup);
115 wireWorker_.addSignals(iEvent, iSetup);
116 comparatorWorker_.addSignals(iEvent, iSetup);
120 stripWorker_.addPileups(pep, iSetup);
121 wireWorker_.addPileups(pep, iSetup);
122 comparatorWorker_.addPileups(pep, iSetup);
127 std::vector<PileupSummaryInfo>
const &ps,
128 int bunchSpacing)
override {
129 stripWorker_.put(iEvent);
130 wireWorker_.put(iEvent);
131 comparatorWorker_.put(iEvent);
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
std::unique_ptr< DigiCollection > accumulated_
void addSignals(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
PreMixingMuonWorker< CSCStripDigiCollection > stripWorker_
PreMixingCSCWorker(const edm::ParameterSet &ps, edm::ProducesCollector producesCollector, edm::ConsumesCollector &&iC)
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
def elem(elemtype, innerHTML='', html_class='', kwargs)
PreMixingMuonWorker< CSCWireDigiCollection > wireWorker_
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
std::string collectionDM_
#define DEFINE_PREMIXING_WORKER(TYPE)
PreMixingMuonWorker< CSCComparatorDigiCollection > comparatorWorker_