10#include "FairParGenericSet.h"
11#include "FairRootManager.h"
13#include "FairRunOnline.h"
14#include "FairRuntimeDb.h"
18#include "THttpServer.h"
37 , fbMonitorMode(kTRUE)
38 , fbDebugMonitorMode(kFALSE)
39 , fuHistoryHistoSize(3600)
40 , fsHistoFilename(
"data/HistosMonitorMuch.root")
41 , fuOffSpillCountLimit(200)
43 , fMonitorAlgo(nullptr)
52 LOG(info) <<
"CbmMcbm2018MonitorTaskMuchLite::Init";
53 LOG(info) <<
"Initializing Much 2019 Monitor";
60 LOG(info) <<
"Setting parameter containers for " << GetName();
64 for (Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC) {
65 FairParGenericSet* tempObj = (FairParGenericSet*) (parCList->At(iparC));
66 parCList->Remove(tempObj);
68 std::string sParamName {tempObj->GetName()};
69 FairParGenericSet* newObj =
70 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
72 if (
nullptr == newObj) {
73 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
77 parCList->AddAt(newObj, iparC);
88 LOG(info) <<
"Init parameter containers for " << GetName();
92 dynamic_cast<CbmMcbm2018MuchPar*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018MuchPar"));
93 if (
nullptr == pUnpackPar) {
94 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018MuchPar";
108 LOG(info) <<
"after initOK";
118 LOG(info) <<
"before creating histogram";
120 LOG(info) <<
"created histograms";
127 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
128 if (
nullptr != server) {
129 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
132 server->Register(Form(
"/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first);
135 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
138 server->Register(Form(
"/%s", vCanvases[uCanv].second.data()),
139 gROOT->FindObject((vCanvases[uCanv].first)->GetName()));
142 server->RegisterCommand(
"/Reset_All",
"bMcbm2018ResetTaskMuchLite=kTRUE");
143 server->RegisterCommand(
"/Write_All",
"bMcbm2018WriteTaskMuchLite=kTRUE");
144 server->RegisterCommand(
"/ScanNoisyCh",
"bMcbm2018ScanNoisyTaskMuchLite=kTRUE");
145 server->Restrict(
"/Reset_All",
"allow=admin");
146 server->Restrict(
"/Write_All",
"allow=admin");
147 server->Restrict(
"/ScanNoisyCh",
"allow=admin");
156 LOG(info) <<
"ReInit parameter containers for " << GetName();
290 // SmxErrInitializeVariables();
325 LOG(error) <<
"Failed processing TS " << ts.index() <<
" in unpacker algorithm class";
349 TFile* oldFile = gFile;
350 TDirectory* oldDir = gDirectory;
352 TFile* histoFile =
nullptr;
359 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
361 TString sFolder = vHistos[uHisto].second.data();
362 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
363 gDirectory->cd(sFolder);
366 vHistos[uHisto].first->Write();
ClassImp(CbmConverterManager)
Bool_t bMcbm2018ResetTaskMuchLite
Bool_t bMcbm2018WriteTaskMuchLite
Bool_t bMcbm2018ScanNoisyTaskMuchLite
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetSpillThreshold(UInt_t uCntLimit)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
void SaveAllHistos(TString sFileName="")
Bool_t CreateHistograms()
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
Bool_t ReInitContainers()
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
virtual ~CbmMcbm2018MonitorTaskMuchLite()
Bool_t ReInitContainers()
UInt_t fuHistoryHistoSize
Histograms related variables.
CbmMcbm2018MonitorTaskMuchLite()
CbmMcbm2018MonitorAlgoMuchLite * fMonitorAlgo
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
UInt_t fuOffSpillCountLimit
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.