CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
RPCRawDataCounts Class Reference

#include <RPCRawDataCounts.h>

Public Member Functions

void addDccRecord (int fedId, const rpcrawtodigi::DataRecord &record, int weight=1)
 
void addReadoutError (int fedId, const rpcrawtodigi::ReadoutError &error, int weight=1)
 
int fedBxRecords (int fedId) const
 
int fedErrorRecords (int fedId) const
 
int fedFormatErrors (int fedId) const
 
void operator+= (const RPCRawDataCounts &)
 
std::string print () const
 
 RPCRawDataCounts ()
 
 ~RPCRawDataCounts ()
 

Private Attributes

std::map< std::pair< int, int >, int > theBadEvents
 
std::map< std::pair< int, int >, int > theGoodEvents
 
std::map< std::pair< int, int >, int > theReadoutErrors
 
std::map< std::pair< int, int >, int > theRecordTypes
 

Friends

class RPCMonitorRaw
 

Detailed Description

Definition at line 15 of file RPCRawDataCounts.h.

Constructor & Destructor Documentation

◆ RPCRawDataCounts()

RPCRawDataCounts::RPCRawDataCounts ( )
inline

Definition at line 17 of file RPCRawDataCounts.h.

17 {}

◆ ~RPCRawDataCounts()

RPCRawDataCounts::~RPCRawDataCounts ( )
inline

Definition at line 18 of file RPCRawDataCounts.h.

18 {}

Member Function Documentation

◆ addDccRecord()

void RPCRawDataCounts::addDccRecord ( int  fedId,
const rpcrawtodigi::DataRecord record,
int  weight = 1 
)

Definition at line 45 of file RPCRawDataCounts.cc.

45  {
47  switch (type) {
48  case (DataRecord::StartOfTbLinkInputNumberData): {
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 }

References rpcrawtodigi::DataRecord::RCDM, rpcrawtodigi::DataRecord::RDDM, rpcrawtodigi::DataRecord::RDM, GlobalPosition_Frontier_DevDB_cff::record, rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData, and mps_merge::weight.

◆ addReadoutError()

void RPCRawDataCounts::addReadoutError ( int  fedId,
const rpcrawtodigi::ReadoutError error,
int  weight = 1 
)

Definition at line 71 of file RPCRawDataCounts.cc.

71  {
72  theReadoutErrors[make_pair(fed, e.rawCode())] += weight;
73 }

References MillePedeFileConverter_cfg::e.

◆ fedBxRecords()

int RPCRawDataCounts::fedBxRecords ( int  fedId) const

Definition at line 19 of file RPCRawDataCounts.cc.

19  {
20  int type = DataRecord::StartOfBXData;
21  IT im = theRecordTypes.find(make_pair(fedId, type));
22  return (im == theRecordTypes.end()) ? 0 : im->second;
23 }

References l1tstage2_dqm_sourceclient-live_cfg::fedId, and rpcrawtodigi::DataRecord::StartOfBXData.

◆ fedErrorRecords()

int RPCRawDataCounts::fedErrorRecords ( int  fedId) const

Definition at line 35 of file RPCRawDataCounts.cc.

35  {
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 }

References rpcrawtodigi::DataRecord::Empty, and l1tstage2_dqm_sourceclient-live_cfg::fedId.

◆ fedFormatErrors()

int RPCRawDataCounts::fedFormatErrors ( int  fedId) const

Definition at line 25 of file RPCRawDataCounts.cc.

25  {
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 }

References l1tstage2_dqm_sourceclient-live_cfg::fedId, rpcrawtodigi::ReadoutError::InconsistentDataSize, and rpcrawtodigi::ReadoutError::NoProblem.

◆ operator+=()

void RPCRawDataCounts::operator+= ( const RPCRawDataCounts o)

Definition at line 75 of file RPCRawDataCounts.cc.

75  {
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 }

References EcalTangentSkim_cfg::o.

◆ print()

std::string RPCRawDataCounts::print ( void  ) const

Definition at line 93 of file RPCRawDataCounts.cc.

93  {
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 }

References str.

Friends And Related Function Documentation

◆ RPCMonitorRaw

friend class RPCMonitorRaw
friend

Definition at line 29 of file RPCRawDataCounts.h.

Member Data Documentation

◆ theBadEvents

std::map<std::pair<int, int>, int> RPCRawDataCounts::theBadEvents
private

Definition at line 33 of file RPCRawDataCounts.h.

◆ theGoodEvents

std::map<std::pair<int, int>, int> RPCRawDataCounts::theGoodEvents
private

Definition at line 32 of file RPCRawDataCounts.h.

◆ theReadoutErrors

std::map<std::pair<int, int>, int> RPCRawDataCounts::theReadoutErrors
private

Definition at line 31 of file RPCRawDataCounts.h.

◆ theRecordTypes

std::map<std::pair<int, int>, int> RPCRawDataCounts::theRecordTypes
private

Definition at line 30 of file RPCRawDataCounts.h.

mps_merge.weight
weight
Definition: mps_merge.py:88
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
rpcrawtodigi::ErrorRDM
Definition: ErrorRDM.h:10
rpcrawtodigi::ErrorRCDM
Definition: ErrorRCDM.h:10
rpcrawtodigi::ErrorRDDM
Definition: ErrorRDDM.h:10
RPCRawDataCounts::theBadEvents
std::map< std::pair< int, int >, int > theBadEvents
Definition: RPCRawDataCounts.h:33
str
#define str(s)
Definition: TestProcessor.cc:52
rpcrawtodigi::RecordSLD
Definition: RecordSLD.h:7
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
RPCRawDataCounts::theRecordTypes
std::map< std::pair< int, int >, int > theRecordTypes
Definition: RPCRawDataCounts.h:30
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
RPCRawDataCounts::theReadoutErrors
std::map< std::pair< int, int >, int > theReadoutErrors
Definition: RPCRawDataCounts.h:31
RPCRawDataCounts::theGoodEvents
std::map< std::pair< int, int >, int > theGoodEvents
Definition: RPCRawDataCounts.h:32
weight
Definition: weight.py:1
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37