CMS 3D CMS Logo

RPCRawDataCounts.cc
Go to the documentation of this file.
10 
11 #include <vector>
12 #include <sstream>
13 
14 using namespace rpcrawtodigi;
15 using namespace std;
16 
17 typedef std::map<std::pair<int, int>, int>::const_iterator IT;
18 
21  IT im = theRecordTypes.find(make_pair(fedId, type));
22  return (im == theRecordTypes.end()) ? 0 : im->second;
23 }
24 
26  for (IT im = theReadoutErrors.begin(); im != theReadoutErrors.end(); ++im) {
27  if (im->first.first != fedId)
28  continue;
29  if (im->first.second > ReadoutError::NoProblem && im->first.second <= ReadoutError::InconsistentDataSize)
30  return 1;
31  }
32  return 0;
33 }
34 
36  for (IT im = theRecordTypes.begin(); im != theRecordTypes.end(); ++im) {
37  if (im->first.first != fedId)
38  continue;
39  if (im->first.second > DataRecord::Empty)
40  return 1;
41  }
42  return 0;
43 }
44 
47  switch (type) {
49  theGoodEvents[make_pair(fed, RecordSLD(record).rmb())] += weight;
50  break;
51  }
52  case (DataRecord::RDDM): {
53  theBadEvents[make_pair(fed, ErrorRDDM(record).rmb())] += weight;
54  break;
55  }
56  case (DataRecord::RDM): {
57  theBadEvents[make_pair(fed, ErrorRDM(record).rmb())] += weight;
58  break;
59  }
60  case (DataRecord::RCDM): {
61  theBadEvents[make_pair(fed, ErrorRCDM(record).rmb())] += weight;
62  break;
63  }
64  default: {}
65  }
66 
67  theRecordTypes[make_pair(fed, type)] += weight;
68 }
69 
71  theReadoutErrors[make_pair(fed, e.rawCode())] += weight;
72 }
73 
75  for (IT irt = o.theRecordTypes.begin(); irt != o.theRecordTypes.end(); ++irt) {
76  theRecordTypes[make_pair(irt->first.first, irt->first.second)] += irt->second;
77  }
78 
79  for (IT ire = o.theReadoutErrors.begin(); ire != o.theReadoutErrors.end(); ++ire) {
80  theReadoutErrors[make_pair(ire->first.first, ire->first.second)] += ire->second;
81  }
82 
83  for (IT ire = o.theGoodEvents.begin(); ire != o.theGoodEvents.end(); ++ire) {
84  theGoodEvents[make_pair(ire->first.first, ire->first.second)] += ire->second;
85  }
86 
87  for (IT ire = o.theBadEvents.begin(); ire != o.theBadEvents.end(); ++ire) {
88  theBadEvents[make_pair(ire->first.first, ire->first.second)] += ire->second;
89  }
90 }
91 
93  std::ostringstream str;
94  for (IT irt = theRecordTypes.begin(); irt != theRecordTypes.end(); ++irt) {
95  str << "RECORD (" << irt->first.first << "," << irt->first.second << ")" << irt->second;
96  }
97  for (IT ire = theReadoutErrors.begin(); ire != theReadoutErrors.end(); ++ire) {
98  str << "ERROR(" << ire->first.first << "," << ire->first.second << ")=" << ire->second << endl;
99  }
100  return str.str();
101 }
type
Definition: HCALResponse.h:21
std::map< std::pair< int, int >, int > theReadoutErrors
int fedErrorRecords(int fedId) const
int fedBxRecords(int fedId) const
JetCorrectorParameters::Record record
Definition: classes.h:7
Definition: weight.py:1
int fedFormatErrors(int fedId) const
void addDccRecord(int fedId, const rpcrawtodigi::DataRecord &record, int weight=1)
std::string print() const
std::map< std::pair< int, int >, int > theRecordTypes
std::vector< LinkConnSpec >::const_iterator IT
std::map< std::pair< int, int >, int > theGoodEvents
std::map< std::pair< int, int >, int > theBadEvents
void addReadoutError(int fedId, const rpcrawtodigi::ReadoutError &error, int weight=1)
unsigned int rawCode() const
Definition: ReadoutError.h:34
std::map< std::pair< int, int >, int >::const_iterator IT
void operator+=(const RPCRawDataCounts &)
#define str(s)
DataRecordType type() const
Definition: DataRecord.cc:13