CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< CSCComparatorDigiCollection
CSCCompDigiPToken_
 
edm::EDGetTokenT
< CSCComparatorDigiCollection
CSCCompDigiToken_
 
edm::InputTag CSCCompPileInputTag_
 
edm::InputTag CSCDigiTagSig_
 
edm::InputTag CSCstripdigi_collectionSig_
 
std::string CSCStripDigiCollectionDM_
 
edm::EDGetTokenT
< CSCStripDigiCollection
CSCStripDigiPToken_
 
edm::EDGetTokenT
< CSCStripDigiCollection
CSCStripDigiToken_
 
edm::InputTag CSCStripPileInputTag_
 
edm::InputTag CSCwiredigi_collectionSig_
 
std::string CSCWireDigiCollectionDM_
 
edm::EDGetTokenT
< CSCWireDigiCollection
CSCWireDigiPToken_
 
edm::EDGetTokenT
< CSCWireDigiCollection
CSCWireDigiToken_
 
edm::InputTag CSCWirePileInputTag_
 
edm::InputTag DTdigi_collectionSig_
 
std::string DTDigiCollectionDM_
 
edm::EDGetTokenT
< DTDigiCollection
DTDigiPToken_
 
edm::InputTag DTDigiTagSig_
 
edm::EDGetTokenT
< DTDigiCollection
DTDigiToken_
 
edm::InputTag DTPileInputTag_
 
std::string label_
 
CSCComparatorDigiCollectionOurCSCComparatorDigis_
 
CSCStripDigiCollectionOurCSCStripDigis_
 
CSCWireDigiCollectionOurCSCWireDigis_
 
DTDigiCollectionOurDTDigis_
 
RPCDigiCollectionOurRPCDigis_
 
edm::InputTag RPCdigi_collectionSig_
 
std::string RPCDigiCollectionDM_
 
edm::EDGetTokenT
< RPCDigiCollection
RPCDigiPToken_
 
edm::InputTag RPCDigiTagSig_
 
edm::EDGetTokenT
< RPCDigiCollection
RPCDigiToken_
 
edm::InputTag RPCPileInputTag_
 

Detailed Description

Definition at line 43 of file DataMixingMuonWorker.h.

Constructor & Destructor Documentation

DataMixingMuonWorker::DataMixingMuonWorker ( )

Definition at line 27 of file DataMixingMuonWorker.cc.

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

standard constructor

Definition at line 30 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.

