#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 |
Definition at line 11 of file RPCRawDataCounts.h.
RPCRawDataCounts::RPCRawDataCounts | ( | ) | [inline] |
Definition at line 14 of file RPCRawDataCounts.h.
{}
RPCRawDataCounts::~RPCRawDataCounts | ( | ) | [inline] |
Definition at line 15 of file RPCRawDataCounts.h.
{ }
void RPCRawDataCounts::addDccRecord | ( | int | fedId, |
const rpcrawtodigi::DataRecord & | record, | ||
int | weight = 1 |
||
) |
Definition at line 44 of file RPCRawDataCounts.cc.
References rpcrawtodigi::DataRecord::RCDM, rpcrawtodigi::DataRecord::RDDM, rpcrawtodigi::DataRecord::RDM, rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData, rpcrawtodigi::DataRecord::type(), and CommonMethods::weight().
{ DataRecord::DataRecordType type = record.type(); switch (type) { case (DataRecord::StartOfTbLinkInputNumberData) : { theGoodEvents[make_pair(fed, RecordSLD(record).rmb())] += weight; break; } case (DataRecord::RDDM) : { theBadEvents[make_pair(fed,ErrorRDDM(record).rmb())] += weight; break;} case (DataRecord::RDM) : { theBadEvents[make_pair(fed,ErrorRDM(record).rmb())] += weight; break;} case (DataRecord::RCDM) : { theBadEvents[make_pair(fed,ErrorRCDM(record).rmb())] += weight; break;} default : {} } theRecordTypes[ make_pair(fed,type) ] += weight; }
void RPCRawDataCounts::addReadoutError | ( | int | fedId, |
const rpcrawtodigi::ReadoutError & | error, | ||
int | weight = 1 |
||
) |
Definition at line 62 of file RPCRawDataCounts.cc.
References rpcrawtodigi::ReadoutError::rawCode().
Referenced by RPCRecordFormatter::recordUnpack().
{ theReadoutErrors[ make_pair(fed,e.rawCode()) ] += weight; }
int RPCRawDataCounts::fedBxRecords | ( | int | fedId | ) | const |
Definition at line 19 of file RPCRawDataCounts.cc.
References rpcrawtodigi::DataRecord::StartOfBXData.
Referenced by RPCFEDIntegrity::analyze().
{ int type= DataRecord::StartOfBXData; IT im = theRecordTypes.find(make_pair(fedId,type)); return (im==theRecordTypes.end())? 0 : im->second; }
int RPCRawDataCounts::fedErrorRecords | ( | int | fedId | ) | const |
Definition at line 35 of file RPCRawDataCounts.cc.
References rpcrawtodigi::DataRecord::Empty.
Referenced by RPCFEDIntegrity::analyze().
{ for (IT im=theRecordTypes.begin(); im != theRecordTypes.end(); ++im) { if (im->first.first != fedId) continue; if (im->first.second > DataRecord::Empty) return 1; } return 0; }
int RPCRawDataCounts::fedFormatErrors | ( | int | fedId | ) | const |
Definition at line 26 of file RPCRawDataCounts.cc.
References rpcrawtodigi::ReadoutError::InconsistentDataSize, and rpcrawtodigi::ReadoutError::NoProblem.
Referenced by RPCFEDIntegrity::analyze().
{ for (IT im=theReadoutErrors.begin(); im != theReadoutErrors.end(); ++im) { if (im->first.first != fedId) continue; if (im->first.second > ReadoutError::NoProblem && im->first.second <= ReadoutError::InconsistentDataSize) return 1; } return 0; }
void RPCRawDataCounts::operator+= | ( | const RPCRawDataCounts & | o | ) |
Definition at line 67 of file RPCRawDataCounts.cc.
References theBadEvents, theGoodEvents, theReadoutErrors, and theRecordTypes.
{ for (IT irt= o.theRecordTypes.begin(); irt != o.theRecordTypes.end(); ++irt) { theRecordTypes[ make_pair(irt->first.first,irt->first.second) ] += irt->second; } for (IT ire=o.theReadoutErrors.begin(); ire != o.theReadoutErrors.end();++ire) { theReadoutErrors[ make_pair(ire->first.first,ire->first.second) ] += ire->second; } for (IT ire=o.theGoodEvents.begin(); ire != o.theGoodEvents.end();++ire) { theGoodEvents[ make_pair(ire->first.first,ire->first.second) ] += ire->second; } for (IT ire=o.theBadEvents.begin(); ire != o.theBadEvents.end();++ire) { theBadEvents[ make_pair(ire->first.first,ire->first.second) ] += ire->second; } }
std::string RPCRawDataCounts::print | ( | void | ) | const |
Definition at line 87 of file RPCRawDataCounts.cc.
{ std::ostringstream str; for (IT irt=theRecordTypes.begin(); irt != theRecordTypes.end(); ++irt) { str << "RECORD ("<<irt->first.first<<","<<irt->first.second<<")"<<irt->second; } for (IT ire=theReadoutErrors.begin(); ire != theReadoutErrors.end();++ire) { str <<"ERROR("<<ire->first.first<<","<<ire->first.second<<")="<<ire->second<<endl; } return str.str(); }
friend class RPCMonitorRaw [friend] |
Definition at line 27 of file RPCRawDataCounts.h.
std::map< std::pair<int,int>, int> RPCRawDataCounts::theBadEvents [private] |
Definition at line 31 of file RPCRawDataCounts.h.
Referenced by RPCMonitorRaw::analyze(), and operator+=().
std::map< std::pair<int,int>, int> RPCRawDataCounts::theGoodEvents [private] |
Definition at line 30 of file RPCRawDataCounts.h.
Referenced by RPCMonitorRaw::analyze(), and operator+=().
std::map< std::pair<int,int>, int> RPCRawDataCounts::theReadoutErrors [private] |
Definition at line 29 of file RPCRawDataCounts.h.
Referenced by RPCMonitorRaw::analyze(), and operator+=().
std::map< std::pair<int,int>, int> RPCRawDataCounts::theRecordTypes [private] |
Definition at line 28 of file RPCRawDataCounts.h.
Referenced by RPCMonitorRaw::analyze(), and operator+=().