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 28 of file DataMixingMuonWorker.cc.

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

standard constructor

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

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

80  {
81  }

Member Function Documentation

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

Definition at line 237 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().

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

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

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

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

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