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