CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::DataMixingMuonWorker Class Reference

#include <DataMixingMuonWorker.h>

Public Member Functions

void addMuonPileups (const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
 
void addMuonSignals (const edm::Event &e)
 
 DataMixingMuonWorker ()
 
 DataMixingMuonWorker (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
void putMuon (edm::Event &e)
 
virtual ~DataMixingMuonWorker ()
 

Private Attributes

std::string CSCComparatorDigiCollectionDM_
 
edm::InputTag CSCCompdigi_collectionSig_
 
edm::EDGetTokenT< CSCComparatorDigiCollectionCSCCompDigiPToken_
 
edm::EDGetTokenT< CSCComparatorDigiCollectionCSCCompDigiToken_
 
edm::InputTag CSCCompPileInputTag_
 
edm::InputTag CSCDigiTagSig_
 
edm::InputTag CSCstripdigi_collectionSig_
 
std::string CSCStripDigiCollectionDM_
 
edm::EDGetTokenT< CSCStripDigiCollectionCSCStripDigiPToken_
 
edm::EDGetTokenT< CSCStripDigiCollectionCSCStripDigiToken_
 
edm::InputTag CSCStripPileInputTag_
 
edm::InputTag CSCwiredigi_collectionSig_
 
std::string CSCWireDigiCollectionDM_
 
edm::EDGetTokenT< CSCWireDigiCollectionCSCWireDigiPToken_
 
edm::EDGetTokenT< CSCWireDigiCollectionCSCWireDigiToken_
 
edm::InputTag CSCWirePileInputTag_
 
edm::InputTag DTdigi_collectionSig_
 
std::string DTDigiCollectionDM_
 
edm::EDGetTokenT< DTDigiCollectionDTDigiPToken_
 
edm::InputTag DTDigiTagSig_
 
edm::EDGetTokenT< DTDigiCollectionDTDigiToken_
 
edm::InputTag DTPileInputTag_
 
std::string label_
 
CSCComparatorDigiCollectionOurCSCComparatorDigis_
 
CSCStripDigiCollectionOurCSCStripDigis_
 
CSCWireDigiCollectionOurCSCWireDigis_
 
DTDigiCollectionOurDTDigis_
 
RPCDigiCollectionOurRPCDigis_
 
edm::InputTag RPCdigi_collectionSig_
 
std::string RPCDigiCollectionDM_
 
edm::EDGetTokenT< RPCDigiCollectionRPCDigiPToken_
 
edm::InputTag RPCDigiTagSig_
 
edm::EDGetTokenT< RPCDigiCollectionRPCDigiToken_
 
edm::InputTag RPCPileInputTag_
 

Detailed Description

Definition at line 41 of file DataMixingMuonWorker.h.

Constructor & Destructor Documentation

◆ DataMixingMuonWorker() [1/2]

DataMixingMuonWorker::DataMixingMuonWorker ( )

Definition at line 21 of file DataMixingMuonWorker.cc.

21 {}

◆ DataMixingMuonWorker() [2/2]

DataMixingMuonWorker::DataMixingMuonWorker ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)
explicit

standard constructor

Definition at line 24 of file DataMixingMuonWorker.cc.

References CSCComparatorDigiCollectionDM_, CSCCompdigi_collectionSig_, CSCCompDigiPToken_, CSCCompDigiToken_, CSCCompPileInputTag_, CSCstripdigi_collectionSig_, CSCStripDigiCollectionDM_, CSCStripDigiPToken_, CSCStripDigiToken_, CSCStripPileInputTag_, CSCwiredigi_collectionSig_, CSCWireDigiCollectionDM_, CSCWireDigiPToken_, CSCWireDigiToken_, CSCWirePileInputTag_, DTDigiCollectionDM_, DTDigiPToken_, DTDigiTagSig_, DTDigiToken_, DTPileInputTag_, edm::ParameterSet::getParameter(), RPCDigiCollectionDM_, RPCDigiPToken_, RPCDigiTagSig_, RPCDigiToken_, RPCPileInputTag_, and AlCaHLTBitMon_QueryRunRegistry::string.

25  : label_(ps.getParameter<std::string>("Label"))
26 
27  {
28  // get the subdetector names
29  // this->getSubdetectorNames(); //something like this may be useful to
30  // check what we are supposed to do...
31 
32  // Declare the products to produce
33 
34  DTDigiTagSig_ = ps.getParameter<edm::InputTag>("DTDigiTagSig");
35  RPCDigiTagSig_ = ps.getParameter<edm::InputTag>("RPCDigiTagSig");
36 
37  CSCstripdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCstripdigiCollectionSig");
38  CSCwiredigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCwiredigiCollectionSig");
39  CSCCompdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCCompdigiCollectionSig");
40 
46 
47  DTPileInputTag_ = ps.getParameter<edm::InputTag>("DTPileInputTag");
48  RPCPileInputTag_ = ps.getParameter<edm::InputTag>("RPCPileInputTag");
49  CSCWirePileInputTag_ = ps.getParameter<edm::InputTag>("CSCWirePileInputTag");
50  CSCStripPileInputTag_ = ps.getParameter<edm::InputTag>("CSCStripPileInputTag");
51  CSCCompPileInputTag_ = ps.getParameter<edm::InputTag>("CSCCompPileInputTag");
52 
58 
59  // outputs:
60 
61  DTDigiCollectionDM_ = ps.getParameter<std::string>("DTDigiCollectionDM");
62  RPCDigiCollectionDM_ = ps.getParameter<std::string>("RPCDigiCollectionDM");
63  CSCStripDigiCollectionDM_ = ps.getParameter<std::string>("CSCStripDigiCollectionDM");
64  CSCWireDigiCollectionDM_ = ps.getParameter<std::string>("CSCWireDigiCollectionDM");
65  CSCComparatorDigiCollectionDM_ = ps.getParameter<std::string>("CSCComparatorDigiCollectionDM");
66  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag CSCwiredigi_collectionSig_
edm::EDGetTokenT< RPCDigiCollection > RPCDigiPToken_
edm::EDGetTokenT< CSCStripDigiCollection > CSCStripDigiPToken_
edm::EDGetTokenT< DTDigiCollection > DTDigiPToken_
edm::EDGetTokenT< RPCDigiCollection > RPCDigiToken_
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
edm::EDGetTokenT< CSCStripDigiCollection > CSCStripDigiToken_
edm::EDGetTokenT< CSCComparatorDigiCollection > CSCCompDigiToken_
edm::EDGetTokenT< CSCWireDigiCollection > CSCWireDigiToken_
edm::InputTag CSCCompdigi_collectionSig_
edm::EDGetTokenT< CSCComparatorDigiCollection > CSCCompDigiPToken_
edm::EDGetTokenT< CSCWireDigiCollection > CSCWireDigiPToken_
edm::InputTag CSCstripdigi_collectionSig_

◆ ~DataMixingMuonWorker()

DataMixingMuonWorker::~DataMixingMuonWorker ( )
virtual

Default destructor

Definition at line 69 of file DataMixingMuonWorker.cc.

69 {}

Member Function Documentation

◆ addMuonPileups()

void DataMixingMuonWorker::addMuonPileups ( const int  bcr,
const edm::EventPrincipal ep,
unsigned int  EventId,
ModuleCallingContext const *  mcc 
)

Definition at line 218 of file DataMixingMuonWorker.cc.

References CSCCompPileInputTag_, CSCStripPileInputTag_, CSCWirePileInputTag_, DTPileInputTag_, SiStripBadComponentsDQMServiceTemplate_cfg::ep, LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, FastTimerService_cff::range, and RPCPileInputTag_.

Referenced by edm::DataMixingModule::pileWorker().

221  {
222  LogDebug("DataMixingMuonWorker") << "\n===============> adding pileups from event " << ep->id()
223  << " for bunchcrossing " << bcr;
224 
225  // fill in maps of hits; same code as addSignals, except now applied to the
226  // pileup events
227 
228  // DT
229  //
230  // Get the digis from the event
231 
232  std::shared_ptr<Wrapper<DTDigiCollection> const> DTDigisPTR =
233  getProductByTag<DTDigiCollection>(*ep, DTPileInputTag_, mcc);
234 
235  if (DTDigisPTR) {
236  const DTDigiCollection *DTDigis = const_cast<DTDigiCollection *>(DTDigisPTR->product());
237 
239  for (DTLayerIt = DTDigis->begin(); DTLayerIt != DTDigis->end(); ++DTLayerIt) {
240  // The layerId
241  const DTLayerId &layerId = (*DTLayerIt).first;
242 
243  // Get the iterators over the Digis associated with this LayerId
244  const DTDigiCollection::Range &range = (*DTLayerIt).second;
245 
246  OurDTDigis_->put(range, layerId);
247  }
248  }
249  // RPC
250  //
251 
252  // Get the digis from the event
253 
254  std::shared_ptr<Wrapper<RPCDigiCollection> const> RPCDigisPTR =
255  getProductByTag<RPCDigiCollection>(*ep, RPCPileInputTag_, mcc);
256 
257  if (RPCDigisPTR) {
258  const RPCDigiCollection *RPCDigis = const_cast<RPCDigiCollection *>(RPCDigisPTR->product());
259 
261  for (RPCLayerIt = RPCDigis->begin(); RPCLayerIt != RPCDigis->end(); ++RPCLayerIt) {
262  // The layerId
263  const RPCDetId &layerId = (*RPCLayerIt).first;
264 
265  // Get the iterators over the digis associated with this LayerId
266  const RPCDigiCollection::Range &range = (*RPCLayerIt).second;
267 
268  OurRPCDigis_->put(range, layerId);
269  }
270  }
271 
272  // CSCStrip
273  //
274 
275  // Get the digis from the event
276 
277  std::shared_ptr<Wrapper<CSCStripDigiCollection> const> CSCStripDigisPTR =
278  getProductByTag<CSCStripDigiCollection>(*ep, CSCStripPileInputTag_, mcc);
279 
280  if (CSCStripDigisPTR) {
281  const CSCStripDigiCollection *CSCStripDigis = const_cast<CSCStripDigiCollection *>(CSCStripDigisPTR->product());
282 
284  for (CSCStripLayerIt = CSCStripDigis->begin(); CSCStripLayerIt != CSCStripDigis->end(); ++CSCStripLayerIt) {
285  // The layerId
286  const CSCDetId &layerId = (*CSCStripLayerIt).first;
287 
288  // Get the iterators over the digis associated with this LayerId
289  const CSCStripDigiCollection::Range &range = (*CSCStripLayerIt).second;
290 
291  // std::cout << " Pileup CSC layer " << (*CSCStripLayerIt).first <<
292  // std::endl;
293 
294  // for(CSCStripDigiCollection::const_iterator dtdigi=range.first;
295  // dtdigi!=range.second; dtdigi++){
296  // std::cout << "Digi " << (*dtdigi) << std::endl;
297  // }
298 
299  OurCSCStripDigis_->put(range, layerId);
300  }
301  }
302 
303  // CSCWire
304  //
305 
306  // Get the digis from the event
307 
308  std::shared_ptr<Wrapper<CSCWireDigiCollection> const> CSCWireDigisPTR =
309  getProductByTag<CSCWireDigiCollection>(*ep, CSCWirePileInputTag_, mcc);
310 
311  if (CSCWireDigisPTR) {
312  const CSCWireDigiCollection *CSCWireDigis = const_cast<CSCWireDigiCollection *>(CSCWireDigisPTR->product());
313 
315  for (CSCWireLayerIt = CSCWireDigis->begin(); CSCWireLayerIt != CSCWireDigis->end(); ++CSCWireLayerIt) {
316  // The layerId
317  const CSCDetId &layerId = (*CSCWireLayerIt).first;
318 
319  // Get the iterators over the digis associated with this LayerId
320  const CSCWireDigiCollection::Range &range = (*CSCWireLayerIt).second;
321 
322  OurCSCWireDigis_->put(range, layerId);
323  }
324  }
325 
326  // CSCComparators
327  //
328 
329  // Get the digis from the event
330 
331  std::shared_ptr<Wrapper<CSCComparatorDigiCollection> const> CSCComparatorDigisPTR =
332  getProductByTag<CSCComparatorDigiCollection>(*ep, CSCCompPileInputTag_, mcc);
333 
334  if (CSCComparatorDigisPTR) {
335  const CSCComparatorDigiCollection *CSCComparatorDigis =
336  const_cast<CSCComparatorDigiCollection *>(CSCComparatorDigisPTR->product());
337 
339  for (CSCComparatorLayerIt = CSCComparatorDigis->begin(); CSCComparatorLayerIt != CSCComparatorDigis->end();
340  ++CSCComparatorLayerIt) {
341  // The layerId
342  const CSCDetId &layerId = (*CSCComparatorLayerIt).first;
343 
344  // Get the iterators over the digis associated with this LayerId
345  const CSCComparatorDigiCollection::Range &range = (*CSCComparatorLayerIt).second;
346 
347  OurCSCComparatorDigis_->put(range, layerId);
348  }
349  }
350  }
CSCStripDigiCollection * OurCSCStripDigis_
RPCDigiCollection * OurRPCDigis_
CSCWireDigiCollection * OurCSCWireDigis_
std::pair< const_iterator, const_iterator > Range
CSCComparatorDigiCollection * OurCSCComparatorDigis_
#define LogDebug(id)

◆ addMuonSignals()

void DataMixingMuonWorker::addMuonSignals ( const edm::Event e)

Definition at line 71 of file DataMixingMuonWorker.cc.

References CSCCompDigiToken_, CSCStripDigiToken_, CSCWireDigiToken_, DTDigiToken_, MillePedeFileConverter_cfg::e, LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, edm::Handle< T >::product(), FastTimerService_cff::range, and RPCDigiToken_.

Referenced by edm::DataMixingModule::addSignals().

71  {
72  // fill in maps of hits
73 
74  LogDebug("DataMixingMuonWorker") << "===============> adding MC signals for " << e.id();
75 
76  // DT
77  //
78 
80  Handle<DTDigiCollection> pDTdigis;
81 
82  // Get the digis from the event
83  if (e.getByToken(DTDigiToken_, pDTdigis)) {
84  // LogInfo("DataMixingMuonWorker") << "total # DT Digis: " <<
85  // DTdigis->size();
86 
87  // Loop over digis, copying them to our own local storage
88  const DTDigiCollection *DTdigis = pDTdigis.product();
90  for (DLayerIt = DTdigis->begin(); DLayerIt != DTdigis->end(); ++DLayerIt) {
91  // The layerId
92  const DTLayerId &layerId = (*DLayerIt).first;
93 
94  // Get the iterators over the digis associated with this LayerId
95  const DTDigiCollection::Range &range = (*DLayerIt).second;
96 
97  OurDTDigis_->put(range, layerId);
98  }
99  }
100  // RPC
101  //
102 
104 
105  // Get the digis from the event
106  Handle<RPCDigiCollection> pRPCdigis;
107 
108  if (e.getByToken(RPCDigiToken_, pRPCdigis)) {
109  // Loop over digis, copying them to our own local storage
110 
111  const RPCDigiCollection *RPCdigis = pRPCdigis.product();
113  for (RLayerIt = RPCdigis->begin(); RLayerIt != RPCdigis->end(); ++RLayerIt) {
114  // The layerId
115  const RPCDetId &layerId = (*RLayerIt).first;
116 
117  // Get the iterators over the digis associated with this LayerId
118  const RPCDigiCollection::Range &range = (*RLayerIt).second;
119 
120  OurRPCDigis_->put(range, layerId);
121  }
122  }
123  // CSCStrip
124  //
125 
127 
128  // Get the digis from the event
129  Handle<CSCStripDigiCollection> pCSCStripdigis;
130 
131  if (e.getByToken(CSCStripDigiToken_, pCSCStripdigis)) {
132  // if(pCSCStripdigis.isValid() ) { std::cout << "Signal: have CSCStripDigis"
133  // << std::endl;} else { std::cout << "Signal: NO CSCStripDigis" <<
134  // std::endl;}
135 
136  // Loop over digis, copying them to our own local storage
137 
138  const CSCStripDigiCollection *CSCStripdigis = pCSCStripdigis.product();
140  for (CSLayerIt = CSCStripdigis->begin(); CSLayerIt != CSCStripdigis->end(); ++CSLayerIt) {
141  // The layerId
142  const CSCDetId &layerId = (*CSLayerIt).first;
143 
144  // Get the iterators over the digis associated with this LayerId
145  const CSCStripDigiCollection::Range &range = (*CSLayerIt).second;
146 
147  // std::cout << " Signal CSC layer " << (*CSLayerIt).first << std::endl;
148 
149  // for(CSCStripDigiCollection::const_iterator dtdigi=range.first;
150  // dtdigi!=range.second; dtdigi++){
151  // std::cout << "Digi " << (*dtdigi) << std::endl;
152  //}
153 
154  OurCSCStripDigis_->put(range, layerId);
155  }
156  }
157  // CSCWire
158  //
159 
161 
162  // Get the digis from the event
163  Handle<CSCWireDigiCollection> pCSCWiredigis;
164 
165  if (e.getByToken(CSCWireDigiToken_, pCSCWiredigis)) {
166  // if(pCSCWiredigis.isValid() ) { std::cout << "Signal: have CSCWireDigis"
167  // << std::endl;} else { std::cout << "Signal: NO CSCWireDigis" <<
168  // std::endl;}
169 
170  // Loop over digis, copying them to our own local storage
171 
172  const CSCWireDigiCollection *CSCWiredigis = pCSCWiredigis.product();
174  for (CWLayerIt = CSCWiredigis->begin(); CWLayerIt != CSCWiredigis->end(); ++CWLayerIt) {
175  // The layerId
176  const CSCDetId &layerId = (*CWLayerIt).first;
177 
178  // Get the iterators over the digis associated with this LayerId
179  const CSCWireDigiCollection::Range &range = (*CWLayerIt).second;
180 
181  OurCSCWireDigis_->put(range, layerId);
182  }
183  }
184 
185  // CSCComparators
186  //
187 
189 
190  // Get the digis from the event
191  Handle<CSCComparatorDigiCollection> pCSCComparatordigis;
192 
193  // std::cout << "CSCComp label: " << CSCDigiTagSig_.label() << " " <<
194  // CSCCompdigi_collectionSig_.label() << std::endl;
195 
196  if (e.getByToken(CSCCompDigiToken_, pCSCComparatordigis)) {
197  // if(pCSCComparatordigis.isValid() ) { std::cout << "Signal: have
198  // CSCComparatorDigis" << std::endl;} else { std::cout << "Signal: NO
199  // CSCComparatorDigis" << std::endl;}
200 
201  // Loop over digis, copying them to our own local storage
202 
203  const CSCComparatorDigiCollection *CSCComparatordigis = pCSCComparatordigis.product();
205  for (CWLayerIt = CSCComparatordigis->begin(); CWLayerIt != CSCComparatordigis->end(); ++CWLayerIt) {
206  // The layerId
207  const CSCDetId &layerId = (*CWLayerIt).first;
208 
209  // Get the iterators over the digis associated with this LayerId
210  const CSCComparatorDigiCollection::Range &range = (*CWLayerIt).second;
211 
212  OurCSCComparatorDigis_->put(range, layerId);
213  }
214  }
215 
216  } // end of addMuonSignals
MuonDigiCollection< CSCDetId, CSCStripDigi > CSCStripDigiCollection
CSCStripDigiCollection * OurCSCStripDigis_
MuonDigiCollection< CSCDetId, CSCComparatorDigi > CSCComparatorDigiCollection
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
edm::EDGetTokenT< RPCDigiCollection > RPCDigiToken_
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
RPCDigiCollection * OurRPCDigis_
CSCWireDigiCollection * OurCSCWireDigis_
MuonDigiCollection< CSCDetId, CSCWireDigi > CSCWireDigiCollection
edm::EDGetTokenT< CSCStripDigiCollection > CSCStripDigiToken_
edm::EDGetTokenT< CSCComparatorDigiCollection > CSCCompDigiToken_
edm::EDGetTokenT< CSCWireDigiCollection > CSCWireDigiToken_
std::pair< const_iterator, const_iterator > Range
CSCComparatorDigiCollection * OurCSCComparatorDigis_
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
#define LogDebug(id)

◆ putMuon()

void DataMixingMuonWorker::putMuon ( edm::Event e)

Definition at line 352 of file DataMixingMuonWorker.cc.

References edm::check(), submitPVResolutionJobs::count, CSCComparatorDigiCollectionDM_, CSCStripDigiCollectionDM_, CSCWireDigiCollectionDM_, MillePedeFileConverter_cfg::e, eostools::move(), OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, and FastTimerService_cff::range.

Referenced by edm::DataMixingModule::put().

352  {
353  // collections of digis to put in the event
354  std::unique_ptr<DTDigiCollection> DTDigiMerge(new DTDigiCollection);
355  std::unique_ptr<RPCDigiCollection> RPCDigiMerge(new RPCDigiCollection);
356  std::unique_ptr<CSCStripDigiCollection> CSCStripDigiMerge(new CSCStripDigiCollection);
357  std::unique_ptr<CSCWireDigiCollection> CSCWireDigiMerge(new CSCWireDigiCollection);
358  std::unique_ptr<CSCComparatorDigiCollection> CSCComparatorDigiMerge(new CSCComparatorDigiCollection);
359 
360  // Loop over DT digis, copying them from our own local storage
361 
363  for (DLayerIt = OurDTDigis_->begin(); DLayerIt != OurDTDigis_->end(); ++DLayerIt) {
364  // The layerId
365  const DTLayerId &layerId = (*DLayerIt).first;
366 
367  // Get the iterators over the digis associated with this LayerId
368  const DTDigiCollection::Range &range = (*DLayerIt).second;
369 
370  DTDigiMerge->put(range, layerId);
371  }
372 
373  // Loop over RPC digis, copying them from our own local storage
374 
376  for (RLayerIt = OurRPCDigis_->begin(); RLayerIt != OurRPCDigis_->end(); ++RLayerIt) {
377  // The layerId
378  const RPCDetId &layerId = (*RLayerIt).first;
379 
380  // Get the iterators over the digis associated with this LayerId
381  const RPCDigiCollection::Range &range = (*RLayerIt).second;
382 
383  RPCDigiMerge->put(range, layerId);
384  }
385  // Loop over CSCStrip digis, copying them from our own local storage
386 
388  for (CSLayerIt = OurCSCStripDigis_->begin(); CSLayerIt != OurCSCStripDigis_->end(); ++CSLayerIt) {
389  // The layerId
390  const CSCDetId &layerId = (*CSLayerIt).first;
391 
392  // Get the iterators over the digis associated with this LayerId
393  const CSCStripDigiCollection::Range &range = (*CSLayerIt).second;
394 
395  std::vector<CSCStripDigi> NewDigiList;
396 
397  std::vector<int> StripList;
398  std::vector<CSCStripDigiCollection::const_iterator> StripPointer;
399 
400  for (CSCStripDigiCollection::const_iterator dtdigi = range.first; dtdigi != range.second; ++dtdigi) {
401  // std::cout << "Digi " << (*dtdigi).getStrip() << std::endl;
402  StripList.push_back((*dtdigi).getStrip());
403  StripPointer.push_back(dtdigi);
404  }
405 
406  int PrevStrip = -1;
407  std::vector<int> DuplicateList;
408 
409  std::vector<CSCStripDigiCollection::const_iterator>::const_iterator StripPtr = StripPointer.begin();
410 
411  for (std::vector<int>::const_iterator istrip = StripList.begin(); istrip != StripList.end(); ++istrip) {
412  const int CurrentStrip = *(istrip);
413 
414  if (CurrentStrip > PrevStrip) {
415  PrevStrip = CurrentStrip;
416 
417  int dupl_count;
418  dupl_count = std::count(StripList.begin(), StripList.end(), CurrentStrip);
419  if (dupl_count > 1) {
420  std::vector<int>::const_iterator duplicate = istrip;
421  ++duplicate;
422  std::vector<CSCStripDigiCollection::const_iterator>::const_iterator DuplPointer = StripPtr;
423  ++DuplPointer;
424  for (; duplicate != StripList.end(); ++duplicate) {
425  if ((*duplicate) == CurrentStrip) {
426  // std::cout << " Duplicate of current " <<
427  // CurrentStrip << " found at " << (duplicate - StripList.begin())
428  //<< std::endl;
429 
430  DuplicateList.push_back(CurrentStrip);
431 
432  std::vector<int> pileup_adc = (**DuplPointer).getADCCounts();
433  std::vector<int> signal_adc = (**StripPtr).getADCCounts();
434 
435  std::vector<int>::const_iterator minplace;
436 
437  minplace = std::min_element(pileup_adc.begin(), pileup_adc.end());
438 
439  int minvalue = (*minplace);
440 
441  std::vector<int> new_adc;
442 
443  std::vector<int>::const_iterator newsig = signal_adc.begin();
444 
445  for (std::vector<int>::const_iterator ibin = pileup_adc.begin(); ibin != pileup_adc.end(); ++ibin) {
446  new_adc.push_back((*newsig) + (*ibin) - minvalue);
447 
448  ++newsig;
449  }
450 
451  CSCStripDigi newDigi(CurrentStrip, new_adc);
452  NewDigiList.push_back(newDigi);
453  }
454  ++DuplPointer;
455  }
456  } else {
457  NewDigiList.push_back(**StripPtr);
458  }
459  } // if strips monotonically increasing... Haven't hit duplicates yet
460  else { // reached end of signal digis, or there was no overlap
461  PrevStrip = 1000; // now into pileup signals, stop looking forward for
462  // duplicates
463 
464  // check if this digi was in the duplicate list
465  int check;
466  check = std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
467  if (check == 0)
468  NewDigiList.push_back(**StripPtr);
469  }
470  ++StripPtr;
471  }
472 
473  CSCStripDigiCollection::Range stripRange(NewDigiList.begin(), NewDigiList.end());
474 
475  CSCStripDigiMerge->put(stripRange, layerId);
476  }
477  // Loop over CSCStrip digis, copying them from our own local storage
478 
480  for (CWLayerIt = OurCSCWireDigis_->begin(); CWLayerIt != OurCSCWireDigis_->end(); ++CWLayerIt) {
481  // The layerId
482  const CSCDetId &layerId = (*CWLayerIt).first;
483 
484  // Get the iterators over the digis associated with this LayerId
485  const CSCWireDigiCollection::Range &range = (*CWLayerIt).second;
486 
487  CSCWireDigiMerge->put(range, layerId);
488  }
489 
490  // Loop over CSCComparator digis, copying them from our own local storage
491 
493  for (CCLayerIt = OurCSCComparatorDigis_->begin(); CCLayerIt != OurCSCComparatorDigis_->end(); ++CCLayerIt) {
494  // The layerId
495  const CSCDetId &layerId = (*CCLayerIt).first;
496 
497  // Get the iterators over the digis associated with this LayerId
498  const CSCComparatorDigiCollection::Range &range = (*CCLayerIt).second;
499 
500  CSCComparatorDigiMerge->put(range, layerId);
501  }
502 
503  // put the collection of recunstructed hits in the event
504  // LogDebug("DataMixingMuonWorker") << "total # DT Merged Digis: " <<
505  // DTDigiMerge->size() ; LogDebug("DataMixingMuonWorker") << "total # RPC
506  // Merged Digis: " << RPCDigiMerge->size() ;
507  // LogDebug("DataMixingMuonWorker") << "total # CSCStrip Merged Digis: " <<
508  // CSCStripDigiMerge->size() ; LogDebug("DataMixingMuonWorker") << "total #
509  // CSCWire Merged Digis: " << CSCWireDigiMerge->size() ;
510 
511  e.put(std::move(DTDigiMerge));
512  e.put(std::move(RPCDigiMerge));
513  e.put(std::move(CSCStripDigiMerge), CSCStripDigiCollectionDM_);
514  e.put(std::move(CSCWireDigiMerge), CSCWireDigiCollectionDM_);
515  e.put(std::move(CSCComparatorDigiMerge), CSCComparatorDigiCollectionDM_);
516 
517  // clear local storage for this event
518  delete OurDTDigis_;
519  delete OurRPCDigis_;
520  delete OurCSCStripDigis_;
521  delete OurCSCWireDigis_;
522  delete OurCSCComparatorDigis_;
523  }
CSCStripDigiCollection * OurCSCStripDigis_
RPCDigiCollection * OurRPCDigis_
CSCWireDigiCollection * OurCSCWireDigis_
std::pair< const_iterator, const_iterator > Range
CSCComparatorDigiCollection * OurCSCComparatorDigis_
std::vector< DigiType >::const_iterator const_iterator
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ CSCComparatorDigiCollectionDM_

std::string edm::DataMixingMuonWorker::CSCComparatorDigiCollectionDM_
private

Definition at line 94 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

◆ CSCCompdigi_collectionSig_

edm::InputTag edm::DataMixingMuonWorker::CSCCompdigi_collectionSig_
private

Definition at line 67 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCCompDigiPToken_

edm::EDGetTokenT<CSCComparatorDigiCollection> edm::DataMixingMuonWorker::CSCCompDigiPToken_
private

Definition at line 85 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCCompDigiToken_

edm::EDGetTokenT<CSCComparatorDigiCollection> edm::DataMixingMuonWorker::CSCCompDigiToken_
private

Definition at line 79 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

◆ CSCCompPileInputTag_

edm::InputTag edm::DataMixingMuonWorker::CSCCompPileInputTag_
private

Definition at line 74 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

◆ CSCDigiTagSig_

edm::InputTag edm::DataMixingMuonWorker::CSCDigiTagSig_
private

Definition at line 60 of file DataMixingMuonWorker.h.

◆ CSCstripdigi_collectionSig_

edm::InputTag edm::DataMixingMuonWorker::CSCstripdigi_collectionSig_
private

Definition at line 63 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCStripDigiCollectionDM_

std::string edm::DataMixingMuonWorker::CSCStripDigiCollectionDM_
private

Definition at line 90 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

◆ CSCStripDigiPToken_

edm::EDGetTokenT<CSCStripDigiCollection> edm::DataMixingMuonWorker::CSCStripDigiPToken_
private

Definition at line 83 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCStripDigiToken_

edm::EDGetTokenT<CSCStripDigiCollection> edm::DataMixingMuonWorker::CSCStripDigiToken_
private

Definition at line 77 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

◆ CSCStripPileInputTag_

edm::InputTag edm::DataMixingMuonWorker::CSCStripPileInputTag_
private

Definition at line 73 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

◆ CSCwiredigi_collectionSig_

edm::InputTag edm::DataMixingMuonWorker::CSCwiredigi_collectionSig_
private

Definition at line 65 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCWireDigiCollectionDM_

std::string edm::DataMixingMuonWorker::CSCWireDigiCollectionDM_
private

Definition at line 92 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

◆ CSCWireDigiPToken_

edm::EDGetTokenT<CSCWireDigiCollection> edm::DataMixingMuonWorker::CSCWireDigiPToken_
private

Definition at line 84 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ CSCWireDigiToken_

edm::EDGetTokenT<CSCWireDigiCollection> edm::DataMixingMuonWorker::CSCWireDigiToken_
private

Definition at line 78 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

◆ CSCWirePileInputTag_

edm::InputTag edm::DataMixingMuonWorker::CSCWirePileInputTag_
private

Definition at line 72 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

◆ DTdigi_collectionSig_

edm::InputTag edm::DataMixingMuonWorker::DTdigi_collectionSig_
private

Definition at line 58 of file DataMixingMuonWorker.h.

◆ DTDigiCollectionDM_

std::string edm::DataMixingMuonWorker::DTDigiCollectionDM_
private

Definition at line 88 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ DTDigiPToken_

edm::EDGetTokenT<DTDigiCollection> edm::DataMixingMuonWorker::DTDigiPToken_
private

Definition at line 82 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ DTDigiTagSig_

edm::InputTag edm::DataMixingMuonWorker::DTDigiTagSig_
private

Definition at line 61 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ DTDigiToken_

edm::EDGetTokenT<DTDigiCollection> edm::DataMixingMuonWorker::DTDigiToken_
private

Definition at line 76 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

◆ DTPileInputTag_

edm::InputTag edm::DataMixingMuonWorker::DTPileInputTag_
private

Definition at line 70 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

◆ label_

std::string edm::DataMixingMuonWorker::label_
private

◆ OurCSCComparatorDigis_

CSCComparatorDigiCollection* edm::DataMixingMuonWorker::OurCSCComparatorDigis_
private

Definition at line 104 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

◆ OurCSCStripDigis_

CSCStripDigiCollection* edm::DataMixingMuonWorker::OurCSCStripDigis_
private

Definition at line 102 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

◆ OurCSCWireDigis_

CSCWireDigiCollection* edm::DataMixingMuonWorker::OurCSCWireDigis_
private

Definition at line 103 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

◆ OurDTDigis_

DTDigiCollection* edm::DataMixingMuonWorker::OurDTDigis_
private

Definition at line 100 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

◆ OurRPCDigis_

RPCDigiCollection* edm::DataMixingMuonWorker::OurRPCDigis_
private

Definition at line 101 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

◆ RPCdigi_collectionSig_

edm::InputTag edm::DataMixingMuonWorker::RPCdigi_collectionSig_
private

Definition at line 59 of file DataMixingMuonWorker.h.

◆ RPCDigiCollectionDM_

std::string edm::DataMixingMuonWorker::RPCDigiCollectionDM_
private

Definition at line 89 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ RPCDigiPToken_

edm::EDGetTokenT<RPCDigiCollection> edm::DataMixingMuonWorker::RPCDigiPToken_
private

Definition at line 86 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ RPCDigiTagSig_

edm::InputTag edm::DataMixingMuonWorker::RPCDigiTagSig_
private

Definition at line 62 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

◆ RPCDigiToken_

edm::EDGetTokenT<RPCDigiCollection> edm::DataMixingMuonWorker::RPCDigiToken_
private

Definition at line 80 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

◆ RPCPileInputTag_

edm::InputTag edm::DataMixingMuonWorker::RPCPileInputTag_
private

Definition at line 71 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().