13#include <sys/inotify.h>
17#include <BmnConverterTools.h>
18#include <BmnFileProp.h>
19#include <BmnGemStripDigit.h>
20#include <BmnTof1Digit.h>
21#include <BmnTrigDigit.h>
22#include <BmnVSPDigit.h>
27int ReceivedSignal = 0;
29void signal_handler(
int sig)
33 printf(
"Received signal %d Exiting\n", sig);
40 , rawDataDecoder(nullptr)
43 , _do_process_stat_ev(false)
44 , _do_process_norm_ev(true)
50 signal(SIGINT, SIG_DFL);
53 delete rawDataDecoder;
54 rawDataDecoder =
nullptr;
57 zmq_ctx_destroy(_ctx);
62BmnStatus BmnOnlineDecoder::InitDecoder(
string fRawFileName)
64 return InitDecoder(TString(fRawFileName.data()));
67BmnStatus BmnOnlineDecoder::InitDecoder(TString fRawFileName)
72 Int_t runID = rawDataDecoder->GetRunId();
79 printf(
"!!! Error Could not detect runID\n");
91 LOGF(info,
"InitDecoder runID = %d", runID);
103 TString PeriodSetupExt = Form(
"%d%s.txt", fPeriodID, ((fBmnSetup ==
kBMNSETUP) ?
"" :
"_SRC"));
107 decoder->
SetSiBTMapping(TString(
"SiBT_map_period") + PeriodSetupExt);
108 decoder->
SetGemMapping(TString(
"GEM_map_run") + PeriodSetupExt);
110 + Form(
"%d%s%s.txt", fPeriodID, ((fBmnSetup ==
kBMNSETUP) ?
"" :
"_SRC"),
111 (((decoder->GetRunId() < 7013) && (fPeriodID == 8)) ?
"_before_run_7013" :
"")));
112 decoder->
SetVspMapping(TString(
"VSP_map_period") + PeriodSetupExt);
113 decoder->
SetMSCMapping(TString(
"MSC_map_Run") + PeriodSetupExt);
117 decoder->
SetTof700Geom(TString(
"TOF700_geometry_run") + PeriodSetupExt);
119 TString(
"TOF400_StripMap_RUN") + PeriodSetupExt);
121 TString(
"TOF701_StripMap_RUN") + PeriodSetupExt);
123 decoder->
SetTof700Mapping(TString(
"TOF700_map_period_") + Form(
"%d_from_run_4278.txt", fPeriodID));
125 decoder->
SetTof700Mapping(TString(
"TOF700_map_period_") + Form(
"%d.txt", fPeriodID));
128 decoder->
SetFHCalMapping(TString(
"FHCAL_map_period") + PeriodSetupExt);
130 decoder->
SetHodoMapping(Form(
"HODO_map_period%d%s.json", fPeriodID, ((fBmnSetup ==
kBMNSETUP) ?
"" :
"_SRC")));
132 Form(
"HODO_Q_calibration_period%d%s.json", fPeriodID, ((fBmnSetup ==
kBMNSETUP) ?
"" :
"_SRC")));
133 decoder->
SetNdetMapping(TString(
"NDET_map_period") + PeriodSetupExt);
137 + Form(
"%d_run_7506_7534_or_8203_8258.txt", fPeriodID));
141 if (_curFile.Length() > 0)
150BmnStatus BmnOnlineDecoder::ConnectDataSocket()
154 snprintf(endpoint_addr,
MAX_ADDR_LEN,
"tcp://%s", fDAQAddr.Data());
155 if (zmq_connect(_socket_data, endpoint_addr) != 0) {
159 printf(
"Listening to %s\n", endpoint_addr);
172BmnStatus BmnOnlineDecoder::ConnectDigiSocket()
174 _decoSocket = zmq_socket(_ctx, ZMQ_PUB);
185 if (zmq_setsockopt(_decoSocket, ZMQ_SNDHWM, &hwm,
sizeof(hwm)) == -1)
186 fprintf(stderr,
"Error in zmq_setsockopt of ZMQ_SNDHWM: %s\n", strerror(errno));
187 size_t vl =
sizeof(hwm);
188 if (zmq_getsockopt(_decoSocket, ZMQ_SNDHWM, &hwm, &vl) == -1)
189 fprintf(stderr,
"Error getting ZMQ socket ZMQ_SNDHWM size: %s\n", strerror(errno));
190 printf(
"ZMQ_SND HWM %d\n", hwm);
192 TString localDecoStr = Form(
"tcp://*:%d", _digi_socket);
193 if (zmq_bind(_decoSocket, localDecoStr.Data()) != 0) {
203 _ctx = zmq_ctx_new();
215 zmq_close(_socket_data);
216 zmq_close(_decoSocket);
217 zmq_ctx_destroy(_ctx);
226 _ctx = zmq_ctx_new();
227 _decoSocket = zmq_socket(_ctx, ZMQ_PUB);
229 size_t vl =
sizeof(rcvBuf);
230 if (zmq_getsockopt(_decoSocket, ZMQ_RCVBUF, &rcvBuf, &vl) == -1)
231 DBGERR(
"zmq_getsockopt of ZMQ_RCVBUF")
232 printf(
"rcvbuf = %d\n", rcvBuf);
243 if (zmq_bind(_decoSocket, localDecoStr.Data()) != 0) {
247 _curFile = startFile;
254 }
else if (_curFile.Length() == 0) {
259 if (InitDecoder(_curDir + _curFile) ==
kBMNERROR)
261 ProcessFileRun(_curDir + _curFile);
263 delete rawDataDecoder;
264 rawDataDecoder = NULL;
268 zmq_close(_decoSocket);
269 zmq_ctx_destroy(_ctx);
278 LOGF(error,
"Connection failed! Exit!");
283 Int_t conID_size = 0;
285 Int_t frame_size = 0;
291 TBufferFile t(TBuffer::kWrite);
293 bool isListening =
true;
297 signal(SIGINT, signal_handler);
300 while ((!ReceivedSignal) && isListening ) {
302 conID_size = zmq_recv(_socket_data, &conID,
sizeof(conID), ZMQ_DONTWAIT);
304 if (conID_size == -1) {
313 printf(
"Interrupted!\n");
314 isListening = kFALSE;
315 printf(
"Exit cycle!\n");
319 printf(
"ID Receive error #%d : %s\n", errno, zmq_strerror(errno));
323 LOGF(debug,
"ID size = %d\n Id:%x\n", conID_size, conID);
332 bool isReceiving =
true;
334 frame_size = zmq_msg_recv(&msg, _socket_data, ZMQ_DONTWAIT);
337 if (frame_size == -1) {
338 printf(
"Receive error # %d #%s\n", errno, zmq_strerror(errno));
346 isReceiving = kFALSE;
347 isListening = kFALSE;
352 zmq_close(_socket_data);
354 isReceiving = kFALSE;
362 printf(
"buf overflow! msg len %u frame size %u\n", msg_len, frame_size);
363 printf(
"Something wrong! Exit!\n");
364 isReceiving = kFALSE;
365 isListening = kFALSE;
378 memcpy(buf + msg_len, zmq_msg_data(&msg), frame_size);
379 msg_len += frame_size;
384 size_t opt_size =
sizeof(recv_more);
385 if (zmq_getsockopt(_socket_data, ZMQ_RCVMORE, &recv_more, &opt_size) == -1) {
386 printf(
"ZMQ socket options error #%s\n", zmq_strerror(errno));
391 }
while ((!ReceivedSignal) && recv_more && isReceiving);
396 Bool_t evExit =
false;
400 word =
reinterpret_cast<UInt_t*
>(buf);
401 while (isListening && (!ReceivedSignal) && (iWord < msg_len /
kNBYTESINWORD) && (!evExit)
404 UInt_t val = *(word + iWord);
407 printf(
"iWord = %u\n", iWord);
408 printf(
"start run\n");
409 lenWords = *(word + ++iWord) /
sizeof(UInt_t);
410 printf(
"payLen = %u words\n", lenWords);
412 printf(
"Wrong payload size!\n");
413 lenBytes = iWord *
sizeof(UInt_t);
415 printf(
" %u will move by %u bytes. skip wrong header\n", msg_len, lenBytes);
416 memmove(&buf[0], &buf[lenBytes], msg_len);
421 printf(
"runID = %u\n", runID);
422 if (fRunID != runID) {
424 if (StartNewRun(runID))
428 lenBytes = iWord *
sizeof(UInt_t);
430 memmove(&buf[0], &buf[lenBytes], msg_len);
435 printf(
"iWord = %u\n", iWord);
436 printf(
"stop run\n");
437 lenWords = *(word + ++iWord) /
sizeof(UInt_t);
438 printf(
"payLen = %d words\n", lenWords);
440 printf(
"Wrong payload size!\n");
441 lenBytes = iWord *
sizeof(UInt_t);
443 printf(
" %u will move by %u bytes\n", msg_len, lenBytes);
444 memmove(&buf[0], &buf[lenBytes], msg_len);
452 if (rawDataDecoder) {
454 delete rawDataDecoder;
455 rawDataDecoder = NULL;
458 lenBytes = iWord *
sizeof(UInt_t);
461 memmove(&buf[0], &buf[lenBytes], msg_len);
467 lenBytes = *(word + ++iWord);
468 lenWords = lenBytes /
kNBYTESINWORD + (fPeriodID <= 7 ? 1 : 0);
478 if (!rawDataDecoder) {
479 printf(
"Init without run header!\n");
481 printf(
"\n\tError in InitDecoder !!\n\n");
486 if (_do_process_norm_ev) {
491 printf(
"convert failed\n");
493 lenBytes = (iWord - 1) *
sizeof(UInt_t);
496 printf(
" %u will move by %u bytes. after conv failed\n", msg_len, lenBytes);
497 memmove(&buf[0], &buf[lenBytes], msg_len);
508 if (fRunID != head->GetRunId()) {
509 if (StartNewRun(head->GetRunId()))
513 t.WriteObject(&iterDigi);
514 sendRes = zmq_send(_decoSocket, t.Buffer(), t.Length(), ZMQ_NOBLOCK);
518 printf(
"Send error # %d : %s\n", errno, zmq_strerror(errno));
525 lenBytes = iWord *
sizeof(UInt_t);
531 memmove(&buf[0], &buf[lenBytes], msg_len);
541 lenBytes = *(word + ++iWord);
551 if (_do_process_stat_ev) {
552 if (!rawDataDecoder) {
553 printf(
"Init without run header!\n");
555 printf(
"\n\tError in InitDecoder !!\n\n");
566 printf(
"stat convert failed\n");
568 lenBytes = iWord *
sizeof(UInt_t);
572 memmove(&buf[0], &buf[lenBytes], msg_len);
585 t.WriteObject(&iterDigi);
586 sendRes = zmq_send(_decoSocket, t.Buffer(), t.Length(), ZMQ_NOBLOCK);
590 printf(
"Send error # %d : %s\n", errno, zmq_strerror(errno));
602 memmove(&buf[0], &buf[lenBytes], msg_len);
612 lenBytes = *(word + ++iWord);
620 if (!rawDataDecoder) {
621 printf(
"Init without run header!\n");
623 printf(
"\n\tError in InitDecoder !!\n\n");
631 word =
reinterpret_cast<UInt_t*
>(buf + lenBytes);
634 memmove(&buf[0], &buf[lenBytes], msg_len);
649 printf(
"Wrong data, resetting array!\n");
657 printf(
"I: file closed\n\r");
660 signal(SIGINT, SIG_DFL);
663BmnStatus BmnOnlineDecoder::StartNewRun(uint32_t runID)
666 LOGF(info,
"fRunID %u\n", fRunID);
667 if (rawDataDecoder) {
669 delete rawDataDecoder;
670 rawDataDecoder = NULL;
673 printf(
"\n\tError in InitDecoder !!\n\n");
674 if (rawDataDecoder) {
675 delete rawDataDecoder;
676 rawDataDecoder = NULL;
691 TDatime fFileStartDate(Int_t(fRunStartTime.GetDate(kFALSE)), Int_t(fRunStartTime.GetTime(kFALSE)));
692 TDatime fFileEndDate(Int_t(fRunEndTime.GetDate(kFALSE)), Int_t(fRunEndTime.GetTime(kFALSE)));
693 Int_t event_count = rawDataDecoder->
GetEventId();
694 printf(
"\tEvCnt %d\n", event_count);
695 printf(
"\tStartTime %s\n", fRunStartTime.AsString());
696 printf(
"\t EndTime %s\n", fRunEndTime.AsString());
699 pRun =
UniRun::CreateRun(fPeriodID, fRunID, 0, fFileStartDate, &fFileEndDate,
nullptr,
nullptr,
nullptr,
700 nullptr, &event_count,
nullptr, 1);
702 cout <<
"New run has been successfully created in the Condition Database with number " << fPeriodID <<
":"
707 printf(
"Run %8u is already found in the DB.\n", fRunID);
715 printf(
"writing StartTime %s\n", fFileStartDate.AsString());
719 printf(
"writing EndTime %s\n", fFileEndDate.AsString());
722 printf(
"writing EvCnt %d\n", event_count);
728void BmnOnlineDecoder::ProcessFileRun(TString rawFileName, UInt_t timeLimit)
735 TBufferFile t(TBuffer::kWrite);
736 while (!ReceivedSignal) {
743 printf(
"Converting error\n");
753 if (iterDigi.
header == NULL)
758 t.WriteObject(&iterDigi);
759 sendRes = zmq_send(_decoSocket, t.Buffer(), t.Length(), ZMQ_NOBLOCK);
762 printf(
"Send error %d #%s\n", errno, zmq_strerror(errno));
773TString BmnOnlineDecoder::WatchNext(TString dirname, TString filename, Int_t cycleWait)
776 struct dirent** namelist;
777 regex re("\\w+\\.data");
781 n = scandir(dirname.Data(), &namelist, 0, versionsort);
785 for (Int_t
i = 0;
i < n; ++
i) {
786 if (regex_match(namelist[
i]->d_name, re))
787 ret = namelist[
i]->d_name;
792 if (strcmp(
filename.Strip().Data(), ret.Strip().Data()) != 0)
794 gSystem->ProcessEvents();
801TString BmnOnlineDecoder::WatchNext(Int_t inotifDir, Int_t cycleWait)
803 TString fileName =
"";
808 if ((len == -1) && (errno != EAGAIN))
809 DBG(
"inotify read error!")
812 struct inotify_event*
event = (
struct inotify_event*)&evBuf[
i];
814 if ((event->mask & IN_CREATE) && !(
event->mask & IN_ISDIR)) {
815 fileName = TString(event->name);
816 printf(
"File %s was created!\n", fileName.Data());
820 i +=
sizeof(
struct inotify_event) + event->len;
827 gSystem->ProcessEvents();
835 _ctx = zmq_ctx_new();
836 _decoSocket = zmq_socket(_ctx, ZMQ_PUB);
838 if (zmq_bind(_decoSocket, localDecoStr.Data()) != 0) {
842 struct dirent** namelist;
843 const regex re(
".*_run_.*_(\\d+).*.data");
846 vector<pair<BmnFileProp, string>> fileNames;
849 n = scandir(_curDir, &namelist, 0, versionsort);
850 LOGF(info,
"Found %d files for batch decoding", n);
855 for (Int_t
i = 0;
i < n; ++
i) {
858 if (regex_match(namelist[
i]->d_name, re)) {
860 string file_name(namelist[
i]->d_name);
863 fileNames.emplace_back(make_pair(move(prop), move(file_name)));
866 std::sort(fileNames.begin(), fileNames.end(), [](
auto& a,
auto& b) {
867 if (a.first.GetRunId() < b.first.GetRunId())
869 else if (a.first.GetRunId() == b.first.GetRunId()) {
870 if (a.first.GetFileId() < b.first.GetFileId())
872 else if ((a.first.GetFileId() == b.first.GetFileId())
873 && (a.first.GetEventOrder() < b.first.GetEventOrder()))
878 for (
auto& pf : fileNames) {
879 LOGF(info,
"raw file: %s", pf.second.data());
880 _curFile = TString(pf.second.data());
881 int32_t runID = pf.first.GetRunId();
882 if ((runID > 7281) || (runID < 1)) {
884 if (InitDecoder(_curDir + _curFile) ==
kBMNERROR)
887 if (rawDataDecoder) {
889 delete rawDataDecoder;
890 rawDataDecoder = NULL;
892 if (InitDecoder(_curDir + _curFile) ==
kBMNERROR) {
893 printf(
"\n\tError in InitDecoder !!\n\n");
894 if (rawDataDecoder) {
895 delete rawDataDecoder;
896 rawDataDecoder = NULL;
902 ProcessFileRun(_curFile, 0);
910 zmq_close(_decoSocket);
911 zmq_ctx_destroy(_ctx);
918 uint32_t data_port = 21323;
919 signal(SIGINT, signal_handler);
921 struct dirent** namelist;
922 const regex re(
".*_run_.*_(\\d+).*.data");
925 vector<pair<BmnFileProp, string>> fileNames;
927 n = scandir(_curDir, &namelist, 0, versionsort);
928 LOGF(info,
"Found %d files for batch decoding", n);
933 for (Int_t
i = 0;
i < n; ++
i) {
936 if (regex_match(namelist[
i]->d_name, re)) {
938 string file_name(namelist[
i]->d_name);
941 fileNames.emplace_back(make_pair(move(prop), move(file_name)));
944 std::sort(fileNames.begin(), fileNames.end(), [](
auto& a,
auto& b) {
945 if (a.first.GetRunId() < b.first.GetRunId())
947 else if (a.first.GetRunId() == b.first.GetRunId()) {
948 if (a.first.GetFileId() < b.first.GetFileId())
950 else if ((a.first.GetFileId() == b.first.GetFileId())
951 && (a.first.GetEventOrder() < b.first.GetEventOrder()))
956 for (
auto& pf : fileNames) {
959 if (pf.first.GetRunId() < 7281)
961 LOGF(info,
"raw file: %s", pf.second.data());
962 _curFile = TString(pf.second.data());
963 int ret = system(Form(
"socat -u FILE:%s TCP4-LISTEN:%u,reuseaddr", (_curDir + _curFile).Data(), data_port));
965 LOGF(info,
"Socat error code: %d", ret);
969 zmq_close(_decoSocket);
970 zmq_ctx_destroy(_ctx);
972 signal(SIGINT, SIG_DFL);
976Int_t BmnOnlineDecoder::GetRunIdFromName(TString name)
978 TPRegexp re(
".*\\w+_\\w+_\\w+_(\\d+)[^/]*\\.data");
980 TObjArray* subStr = re.MatchS(
name.Data());
981 if (subStr->GetEntriesFast() > 1) {
982 TString str = ((TObjString*)subStr->At(1))->GetString();
983 Int_t runID = atoi(str.Data());
994 TString TestFileName,
1000 gStyle->SetOptStat(0);
1003 bool set_bin_content = !FillOccupancy;
1007 TString hdrNames[
STRIP_COMP_COLS] = {
"BmnEventHeader.",
"BmnEventHeader."};
1008 TString runhdrNames[
STRIP_COMP_COLS] = {
"DigiRunHeader",
"DigiRunHeader"};
1030 TCanvas* canStrip =
nullptr;
1031 TCanvas* canStripGem =
nullptr;
1032 TCanvas* canStripCsc =
nullptr;
1033 TCanvas* canStripSiBT =
nullptr;
1034 TCanvas* canStripVSP =
nullptr;
1035 vector<PadInfo*> canStripPads;
1036 vector<PadInfo*> canStripPadsGem;
1037 vector<PadInfo*> canStripPadsCsc;
1038 vector<PadInfo*> canStripPadsSiBT;
1039 vector<PadInfo*> canStripPadsVSP;
1045 InitCanvas(
"Silicon", stationSetFSD, canStrip, canStripPads, histStrip);
1047 InitCanvas(
"GEM", stationSetGEM, canStripGem, canStripPadsGem, histStripGem);
1049 InitCanvas(
"CSC", stationSetCSC, canStripCsc, canStripPadsCsc, histStripCsc);
1051 InitCanvas(
"SiBT", stationSetSiBT, canStripSiBT, canStripPadsSiBT, histStripSiBT);
1053 InitCanvas(
"VSP", stationSetVSP, canStripVSP, canStripPadsVSP, histStripVSP);
1061 Long64_t nEvs = LONG_MAX;
1063 if (fnames[
i].Length() == 0)
1065 files[
i] =
new TFile(fnames[
i],
"READ");
1066 if (files[
i]->IsOpen())
1067 printf(
"file %s opened\n", fnames[
i].Data());
1069 fprintf(stderr,
"file %s open error\n", fnames[
i].Data());
1072 trees[
i] = (TTree*)files[
i]->Get(treeNames[
i]);
1073 nEvs = Min(nEvs, trees[
i]->GetEntries());
1074 cout <<
"#recorded entries = " << trees[
i]->GetEntries() << endl;
1078 trees[
i]->SetBranchAddress(hdrNames[
i], &headers[
i]);
1079 trees[
i]->SetBranchAddress(silNames[
i], &silDigit[
i]);
1080 trees[
i]->SetBranchAddress(gemNames[
i], &gemDigit[
i]);
1081 trees[
i]->SetBranchAddress(cscNames[
i], &cscDigit[
i]);
1082 trees[
i]->SetBranchAddress(sibtNames[
i], &sibtDigit[
i]);
1083 trees[
i]->SetBranchAddress(vspNames[
i], &vspDigit[
i]);
1086 if (trees[
i] ==
nullptr)
1088 cout <<
"tree # " <<
i << endl;
1089 if (
i > 0 && runHeaders[
i]) {
1090 printf(
"START (event 1):\t%s\n", runHeaders[
i]->GetRunStartTime().AsString());
1091 printf(
"FINISH (event %lld):\t%s\n", nEvs, runHeaders[
i]->GetRunEndTime().AsString());
1093 for (Int_t iEv = 0; iEv < nEvs; iEv++) {
1094 trees[
i]->GetEntry(iEv);
1095 if (iEv % 10000 == 0)
1096 cout <<
"iEv = " << iEv << endl;
1103 FillHists<BmnSiliconDigit>(histStrip[
i], silDigit[
i], set_bin_content);
1105 FillHists<BmnGemStripDigit>(histStripGem[
i], gemDigit[
i], set_bin_content);
1107 FillHists<BmnCSCDigit>(histStripCsc[
i], cscDigit[
i], set_bin_content);
1109 FillHists<BmnSiBTDigit>(histStripSiBT[
i], sibtDigit[
i], set_bin_content);
1111 FillHists<BmnVSPDigit>(histStripVSP[
i], vspDigit[
i], set_bin_content);
1113 printf(
"Last event %d\n", curEv);
1117 canStrip->SaveAs(Form(
"can-run-%d-sil.png", runID));
1121 canStripGem->SaveAs(Form(
"can-run-%d-gem.png", runID));
1125 canStripCsc->SaveAs(Form(
"can-run-%d-csc.png", runID));
1129 canStripSiBT->SaveAs(Form(
"can-run-%d-sibt.png", runID));
1133 canStripVSP->SaveAs(Form(
"can-run-%d-vsp.png", runID));
const uint32_t SYNC_RUN_START
const uint32_t SYNC_EVENT
const uint32_t SYNC_RUN_STOP
const uint32_t kNBYTESINWORD
const uint32_t SYNC_EVENT_OLD
static unique_ptr< BmnCSCStationSet > Create(Int_t period, Int_t stp=0)
void SetVspMapping(TString map)
void SetTOF700ReferenceRun(Int_t n)
UInt_t GetPeriodId() const
void SetTof700Geom(TString geom)
void SetFHCalCalibration(TString cal)
void SetFHCalMapping(TString map)
void SetMSCMapping(TString map)
void SetTof701Mapping(TString PlaceMap, TString StripMap)
void SetUseCalibFile(bool v)
void SetNdetCalibration(TString cal)
void SetTrigPlaceMapping(TString map)
void SetGemMapping(TString map)
void SetHodoCalibration(TString cal)
void SetTof700Mapping(TString map)
void SetTrigChannelMapping(TString file)
void SetScWallMapping(TString map)
void SetCSCMapping(TString map)
void SetSiliconMapping(TString map)
void SetTof400Mapping(TString PlaceMap, TString StripMap)
void SetScWallCalibration(TString cal)
void SetHodoMapping(TString map)
void SetNdetMapping(TString map)
void SetSiBTMapping(TString map)
DigiArrays GetDigiArraysObject()
static unique_ptr< BmnGemStripStationSet > Create(Int_t period, Int_t stp=0)
static void DrawRef(unique_ptr< TCanvas > &canGemStrip, vector< PadInfo * > *canGemStripPads)
static void StripView(TString OrigFileName, TString TestFileName, uint32_t periodID=8, uint32_t runID=0, BmnSetup fSetup=kBMNSETUP, bool FillOccupancy=true)
BmnStatus BatchDirectoryToSocket(TString dirname)
BmnStatus Decode(TString dirname, TString startFile, Bool_t runCurrent)
BmnStatus BatchDirectory(TString dirname)
virtual ~BmnOnlineDecoder()
void SetDetectorSetup(std::map< DetectorId, bool > setup)
void SetPeriodId(UInt_t v)
BmnDecoder * GetDecoder() const
UInt_t GetEventId() const
BmnStatus DecodeDataToDigiIterate()
void SetBmnSetup(BmnSetup v)
BmnStatus InitConverter(TString FileName)
BmnStatus ConvertRawToRootIterate(UInt_t *buf, UInt_t len)
BmnRawSource * GetRawConverter() const
TTimeStamp GetRunStartTime() const
void SetForwardMode(bool v=true)
TTimeStamp GetRunEndTime() const
static Int_t GetRunIdFromFile(TString name)
BmnStatus ParseJsonTLV(UInt_t *buf, UInt_t &len)
BmnStatus ConvertRawToRootIterateFileRead()
static unique_ptr< BmnSiBTStationSet > Create(Int_t period, Int_t stp=0)
static unique_ptr< BmnSiliconStationSet > Create(Int_t period, Int_t stp=0)
static unique_ptr< BmnVSPStationSet > Create(Int_t period, Int_t stp=0)
static UniRun * GetRun(int period_number, int run_number)
get run from the database
int SetEndDatetime(TDatime *end_datetime)
set end datetime of the current run
TDatime * GetEndDatetime()
get end datetime of the current run
TDatime GetStartDatetime()
get start datetime of the current run
static UniRun * CreateRun(int period_number, int run_number, int run_type, TDatime start_datetime, TDatime *end_datetime, TString beam_particle, TString target_particle, double *energy, double *field_voltage, int *event_count, int *geometry_id, int run_quality)
add new run to the database
int * GetEventCount()
get event count of the current run
int SetEventCount(int *event_count)
set event count of the current run
int SetStartDatetime(TDatime start_datetime)
set start datetime of the current run
#define RAW_DECODER_SOCKET_PORT
#define RUN_FILE_CHECK_PERIOD
#define MPD_EVENT_HEAD_WORDS_OLD
#define MPD_EVENT_HEAD_WORDS
#define RAW_DECODER_SOCKET_PORT