30  :
31  label_(ps.getParameter<std::string>("Label"))
32 
33  {
34 
35  // get the subdetector names
36  // this->getSubdetectorNames(); //something like this may be useful to check what we are supposed to do...
37 
38  // Declare the products to produce
39 
40  DTDigiTagSig_ = ps.getParameter<edm::InputTag>("DTDigiTagSig");
41  RPCDigiTagSig_ = ps.getParameter<edm::InputTag>("RPCDigiTagSig");
42 
43  CSCstripdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCstripdigiCollectionSig");
44  CSCwiredigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCwiredigiCollectionSig");
45  CSCCompdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCCompdigiCollectionSig");
46 
52 
53  DTPileInputTag_ = ps.getParameter<edm::InputTag>("DTPileInputTag");
54  RPCPileInputTag_ = ps.getParameter<edm::InputTag>("RPCPileInputTag");
55  CSCWirePileInputTag_ = ps.getParameter<edm::InputTag>("CSCWirePileInputTag");
56  CSCStripPileInputTag_ = ps.getParameter<edm::InputTag>("CSCStripPileInputTag");
57  CSCCompPileInputTag_ = ps.getParameter<edm::InputTag>("CSCCompPileInputTag");
58 
64 
65 
66  // outputs:
67 
68  DTDigiCollectionDM_ = ps.getParameter<std::string>("DTDigiCollectionDM");
69  RPCDigiCollectionDM_ = ps.getParameter<std::string>("RPCDigiCollectionDM");
70  CSCStripDigiCollectionDM_ = ps.getParameter<std::string>("CSCStripDigiCollectionDM");
71  CSCWireDigiCollectionDM_ = ps.getParameter<std::string>("CSCWireDigiCollectionDM");
72  CSCComparatorDigiCollectionDM_ = ps.getParameter<std::string>("CSCComparatorDigiCollectionDM");
73 
74 
75  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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 ( )
virtual

Default destructor

Definition at line 79 of file DataMixingMuonWorker.cc.

79  {
80  }

Member Function Documentation

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

Definition at line 236 of file DataMixingMuonWorker.cc.

References CSCCompPileInputTag_, CSCStripPileInputTag_, CSCWirePileInputTag_, DTPileInputTag_, edm::EventPrincipal::id(), LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, and RPCPileInputTag_.

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

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

Definition at line 82 of file DataMixingMuonWorker.cc.

References CSCCompDigiToken_, CSCStripDigiToken_, CSCWireDigiToken_, DTDigiToken_, edm::Event::getByToken(), edm::EventBase::id(), LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, edm::Handle< T >::product(), and RPCDigiToken_.

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

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

Definition at line 377 of file DataMixingMuonWorker.cc.

References edm::check(), prof2calltree::count, CSCComparatorDigiCollectionDM_, CSCStripDigiCollectionDM_, CSCWireDigiCollectionDM_, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, and edm::Event::put().

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

377  {
378 
379  // collections of digis to put in the event
380  std::auto_ptr< DTDigiCollection > DTDigiMerge( new DTDigiCollection );
381  std::auto_ptr< RPCDigiCollection > RPCDigiMerge( new RPCDigiCollection );
382  std::auto_ptr< CSCStripDigiCollection > CSCStripDigiMerge( new CSCStripDigiCollection );
383  std::auto_ptr< CSCWireDigiCollection > CSCWireDigiMerge( new CSCWireDigiCollection );
384  std::auto_ptr< CSCComparatorDigiCollection > CSCComparatorDigiMerge( new CSCComparatorDigiCollection );
385 
386  // Loop over DT digis, copying them from our own local storage
387 
389  for (DLayerIt = OurDTDigis_->begin(); DLayerIt != OurDTDigis_->end(); ++DLayerIt) {
390  // The layerId
391  const DTLayerId& layerId = (*DLayerIt).first;
392 
393  // Get the iterators over the digis associated with this LayerId
394  const DTDigiCollection::Range& range = (*DLayerIt).second;
395 
396 
397  DTDigiMerge->put(range, layerId);
398 
399  }
400 
401  // Loop over RPC digis, copying them from our own local storage
402 
404  for (RLayerIt = OurRPCDigis_->begin(); RLayerIt != OurRPCDigis_->end(); ++RLayerIt) {
405  // The layerId
406  const RPCDetId& layerId = (*RLayerIt).first;
407 
408  // Get the iterators over the digis associated with this LayerId
409  const RPCDigiCollection::Range& range = (*RLayerIt).second;
410 
411  RPCDigiMerge->put(range, layerId);
412 
413  }
414  // Loop over CSCStrip digis, copying them from our own local storage
415 
417  for (CSLayerIt = OurCSCStripDigis_->begin(); CSLayerIt != OurCSCStripDigis_->end(); ++CSLayerIt) {
418  // The layerId
419  const CSCDetId& layerId = (*CSLayerIt).first;
420 
421  // Get the iterators over the digis associated with this LayerId
422  const CSCStripDigiCollection::Range& range = (*CSLayerIt).second;
423 
424  std::vector<CSCStripDigi> NewDigiList;
425 
426  std::vector<int> StripList;
427  std::vector<CSCStripDigiCollection::const_iterator> StripPointer;
428 
429  for(CSCStripDigiCollection::const_iterator dtdigi=range.first; dtdigi!=range.second; ++dtdigi){
430  //std::cout << "Digi " << (*dtdigi).getStrip() << std::endl;
431  StripList.push_back( (*dtdigi).getStrip() );
432  StripPointer.push_back( dtdigi );
433  }
434 
435  int PrevStrip = -1;
436  std::vector<int> DuplicateList;
437 
438  std::vector<CSCStripDigiCollection::const_iterator>::const_iterator StripPtr = StripPointer.begin();
439 
440  for( std::vector<int>::const_iterator istrip = StripList.begin(); istrip !=StripList.end(); ++istrip) {
441 
442  const int CurrentStrip = *(istrip);
443 
444  if(CurrentStrip > PrevStrip) {
445  PrevStrip = CurrentStrip;
446 
447  int dupl_count;
448  dupl_count = std::count(StripList.begin(), StripList.end(), CurrentStrip);
449  if(dupl_count > 1) {
450  std::vector<int>::const_iterator duplicate = istrip;
451  ++duplicate;
452  std::vector<CSCStripDigiCollection::const_iterator>::const_iterator DuplPointer = StripPtr;
453  ++DuplPointer;
454  for( ; duplicate!=StripList.end(); ++duplicate) {
455  if( (*duplicate) == CurrentStrip ) {
456 
457  // std::cout << " Duplicate of current " << CurrentStrip << " found at " << (duplicate - StripList.begin()) << std::endl;
458 
459  DuplicateList.push_back(CurrentStrip);
460 
461  std::vector<int> pileup_adc = (**DuplPointer).getADCCounts();
462  std::vector<int> signal_adc = (**StripPtr).getADCCounts();
463 
464  std::vector<int>::const_iterator minplace;
465 
466  minplace = std::min_element(pileup_adc.begin(), pileup_adc.end());
467 
468  int minvalue = (*minplace);
469 
470  std::vector<int> new_adc;
471 
472  std::vector<int>::const_iterator newsig = signal_adc.begin();
473 
474  for(std::vector<int>::const_iterator ibin = pileup_adc.begin(); ibin!=pileup_adc.end(); ++ibin) {
475  new_adc.push_back((*newsig)+(*ibin)-minvalue);
476 
477  ++newsig;
478  }
479 
480  CSCStripDigi newDigi(CurrentStrip, new_adc);
481  NewDigiList.push_back(newDigi);
482  }
483  ++DuplPointer;
484  }
485  }
486  else { NewDigiList.push_back(**StripPtr); }
487  } // if strips monotonically increasing... Haven't hit duplicates yet
488  else { // reached end of signal digis, or there was no overlap
489  PrevStrip = 1000; // now into pileup signals, stop looking forward for duplicates
490 
491  // check if this digi was in the duplicate list
492  int check;
493  check = std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
494  if(check == 0) NewDigiList.push_back(**StripPtr);
495  }
496  ++StripPtr;
497  }
498 
499  CSCStripDigiCollection::Range stripRange(NewDigiList.begin(), NewDigiList.end());
500 
501  CSCStripDigiMerge->put(stripRange, layerId);
502 
503  }
504  // Loop over CSCStrip digis, copying them from our own local storage
505 
507  for (CWLayerIt = OurCSCWireDigis_->begin(); CWLayerIt != OurCSCWireDigis_->end(); ++CWLayerIt) {
508  // The layerId
509  const CSCDetId& layerId = (*CWLayerIt).first;
510 
511  // Get the iterators over the digis associated with this LayerId
512  const CSCWireDigiCollection::Range& range = (*CWLayerIt).second;
513 
514  CSCWireDigiMerge->put(range, layerId);
515 
516  }
517 
518  // Loop over CSCComparator digis, copying them from our own local storage
519 
521  for (CCLayerIt = OurCSCComparatorDigis_->begin(); CCLayerIt != OurCSCComparatorDigis_->end(); ++CCLayerIt) {
522  // The layerId
523  const CSCDetId& layerId = (*CCLayerIt).first;
524 
525  // Get the iterators over the digis associated with this LayerId
526  const CSCComparatorDigiCollection::Range& range = (*CCLayerIt).second;
527 
528  CSCComparatorDigiMerge->put(range, layerId);
529 
530  }
531 
532 
533  // put the collection of recunstructed hits in the event
534  // LogDebug("DataMixingMuonWorker") << "total # DT Merged Digis: " << DTDigiMerge->size() ;
535  // LogDebug("DataMixingMuonWorker") << "total # RPC Merged Digis: " << RPCDigiMerge->size() ;
536  // LogDebug("DataMixingMuonWorker") << "total # CSCStrip Merged Digis: " << CSCStripDigiMerge->size() ;
537  // LogDebug("DataMixingMuonWorker") << "total # CSCWire Merged Digis: " << CSCWireDigiMerge->size() ;
538 
539  e.put( DTDigiMerge );
540  e.put( RPCDigiMerge );
541  e.put( CSCStripDigiMerge, CSCStripDigiCollectionDM_ );
542  e.put( CSCWireDigiMerge, CSCWireDigiCollectionDM_ );
543  e.put( CSCComparatorDigiMerge, CSCComparatorDigiCollectionDM_ );
544 
545  // clear local storage for this event
546  delete OurDTDigis_;
547  delete OurRPCDigis_;
548  delete OurCSCStripDigis_;
549  delete OurCSCWireDigis_;
550  delete OurCSCComparatorDigis_;
551 
552  }
CSCStripDigiCollection * OurCSCStripDigis_
DTDigiCollection * OurDTDigis_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
RPCDigiCollection * OurRPCDigis_
CSCWireDigiCollection * OurCSCWireDigis_
static void check(Principal const &p, std::string const &id, edm::ModuleCallingContext const *mcc)
CSCComparatorDigiCollection * OurCSCComparatorDigis_
std::vector< CSCStripDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range

Member Data Documentation

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

Definition at line 94 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

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

Definition at line 70 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 87 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 81 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

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

Definition at line 76 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

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

Definition at line 65 of file DataMixingMuonWorker.h.

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

Definition at line 68 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 92 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

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

Definition at line 85 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 79 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

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

Definition at line 75 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

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

Definition at line 69 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 93 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

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

Definition at line 86 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 80 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

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

Definition at line 74 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

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

Definition at line 63 of file DataMixingMuonWorker.h.

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

Definition at line 90 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 84 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 66 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 78 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

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

Definition at line 72 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

std::string edm::DataMixingMuonWorker::label_
private
CSCComparatorDigiCollection* edm::DataMixingMuonWorker::OurCSCComparatorDigis_
private

Definition at line 103 of file DataMixingMuonWorker.h.

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

CSCStripDigiCollection* edm::DataMixingMuonWorker::OurCSCStripDigis_
private

Definition at line 101 of file DataMixingMuonWorker.h.

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

CSCWireDigiCollection* edm::DataMixingMuonWorker::OurCSCWireDigis_
private

Definition at line 102 of file DataMixingMuonWorker.h.

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

DTDigiCollection* edm::DataMixingMuonWorker::OurDTDigis_
private

Definition at line 99 of file DataMixingMuonWorker.h.

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

RPCDigiCollection* edm::DataMixingMuonWorker::OurRPCDigis_
private

Definition at line 100 of file DataMixingMuonWorker.h.

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

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

Definition at line 64 of file DataMixingMuonWorker.h.

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

Definition at line 91 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 88 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 67 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

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

Definition at line 82 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

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

Definition at line 73 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().