CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
58 
59  private:
60 
61  virtual 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& );
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  //this propagates dqm_ to the histoclass, must be called !
212 
214 
215  //dummy error object
216  SPYHistograms::Errors lError;
217  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId)
218  histManager_.bookFEDHistograms(ibooker , lFedId , lError , true);
219 }
220 
221 // ------------ method called to for each event ------------
222 void
224  const edm::EventSetup& iSetup)
225 {
226 
227  //update cabling and pedestals
228  const SiStripFedCabling* lCabling = utility_.getCabling( iSetup );
229  if (evt_ == 0 && writeCabling_){
230  std::ofstream lOutCabling;
231  lOutCabling.open("trackerDetId_FEDIdChNum_list.txt",std::ios::out);
232  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId) {//loop on feds
233  for (uint16_t lFedChannel = 0; lFedChannel < sistrip::FEDCH_PER_FED; lFedChannel++){//loop on channels
234  const FedChannelConnection & lConnection = lCabling->fedConnection(lFedId,lFedChannel);
235  if (!lConnection.isConnected()) continue;
236  uint32_t lDetId = lConnection.detId();
237  lOutCabling << "FED ID = " << lFedId
238  << ", Channel = " << lFedChannel
239  << ",fedkey = " << sistrip::FEDCH_PER_FED*lFedId + lFedChannel
240  << ", detId = " << lDetId
241  << std::endl;
242  }
243  }
244  lOutCabling.close();
245  }
246 
247  //For spy data
248  //get map of TotalEventCount and L1ID, indexed by fedId, and APVaddress indexed by fedIndex.
249  edm::Handle<std::vector<uint32_t> > lSpyL1IDHandle,lSpyTotCountHandle,lSpyAPVeHandle;
250  try {
251  iEvent.getByToken(spyL1Token_,lSpyL1IDHandle);
252  iEvent.getByToken(spyTotCountToken_,lSpyTotCountHandle);
253  iEvent.getByToken(spyAPVeToken_,lSpyAPVeHandle);
254  }
255  catch (const cms::Exception& e) {
256  LogError("SiStripSpyMonitorModule") << e.what() ;
257  return;
258  }
259  //const std::map<uint32_t,uint32_t> & lSpyMaxCountMap = *lSpyL1IDHandle;
260  //const std::map<uint32_t,uint32_t> & lSpyMinCountMap = *lSpyTotCountHandle;
261  const std::vector<uint32_t> & lSpyAPVeVec = *lSpyAPVeHandle;
262 
263  //retrieve the scope digis
265  try {
266  iEvent.getByToken(spyScopeRawDigisToken_, digisHandle);
267  }
268  catch (const cms::Exception& e) {
269  LogError("SiStripSpyMonitorModule") << e.what() ;
270  return;
271  }
272  const edm::DetSetVector<SiStripRawDigi> * lInputDigis = digisHandle.product();
273 
274  //retrieve the reordered payload digis
276  try {
277  iEvent.getByToken(spyPedSubtrDigisToken_, payloadHandle);
278  }
279  catch (const cms::Exception& e) {
280  LogError("SiStripSpyMonitorModule") << e.what() ;
281  return;
282  }
283  const edm::DetSetVector<SiStripRawDigi> * lPayloadDigis = payloadHandle.product();
284 
285 
286  //for first event only
287  //loop first on channels to calculate majority value of when the first header bit is found.
288  //output info message to give the value found
289  //should currently be 6 but may vary in the futur
290  //then we can check firstTrailerBit is +256+24 after
291 
292  if (evt_ == 0){
295  }
296 
297  //initialise some counters, filled in histos eventually
299  lCounters.nNoData = 0;
300  lCounters.nLowRange = 0;
301  lCounters.nHighRange = 0;
302  lCounters.nMinZero = 0;
303  lCounters.nMaxSat = 0;
304  lCounters.nLowPb = 0;
305  lCounters.nHighPb = 0;
306  lCounters.nOOS = 0;
307  lCounters.nOtherPbs = 0;
308  lCounters.nAPVError = 0;
309  lCounters.nAPVAddressError = 0;
310  lCounters.nNegPeds = 0;
311 
312 
313 
314  //fill event number for output text files
315  const unsigned int nFiles = outfileNames_.size();
316  for (unsigned int i(0); i<nFiles; i++){
317  outfile_[i] << "**** evt "<< iEvent.id().event() << " ****" << std::endl ;
318  }
319 
320 
321  //loop over all FEDs and channels
322 
323  for (uint16_t lFedId = sistrip::FED_ID_MIN; lFedId <= sistrip::FED_ID_MAX; ++lFedId) {//loop on feds
324 
325  SPYHistograms::Errors lFEDErrors;
326  lFEDErrors.hasNoData = false;
327  lFEDErrors.hasLowRange = false;
328  lFEDErrors.hasHighRange = false;
329  lFEDErrors.hasMinZero = false;
330  lFEDErrors.hasMaxSat = false;
331  lFEDErrors.hasLowPb = false;
332  lFEDErrors.hasHighPb = false;
333  lFEDErrors.hasOOS = false;
334  lFEDErrors.hasOtherPbs = false;
335  lFEDErrors.hasErrorBit0 = false;
336  lFEDErrors.hasErrorBit1 = false;
337  lFEDErrors.hasAPVAddressError0 = false;
338  lFEDErrors.hasAPVAddressError1 = false;
339  lFEDErrors.hasNegPeds = false;
340 
341  uint32_t lAPVAddrRef = lSpyAPVeVec.at(lFedId);
342 
343  for (uint16_t lFedChannel = 0; lFedChannel < sistrip::FEDCH_PER_FED; lFedChannel++){//loop on channels
344 
345  uint32_t lFedIndex = sistrip::FEDCH_PER_FED*lFedId + lFedChannel;
346 
347  const FedChannelConnection & lConnection = lCabling->fedConnection(lFedId,lFedChannel);
348 
349  if (!lConnection.isConnected()) continue;
350 
351  uint32_t lDetId = lConnection.detId();
352  //uint16_t lNPairs = lConnection.nApvPairs();
353  uint16_t lPair = lConnection.apvPairNumber();
354 
355  edm::DetSetVector<SiStripRawDigi>::const_iterator lDigis = lInputDigis->find(lFedIndex);
356 
357  //pedsubtr digis
358  edm::DetSetVector<SiStripRawDigi>::const_iterator lPayload = lPayloadDigis->find(lDetId);
359 
360  //no digis found, continue.
361  if (lDigis == lInputDigis->end()) {
362  LogDebug("SiStripSpyMonitorModule") << " -- digis not found in ScopeRawDigis map for FEDID "
363  << lFedId << " and FED channel " << lFedChannel << std::endl;
364  continue;
365  }
366 
368 
369  SPYHistograms::Errors lErrors;
370  lErrors.hasNoData = false;
371  lErrors.hasLowRange = false;
372  lErrors.hasHighRange = false;
373  lErrors.hasMinZero = false;
374  lErrors.hasMaxSat = false;
375  lErrors.hasLowPb = false;
376  lErrors.hasHighPb = false;
377  lErrors.hasOOS = false;
378  lErrors.hasOtherPbs = false;
379  lErrors.hasErrorBit0 = false;
380  lErrors.hasErrorBit1 = false;
381  lErrors.hasAPVAddressError0 = false;
382  lErrors.hasAPVAddressError1 = false;
383  lErrors.hasNegPeds = false;
384 
385  uint16_t lRange = sistrip::SpyUtilities::range(lFrame);
386  uint16_t lThreshold = sistrip::SpyUtilities::threshold(lFrame);
387 
388  if (lRange == 0) {
389  lCounters.nNoData++;
390  lErrors.hasNoData = true;
391  lFEDErrors.hasNoData = true;
392  if (outfileMap_.find("NoData") != outfileMap_.end()) outfile_[outfileMap_["NoData"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
393  }
394  else if (lFrame.digitalLow == 0 && lRange > 0) {
395  lCounters.nMinZero++;
396  lErrors.hasMinZero = true;
397  lFEDErrors.hasMinZero = true;
398  if (outfileMap_.find("MinZero") != outfileMap_.end()) outfile_[outfileMap_["MinZero"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
399  }
400  else if (lFrame.digitalHigh >= 1023){
401  lCounters.nMaxSat++;
402  lErrors.hasMaxSat = true;
403  lFEDErrors.hasMaxSat = true;
404  if (outfileMap_.find("MaxSat") != outfileMap_.end()) outfile_[outfileMap_["MaxSat"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
405  }
406  else if (lRange > 0 && lRange < frameQuality_.minDigiRange) {
407  lCounters.nLowRange++;
408  lErrors.hasLowRange = true;
409  lFEDErrors.hasLowRange = true;
410  if (outfileMap_.find("LowRange") != outfileMap_.end()) outfile_[outfileMap_["LowRange"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
411  }
412  else if (lRange > frameQuality_.maxDigiRange) {
413  lCounters.nHighRange++;
414  lErrors.hasHighRange = true;
415  lFEDErrors.hasHighRange = true;
416  if (outfileMap_.find("HighRange") != outfileMap_.end()) outfile_[outfileMap_["HighRange"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
417  }
419  lCounters.nLowPb++;
420  lErrors.hasLowPb = true;
421  lFEDErrors.hasLowPb = true;
422  if (outfileMap_.find("LowPb") != outfileMap_.end()) outfile_[outfileMap_["LowPb"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
423  }
425  lCounters.nHighPb++;
426  lErrors.hasHighPb = true;
427  lFEDErrors.hasHighPb = true;
428  if (outfileMap_.find("HighPb") != outfileMap_.end()) outfile_[outfileMap_["HighPb"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
429  }
430  else if ( lFrame.firstHeaderBit != firstHeaderBit_ && //header in wrong position
431  ( (lFrame.firstHeaderBit != sistrip::SPY_SAMPLES_PER_CHANNEL && //header and
432  lFrame.firstTrailerBit != sistrip::SPY_SAMPLES_PER_CHANNEL && //trailer found
433  lFrame.firstTrailerBit-lFrame.firstHeaderBit == 280) || //+ right distance between them
434  (lFrame.firstHeaderBit != sistrip::SPY_SAMPLES_PER_CHANNEL && // or header found
435  lFrame.firstTrailerBit == sistrip::SPY_SAMPLES_PER_CHANNEL && // and trailer not found
436  lFrame.firstHeaderBit > 16 ) || // corresponding to back-to-back frame late enough
437  (lFrame.firstHeaderBit == sistrip::SPY_SAMPLES_PER_CHANNEL && // or header not found
438  identifyTickmarks(*lDigis,lThreshold) ) // but such that tickmark compatible with OOS frame
439  )
440  ){
441  lCounters.nOOS++;
442  lErrors.hasOOS = true;
443  lFEDErrors.hasOOS = true;
444  if (outfileMap_.find("OOS") != outfileMap_.end()) outfile_[outfileMap_["OOS"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
445  }
446  else if ( !(lFrame.firstHeaderBit == firstHeaderBit_ && lFrame.firstTrailerBit == firstTrailerBit_) ){
447  lCounters.nOtherPbs++;
448  lErrors.hasOtherPbs = true;
449  lFEDErrors.hasOtherPbs = true;
450  if (outfileMap_.find("OtherPbs") != outfileMap_.end()) outfile_[outfileMap_["OtherPbs"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
451  }
452  else if (lFrame.apvErrorBit.first || lFrame.apvErrorBit.second) {
453  if (lFrame.apvErrorBit.first) {
454  lCounters.nAPVError++;
455  lErrors.hasErrorBit0 = true;
456  lFEDErrors.hasErrorBit0 = true;
457  }
458  if (lFrame.apvErrorBit.second) {
459  lCounters.nAPVError++;
460  lErrors.hasErrorBit1 = true;
461  lFEDErrors.hasErrorBit1 = true;
462  }
463  if (outfileMap_.find("APVError") != outfileMap_.end()) {
464  outfile_[outfileMap_["APVError"]] << lFedId << " " << lFedChannel << " " << lDetId ;
465  if (lFrame.apvErrorBit.first) outfile_[outfileMap_["APVError"]] << " APV0" << std::endl;
466  if (lFrame.apvErrorBit.second) outfile_[outfileMap_["APVError"]] << " APV1" << std::endl;
467  }
468  }
469  else if ( lFrame.apvAddress.first != lAPVAddrRef ||
470  lFrame.apvAddress.second != lAPVAddrRef ) {
471  if (lFrame.apvAddress.first != lAPVAddrRef){
472  lCounters.nAPVAddressError++;
473  lErrors.hasAPVAddressError0 = true;
474  lFEDErrors.hasAPVAddressError0 = true;
475  }
476  if (lFrame.apvAddress.second != lAPVAddrRef){
477  lCounters.nAPVAddressError++;
478  lErrors.hasAPVAddressError1 = true;
479  lFEDErrors.hasAPVAddressError1 = true;
480  }
481  if (outfileMap_.find("APVAddressError") != outfileMap_.end()){
482  outfile_[outfileMap_["APVAddressError"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
483  if (lFrame.apvAddress.first != lAPVAddrRef) outfile_[outfileMap_["APVAddressError"]] << " APV0" << std::endl;
484  if (lFrame.apvAddress.second != lAPVAddrRef) outfile_[outfileMap_["APVAddressError"]] << " APV1" << std::endl;
485  }
486  }
487  else if (lPayload != lPayloadDigis->end() && hasNegativePedSubtr(*lPayload,lPair)){
488  lCounters.nNegPeds++;
489  lErrors.hasNegPeds = true;
490  lFEDErrors.hasNegPeds = true;
491  if (outfileMap_.find("NegPeds") != outfileMap_.end()) outfile_[outfileMap_["NegPeds"]] << lFedId << " " << lFedChannel << " " << lDetId << std::endl;
492  }
493 
494  histManager_.fillDetailedHistograms(lErrors,lFrame,lFedId,lFedChannel);
495 
496  }//loop on channels
497 
498 
499  histManager_.fillFEDHistograms(lFEDErrors,lFedId);
500 
501  }//loop on feds
502 
503  double lTime;
504  //if (fillWithEvtNum_)
505  //lTime = iEvent.id().event();
506  //else if (fillWithLocalEvtNum_) lTime = evt_;
507  //no orbit number for spy data !!
508  //else lTime = iEvent.orbitNumber()/11223.;
509  if (fillWithLocalEvtNum_) {
510  // casting from unsigned long long to a double here
511  // doing it explicitely
512  lTime = static_cast<double>(evt_);
513  } else {
514  // casting from unsigned long long to a double here
515  // doing it explicitely
516  lTime = static_cast<double>(iEvent.id().event());
517  }
518 
519  histManager_.fillCountersHistograms(lCounters,lTime);
520 
521 
522  //used to fill histo vs time with local event number....
523  evt_++;
524 
525 }//analyze method
526 
528  uint16_t aPair)
529 {
531  const edm::DetSetVector<SiStripRawDigi>::detset::const_iterator endChannelDigis = channelDigis.end();
532 
533  uint32_t count = 0;
534  for (; iDigi != endChannelDigis; ++iDigi) {
535  const uint16_t val = iDigi->adc();
536  uint16_t lPair = static_cast<uint16_t>(count/sistrip::STRIPS_PER_FEDCH);
537  if (val == 0 && lPair == aPair) return true;
538  count++;
539  }
540 
541  return false;
542 
543 }
544 
546  const uint16_t threshold)
547 {
548 
549  //start from the end
551  uint16_t lastPos = sistrip::SPY_SAMPLES_PER_CHANNEL;
552  uint16_t nTrailers = 0;
554 
555  for ( ; count == 0; count--){
556  iDigi = findTwoConsecutive(channelDigis,threshold,count);
557  //if found, in different position = 70 before than previous value, go and look 70 before
558  if (iDigi != channelDigis.end() &&
559  (lastPos == sistrip::SPY_SAMPLES_PER_CHANNEL || count == lastPos+1-70)) {
560  nTrailers++;
561  lastPos = count-1;
562  count -= 70;
563  }
564  //else keep looking
565  else count--;
566  }
567 
568  if (nTrailers > 1) LogDebug("SiStripSpyMonitorModule") << " -- Found "
569  << nTrailers << " trailers every 70 clock cycles for channel "
570  << channelDigis.detId()
571  << ", evt " << evt_
572  << std::endl;
573  //if only one found, should be < 280 otherwise header should have been found and this method would not be called
574  return (nTrailers > 1) || (nTrailers == 1 && lastPos < 280);
575 
576 }
577 
580  const uint16_t threshold,
581  uint16_t & aCounter)
582 {
583  const edm::DetSetVector<SiStripRawDigi>::detset::const_iterator endChannelDigis = channelDigis.end();
584  edm::DetSetVector<SiStripRawDigi>::detset::const_iterator lStart = channelDigis.begin()+aCounter;
585 
586  bool foundTrailer = false;
587  // Loop over digis looking for last two above threshold
588  uint8_t aboveThreshold = 0;
589 
590  for (; lStart != endChannelDigis; ++lStart) {
591  if ( lStart->adc() > threshold) {
592  aboveThreshold++;
593  }
594  else {
595  aboveThreshold = 0;
596  }
597  if (aboveThreshold == 2) {foundTrailer = true; break; }
598  aCounter++;
599  }//end of loop over digis
600 
601  if (foundTrailer) return lStart;
602  else {
604  return endChannelDigis;
605  }
606 }
607 
608 //
609 // Define as a plug-in
610 //
611 
614 
#define LogDebug(id)
iterator end()
Definition: DetSet.h:60
virtual char const * what() const
Definition: Exception.cc:141
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
static const uint16_t FED_ID_MIN
iterator find(det_id_type id)
Definition: DetSetVector.h:294
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:72
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void bookTopLevelHistograms(DQMStore::IBooker &)
const std::string & pwd(void)
Definition: DQMStore.cc:282
uint16_t apvPairNumber() const
SiStripSpyMonitorModule(const edm::ParameterSet &)
unsigned long long EventNumber_t
bool identifyTickmarks(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
static const uint16_t SPY_SAMPLES_PER_CHANNEL
void bookAllFEDHistograms(DQMStore::IBooker &)
std::pair< uint8_t, uint8_t > apvAddress
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream)
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:230
static const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
const uint32_t & detId() const
tuple nFiles
Definition: cmsBatch.py:306
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:365
static const uint16_t threshold(const Frame &aFrame)
iterator begin()
Definition: DetSet.h:59
tuple out
Definition: dbtoconf.py:99
static const uint16_t STRIPS_PER_FEDCH
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
T const * product() const
Definition: Handle.h:81
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:60
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)
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_
volatile std::atomic< bool > shutdown_flag false
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108
sistrip::SpyUtilities utility_
Definition: Run.h:43
edm::EDGetTokenT< std::vector< uint32_t > > spyTotCountToken_