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 
68  theRecordTypes[make_pair(fed, type)] += weight;
69 }
70 
72  theReadoutErrors[make_pair(fed, e.rawCode())] += weight;
73 }
74 
76  for (IT irt = o.theRecordTypes.begin(); irt != o.theRecordTypes.end(); ++irt) {
77  theRecordTypes[make_pair(irt->first.first, irt->first.second)] += irt->second;
78  }
79 
80  for (IT ire = o.theReadoutErrors.begin(); ire != o.theReadoutErrors.end(); ++ire) {
81  theReadoutErrors[make_pair(ire->first.first, ire->first.second)] += ire->second;
82  }
83 
84  for (IT ire = o.theGoodEvents.begin(); ire != o.theGoodEvents.end(); ++ire) {
85  theGoodEvents[make_pair(ire->first.first, ire->first.second)] += ire->second;
86  }
87 
88  for (IT ire = o.theBadEvents.begin(); ire != o.theBadEvents.end(); ++ire) {
89  theBadEvents[make_pair(ire->first.first, ire->first.second)] += ire->second;
90  }
91 }
92 
94  std::ostringstream str;
95  for (IT irt = theRecordTypes.begin(); irt != theRecordTypes.end(); ++irt) {
96  str << "RECORD (" << irt->first.first << "," << irt->first.second << ")" << irt->second;
97  }
98  for (IT ire = theReadoutErrors.begin(); ire != theReadoutErrors.end(); ++ire) {
99  str << "ERROR(" << ire->first.first << "," << ire->first.second << ")=" << ire->second << endl;
100  }
101  return str.str();
102 }
RPCRawDataCounts::addDccRecord
void addDccRecord(int fedId, const rpcrawtodigi::DataRecord &record, int weight=1)
Definition: RPCRawDataCounts.cc:45
ErrorRDDM.h
MessageLogger.h
RPCRawDataCounts::print
std::string print() const
Definition: RPCRawDataCounts.cc:93
RPCRawDataCounts
Definition: RPCRawDataCounts.h:15
rpcrawtodigi::DataRecord
Definition: DataRecord.h:10
rpcrawtodigi::DataRecord::RDM
Definition: DataRecord.h:22
mps_merge.weight
weight
Definition: mps_merge.py:88
ErrorRDM.h
ErrorRCDM.h
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
rpcrawtodigi::ReadoutError
Definition: ReadoutError.h:8
rpcrawtodigi
Definition: DataRecord.h:9
RPCRawDataCounts::fedBxRecords
int fedBxRecords(int fedId) const
Definition: RPCRawDataCounts.cc:19
rpcrawtodigi::ReadoutError::NoProblem
Definition: ReadoutError.h:11
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
RecordSLD.h
rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData
Definition: DataRecord.h:16
rpcrawtodigi::ErrorRDM
Definition: ErrorRDM.h:10
RPCRawDataCounts::addReadoutError
void addReadoutError(int fedId, const rpcrawtodigi::ReadoutError &error, int weight=1)
Definition: RPCRawDataCounts.cc:71
rpcrawtodigi::ErrorRCDM
Definition: ErrorRCDM.h:10
rpcrawtodigi::ErrorRDDM
Definition: ErrorRDDM.h:10
RPCRawDataCounts.h
str
#define str(s)
Definition: TestProcessor.cc:52
RPCRawDataCounts::fedFormatErrors
int fedFormatErrors(int fedId) const
Definition: RPCRawDataCounts.cc:25
rpcrawtodigi::DataRecord::Empty
Definition: DataRecord.h:18
rpcrawtodigi::DataRecord::RCDM
Definition: DataRecord.h:21
rpcrawtodigi::RecordSLD
Definition: RecordSLD.h:7
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
rpcrawtodigi::ReadoutError::InconsistentDataSize
Definition: ReadoutError.h:15
ReadoutError.h
RPCRawDataCounts::fedErrorRecords
int fedErrorRecords(int fedId) const
Definition: RPCRawDataCounts.cc:35
IT
std::map< std::pair< int, int >, int >::const_iterator IT
Definition: RPCRawDataCounts.cc:17
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
RPCRawDataCounts::operator+=
void operator+=(const RPCRawDataCounts &)
Definition: RPCRawDataCounts.cc:75
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
rpcrawtodigi::DataRecord::DataRecordType
DataRecordType
Definition: DataRecord.h:13
DataRecord.h
std
Definition: JetResolutionObject.h:76
rpcrawtodigi::DataRecord::StartOfBXData
Definition: DataRecord.h:15
weight
Definition: weight.py:1
rpcrawtodigi::DataRecord::RDDM
Definition: DataRecord.h:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37