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)
49 , fuOffSpillCountLimitNonPulser(80)
50 , fdSpillCheckInterval(1.0)
52 , fMonitorAlgo(nullptr)
61 LOG(info) <<
"CbmMcbm2018MonitorTaskBmon::Init";
62 LOG(info) <<
"Initializing mCBM Bmon 2019 Monitor";
69 LOG(info) <<
"Setting parameter containers for " << GetName();
73 for (Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC) {
74 FairParGenericSet* tempObj = (FairParGenericSet*) (parCList->At(iparC));
75 parCList->Remove(tempObj);
77 std::string sParamName {tempObj->GetName()};
78 FairParGenericSet* newObj =
79 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
81 if (
nullptr == newObj) {
82 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
86 parCList->AddAt(newObj, iparC);
93 LOG(info) <<
"Init parameter containers for " << GetName();
97 dynamic_cast<CbmMcbm2018TofPar*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018TofPar"));
98 if (
nullptr == pUnpackPar) {
99 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018TofPar";
131 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
132 if (
nullptr != server) {
133 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
136 server->Register(Form(
"/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first);
139 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
142 server->Register(Form(
"/%s", vCanvases[uCanv].second.data()),
143 gROOT->FindObject((vCanvases[uCanv].first)->GetName()));
146 server->RegisterCommand(
"/Reset_MoniBmon_Hist",
"bMcbm2018MonitorTaskBmonResetHistos=kTRUE");
147 server->Restrict(
"/Reset_MoniBmon_Hist",
"allow=admin");
155 LOG(info) <<
"ReInit parameter containers for " << GetName();
169 LOG(info) <<
"Reset Bmon Monitor histos ";
175 LOG(error) <<
"Failed processing TS " << ts.index() <<
" in unpacker algorithm class";
197 TFile* oldFile = gFile;
198 TDirectory* oldDir = gDirectory;
200 TFile* histoFile =
nullptr;
207 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
209 TString sFolder = vHistos[uHisto].second.data();
210 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
211 gDirectory->cd(sFolder);
214 vHistos[uHisto].first->Write();
229 UInt_t uChan4, UInt_t uChan5, UInt_t uChan6, UInt_t uChan7)
ClassImp(CbmConverterManager)
Bool_t bMcbm2018MonitorTaskBmonResetHistos
Bool_t ResetHistograms(Bool_t bResetTime=kTRUE)
Bool_t ReInitContainers()
void SetSpillThreshold(UInt_t uCntLimit)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t CreateHistograms()
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetChannelMap(UInt_t uChan0, UInt_t uChan1, UInt_t uChan2, UInt_t uChan3, UInt_t uChan4, UInt_t uChan5, UInt_t uChan6, UInt_t uChan7)
void SetSpillCheckInterval(Double_t dIntervalSec)
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
void SetSpillThresholdNonPulser(UInt_t uCntLimit)
CbmMcbm2018MonitorAlgoBmon * fMonitorAlgo
Processing algo.
UInt_t fuOffSpillCountLimitNonPulser
UInt_t fuHistoryHistoSize
Switch ON the filling of a additional set of histograms.
virtual ~CbmMcbm2018MonitorTaskBmon()
void SetChannelMap(UInt_t uChan0, UInt_t uChan1, UInt_t uChan2, UInt_t uChan3, UInt_t uChan4, UInt_t uChan5, UInt_t uChan6, UInt_t uChan7)
Double_t fdSpillCheckInterval
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
CbmMcbm2018MonitorTaskBmon()
Bool_t ReInitContainers()
uint64_t fulTsCounter
Statistics & first TS rejection.
UInt_t fuOffSpillCountLimit
Bool_t fbMonitorMode
Control flags.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
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.