11 auto merged = std::make_unique<CSCStripDigiCollection>();
19 std::vector<CSCStripDigi> NewDigiList;
21 std::vector<int> StripList;
22 std::vector<CSCStripDigiCollection::const_iterator> StripPointer;
25 StripList.push_back((*dtdigi).getStrip());
26 StripPointer.push_back(dtdigi);
30 std::vector<int> DuplicateList;
32 std::vector<CSCStripDigiCollection::const_iterator>::const_iterator StripPtr = StripPointer.begin();
34 for (std::vector<int>::const_iterator istrip = StripList.begin(); istrip != StripList.end(); ++istrip) {
35 const int CurrentStrip = *(istrip);
37 if (CurrentStrip > PrevStrip) {
38 PrevStrip = CurrentStrip;
41 dupl_count =
std::count(StripList.begin(), StripList.end(), CurrentStrip);
43 std::vector<int>::const_iterator duplicate = istrip;
45 std::vector<CSCStripDigiCollection::const_iterator>::const_iterator DuplPointer = StripPtr;
47 for (; duplicate != StripList.end(); ++duplicate) {
48 if ((*duplicate) == CurrentStrip) {
49 DuplicateList.push_back(CurrentStrip);
51 std::vector<int> pileup_adc = (**DuplPointer).getADCCounts();
52 std::vector<int> signal_adc = (**StripPtr).getADCCounts();
54 std::vector<int>::const_iterator minplace;
56 minplace = std::min_element(pileup_adc.begin(), pileup_adc.end());
58 int minvalue = (*minplace);
60 std::vector<int> new_adc;
62 std::vector<int>::const_iterator newsig = signal_adc.begin();
64 for (std::vector<int>::const_iterator ibin = pileup_adc.begin(); ibin != pileup_adc.end(); ++ibin) {
65 new_adc.push_back((*newsig) + (*ibin) - minvalue);
71 NewDigiList.push_back(newDigi);
76 NewDigiList.push_back(**StripPtr);
85 check =
std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
87 NewDigiList.push_back(**StripPtr);
94 merged->put(stripRange, layerId);
105 : stripWorker_(ps.getParameter<
edm::
ParameterSet>(
"strip"), producer, iC),
107 comparatorWorker_(ps.getParameter<
edm::
ParameterSet>(
"comparator"), producer, iC) {}
113 stripWorker_.addSignals(iEvent, iSetup);
114 wireWorker_.addSignals(iEvent, iSetup);
115 comparatorWorker_.addSignals(iEvent, iSetup);
119 stripWorker_.addPileups(pep, iSetup);
120 wireWorker_.addPileups(pep, iSetup);
121 comparatorWorker_.addPileups(pep, iSetup);
126 std::vector<PileupSummaryInfo>
const &ps,
127 int bunchSpacing)
override {
128 stripWorker_.put(iEvent);
129 wireWorker_.put(iEvent);
130 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_
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
PreMixingCSCWorker(const edm::ParameterSet &ps, edm::ProducerBase &producer, edm::ConsumesCollector &&iC)
def elem(elemtype, innerHTML='', html_class='', kwargs)
PreMixingMuonWorker< CSCWireDigiCollection > wireWorker_
std::vector< DigiType >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
std::string collectionDM_
#define DEFINE_PREMIXING_WORKER(TYPE)
PreMixingMuonWorker< CSCComparatorDigiCollection > comparatorWorker_