17#include "FairParGenericSet.h"
18#include "FairRootManager.h"
20#include "FairRunOnline.h"
21#include "FairRuntimeDb.h"
25#include "THttpServer.h"
42 , fbMonitorMode(kTRUE)
43 , fbDebugMonitorMode(kFALSE)
44 , fuHistoryHistoSize(3600)
45 , fsHistoFileName(
"data/HistosMonitorBmon.root")
48 , fuOffSpillCountLimit(200)
50 , fMonitorAlgo(nullptr)
59 LOG(info) <<
"CbmMcbmSpillFindTask::Init";
60 LOG(info) <<
"Initializing mCBM Bmon 2019 Monitor";
67 LOG(info) <<
"Setting parameter containers for " << GetName();
71 for (Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC) {
72 FairParGenericSet* tempObj = (FairParGenericSet*) (parCList->At(iparC));
73 parCList->Remove(tempObj);
75 std::string sParamName {tempObj->GetName()};
76 FairParGenericSet* newObj =
77 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
79 if (
nullptr == newObj) {
80 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
84 parCList->AddAt(newObj, iparC);
91 LOG(info) <<
"Init parameter containers for " << GetName();
95 dynamic_cast<CbmMcbm2018TofPar*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018TofPar"));
96 if (
nullptr == pUnpackPar) {
97 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018TofPar";
120 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
121 if (
nullptr != server) {
122 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
125 server->Register(Form(
"/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first);
128 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
131 server->Register(Form(
"/%s", vCanvases[uCanv].second.data()),
132 gROOT->FindObject((vCanvases[uCanv].first)->GetName()));
135 server->RegisterCommand(
"/Reset_MoniBmon_Hist",
"bMcbmSpillFindResetHistos=kTRUE");
136 server->Restrict(
"/Reset_MoniBmon_Hist",
"allow=admin");
144 LOG(info) <<
"ReInit parameter containers for " << GetName();
158 LOG(info) <<
"Reset Bmon Monitor histos ";
164 LOG(error) <<
"Failed processing TS " << ts.index() <<
" in unpacker algorithm class";
188 TFile* oldFile = gFile;
189 TDirectory* oldDir = gDirectory;
191 TFile* histoFile =
nullptr;
198 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
200 TString sFolder = vHistos[uHisto].second.data();
201 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
202 gDirectory->cd(sFolder);
205 vHistos[uHisto].first->Write();
ClassImp(CbmConverterManager)
Bool_t bMcbmSpillFindResetHistos
void SetSpillCheckIntervalSec(Double_t dInterval)
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
Bool_t ProcessTs(const fles::Timeslice &ts)
Bool_t CreateHistograms()
Bool_t ReInitContainers()
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t ResetHistograms(Bool_t bResetTime=kTRUE)
void SetSpillThreshold(UInt_t uCntLimit)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
Bool_t ReInitContainers()
uint64_t fulTsCounter
Statistics & first TS rejection.
virtual ~CbmMcbmSpillFindTask()
Bool_t fbMonitorMode
Control flags.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
CbmMcbmSpillFindAlgo * fMonitorAlgo
Processing algo.
UInt_t fuHistoryHistoSize
Switch ON the filling of a additional set of histograms.
UInt_t fuOffSpillCountLimit
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Double_t fdSpillCheckInterval
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
std::vector< T > & GetVector()
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Control flags.
std::vector< std::pair< TCanvas *, std::string > > GetCanvasVector()
void ClearVector()
For unpacker algos.