CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalUnpackerReport.cc
Go to the documentation of this file.
2 
4  : unmappedDigis_(0),
5  unmappedTPDigis_(0),
6  spigotFormatErrors_(0),
7  badqualityDigis_(0),
8  totalDigis_(0),
9  totalTPDigis_(0),
10  totalHOTPDigis_(0),
11  unsuppressed_(false),
12  emptyEventSpigots_(0),
13  ofwSpigots_(0),
14  busySpigots_(0) {}
15 
16 bool HcalUnpackerReport::errorFree() const { return FEDsError_.empty() && spigotFormatErrors_ == 0; }
17 
18 bool HcalUnpackerReport::anyValidHCAL() const { return !FEDsUnpacked_.empty(); }
19 
20 void HcalUnpackerReport::addUnpacked(int fed) { FEDsUnpacked_.push_back(fed); }
21 
22 void HcalUnpackerReport::addError(int fed) { FEDsError_.push_back(fed); }
23 
26  if (ho)
28  else
29  totalTPDigis_++;
30 }
31 
38 
42  badqualityIds_.push_back(id);
43 }
46  unmappedIds_.push_back(eid);
47 }
50  unmappedIds_.push_back(eid);
51 }
52 
55  uint16_t retval = 0;
56  for (i = 0; i < fedInfo_.size(); i += 2)
57  if (fedInfo_[i] == fed) {
58  retval = fedInfo_[i + 1];
59  break;
60  }
61  return HcalCalibrationEventType(retval);
62 }
63 
66  for (i = 0; i < fedInfo_.size(); i += 2)
67  if (fedInfo_[i] == fed) {
68  fedInfo_[i + 1] = uint16_t(ctype);
69  break;
70  }
71  if (i >= fedInfo_.size()) {
72  fedInfo_.push_back(fed);
73  fedInfo_.push_back(uint16_t(ctype));
74  }
75 }
76 
78 
79 static const std::string ReportSeparator("==>");
80 
82  reportInfo_.push_back(name + "==>" + value);
83 }
84 
86  std::string searchFor = name + ReportSeparator;
87  std::vector<std::string>::const_iterator i;
88  for (i = reportInfo_.begin(); i != reportInfo_.end(); i++)
89  if (i->find(searchFor) == 0)
90  break;
91  return (i != reportInfo_.end());
92 }
94  std::string searchFor = name + ReportSeparator;
95  std::vector<std::string>::const_iterator i;
96  for (i = reportInfo_.begin(); i != reportInfo_.end(); i++)
97  if (i->find(searchFor) == 0)
98  break;
99  std::string retval;
100  if (i != reportInfo_.end()) {
101  retval = i->substr(searchFor.length());
102  }
103  return retval;
104 }
105 
106 std::vector<std::string> HcalUnpackerReport::getReportKeys() const {
107  std::vector<std::string> retval;
108  std::vector<std::string>::const_iterator i;
109  for (i = reportInfo_.begin(); i != reportInfo_.end(); i++)
110  retval.push_back(i->substr(0, i->find(ReportSeparator)));
111  return retval;
112 }
std::vector< std::string > reportInfo_
std::vector< int > FEDsError_
std::vector< int > FEDsUnpacked_
std::vector< std::string > getReportKeys() const
void setFedCalibInfo(uint16_t fed, HcalCalibrationEventType ctype)
void setUnsuppressed(bool isSup)
bool anyValidHCAL() const
std::vector< uint16_t > fedInfo_
HcalCalibrationEventType
ElectronicsIdVector unmappedIds_
uint16_t size_type
DetIdVector badqualityIds_
bool hasReportInfo(const std::string &name) const
void countTPDigi(bool ho=false)
Definition: DetId.h:17
std::string getReportInfo(const std::string &name) const
static const std::string ReportSeparator("==>")
void setReportInfo(const std::string &name, const std::string &value)
void addUnpacked(int fed)
Readout chain identification for Hcal.
HcalCalibrationEventType fedCalibType(uint16_t fed) const