CMS 3D CMS Logo

SiStripSpyMonitorModule.cc
Go to the documentation of this file.
1 // Original Author: Anne-Marie Magnan
2 // Created: 2010/01/11
3 //
4 
5 #include <sstream>
6 #include <memory>
7 #include <list>
8 #include <algorithm>
9 #include <cassert>
10 
21 
29 
34 
36 
37 // For plotting.
40 
44 
46 
47 //
48 // Class declaration
49 //
50 
52 {
53  public:
54 
55 
57  ~SiStripSpyMonitorModule() override;
58 
59  private:
60 
61  void analyze(const edm::Event&, const edm::EventSetup&) override;
62  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
63  void dqmBeginRun(const edm::Run& , const edm::EventSetup& ) override;
64 
65 
66  //check if contains pedsubtr data = 0
68  uint16_t aPair);
69 
71  const uint16_t threshold);
72 
75  const uint16_t threshold,
76  uint16_t & aCounter);
77 
78  //tag of spydata collection
81 
84 
85 
86  //tag of l1A and apveAddress counters
90 
94 
95 
96  uint32_t minDigiRange_;
97  uint32_t maxDigiRange_;
98  uint32_t minDigitalLow_;
99  uint32_t maxDigitalLow_;
100  uint32_t minDigitalHigh_;
101  uint32_t maxDigitalHigh_;
102 
104 
105  //folder name for histograms in DQMStore
107  //book detailed histograms even if they will be empty (for merging)
109  //do histos vs time with time=event number. Default time = orbit number (s)
112 
114  uint16_t firstHeaderBit_;
116 
119 
120  std::ofstream outfile_[20];
121  std::vector<std::string> outfileNames_;
122  std::map<std::string,unsigned int> outfileMap_;
123 
125 
126 };
127 
128 
129 
130 using edm::LogError;
131 using edm::LogWarning;
132 using edm::LogInfo;
133 //
134 // Constructors and destructor
135 //
136 
138  : spyScopeRawDigisTag_(iConfig.getUntrackedParameter<edm::InputTag>("SpyScopeRawDigisTag",edm::InputTag("SiStripSpyUnpacker","ScopeRawDigis"))),
139  spyPedSubtrDigisTag_(iConfig.getUntrackedParameter<edm::InputTag>("SpyPedSubtrDigisTag",edm::InputTag("SiStripFEDEmulator",""))),
140  spyL1Tag_(iConfig.getUntrackedParameter<edm::InputTag>("SpyL1Tag",edm::InputTag("SiStripSpyDigiConverter","L1ACount"))),
141  spyTotCountTag_(iConfig.getUntrackedParameter<edm::InputTag>("SpyTotalEventCountTag",edm::InputTag("SiStripSpyDigiConverter","TotalEventCount"))),
142  spyAPVeTag_(iConfig.getUntrackedParameter<edm::InputTag>("SpyAPVeTag",edm::InputTag("SiStripSpyDigiConverter","APVAddress"))),
143  folderName_(iConfig.getUntrackedParameter<std::string>("HistogramFolderName","SiStrip/ReadoutView/SpyMonitoringSummary")),
144  fillAllDetailedHistograms_(iConfig.getUntrackedParameter<bool>("FillAllDetailedHistograms",false)),
145  fillWithEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithEventNumber",false)),
146  fillWithLocalEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithLocalEventNumber",false)),
147  firstHeaderBit_(0),
148  firstTrailerBit_(0),
149  outfileNames_(iConfig.getUntrackedParameter<std::vector<std::string> >("OutputErrors")),
150  writeCabling_(iConfig.getUntrackedParameter<bool>("WriteCabling",false))
151 {
152 
153  spyScopeRawDigisToken_ = consumes<edm::DetSetVector<SiStripRawDigi> >(spyScopeRawDigisTag_);
154  spyPedSubtrDigisToken_ = consumes<edm::DetSetVector<SiStripRawDigi> >(spyPedSubtrDigisTag_);
155 
156  spyL1Token_ = consumes<std::vector<uint32_t> >(spyL1Tag_);
157  spyTotCountToken_ = consumes<std::vector<uint32_t> >(spyTotCountTag_);
158  spyAPVeToken_ = consumes<std::vector<uint32_t> >(spyAPVeTag_);
159 
160  evt_ = 0;
161  std::ostringstream pDebugStream;
162  histManager_.initialise(iConfig,&pDebugStream);
163  const unsigned int nFiles = outfileNames_.size();
164 
165  for (unsigned int i(0); i<nFiles; i++){
166  std::ostringstream lName;
167  lName << outfileNames_.at(i) << ".out";
168  if (i<20) outfile_[i].open(lName.str().c_str(),std::ios::out);
169  outfileMap_[outfileNames_.at(i)] = i;
170  }
171 
172  frameQuality_.minDigiRange = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MinDigiRange",100));
173  frameQuality_.maxDigiRange = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MaxDigiRange",1024));
174  frameQuality_.minZeroLight = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MinZeroLight",0));
175  frameQuality_.maxZeroLight = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MaxZeroLight",1024));
176  frameQuality_.minTickHeight = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MinTickHeight",0));
177  frameQuality_.maxTickHeight = static_cast<uint16_t>(iConfig.getUntrackedParameter<uint32_t>("MaxTickHeight",1024));
178 
179 }
180 
182 {
183  const unsigned int nFiles = outfileNames_.size();
184  for (unsigned int i(0); i<nFiles; i++){
185  outfile_[i].close();
186  }
187 
188  outfileMap_.clear();
189  outfileNames_.clear();
190 
191 }
192 
194 {
195  evt_ = 0;
196  firstHeaderBit_ = 0;
197  firstTrailerBit_ = 0;
198 }
199 
201 {
202  ibooker.setCurrentFolder(folderName_);
203 
204  LogInfo("SiStripSpyMonitorModule") << " Histograms will be written in "
205  << folderName_
206  << ". Current folder is : "
207  << ibooker.pwd()
208  << std::endl;
209 
210  edm::ESHandle<TkDetMap> tkDetMapHandle;
211  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
212  const TkDetMap* tkDetMap = tkDetMapHandle.product();
213 
214  //this propagates dqm_ to the histoclass, must be called !
215  histManager_.bookTopLevelHistograms(ibooker, tkDetMap);
216 
218 
219  //dummy error object
220  SPYHistograms::Errors lError;
221  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId)
222  histManager_.bookFEDHistograms(ibooker , lFedId , lError , true);
223 }
224 
225 // ------------ method called to for each event ------------
226 void
228  const edm::EventSetup& iSetup)
229 {
230 
231  //update cabling and pedestals
232  const SiStripFedCabling* lCabling = utility_.getCabling( iSetup );
233  if (evt_ == 0 && writeCabling_){
234  std::ofstream lOutCabling;
235  lOutCabling.open("trackerDetId_FEDIdChNum_list.txt",std::ios::out);
236  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId) {//loop on feds
237  for (uint16_t lFedChannel = 0; lFedChannel < sistrip::FEDCH_PER_FED; lFedChannel++){//loop on channels
238  const FedChannelConnection & lConnection = lCabling->fedConnection(lFedId,lFedChannel);
239  if (!lConnection.isConnected()) continue;
240  uint32_t lDetId = lConnection.detId();
241  lOutCabling << "FED ID = " << lFedId
242  << ", Channel = " << lFedChannel
243  << ",fedkey = " << sistrip::FEDCH_PER_FED*lFedId + lFedChannel
244  << ", detId = " << lDetId
245  << std::endl;
246  }
247  }
248  lOutCabling.close();
249  }
250 
251  //For spy data
252  //get map of TotalEventCount and L1ID, indexed by fedId, and APVaddress indexed by fedIndex.
253  edm::Handle<std::vector<uint32_t> > lSpyL1IDHandle,lSpyTotCountHandle,lSpyAPVeHandle;
254  try {
255  iEvent.getByToken(spyL1Token_,lSpyL1IDHandle);
256  iEvent.getByToken(spyTotCountToken_,lSpyTotCountHandle);
257  iEvent.getByToken(spyAPVeToken_,lSpyAPVeHandle);
258  }
259  catch (const cms::Exception& e) {
260  LogError("SiStripSpyMonitorModule") << e.what() ;
261  return;
262  }
263  //const std::map<uint32_t,uint32_t> & lSpyMaxCountMap = *lSpyL1IDHandle;
264  //const std::map<uint32_t,uint32_t> & lSpyMinCountMap = *lSpyTotCountHandle;
265  const std::vector<uint32_t> & lSpyAPVeVec = *lSpyAPVeHandle;
266 
267  //retrieve the scope digis
269  try {
270  iEvent.getByToken(spyScopeRawDigisToken_, digisHandle);
271  }
272  catch (const cms::Exception& e) {
273  LogError("SiStripSpyMonitorModule") << e.what() ;
274  return;
275  }
276  const edm::DetSetVector<SiStripRawDigi> * lInputDigis = digisHandle.product();
277 
278  //retrieve the reordered payload digis
280  try {
281  iEvent.getByToken(spyPedSubtrDigisToken_, payloadHandle);
282  }
283  catch (const cms::Exception& e) {
284  LogError("SiStripSpyMonitorModule") << e.what() ;
285  return;
286  }
287  const edm::DetSetVector<SiStripRawDigi> * lPayloadDigis = payloadHandle.product();
288 
289 
290  //for first event only
291  //loop first on channels to calculate majority value of when the first header bit is found.
292  //output info message to give the value found
293  //should currently be 6 but may vary in the futur
294  //then we can check firstTrailerBit is +256+24 after
295 
296  if (evt_ == 0){
299  }
300 
301  //initialise some counters, filled in histos eventually
303  lCounters.nNoData = 0;
304  lCounters.nLowRange = 0;
305  lCounters.nHighRange = 0;
306  lCounters.nMinZero = 0;
307  lCounters.nMaxSat = 0;
308  lCounters.nLowPb = 0;
309  lCounters.nHighPb = 0;
310  lCounters.nOOS = 0;
311  lCounters.nOtherPbs = 0;
312  lCounters.nAPVError = 0;
313  lCounters.nAPVAddressError = 0;
314  lCounters.nNegPeds = 0;
315 
316 
317 
318  //fill event number for output text files
319  const unsigned int nFiles = outfileNames_.size();
320  for (unsigned int i(0); i<nFiles; i++){
321  outfile_[i] << "**** evt "<< iEvent.id().event() << " ****" << std::endl ;
322  }
323 
324 
325  //loop over all FEDs and channels
326 
327  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId) {//loop on feds
328 
329  SPYHistograms::Errors lFEDErrors;
330  lFEDErrors.hasNoData = false;
331  lFEDErrors.hasLowRange = false;
332  lFEDErrors.hasHighRange = false;
333  lFEDErrors.hasMinZero = false;
334  lFEDErrors.hasMaxSat = false;
335  lFEDErrors.hasLowPb = false;
336  lFEDErrors.hasHighPb = false;
337  lFEDErrors.hasOOS = false;
338  lFEDErrors.hasOtherPbs = false;
339  lFEDErrors.hasErrorBit0 = false;
340  lFEDErrors.hasErrorBit1 = false;
341  lFEDErrors.hasAPVAddressError0 = false;
342  lFEDErrors.hasAPVAddressError1 = false;
343  lFEDErrors.hasNegPeds = false;
344 
345  uint32_t lAPVAddrRef = lSpyAPVeVec.at(lFedId);
346 
347  for (uint16_t lFedChannel = 0; lFedChannel < sistrip::FEDCH_PER_FED; lFedChannel++){//loop on channels
348 
349  uint32_t lFedIndex = sistrip::FEDCH_PER_FED*lFedId + lFedChannel;
350 
351  const FedChannelConnection & lConnection = lCabling->fedConnection(lFedId,lFedChannel);
352 
353  if (!lConnection.isConnected()) continue;
354 
355  uint32_t lDetId = lConnection.detId();
356  //uint16_t lNPairs = lConnection.nApvPairs();
357  uint16_t lPair = lConnection.apvPairNumber();
358 
359  edm::DetSetVector<SiStripRawDigi>::const_iterator lDigis = lInputDigis->find(lFedIndex);
360 
361  //pedsubtr digis
362  edm::DetSetVector<SiStripRawDigi>::const_iterator lPayload = lPayloadDigis->find(lDetId);
363 
364  //no digis found, continue.
365  if (lDigis == lInputDigis->end()) {
366  LogDebug("SiStripSpyMonitorModule") << " -- digis not found in ScopeRawDigis map for FEDID "
367  << lFedId << " and FED channel " << lFedChannel << std::endl;
368  continue;
369  }
370 
372 
373  SPYHistograms::Errors lErrors;
374  lErrors.hasNoData = false;
375  lErrors.hasLowRange = false;
376  lErrors.hasHighRange = false;
377  lErrors.hasMinZero = false;
378  lErrors.hasMaxSat = false;
379  lErrors.hasLowPb = false;
380  lErrors.hasHighPb = false;
381  lErrors.hasOOS = false;
382  lErrors.hasOtherPbs = false;
383  lErrors.hasErrorBit0 = false;
384  lErrors.hasErrorBit1 = false;
385  lErrors.hasAPVAddressError0 = false;
386  lErrors.hasAPVAddressError1 = false;
387  lErrors.hasNegPeds = false;
388 
389  uint16_t lRange = sistrip::SpyUtilities::range(lFrame);
390  uint16_t lThreshold = sistrip::SpyUtilities::threshold(lFrame);
391 
392  if (lRange == 0) {
393  lCounters.nNoData++;
394  lErrors.hasNoData = true;
395  lFEDErrors.hasNoData = true;
396  if (outfileMap_.find("NoData") != outfileMap_.end()) outfile_[outfileMap_["NoData"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
397  }
398  else if (lFrame.digitalLow == 0 && lRange > 0) {
399  lCounters.nMinZero++;
400  lErrors.hasMinZero = true;
401  lFEDErrors.hasMinZero = true;
402  if (outfileMap_.find("MinZero") != outfileMap_.end()) outfile_[outfileMap_["MinZero"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
403  }
404  else if (lFrame.digitalHigh >= 1023){
405  lCounters.nMaxSat++;
406  lErrors.hasMaxSat = true;
407  lFEDErrors.hasMaxSat = true;
408  if (outfileMap_.find("MaxSat") != outfileMap_.end()) outfile_[outfileMap_["MaxSat"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
409  }
410  else if (lRange > 0 && lRange < frameQuality_.minDigiRange) {
411  lCounters.nLowRange++;
412  lErrors.hasLowRange = true;
413  lFEDErrors.hasLowRange = true;
414  if (outfileMap_.find("LowRange") != outfileMap_.end()) outfile_[outfileMap_["LowRange"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
415  }
416  else if (lRange > frameQuality_.maxDigiRange) {
417  lCounters.nHighRange++;
418  lErrors.hasHighRange = true;
419  lFEDErrors.hasHighRange = true;
420  if (outfileMap_.find("HighRange") != outfileMap_.end()) outfile_[outfileMap_["HighRange"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
421  }
423  lCounters.nLowPb++;
424  lErrors.hasLowPb = true;
425  lFEDErrors.hasLowPb = true;
426  if (outfileMap_.find("LowPb") != outfileMap_.end()) outfile_[outfileMap_["LowPb"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
427  }
429  lCounters.nHighPb++;
430  lErrors.hasHighPb = true;
431  lFEDErrors.hasHighPb = true;
432  if (outfileMap_.find("HighPb") != outfileMap_.end()) outfile_[outfileMap_["HighPb"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
433  }
434  else if ( lFrame.firstHeaderBit != firstHeaderBit_ && //header in wrong position
435  ( (lFrame.firstHeaderBit != sistrip::SPY_SAMPLES_PER_CHANNEL && //header and
436  lFrame.firstTrailerBit != sistrip::SPY_SAMPLES_PER_CHANNEL && //trailer found
437  lFrame.firstTrailerBit-lFrame.firstHeaderBit == 280) || //+ right distance between them
438  (lFrame.firstHeaderBit != sistrip::SPY_SAMPLES_PER_CHANNEL && // or header found
439  lFrame.firstTrailerBit == sistrip::SPY_SAMPLES_PER_CHANNEL && // and trailer not found
440  lFrame.firstHeaderBit > 16 ) || // corresponding to back-to-back frame late enough
441  (lFrame.firstHeaderBit == sistrip::SPY_SAMPLES_PER_CHANNEL && // or header not found
442  identifyTickmarks(*lDigis,lThreshold) ) // but such that tickmark compatible with OOS frame
443  )
444  ){
445  lCounters.nOOS++;
446  lErrors.hasOOS = true;
447  lFEDErrors.hasOOS = true;
448  if (outfileMap_.find("OOS") != outfileMap_.end()) outfile_[outfileMap_["OOS"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
449  }
450  else if ( !(lFrame.firstHeaderBit == firstHeaderBit_ && lFrame.firstTrailerBit == firstTrailerBit_) ){
451  lCounters.nOtherPbs++;
452  lErrors.hasOtherPbs = true;
453  lFEDErrors.hasOtherPbs = true;
454  if (outfileMap_.find("OtherPbs") != outfileMap_.end()) outfile_[outfileMap_["OtherPbs"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
455  }
456  else if (lFrame.apvErrorBit.first || lFrame.apvErrorBit.second) {
457  if (lFrame.apvErrorBit.first) {
458  lCounters.nAPVError++;
459  lErrors.hasErrorBit0 = true;
460  lFEDErrors.hasErrorBit0 = true;
461  }
462  if (lFrame.apvErrorBit.second) {
463  lCounters.nAPVError++;
464  lErrors.hasErrorBit1 = true;
465  lFEDErrors.hasErrorBit1 = true;
466  }
467  if (outfileMap_.find("APVError") != outfileMap_.end()) {
468  outfile_[outfileMap_["APVError"]] << lFedId << " " << lFedChannel << " " << lDetId ;
469  if (lFrame.apvErrorBit.first) outfile_[outfileMap_["APVError"]] << " APV0" << std::endl;
470  if (lFrame.apvErrorBit.second) outfile_[outfileMap_["APVError"]] << " APV1" << std::endl;
471  }
472  }
473  else if ( lFrame.apvAddress.first != lAPVAddrRef ||
474  lFrame.apvAddress.second != lAPVAddrRef ) {
475  if (lFrame.apvAddress.first != lAPVAddrRef){
476  lCounters.nAPVAddressError++;
477  lErrors.hasAPVAddressError0 = true;
478  lFEDErrors.hasAPVAddressError0 = true;
479  }
480  if (lFrame.apvAddress.second != lAPVAddrRef){
481  lCounters.nAPVAddressError++;
482  lErrors.hasAPVAddressError1 = true;
483  lFEDErrors.hasAPVAddressError1 = true;
484  }
485  if (outfileMap_.find("APVAddressError") != outfileMap_.end()){
486  outfile_[outfileMap_["APVAddressError"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
487  if (lFrame.apvAddress.first != lAPVAddrRef) outfile_[outfileMap_["APVAddressError"]] << " APV0" << std::endl;
488  if (lFrame.apvAddress.second != lAPVAddrRef) outfile_[outfileMap_["APVAddressError"]] << " APV1" << std::endl;
489  }
490  }
491  else if (lPayload != lPayloadDigis->end() && hasNegativePedSubtr(*lPayload,lPair)){
492  lCounters.nNegPeds++;
493  lErrors.hasNegPeds = true;
494  lFEDErrors.hasNegPeds = true;
495  if (outfileMap_.find("NegPeds") != outfileMap_.end()) outfile_[outfileMap_["NegPeds"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
496  }
497 
498  histManager_.fillDetailedHistograms(lErrors,lFrame,lFedId,lFedChannel);
499 
500  }//loop on channels
501 
502 
503  histManager_.fillFEDHistograms(lFEDErrors,lFedId);
504 
505  }//loop on feds
506 
507  double lTime;
508  //if (fillWithEvtNum_)
509  //lTime = iEvent.id().event();
510  //else if (fillWithLocalEvtNum_) lTime = evt_;
511  //no orbit number for spy data !!
512  //else lTime = iEvent.orbitNumber()/11223.;
513  if (fillWithLocalEvtNum_) {
514  // casting from unsigned long long to a double here
515  // doing it explicitely
516  lTime = static_cast<double>(evt_);
517  } else {
518  // casting from unsigned long long to a double here
519  // doing it explicitely
520  lTime = static_cast<double>(iEvent.id().event());
521  }
522 
523  histManager_.fillCountersHistograms(lCounters,lTime);
524 
525 
526  //used to fill histo vs time with local event number....
527  evt_++;
528 
529 }//analyze method
530 
532  uint16_t aPair)
533 {
535  const edm::DetSetVector<SiStripRawDigi>::detset::const_iterator endChannelDigis = channelDigis.end();
536 
537  uint32_t count = 0;
538  for (; iDigi != endChannelDigis; ++iDigi) {
539  const uint16_t val = iDigi->adc();
540  uint16_t lPair = static_cast<uint16_t>(count/sistrip::STRIPS_PER_FEDCH);
541  if (val == 0 && lPair == aPair) return true;
542  count++;
543  }
544 
545  return false;
546 
547 }
548 
550  const uint16_t threshold)
551 {
552 
553  //start from the end
555  uint16_t lastPos = sistrip::SPY_SAMPLES_PER_CHANNEL;
556  uint16_t nTrailers = 0;
558 
559  for ( ; count == 0; count--){
560  iDigi = findTwoConsecutive(channelDigis,threshold,count);
561  //if found, in different position = 70 before than previous value, go and look 70 before
562  if (iDigi != channelDigis.end() &&
563  (lastPos == sistrip::SPY_SAMPLES_PER_CHANNEL || count == lastPos+1-70)) {
564  nTrailers++;
565  lastPos = count-1;
566  count -= 70;
567  }
568  //else keep looking
569  else count--;
570  }
571 
572  if (nTrailers > 1) LogDebug("SiStripSpyMonitorModule") << " -- Found "
573  << nTrailers << " trailers every 70 clock cycles for channel "
574  << channelDigis.detId()
575  << ", evt " << evt_
576  << std::endl;
577  //if only one found, should be < 280 otherwise header should have been found and this method would not be called
578  return (nTrailers > 1) || (nTrailers == 1 && lastPos < 280);
579 
580 }
581 
584  const uint16_t threshold,
585  uint16_t & aCounter)
586 {
587  const edm::DetSetVector<SiStripRawDigi>::detset::const_iterator endChannelDigis = channelDigis.end();
588  edm::DetSetVector<SiStripRawDigi>::detset::const_iterator lStart = channelDigis.begin()+aCounter;
589 
590  bool foundTrailer = false;
591  // Loop over digis looking for last two above threshold
592  uint8_t aboveThreshold = 0;
593 
594  for (; lStart != endChannelDigis; ++lStart) {
595  if ( lStart->adc() > threshold) {
596  aboveThreshold++;
597  }
598  else {
599  aboveThreshold = 0;
600  }
601  if (aboveThreshold == 2) {foundTrailer = true; break; }
602  aCounter++;
603  }//end of loop over digis
604 
605  if (foundTrailer) return lStart;
606  else {
608  return endChannelDigis;
609  }
610 }
611 
612 //
613 // Define as a plug-in
614 //
615 
618 
#define LogDebug(id)
iterator end()
Definition: DetSet.h:60
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
static const uint16_t FED_ID_MIN
iterator find(det_id_type id)
Definition: DetSetVector.h:290
edm::DetSetVector< SiStripRawDigi >::detset::const_iterator findTwoConsecutive(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, uint16_t &aCounter)
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
det_id_type detId() const
Definition: DetSet.h:74
void analyze(const edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
uint16_t apvPairNumber() const
SiStripSpyMonitorModule(const edm::ParameterSet &)
unsigned long long EventNumber_t
void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *)
bool identifyTickmarks(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
static const uint16_t SPY_SAMPLES_PER_CHANNEL
char const * what() const override
Definition: Exception.cc:103
void bookAllFEDHistograms(DQMStore::IBooker &)
std::pair< uint8_t, uint8_t > apvAddress
bool hasNegativePedSubtr(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, uint16_t aPair)
edm::EDGetTokenT< std::vector< uint32_t > > spyAPVeToken_
void fillCountersHistograms(const ErrorCounters &aCounter, const double aTime)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyPedSubtrDigisToken_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
static const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
const uint32_t & detId() const
std::map< std::string, unsigned int > outfileMap_
Class containning control, module, detector and connection information, at the level of a FED channel...
sistrip::SpyUtilities::FrameQuality frameQuality_
static const uint16_t range(const Frame &aFrame)
std::vector< std::string > outfileNames_
void bookFEDHistograms(DQMStore::IBooker &, const unsigned int fedId, const Errors &aErr, bool doAll=false)
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyScopeRawDigisToken_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
static const uint16_t threshold(const Frame &aFrame)
iterator begin()
Definition: DetSet.h:59
static const uint16_t STRIPS_PER_FEDCH
T const * product() const
Definition: Handle.h:74
std::string const & pwd()
Definition: DQMStore.cc:278
Constants and enumerated types for FED/FEC systems.
const SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
void fillFEDHistograms(const Errors &aErr, const unsigned int aFedId)
std::pair< bool, bool > apvErrorBit
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
static const uint16_t FEDCH_PER_FED
void fillDetailedHistograms(const Errors &aErr, const sistrip::SpyUtilities::Frame &aFrame, const unsigned int aFedId, const unsigned int aFedChannel)
T get() const
Definition: EventSetup.h:71
static void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
static const uint16_t FED_ID_MAX
edm::EDGetTokenT< std::vector< uint32_t > > spyL1Token_
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
T const * product() const
Definition: ESHandle.h:86
sistrip::SpyUtilities utility_
Definition: Run.h:45
edm::EDGetTokenT< std::vector< uint32_t > > spyTotCountToken_