test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 11 of file RPCRawDataCounts.h.

Constructor & Destructor Documentation

RPCRawDataCounts::RPCRawDataCounts ( )
inline

Definition at line 14 of file RPCRawDataCounts.h.

14 {}
RPCRawDataCounts::~RPCRawDataCounts ( )
inline

Definition at line 15 of file RPCRawDataCounts.h.

15 { }

Member Function Documentation

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 puppiForMET_cff::weight.

45 {
47  switch (type) {
48  case (DataRecord::StartOfTbLinkInputNumberData) : { theGoodEvents[make_pair(fed, RecordSLD(record).rmb())] += weight; break; }
49  case (DataRecord::RDDM) : { theBadEvents[make_pair(fed,ErrorRDDM(record).rmb())] += weight; break;}
50  case (DataRecord::RDM) : { theBadEvents[make_pair(fed,ErrorRDM(record).rmb())] += weight; break;}
51  case (DataRecord::RCDM) : { theBadEvents[make_pair(fed,ErrorRCDM(record).rmb())] += weight; break;}
52  default : {}
53  }
54 
55  theRecordTypes[ make_pair(fed,type) ] += weight;
56 }
type
Definition: HCALResponse.h:21
std::map< std::pair< int, int >, int > theGoodEvents
std::map< std::pair< int, int >, int > theRecordTypes
std::map< std::pair< int, int >, int > theBadEvents
DataRecordType type() const
Definition: DataRecord.cc:13
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().

63 {
64  theReadoutErrors[ make_pair(fed,e.rawCode()) ] += weight;
65 }
std::map< std::pair< int, int >, int > theReadoutErrors
int RPCRawDataCounts::fedBxRecords ( int  fedId) const

Definition at line 19 of file RPCRawDataCounts.cc.

References rpcrawtodigi::DataRecord::StartOfBXData.

Referenced by RPCFEDIntegrity::analyze().

20 {
21  int type= DataRecord::StartOfBXData;
22  IT im = theRecordTypes.find(make_pair(fedId,type));
23  return (im==theRecordTypes.end())? 0 : im->second;
24 }
type
Definition: HCALResponse.h:21
std::vector< LinkConnSpec >::const_iterator IT
std::map< std::pair< int, int >, int > theRecordTypes
int RPCRawDataCounts::fedErrorRecords ( int  fedId) const

Definition at line 35 of file RPCRawDataCounts.cc.

References rpcrawtodigi::DataRecord::Empty.

Referenced by RPCFEDIntegrity::analyze().

36 {
37  for (IT im=theRecordTypes.begin(); im != theRecordTypes.end(); ++im) {
38  if (im->first.first != fedId) continue;
39  if (im->first.second > DataRecord::Empty) return 1;
40  }
41  return 0;
42 }
std::vector< LinkConnSpec >::const_iterator IT
std::map< std::pair< int, int >, int > theRecordTypes
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().

27 {
28  for (IT im=theReadoutErrors.begin(); im != theReadoutErrors.end(); ++im) {
29  if (im->first.first != fedId) continue;
30  if (im->first.second > ReadoutError::NoProblem && im->first.second <= ReadoutError::InconsistentDataSize) return 1;
31  }
32  return 0;
33 }
std::map< std::pair< int, int >, int > theReadoutErrors
std::vector< LinkConnSpec >::const_iterator IT
void RPCRawDataCounts::operator+= ( const RPCRawDataCounts o)

Definition at line 67 of file RPCRawDataCounts.cc.

References theBadEvents, theGoodEvents, theReadoutErrors, and theRecordTypes.

68 {
69 
70  for (IT irt= o.theRecordTypes.begin(); irt != o.theRecordTypes.end(); ++irt) {
71  theRecordTypes[ make_pair(irt->first.first,irt->first.second) ] += irt->second;
72  }
73 
74  for (IT ire=o.theReadoutErrors.begin(); ire != o.theReadoutErrors.end();++ire) {
75  theReadoutErrors[ make_pair(ire->first.first,ire->first.second) ] += ire->second;
76  }
77 
78  for (IT ire=o.theGoodEvents.begin(); ire != o.theGoodEvents.end();++ire) {
79  theGoodEvents[ make_pair(ire->first.first,ire->first.second) ] += ire->second;
80  }
81 
82  for (IT ire=o.theBadEvents.begin(); ire != o.theBadEvents.end();++ire) {
83  theBadEvents[ make_pair(ire->first.first,ire->first.second) ] += ire->second;
84  }
85 }
std::map< std::pair< int, int >, int > theReadoutErrors
std::map< std::pair< int, int >, int > theGoodEvents
std::vector< LinkConnSpec >::const_iterator IT
std::map< std::pair< int, int >, int > theRecordTypes
std::map< std::pair< int, int >, int > theBadEvents
std::string RPCRawDataCounts::print ( void  ) const

Definition at line 87 of file RPCRawDataCounts.cc.

88 {
89  std::ostringstream str;
90  for (IT irt=theRecordTypes.begin(); irt != theRecordTypes.end(); ++irt) {
91  str << "RECORD ("<<irt->first.first<<","<<irt->first.second<<")"<<irt->second;
92  }
93  for (IT ire=theReadoutErrors.begin(); ire != theReadoutErrors.end();++ire) {
94  str <<"ERROR("<<ire->first.first<<","<<ire->first.second<<")="<<ire->second<<endl;
95  }
96  return str.str();
97 }
std::map< std::pair< int, int >, int > theReadoutErrors
std::vector< LinkConnSpec >::const_iterator IT
std::map< std::pair< int, int >, int > theRecordTypes

Friends And Related Function Documentation

friend class RPCMonitorRaw
friend

Definition at line 27 of file RPCRawDataCounts.h.

Member Data Documentation

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+=().