17#include "FairParGenericSet.h"
18#include "FairRootManager.h"
20#include "FairRunOnline.h"
21#include "FairRuntimeDb.h"
25#include "THttpServer.h"
43 , fsHistoFileName(
"data/HistosMonitorPulser.root")
49 , fuHistoryHistoSize(1800)
51 , fMonitorPulserAlgo(nullptr)
60 LOG(info) <<
"CbmMcbm2018MonitorTaskTofPulser::Init";
61 LOG(info) <<
"Initializing mCBM 2019 Monitor task";
68 LOG(info) <<
"Setting parameter containers for " << GetName();
72 for (Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC) {
73 FairParGenericSet* tempObj = (FairParGenericSet*) (parCList->At(iparC));
74 parCList->Remove(tempObj);
76 std::string sParamName {tempObj->GetName()};
77 FairParGenericSet* newObj =
78 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
80 if (
nullptr == newObj) {
81 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
85 parCList->AddAt(newObj, iparC);
92 LOG(info) <<
"Init parameter containers for " << GetName();
96 dynamic_cast<CbmMcbm2018TofPar*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018TofPar"));
97 if (
nullptr == pUnpackPar) {
98 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_Pulser_Hist",
"bMcbm2018MonitorTaskTofPulserResetHistos=kTRUE");
136 server->RegisterCommand(
"/Save_Pulser_Hist",
"bMcbm2018MonitorTaskTofPulserSaveHistos=kTRUE");
138 server->Restrict(
"/Reset_Moni_Hist",
"allow=admin");
146 LOG(info) <<
"ReInit parameter containers for " << GetName();
160 LOG(info) <<
"Reset Monitor histos ";
166 LOG(info) <<
"Save Monitor histos & canvases";
172 LOG(error) <<
"Failed processing TS " << ts.index() <<
" in unpacker algorithm class";
206 TFile* oldFile = gFile;
207 TDirectory* oldDir = gDirectory;
209 TFile* histoFile =
nullptr;
214 if (
nullptr == histoFile)
return kFALSE;
217 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
219 TString sFolder = vHistos[uHisto].second.data();
220 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
221 gDirectory->cd(sFolder);
224 vHistos[uHisto].first->Write();
229 for (UInt_t uCanvas = 0; uCanvas < vCanvas.size(); ++uCanvas) {
231 TString sFolder = vCanvas[uCanvas].second.data();
232 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
233 gDirectory->cd(sFolder);
236 vCanvas[uCanvas].first->Write();
ClassImp(CbmConverterManager)
Bool_t bMcbm2018MonitorTaskTofPulserSaveHistos
Bool_t bMcbm2018MonitorTaskTofPulserResetHistos
void SetGdpbIndex(Int_t iGdpb=-1)
Bool_t ReInitContainers()
Bool_t ProcessTs(const fles::Timeslice &ts)
Bool_t CreateHistograms()
void SetPulserChannel(UInt_t uChan)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
void SetUpdateFreqTs(UInt_t uFreq=100)
TString fsHistoFileName
Control flags.
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Algo settings setters.
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
CbmMcbm2018MonitorTaskTofPulser()
Bool_t ReInitContainers()
virtual ~CbmMcbm2018MonitorTaskTofPulser()
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
CbmMcbm2018MonitorAlgoTofPulser * fMonitorPulserAlgo
Processing algo.
uint64_t fulTsCounter
Statistics & first TS rejection.
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.