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) {
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 else { NewDigiList.push_back(**StripPtr); }
84 check =
std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
85 if(check == 0) NewDigiList.push_back(**StripPtr);
92 merged->put(stripRange, layerId);
103 stripWorker_(ps.getParameter<
edm::
ParameterSet>(
"strip"), producer, iC),
105 comparatorWorker_(ps.getParameter<
edm::
ParameterSet>(
"comparator"), producer, iC) {}
111 stripWorker_.addSignals(iEvent, iSetup);
112 wireWorker_.addSignals(iEvent, iSetup);
113 comparatorWorker_.addSignals(iEvent, iSetup);
117 stripWorker_.addPileups(pep, iSetup);
118 wireWorker_.addPileups(pep, iSetup);
119 comparatorWorker_.addPileups(pep, iSetup);
123 stripWorker_.put(iEvent);
124 wireWorker_.put(iEvent);
125 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< CSCStripDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
std::string collectionDM_
#define DEFINE_PREMIXING_WORKER(TYPE)
PreMixingMuonWorker< CSCComparatorDigiCollection > comparatorWorker_