BmnRoot
Loading...
Searching...
No Matches
BmnMonitor.cxx
Go to the documentation of this file.
1#include "BmnMonitor.h"
2
3#include <ctime>
4#include <dirent.h>
5#include <fcntl.h>
6#include <sys/epoll.h>
7#include <sys/stat.h>
8#include <sys/types.h>
9#include <thread>
10#include <time.h>
11// ROOT
12#include <TLatex.h>
13#include <TPaveText.h>
14// BmnRoot
15#include "BmnHistCsc.h"
16#include "BmnHistECAL.h"
17#include "BmnHistFHCal.h"
18#include "BmnHistGem.h"
19#include "BmnHistHodo.h"
20#include "BmnHistMSC.h"
21#include "BmnHistNdet.h"
22#include "BmnHistScWall.h"
23#include "BmnHistSiBT.h"
24#include "BmnHistSilicon.h"
25#include "BmnHistStat.h"
26#include "BmnHistToF.h"
27#include "BmnHistToF700.h"
28#include "BmnHistTrigger.h"
29#include "BmnHistVsp.h"
30#include "BmnHistZDC.h"
31
32#include <ElogRecord.h>
33#include <UniRun.h>
34
35#define DECO_SOCK_WAIT_PERIOD 20
36#define DECO_SOCK_WAIT_LIMIT 15e3
37
38using namespace chrono;
39
41 : _ctx(nullptr)
42 , fRecoTree(nullptr)
43 , fRecoTree4Show(nullptr)
44 , fHistOut(nullptr)
45 , fHistOutTemp(nullptr)
46 , fServer(nullptr)
47 , fDigiArrays(nullptr)
48 , keepWorking(kTRUE)
49 , fSetup(kBMNSETUP)
50 , fRunID(0)
51 , fTrigMapper(nullptr)
52 , fEvents(0)
53 , fNItersSinceUpdate(0)
54 , fNItersToUpdate(1000)
55 , fTimeToProcessRequests(milliseconds(20))
56 // , fTicksLastProcess()
57 , fTimeToUpdate(seconds(3))
58 , fIsSlowMode(true)
59 , fState(kBMNRECON)
60{
61 TString name = "infoCanvas";
62 infoCanvas = new TCanvas(name, name, 3 * PAD_WIDTH, 1 * PAD_HEIGHT * 2 / 3);
63 infoCanvas->Divide(3, 1);
64 // refList = new TList();
65 // refList->SetName("refList");
66 refTable = new TList();
67 refTable->SetName("refTable");
68 runPub = new TList();
69 runPub->SetName("CurRun");
70 CurRun = new BmnRunInfo();
71 runPub->Add((TObject*)CurRun);
72}
73
75{
76 DBG("started")
77 for (auto h : bhVec)
78 if (h)
79 delete h;
80 bhVec.clear();
81 // delete fRecoTree;
82 if (fHistOut)
83 delete fHistOut;
84 if (infoCanvas)
85 delete infoCanvas;
86 for (auto h : bhVec4show)
87 if (h)
88 delete h;
89 bhVec4show.clear();
90 if (fServer)
91 delete fServer;
92 if (_ctx) {
93 zmq_ctx_destroy(_ctx);
94 _ctx = nullptr;
95 }
96 if (CurRun)
97 delete CurRun;
98 if (runPub)
99 delete runPub;
100 if (fTrigMapper)
101 delete fTrigMapper;
102}
103
104void BmnMonitor::MonitorStreamZ(TString dirname, TString refDir, TString decoAddr, Int_t webPort)
105{
106 DBG("started")
107 fState = kBMNWAIT;
108 _ctx = zmq_ctx_new();
109 _decoSocket = zmq_socket(_ctx, ZMQ_SUB);
110 if (_decoSocket == nullptr) {
111 DBGERR("zmq socket")
112 return;
113 }
114 if (zmq_setsockopt(_decoSocket, ZMQ_SUBSCRIBE, nullptr, 0) == -1) {
115 DBGERR("zmq subscribe")
116 return;
117 }
118 Int_t rcvBuf = MAX_BUF_LEN;
119 if (zmq_setsockopt(_decoSocket, ZMQ_RCVBUF, &rcvBuf, sizeof(rcvBuf)) == -1)
120 DBGERR("zmq_setsockopt of ZMQ_RCVBUF")
121 if (zmq_setsockopt(_decoSocket, ZMQ_SNDBUF, &rcvBuf, sizeof(rcvBuf)) == -1)
122 DBGERR("zmq_setsockopt of ZMQ_SNDBUF")
123 _webPort = webPort;
124 gSystem->ExpandPathName(dirname);
125 printf("dir %s\n", dirname.Data());
126 _curDir = dirname + "/";
127 if (refDir == "")
128 _refDir = _curDir;
129 else {
130 gSystem->ExpandPathName(refDir);
131 _refDir = refDir + "/";
132 }
133 printf("Ref dir set to %s\n", _refDir.Data());
134 TString PeriodSetupExt = Form("%d%s.txt", fPeriodID, ((fSetup == kBMNSETUP) ? "" : "_SRC"));
135 TString MapFileName = TString("Trig_map_Run") + PeriodSetupExt;
136 TString PlaceMapFileName = TString("Trig_PlaceMap_Run") + PeriodSetupExt;
137 TTree* temp_tree = new TTree("Temp", "Temp");
138 fTrigMapper = new BmnTrigRaw2Digit(PlaceMapFileName, MapFileName, temp_tree);
139
140 InitServer();
141 RegisterAll();
142 for (auto h : bhVec4show)
143 h->DrawBoth();
144 fRawDecoAddr = decoAddr;
145 TString conStr = Form("tcp://%s", fRawDecoAddr.Data());
146 // TString conStr = Form("tcp://%s:%d", fRawDecoAddr.Data(), RAW_DECODER_SOCKET_PORT);
147 if (zmq_connect(_decoSocket, conStr.Data()) != 0) {
148 DBGERR("zmq connect")
149 return;
150 }
151 printf("Monitor listens to %s\n", conStr.Data());
152 zmq_msg_t msg;
153 TBufferFile t(TBuffer::kRead);
154 t.SetReadMode();
155 Int_t frame_size = 0;
156 decoTimeout = 0;
157 keepWorking = kTRUE;
158 while (keepWorking) {
159 if (fIsSlowMode || (fState == kBMNWAIT))
160 fServer->ProcessRequests();
161 // gSystem->ProcessEvents();
162 zmq_msg_init(&msg);
163 frame_size = zmq_msg_recv(&msg, _decoSocket, ZMQ_DONTWAIT); // ZMQ_DONTWAIT
164 // printf("frame_size %d\n", frame_size);
165 if (frame_size == -1) {
166 if (errno == EAGAIN) {
167 usleep(DECO_SOCK_WAIT_PERIOD * 1000);
168 decoTimeout += DECO_SOCK_WAIT_PERIOD;
169 if ((decoTimeout > DECO_SOCK_WAIT_LIMIT) && (fState == kBMNWORK)) {
170 FinishRun();
171 fState = kBMNWAIT;
172 // keepWorking = false; // @TODO Remove
173 // fServer->SetTimer(50, kTRUE);
174 DBG("state changed to kBMNWAIT")
175 }
176 } else {
177 printf("Receive error № %d #%s\n", errno, zmq_strerror(errno));
178 return;
179 }
180 } else {
181 decoTimeout = 0;
182 t.Reset();
183 t.SetBuffer(zmq_msg_data(&msg), zmq_msg_size(&msg));
184 fDigiArrays = (DigiArrays*)(t.ReadObject(DigiArrays::Class()));
185 // gSystem->ProcessEvents();
186 // if (fDigiArrays->header->GetEntriesFast() > 0) {
187 BmnEventHeader* head = fDigiArrays->header;
188 uint32_t runID = head->GetRunId();
189 switch (fState) {
190 case kBMNWAIT:
191 FinishRun();
192 fRunID = runID;
193 CreateFile(fRunID);
194 DBG("state changed to kBMNWORK")
195 // fServer->SetTimer(0, kTRUE);
196 fState = kBMNWORK;
197 ProcessDigi(0);
198 break;
199 case kBMNWORK:
200 if (fRunID != runID) {
201 printf("change run %5u to %5u\n", fRunID, runID);
202 FinishRun();
203 fRunID = runID;
204 CreateFile(fRunID);
205 }
206 ProcessDigi(0);
207 break;
208 default:
209 break;
210 }
211 // } else {
212 // printf("No header??\n");
213 // }
214 fDigiArrays->Clear();
215 delete fDigiArrays;
216 t.DetachBuffer();
217 }
218 zmq_msg_close(&msg);
219 }
220 zmq_close(_decoSocket);
221 zmq_ctx_destroy(_ctx);
222 _ctx = nullptr;
223}
224
225void BmnMonitor::InitServer()
226{
227 TString mode = "http"; // "http" // fastcgi
228 TString cgiStr = Form("%s:%d;noglobal;cors", mode.Data(), _webPort);
229 if (gSystem->AccessPathName(_curDir + "auth.htdigest") != 0) {
230 printf("Authorization file not found\nStarting server without authorization\n");
231 fServer = new THttpServer(cgiStr.Data());
232 } else
233 fServer = new THttpServer(TString(cgiStr + "?auth_file=auth.htdigest&auth_domain=root").Data());
234 fServer->SetTimer(50, kTRUE);
235}
236
237void BmnMonitor::InitHistVectors(vector<BmnHist*>& vec, TString refName)
238{
239 if (fDetectorSetup & BIT(kGEM))
240 vec.push_back(new BmnHistGem(refName + "GEM", _curDir, fPeriodID, fSetup));
241 if (fDetectorSetup & BIT(kVSP))
242 vec.push_back(new BmnHistVsp(refName + "VSP", _curDir, fPeriodID, fSetup));
243 if (fDetectorSetup & BIT(kSILICON))
244 vec.push_back(new BmnHistSilicon(refName + "Silicon", _curDir, fPeriodID, fSetup));
245 // vec.push_back(new BmnHistZDC(refName + "ZDC", _curDir));
246 // vec.push_back(new BmnHistECAL(refName + "ECAL", _curDir));
247 if (fDetectorSetup & BIT(kTOF1))
248 vec.push_back(new BmnHistToF(refName + "ToF400", _curDir));
249 if (fDetectorSetup & BIT(kTOF701))
250 vec.push_back(new BmnHistToF700(refName + "ToF700", _curDir));
251 if (fDetectorSetup & BIT(kBC)) {
252 vec.push_back(new BmnHistTrigger(refName + "Triggers", _curDir, fPeriodID, fSetup, fTrigMapper));
253 vec.push_back(new BmnHistStat(refName + "Statistics", _curDir));
254 }
255 if (fDetectorSetup & BIT(kSCWALL))
256 vec.push_back(new BmnHistScWall(refName + "ScWall", _curDir, fPeriodID, fSetup));
257 if (fDetectorSetup & BIT(kCSC))
258 vec.push_back(new BmnHistCsc(refName + "CSC", _curDir, fPeriodID, fSetup));
259 if (fDetectorSetup & BIT(kFHCAL))
260 vec.push_back(new BmnHistFHCal(refName + "FHCal", _curDir, fPeriodID, fSetup));
261 if (fDetectorSetup & BIT(kHODO))
262 vec.push_back(new BmnHistHodo(refName + "Hodo", _curDir));
263 if (fDetectorSetup & BIT(kNDET))
264 vec.push_back(new BmnHistNdet(refName + "Ndet", _curDir, fPeriodID, fSetup));
265 if (fDetectorSetup & BIT(kSiBT))
266 vec.push_back(new BmnHistSiBT(refName + "SiBT", _curDir, fPeriodID));
267 if (fDetectorSetup & BIT(kMSC)) {
268 BmnHistMSC* hh = new BmnHistMSC(refName + "MSC", _curDir, fPeriodID, fSetup, fTrigMapper);
269 hh->SetHistFileNameAdd(fHistFileNameAdd);
270 vec.push_back(hh);
271 }
272}
273
274BmnStatus BmnMonitor::CreateFile(uint32_t runID)
275{
276 fEvents = 0;
277 UpdateRuns();
278 // TString outHistName = Form("%s/bmn_run%04u_hist.root", _curDir.Data(), runID);
279 TString outHistName = Form("%s/bmn_run%04u%s_hist.root", _curDir.Data(), runID, fHistFileNameAdd.Data());
280 fHistOut = new TFile(outHistName, "recreate");
281 if (fHistOut)
282 printf("file %s created\n", outHistName.Data());
283 if (fHistOutTemp)
284 printf("file tempo.root created\n");
285
286 TString refName = Form("ref%06u_", fRunID);
287 InitHistVectors(bhVec, refName);
288
289 for (auto h : bhVec) {
290 h->SetDir(fHistOut, fRecoTree);
291 h->SetPeriodID(fPeriodID);
292 }
293 for (auto h : bhVec4show) {
294 // h->SetDir(fHistOutTemp, fRecoTree4Show);
295 h->ClearRefRun();
296 h->Reset();
297 h->SetPeriodID(fPeriodID);
298 }
299 refTable->Clear();
300 runPub->Clear();
301 return kBMNSUCCESS;
302}
303
304void BmnMonitor::ProcessDigi(Int_t iEv)
305{
306 // histograms fill//
307 fEvents++;
308 fNItersSinceUpdate++;
309 BmnEventHeader* head = fDigiArrays->header;
310 LOGF(debug, "Event type %u", (uint8_t)head->GetEventType());
311 Double_t rtime;
312 Double_t ctime;
313 TStopwatch timer;
314 uint32_t index = 0;
315 for (auto h : bhVec)
316 if (h) {
317 if (fIsSlowMode)
318 ProcessRequests();
319 if ((head->GetEventType() != kBMNSTAT) ^ bhVecIsStat[index])
320 h->FillFromDigi(fDigiArrays);
321 index++;
322 }
323 // Fill data Tree //
324 if (fRecoTree)
325 fRecoTree->Fill();
326 // fill histograms what will be shown on the site//
327 index = 0;
328 for (auto h : bhVec4show)
329 if (h) {
330 if (fIsSlowMode)
331 ProcessRequests();
332 timer.Start();
333 if ((head->GetEventType() != kBMNSTAT) ^ bhVecIsStat[index]) {
334 h->FillFromDigi(fDigiArrays);
335 // LOGF(info, "Filling");
336 }
337 timer.Stop();
338 rtime = timer.RealTime();
339 ctime = timer.CpuTime();
340 LOGF(debug, "Real time %f s, CPU time %f s %s ClassName %s Class_Name %s ", rtime, ctime, h->GetName(),
341 h->ClassName(), h->Class_Name());
342 index++;
343 }
344 if (!fIsSlowMode)
345 ProcessRequests();
346 auto now = system_clock::now();
347 seconds time = duration_cast<seconds>(now - fTicksLastUpdate);
348 if (((fNItersSinceUpdate > fNItersToUpdate)
349 && ((head->GetEventType() == kBMNPAYLOAD) || (head->GetEventType() == kBMNPEDESTAL)))
350 || ((time > fTimeToUpdate)))
351 {
352 LOGF(debug, "Draw! iters %d", fNItersSinceUpdate);
353 // print info canvas //
354 // infoCanvas->Clear();
355 TVirtualPad* pad = infoCanvas->cd(1);
356 pad->Clear();
357 TString runType;
358 // switch (head->GetTrigType()) {
359 // case kBMNBEAM:
360 // runType = "beam";
361 // break;
362 // case kBMNMINBIAS:
363 // runType = "target";
364 // break;
365 // default:
366 // runType = "???";
367 // break;
368 // }
369 TLatex Tl;
370 Tl.SetTextAlign(12);
371 Tl.SetTextSize(0.16);
372 TString shownID = head->GetRunId() == UNKNOWN_RUNID ? " o_O" : TString::UItoa(head->GetRunId(), 10);
373 Tl.DrawLatex(0.3, 0.9, Form("Run: %s", shownID.Data()));
374 Tl.DrawLatex(0.3, 0.6, Form("Event: %d", head->GetEventId()));
375 Tl.DrawLatex(0.3, 0.3, Form("Run Type: %s", runType.Data()));
376 Tl.Draw();
377 pad->Update();
378 pad->Modified();
379 pad = infoCanvas->cd(2);
380 pad->Clear();
381 // TLatex l2;
382 Tl.SetTextAlign(12);
383 Tl.SetTextSize(0.16);
384 Tl.DrawLatex(0.3, 0.9, Form("Energy: %1.2f", CurRun->GetEnergy()));
385 Tl.DrawLatex(0.3, 0.7, Form("Beam: %s", CurRun->GetBeamParticle().Data()));
386 Tl.DrawLatex(0.3, 0.5, Form("Target: %s", CurRun->GetTargetParticle().Data()));
387 Tl.DrawLatex(0.3, 0.3, Form("Field Voltage: %1.2f", CurRun->GetFieldVoltage()));
388 Tl.Draw();
389 pad->Update();
390 pad->Modified();
391 for (auto h : bhVec4show)
392 h->DrawBoth();
393 if (fEvents % 1000 == 0)
394 if (refTable->GetEntries() == 0)
395 UpdateRuns();
396 fNItersSinceUpdate = 0;
397 fTicksLastUpdate = now;
398 ProcessRequests();
399 }
400}
401
402void BmnMonitor::ProcessRequests()
403{
404 auto now = system_clock::now();
405 milliseconds time_since_last_process = duration_cast<milliseconds>(now - fTicksLastProcess);
406 // LOGF(info, "Since last process %lu", time_since_last_process.count());
407 if (time_since_last_process > fTimeToProcessRequests) {
408 // LOGF(info, "Process!");
409 fServer->ProcessRequests();
410 fTicksLastProcess = now;
411 }
412}
413
414void BmnMonitor::RegisterAll()
415{
416 InitHistVectors(bhVec4show);
417 fServer->Register("/", infoCanvas);
418 // fServer->Register("/", refList);
419 fServer->Register("/", refTable);
420 fServer->Register("/", runPub);
421 for (auto h : bhVec4show) {
422 h->SetDir(nullptr, nullptr);
423 h->Register(fServer);
424 h->SetRefPath(_refDir);
425 h->SetPeriodID(fPeriodID);
426 bhVecIsStat.push_back(strcmp(h->ClassName(), "BmnHistMSC") == 0);
427 }
428}
429
430void BmnMonitor::UpdateRuns()
431{
432 if (refTable->GetEntries())
433 return;
434 refTable->Clear();
435 runPub->Clear();
436 TObjArray* refRuns = GetAlikeRunsByUniDB(fPeriodID, fRunID);
437 if (refRuns == nullptr) {
438 fprintf(stderr, "Ref list is empty!\n");
439 delete CurRun;
440 CurRun = new BmnRunInfo();
441 CurRun->SetRunNumber(fRunID);
442 runPub->Add((TObject*)CurRun);
443 return;
444 }
445 runPub->Add((TObject*)CurRun);
446 for (Int_t iRun = 0; iRun < refRuns->GetEntriesFast(); iRun++) {
447 UniRun* run = (UniRun*)refRuns->At(iRun);
448 BmnRunInfo* runInfo = new BmnRunInfo(run);
449 refTable->Add((TObject*)runInfo);
450 LOGF(debug, "run %04d Energy %f Voltage %f Beam %s Target %s Date %d", run->GetRunNumber(),
451 run->GetEnergy() ? *run->GetEnergy() : -1, run->GetFieldVoltage() ? *run->GetFieldVoltage() : -1,
452 run->GetBeamParticle().Data(), run->GetTargetParticle().Data(), run->GetStartDatetime().GetDate());
453 }
454 refRuns->Delete();
455 delete refRuns;
456}
457
458void BmnMonitor::FinishRun()
459{
460 DBG("started")
461 if (fHistOut) {
462 printf("fHistOut Write result = %d\n", fHistOut->Write());
463 fHistOut->Close();
464 fHistOut = nullptr;
465 }
466 for (auto h : bhVec)
467 if (h)
468 delete h;
469 bhVec.clear();
470}
471
472TObjArray* BmnMonitor::GetAlikeRunsByElog(uint32_t periodID, uint32_t runID)
473{
474 if (runID == UNKNOWN_RUNID)
475 return nullptr;
476 TPRegexp reElementName(".*(\\w+).*");
477 TString beamParticle = "";
478 TString targetParticle = "";
479 Double_t beamEnergy = 0;
480 Double_t I_SP41 = 0;
481 TObjArray* recs = ElogRecord::GetRecords(periodID, runID);
482 if (recs == nullptr) {
483 fprintf(stderr, "Run not found in ELOG!\n");
484 return nullptr;
485 }
486 for (Int_t iRec = 0; iRec < recs->GetEntriesFast(); iRec++) {
487 ElogRecord* rec = (ElogRecord*)recs->At(iRec);
488 TObjArray* strings = reElementName.MatchS(rec->GetBeam().Data());
489 if (strings->GetEntriesFast() > 1)
490 beamParticle = ((TObjString*)strings->At(1))->GetString();
491 strings->Clear("C");
492 strings = reElementName.MatchS(rec->GetTarget().Data());
493 if (strings->GetEntriesFast() > 1)
494 targetParticle = ((TObjString*)strings->At(1))->GetString();
495 strings->Clear("C");
496 beamEnergy = *rec->GetEnergy() > 0 ? *rec->GetEnergy() : 0;
497 I_SP41 = *rec->GetSp41() > 0 ? *rec->GetSp41() : 0;
498 }
499 if (beamParticle == "" || targetParticle == "" || beamEnergy == 0 || I_SP41 == 0) {
500 fprintf(stderr, "Not enough run data in ELOG!\n");
501 return nullptr;
502 }
503 printf("search Energy %f I %f beam %s target %s\n\n", beamEnergy, I_SP41, beamParticle.Data(),
504 targetParticle.Data());
505 TObjArray arrayConditions;
508 arrayConditions.Add((TObject*)searchCondition);
510 UniSearchCondition::conditionEqual, targetParticle);
511 arrayConditions.Add((TObject*)searchCondition);
512 searchCondition =
514 arrayConditions.Add((TObject*)searchCondition);
515 // searchCondition = new UniSearchCondition(colu, conditionEqual, beamEnergy);
516 // arrayConditions.Add((TObject*) searchCondition);
517
518 TObjArray* refRuns = UniRun::Search(arrayConditions);
519 arrayConditions.SetOwner(kTRUE);
520 arrayConditions.Delete();
521 for (Int_t iRun = 0; iRun < refRuns->GetEntriesFast(); iRun++) {
522 UniRun* run = (UniRun*)refRuns->At(iRun);
523 printf("run %04d Energy %f Voltage %f Date %d\n", run->GetRunNumber(), *run->GetEnergy(),
524 *run->GetFieldVoltage(), run->GetStartDatetime().GetDate());
525 }
526 refRuns->Delete();
527
528 return nullptr; // FIXME
529}
530
531TObjArray* BmnMonitor::GetAlikeRunsByUniDB(uint32_t periodID, uint32_t runID)
532{
533 if (runID == UNKNOWN_RUNID)
534 return nullptr;
535 printf("getalike \n");
536 unique_ptr<UniRun> Run{UniRun::GetRun(periodID, runID)};
537 printf("getalike request returned\n");
538 if (Run.get() == nullptr) {
539 // fprintf(stderr, "Run %d not found in UniDB!\n", runID);
540 return nullptr;
541 }
542 if (!(Run->GetFieldVoltage() && Run->GetEnergy())) {
543 fprintf(stderr, "Not enough info on current run!\n");
544 return nullptr;
545 }
546 if (CurRun)
547 delete CurRun;
548 CurRun = new BmnRunInfo(Run.get());
549 TObjArray arrayConditions;
550 TString beamParticle = Run->GetBeamParticle();
551 printf("Beam particle %s\n", Run->GetBeamParticle().Data());
554 arrayConditions.Add((TObject*)searchCondition);
555 TString targetParticle = Run->GetTargetParticle();
556 printf("Target particle %s\n", targetParticle.Data());
558 UniSearchCondition::conditionEqual, targetParticle);
559 arrayConditions.Add((TObject*)searchCondition);
560 if (Run->GetEnergy()) {
561 printf("Beam Energy %f\n", *Run->GetEnergy());
562 Double_t beamEnergy = *Run->GetEnergy();
563 searchCondition =
565 arrayConditions.Add((TObject*)searchCondition);
566 }
567 if (Run->GetFieldVoltage()) {
568 printf("Field voltage %f\n", *Run->GetFieldVoltage());
569 Double_t V_SP41 = *Run->GetFieldVoltage();
572 arrayConditions.Add((TObject*)searchCondition);
575 arrayConditions.Add((TObject*)searchCondition);
576 }
577 // delete Run;
578 printf("search\n");
579 TObjArray* refRuns = UniRun::Search(arrayConditions);
580 printf("search request returned\n");
581 arrayConditions.SetOwner(kTRUE);
582 arrayConditions.Delete();
583 return refRuns;
584}
#define PAD_WIDTH
Definition BmnAdcQA.cxx:3
#define PAD_HEIGHT
Definition BmnAdcQA.cxx:4
#define DECO_SOCK_WAIT_PERIOD
#define DECO_SOCK_WAIT_LIMIT
@ kBC
@ kSILICON
@ kNDET
@ kGEM
@ kVSP
@ kTOF1
@ kFHCAL
@ kSCWALL
@ kCSC
@ kMSC
@ kTOF701
@ kSiBT
@ kHODO
BmnStatus
Definition BmnEnums.h:24
@ kBMNSUCCESS
Definition BmnEnums.h:25
@ kBMNWAIT
Definition BmnEnums.h:81
@ kBMNRECON
Definition BmnEnums.h:83
@ kBMNWORK
Definition BmnEnums.h:82
@ kBMNSETUP
Definition BmnEnums.h:90
@ kBMNSTAT
Definition BmnEnums.h:73
@ kBMNPAYLOAD
Definition BmnEnums.h:71
@ kBMNPEDESTAL
Definition BmnEnums.h:70
#define DBGERR(a)
Definition BmnMath.h:25
#define DBG(a)
Definition BmnMath.h:24
UInt_t GetEventId()
BmnEventType GetEventType()
void SetHistFileNameAdd(TString add)
Definition BmnHistMSC.h:43
void MonitorStreamZ(TString dir, TString refDir="", TString decoAddr="localhost", Int_t webPort=9000)
virtual ~BmnMonitor()
TObjArray * GetAlikeRunsByElog(uint32_t periodID, uint32_t rinID)
TObjArray * GetAlikeRunsByUniDB(uint32_t periodID, uint32_t rinID)
TString GetBeamParticle()
get beam particle of the current run
Definition BmnRunInfo.h:18
Double_t GetFieldVoltage()
get field voltage of the current run
Definition BmnRunInfo.h:30
Double_t GetEnergy()
get energy of the current run
Definition BmnRunInfo.h:22
void SetRunNumber(Int_t run_number)
set run number of the current run
Definition BmnRunInfo.h:40
TString GetTargetParticle()
get target particle of the current run
Definition BmnRunInfo.h:20
BmnEventHeader * header
Definition DigiArrays.h:146
void Clear()
Definition DigiArrays.h:38
int * GetSp41()
get sp 41 of the current record
Definition ElogRecord.h:161
double * GetEnergy()
get energy of the current record
Definition ElogRecord.h:187
static TObjArray * GetRecords(int period_number, int run_number, bool findPreviousRun=false)
get array of ElogRecord-s for a given or a previous run from the database
TString GetBeam()
get beam of the current record
Definition ElogRecord.h:185
TString GetTarget()
get target of the current record
Definition ElogRecord.h:195
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:177
static TObjArray * Search(UniSearchCondition &search_condition)
get runs corresponding to the specified single condition and set owner for search_condition to kTRUE
Definition UniRun.cxx:1479
#define UNKNOWN_RUNID
Definition BmnDecoder.h:49
#define MAX_BUF_LEN
-clang-format