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

Public Member Functions | |
| RawSpillServerMonitorBlock () | |
| RawSpillServerMonitorBlock (const Int_t *block) | |
| RawSpillServerMonitorBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype, Int_t timeframe) | |
| virtual | ~RawSpillServerMonitorBlock () |
| VldTimeStamp | GetTimeStamp () const |
| VldTimeStamp | GetFrameStartTime () const |
| VldTimeStamp | GetFrameEndTime () const |
| Int_t | GetRun () const |
| Short_t | GetSubRun () const |
| Short_t | GetRunType () const |
| Int_t | GetTimeFrameNum () const |
| Int_t | GetResponse () const |
| VldContext | GetVldContext () const |
| const mdSpillData_t & | GetSpillData () const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| RawSpillServerMonitorBlock (const RawSpillServerMonitorBlock &rhs) | |
Static Public Member Functions | |
| const Char_t * | ResponseAsString (Int_t spillServerQueryErrors) |
| const Char_t * | SpillTypeAsString (Int_t spillTypeEnum) |
| void | SetDebugFlags (const UInt_t dbgflgs) |
| UInt_t | GetDebugFlags () |
Static Private Attributes | |
| UInt_t | fgDebugFlags = 0 |
|
|
Definition at line 56 of file RawSpillServerMonitorBlock.cxx. 00056 : RawDataBlock() 00057 { 00058 // Default constructor 00059 }
|
|
|
Definition at line 62 of file RawSpillServerMonitorBlock.cxx. 00063 : RawDataBlock(block) 00064 { 00065 // stored block format is: 00066 //--------------------- 00067 // 0 # words in block 00068 // 1 checksum 00069 // 2 Block Id 00070 //----- 00071 // 3 run # 00072 // 4 {subrun #| run type} 00073 // 5 timeframe start timestamp (sec) 00074 // 6 timeframe start timestamp (nsec) 00075 // 7 timeframe # 00076 // 8 timeframe end timestamp (sec) 00077 // 9 timeframe end timestamp (nsec) 00078 // 10 query response time (usec if >=0; error code if <0) 00079 // 11 request sec 00080 // 12 isKnown 00081 // 13 spill type 00082 // 14 spill id (unique 'DAQ' id for spill) 00083 // 15 near spill timestamp (sec) 00084 // 16 near spill timestamp (nsec) 00085 // 17 far spill timestamp (sec) 00086 // 18 far spill timestamp (nsec) 00087 // 19 estimated worst case error (nsec) 00088 // 20 suggested window open time (nsec) 00089 // 21 suggested window close time (nsec) 00090 }
|
|
||||||||||||||||||||||||
|
Definition at line 92 of file RawSpillServerMonitorBlock.cxx. References VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), and rdxsum_fill(). 00095 : RawDataBlock() 00096 { 00097 // Component ctor 00098 00099 fSize = zzzz_last; 00100 if (fRawBlock) delete [] fRawBlock; 00101 fRawBlock = new Int_t [fSize]; 00102 00103 fRawBlock[0] = fSize; 00104 // fRawBlock[1] = checksum... see below 00105 00106 RawBlockRegistry& rbr = RawBlockRegistry::Instance(); 00107 RawBlockProxy* rbp = rbr.LookUp("RawSpillServerMonitorBlock"); 00108 00109 Bool_t isDCS = rbp->IsDCS(); 00110 Int_t majorId = rbp->GetMajorId(); 00111 Int_t minorId = 1; // latest and greatest minor version # 00112 RawBlockId rbid(majorId,minorId,isDCS, 00113 vldc.GetDetector(),vldc.GetSimFlag()); 00114 fRawBlock[2] = rbid.GetEncoded(); 00115 00116 fRawBlock[indx_run] = run; 00117 fRawBlock[indx_subrun] = (subrun&0xffff)<<16 | (runtype&0xffff); 00118 fRawBlock[indx_start_sec] = vldc.GetTimeStamp().GetSec(); 00119 fRawBlock[indx_start_nsec] = vldc.GetTimeStamp().GetNanoSec(); 00120 fRawBlock[indx_tf] = timeframe; 00121 fRawBlock[indx_end_sec] = fRawBlock[indx_start_sec] + 1; 00122 fRawBlock[indx_end_nsec] = fRawBlock[indx_start_nsec]; 00123 fRawBlock[indx_response] = -1; 00124 fRawBlock[indx_request] = 0; 00125 fRawBlock[indx_isknown] = 0; 00126 fRawBlock[indx_spilltype] = -1; 00127 fRawBlock[indx_spillid] = 0; 00128 fRawBlock[indx_near_sec] = 0; 00129 fRawBlock[indx_near_sec] = 0; 00130 fRawBlock[indx_near_nsec] = 0; 00131 fRawBlock[indx_far_sec] = 0; 00132 fRawBlock[indx_far_nsec] = 0; 00133 fRawBlock[indx_esterr_ns] = 0; 00134 fRawBlock[indx_open_ns] = 0; 00135 fRawBlock[indx_close_ns] = 0; 00136 00137 // fill checksum 00138 rdxsum_fill((long*)fRawBlock,0); 00139 00140 }
|
|
|
Definition at line 143 of file RawSpillServerMonitorBlock.cxx. 00144 {
00145 // dtor
00146 }
|
|
|
Definition at line 60 of file RawSpillServerMonitorBlock.h. 00061 : RawDataBlock(rhs) { ; }
|
|
||||||||||||
|
Reimplemented from RawDataBlock. Definition at line 232 of file RawSpillServerMonitorBlock.cxx. References VldTimeStamp::AsString(), RawDataBlock::FormatToOStream(), GetFrameEndTime(), GetFrameStartTime(), GetResponse(), GetRun(), GetRunType(), GetSpillData(), GetSubRun(), GetTimeFrameNum(), mdSpillData_t::isKnown, mdSpillData_t::isSpill, mdTimeStamp_t::nsec, option, mdSpillData_t::request_sec, ResponseAsString(), mdTimeStamp_t::sec, mdSpillData_t::spillId, mdSpillData_t::spillTimeError_nsec, mdSpillData_t::spillTimeFD, mdSpillData_t::spillTimeND, SpillTypeAsString(), mdSpillData_t::windowClose_nsec, and mdSpillData_t::windowOpen_nsec. 00234 {
00235 RawDataBlock::FormatToOStream(os,option);
00236 if (option[0] == 'X') return os;
00237
00238 //Int_t minor = GetMinorId();
00239
00240 os << " [ "
00241 << GetFrameStartTime().AsString("c")
00242 << " : "
00243 << GetFrameEndTime().AsString("c")
00244 << " ]"
00245 << endl;
00246 os << " Run " << GetRun()
00247 << " SubRun " << GetSubRun()
00248 << " RunType " << GetRunType()
00249 << " TimeFrame " << GetTimeFrameNum()
00250 << endl;
00251
00252 Int_t response = GetResponse();
00253 os << " Response";
00254 if (response >= 0) os << " in " << response << "usec" << endl;
00255 else os << ": " << ResponseAsString(response) << endl;
00256
00257 // interpret mdSpillData_t info
00258
00259 const mdSpillData_t& spillData = GetSpillData();
00260 long request_sec = spillData.request_sec;
00261 VldTimeStamp requestTimeStamp((time_t)request_sec,0);
00262 os << " Queried time: " << request_sec
00263 << " [ " << requestTimeStamp.AsString("s") << "]" << endl;
00264 os << " isKnown " << spillData.isKnown
00265 << " " << SpillTypeAsString(spillData.isSpill)
00266 << " DAQ-ID " << spillData.spillId
00267 << endl;
00268 VldTimeStamp nearTimeStamp(spillData.spillTimeND.sec,
00269 spillData.spillTimeND.nsec);
00270 VldTimeStamp farTimeStamp(spillData.spillTimeFD.sec,
00271 spillData.spillTimeFD.nsec);
00272 os << " Near " << nearTimeStamp.AsString("c")
00273 << " Far " << farTimeStamp.AsString("c")
00274 << endl;
00275 os << " Est. worst error "
00276 << spillData.spillTimeError_nsec << " ns"
00277 << endl;
00278 os << " Window open " << spillData.windowOpen_nsec
00279 << " close " << spillData.windowClose_nsec << " ns"
00280 << endl;
00281
00282 return os;
00283 }
|
|
|
Definition at line 57 of file RawSpillServerMonitorBlock.h. 00057 { return fgDebugFlags; }
|
|
|
Definition at line 160 of file RawSpillServerMonitorBlock.cxx. References indx_end_nsec, and indx_end_sec. Referenced by FormatToOStream(). 00161 {
00162 // get the timestamp for the end of the timeframe
00163
00164 if (fSize > indx_end_nsec)
00165 return VldTimeStamp(fRawBlock[indx_end_sec],
00166 fRawBlock[indx_end_nsec]);
00167
00168 return VldTimeStamp((time_t)0,(Int_t)0);
00169 }
|
|
|
Definition at line 149 of file RawSpillServerMonitorBlock.cxx. References indx_start_nsec, and indx_start_sec. Referenced by FormatToOStream(), and GetTimeStamp(). 00150 {
00151 // get the timestamp for the start of the timeframe
00152 if (fSize > indx_start_nsec)
00153 return VldTimeStamp(fRawBlock[indx_start_sec],
00154 fRawBlock[indx_start_nsec]);
00155
00156 return VldTimeStamp((time_t)0,(Int_t)0);
00157 }
|
|
|
Definition at line 204 of file RawSpillServerMonitorBlock.cxx. Referenced by FormatToOStream(). 00205 {
00206 // get the time taken to obtain data from server (in usec)
00207 if (fSize > indx_response) return fRawBlock[indx_response];
00208 return -1;
00209 }
|
|
|
Definition at line 172 of file RawSpillServerMonitorBlock.cxx. Referenced by FormatToOStream(). 00173 {
00174 // get the run number
00175 if (fSize > indx_run) return fRawBlock[indx_run];
00176 return -1;
00177 }
|
|
|
Definition at line 188 of file RawSpillServerMonitorBlock.cxx. Referenced by FormatToOStream(). 00189 {
00190 // get the run type
00191 if (fSize > indx_runtype) return fRawBlock[indx_runtype]&0xffff;
00192 return -1;
00193 }
|
|
|
Definition at line 212 of file RawSpillServerMonitorBlock.cxx. References indx_response. Referenced by FormatToOStream(), DQSpillServer::Process(), FillSpillServerMon::ProcessBlock(), and FarDetDataQualityModule::ProcessBlock(). 00213 {
00214 // get the mdSpillData_t structure
00215 static mdSpillData_t dummySpillData; // = {0,0,0,0,0,0,0,0,0,0,0};
00216
00217 if ((unsigned int)fSize > indx_response+sizeof(mdSpillRequest_t)) {
00218 return *(mdSpillData_t*)(fRawBlock+indx_spilldata);
00219 }
00220 else return dummySpillData;
00221 }
|
|
|
Definition at line 180 of file RawSpillServerMonitorBlock.cxx. Referenced by FormatToOStream(). 00181 {
00182 // get the subrun number
00183 if (fSize > indx_subrun) return (fRawBlock[indx_subrun]>>16)&0xffff;
00184 return -1;
00185 }
|
|
|
Definition at line 196 of file RawSpillServerMonitorBlock.cxx. Referenced by FormatToOStream(). 00197 {
00198 // get the timeframe number
00199 if (fSize > indx_tf) return fRawBlock[indx_tf];
00200 return -1;
00201 }
|
|
|
Definition at line 33 of file RawSpillServerMonitorBlock.h. References GetFrameStartTime(). Referenced by GetVldContext(), DQSpillServer::Process(), and FillSpillServerMon::ProcessBlock(). 00033 { return GetFrameStartTime(); }
|
|
|
Definition at line 224 of file RawSpillServerMonitorBlock.cxx. References RawDataBlock::GetBlockId(), RawBlockId::GetDetector(), RawBlockId::GetSimFlag(), and GetTimeStamp(). 00225 {
00226 // build validity context
00227 RawBlockId rbid = GetBlockId();
00228 return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp());
00229 }
|
|
|
Definition at line 286 of file RawSpillServerMonitorBlock.cxx. References Form(), kSpillServerCommsFailure, kSpillServerHangUp, kSpillServerIncompleteData, kSpillServerNoConnect, kSpillServerNotAsked, and kSpillServerTimeout. Referenced by FormatToOStream(). 00287 {
00288 // interpret response error codes -- tpSpillServerQueryErrors
00289
00290 if (response>=0) return Form("in %d usec",response);
00291
00292 switch (response) {
00293 case kSpillServerNotAsked: return "No query to Spill Server "; break;
00294 case kSpillServerNoConnect: return "Connection to Spill Server failed"; break;
00295 case kSpillServerCommsFailure: return "Spill Server socket communications failure"; break;
00296 case kSpillServerHangUp: return "Spill Server hung up before response"; break;
00297 case kSpillServerTimeout: return "Timeout before Spill Server responded"; break;
00298 case kSpillServerIncompleteData: return "Incomplete Data received from Spill Server"; break;
00299 default: return "unknown tpSpillServerQueryError"; break;
00300 }
00301 }
|
|
|
Definition at line 56 of file RawSpillServerMonitorBlock.h. References fgDebugFlags. 00056 {fgDebugFlags=dbgflgs;}
|
|
|
Definition at line 304 of file RawSpillServerMonitorBlock.cxx. References kSpillType_Fake, kSpillType_Local, kSpillType_None, kSpillType_Predicted, and kSpillType_Reported. Referenced by FormatToOStream(). 00305 {
00306 // interpret spill types -- mdSpillTypeEnum
00307
00308 switch (spillType) {
00309 case kSpillType_None: return "None"; break;
00310 case kSpillType_Reported: return "Reported"; break;
00311 case kSpillType_Predicted: return "Predicted"; break;
00312 case kSpillType_Fake: return "Fake"; break;
00313 case kSpillType_Local: return "Local"; break;
00314 default: return "Unknown mdSpillTypeEnum"; break;
00315 }
00316 }
|
|
|
Definition at line 16 of file RawSpillServerMonitorBlock.cxx. Referenced by SetDebugFlags(). |
1.3.9.1