#include <RawTrcMonitorBlock.h>
Inheritance diagram for RawTrcMonitorBlock:

Public Types | |
| enum | ETrcFlagCode { kXQTflag = BIT(0), kLowRate = BIT(1), kHighRate = BIT(2), kBitErrorRate = BIT(3), kLinkPoor = BIT(4), kHardFailure = BIT(5), kLinkSyncFail = BIT(6), kSetTo1 = BIT(7) } |
Public Member Functions | |
| RawTrcMonitorBlock () | |
| RawTrcMonitorBlock (const Int_t *block) | |
| virtual | ~RawTrcMonitorBlock () |
| Int_t | GetRun () const |
| Short_t | GetSubRun () const |
| Short_t | GetRunType () const |
| Int_t | GetCrateId () const |
| Int_t | GetTimeFrameNum () const |
| Int_t | GetNumTrcStatusReports () const |
| const RawTrcStatusReport & | GetTrcStatusReport (UInt_t indx) const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| RawTrcMonitorBlock (const RawTrcMonitorBlock &rhs) | |
Static Public Member Functions | |
| void | SetDebugFlags (const UInt_t dbgflgs) |
| UInt_t | GetDebugFlags () |
Protected Member Functions | |
| virtual void | UnpackTrcStatusReports () const |
Protected Attributes | |
| std::vector< RawTrcStatusReport > | fTrcStatusReports |
Static Private Attributes | |
| UInt_t | fgDebugFlags = 0 |
| unpacked | |
|
|
Definition at line 38 of file RawTrcMonitorBlock.h. 00038 {
00039 // interpretation of flags
00040 kXQTflag = BIT(0),
00041 kLowRate = BIT(1),
00042 kHighRate = BIT(2),
00043 kBitErrorRate = BIT(3),
00044 kLinkPoor = BIT(4),
00045 kHardFailure = BIT(5),
00046 kLinkSyncFail = BIT(6),
00047 kSetTo1 = BIT(7)
00048 };
|
|
|
Definition at line 44 of file RawTrcMonitorBlock.cxx. 00045 {
00046 // Default constructor
00047 }
|
|
|
Definition at line 50 of file RawTrcMonitorBlock.cxx. 00051 : RawDataBlock(block) 00052 { 00053 // stored block format is: 00054 //--------------------- 00055 // 0 # words in block 00056 // 1 checksum 00057 // 2 Block Id 00058 //----- 00059 // 3 run # 00060 // 4 {subrun#| run type} 00061 // 5 crate identifier 00062 // 6 timeframe # 00063 // 7 # of Trc status report blocks 00064 // .. { Trc status report sub-blocks } 00065 }
|
|
|
Definition at line 68 of file RawTrcMonitorBlock.cxx. 00069 {
00070 // dtor
00071 }
|
|
|
Definition at line 72 of file RawTrcMonitorBlock.h. 00073 : RawDataBlock(rhs) { ; }
|
|
||||||||||||
|
Reimplemented from RawDataBlock. Definition at line 140 of file RawTrcMonitorBlock.cxx. References VldTimeStamp::AsString(), fgDebugFlags, RawTrcMonitorBlock::RawTrcStatusReport::flags, RawDataBlock::FormatToOStream(), GetCrateId(), GetNumTrcStatusReports(), GetRun(), GetRunType(), GetSubRun(), GetTrcStatusReport(), RawTrcMonitorBlock::RawTrcStatusReport::numBufferSwaps, option, and RawTrcMonitorBlock::RawTrcStatusReport::timestamp. 00142 {
00143
00144 if (fgDebugFlags & kdbg_ForceHexDump) option = "x";
00145
00146 RawDataBlock::FormatToOStream(os,option);
00147 if (option[0] == 'X') return os;
00148
00149 // additional block specific formatted output is done here
00150
00151 os << " Run " << GetRun()
00152 << " SubRun " << GetSubRun()
00153 << " RunType " << GetRunType() << endl;
00154 int crateid = GetCrateId();
00155 os << " Crate " << (crateid&0x3f)
00156 << " (0x" << hex << crateid << dec << ") had "
00157 << GetNumTrcStatusReports() << " reports: " << endl;
00158 for (int i = 0; i<GetNumTrcStatusReports(); i++) {
00159 const RawTrcStatusReport status = GetTrcStatusReport(i);
00160 os << " report [" << setw(2) << i << "] "
00161 << status.timestamp.AsString("c")
00162 << " swaps=" << int(status.numBufferSwaps)
00163 << " flags=0x" << hex << setfill('0') << int(status.flags&0xFF)
00164 << setfill(' ') << dec
00165 << endl;
00166 }
00167 return os;
00168 }
|
|
|
Definition at line 98 of file RawTrcMonitorBlock.cxx. Referenced by FormatToOStream(). 00099 {
00100 // get the crate id
00101 if (fSize > indx_crateid) return fRawBlock[indx_crateid];
00102 return -1;
00103 }
|
|
|
Definition at line 69 of file RawTrcMonitorBlock.h. 00069 { return fgDebugFlags; }
|
|
|
Definition at line 114 of file RawTrcMonitorBlock.cxx. References fTrcStatusReports, and UnpackTrcStatusReports(). Referenced by FormatToOStream(), and GetTrcStatusReport(). 00115 {
00116 // get the number of status report sub-blocks
00117
00118 //if (fSize > indx_nreports) return fRawBlock[indx_nreports];
00119 //return -1;
00120 UnpackTrcStatusReports();
00121 return fTrcStatusReports.size();
00122 }
|
|
|
Definition at line 74 of file RawTrcMonitorBlock.cxx. Referenced by FormatToOStream(). 00075 {
00076 // get the run number
00077 if (fSize > indx_run) return fRawBlock[indx_run];
00078 return -1;
00079 }
|
|
|
Definition at line 90 of file RawTrcMonitorBlock.cxx. Referenced by FormatToOStream(). 00091 {
00092 // get the run type
00093 if (fSize > indx_runtype) return fRawBlock[indx_runtype]&0xffff;
00094 return -1;
00095 }
|
|
|
Definition at line 82 of file RawTrcMonitorBlock.cxx. Referenced by FormatToOStream(). 00083 {
00084 // get the subrun number
00085 if (fSize > indx_subrun) return (fRawBlock[indx_subrun]>>16)&0xffff;
00086 return -1;
00087 }
|
|
|
Definition at line 106 of file RawTrcMonitorBlock.cxx. 00107 {
00108 // get the time frame #
00109 if (fSize > indx_timeframe) return fRawBlock[indx_timeframe];
00110 return -1;
00111 }
|
|
|
Definition at line 126 of file RawTrcMonitorBlock.cxx. References fTrcStatusReports, GetNumTrcStatusReports(), and MSG. Referenced by FormatToOStream(). 00127 {
00128 // get the i-th status report sub-block
00129 size_t nreports = GetNumTrcStatusReports();
00130 if (indx >= nreports) {
00131 MSG("Raw",Msg::kWarning)
00132 << "GetStatusReport() can't get index " << indx
00133 << " as there are only " << nreports << endl;
00134 return dummyTrcStatusReport;
00135 }
00136 return fTrcStatusReports[indx];
00137 }
|
|
|
Definition at line 68 of file RawTrcMonitorBlock.h. References fgDebugFlags. 00068 {fgDebugFlags=dbgflgs;}
|
|
|
Definition at line 171 of file RawTrcMonitorBlock.cxx. References RawTrcMonitorBlock::RawTrcStatusReport::flags, fTrcStatusReports, indx_nreports, MSG, RawTrcMonitorBlock::RawTrcStatusReport::numBufferSwaps, and RawTrcMonitorBlock::RawTrcStatusReport::timestamp. Referenced by GetNumTrcStatusReports(). 00172 {
00173 // unpack the Trc status sub-blocks
00174 if (!fTrcStatusReports.empty()) return; // early exit if already unpacked
00175
00176 UInt_t nexpected = 0, nseen = 0;
00177 if (fSize > indx_nreports) nexpected = fRawBlock[indx_nreports];
00178
00179 Int_t *report_start = fRawBlock + indx_nreports + 1;
00180 Int_t *toofar = fRawBlock + fSize;
00181
00182 const size_t sizeTrcReportSubBlk = 3;
00183
00184 while (report_start < toofar) {
00185 time_t sec = report_start[0];
00186 Int_t ns = report_start[1];
00187 Int_t packed = report_start[2];
00188 // packed is the two char flags and numBufferSwaps + 2 padding chars
00189 // structure mappings of chars to memory is tricky!
00190 // for gcc Linux on x86 architecture first char maps to *lowest* byte.
00191 // but despite documentation (and structure in mdBlockDefinitions.h
00192 // it appears to be filled via the following) the flags data
00193 // appears to be in the top most byte, not the lowest.
00194 // but that assumes that the structure is filled on the same
00195 // a platform with the endian-ness and a byte swapping doesn't
00196 // occur somewhere in the game.
00197 char flags = (packed>>24) & 0xff;
00198 char nswap = (packed>>16) & 0xff;
00199
00200 RawTrcStatusReport report;
00201 report.timestamp = VldTimeStamp(sec,ns);
00202 report.flags = flags;
00203 report.numBufferSwaps = nswap;
00204 fTrcStatusReports.push_back(report);
00205
00206 ++nseen;
00207 report_start += sizeTrcReportSubBlk;
00208 }
00209
00210 if (nseen != nexpected || report_start != toofar)
00211 MSG("Raw",Msg::kWarning)
00212 << "Unpacking reached end in an inconsistent manner"
00213 << " ptr @ " << report_start << " should be " << toofar
00214 << " saw " << nseen << " of " << nexpected << " expected"
00215 << " TrcStatusReports." << endl;
00216
00217 }
|
|
|
unpacked
Definition at line 14 of file RawTrcMonitorBlock.cxx. Referenced by FormatToOStream(), and SetDebugFlags(). |
|
|
Definition at line 81 of file RawTrcMonitorBlock.h. Referenced by GetNumTrcStatusReports(), GetTrcStatusReport(), and UnpackTrcStatusReports(). |
1.3.9.1