15#include <FairRunOnline.h>
19#include <THttpServer.h>
20#include <fmt/format.h>
35 if (
auto* run = FairRunOnline::Instance(); run !=
nullptr)
45 if (
auto* run = FairRunOnline::Instance(); run !=
nullptr)
47 init_http_server(run);
66 void OnlineSpectra::init_http_server(FairRunOnline* run)
68 const auto reset_neuland_cmd = fmt::format(R
"(/Tasks/{}/->ResetHistos())", GetName());
69 const auto reset_neuland_mapped_cmd = fmt::format(R
"(/Tasks/{}/->ResetHistosMapped())", GetName());
70 const auto save_neuland_hists_cmd = fmt::format(R
"(/Tasks/{}/->SaveAll())", GetName());
71 const auto restart_server_cmd = fmt::format(R
"(/Tasks/{}/->RestartUcesbServer())", GetName());
72 const auto graph_view_full = fmt::format(R
"(/Tasks/{}/->SetCountRateFullView())", GetName());
73 const auto graph_view_two_hours = fmt::format(R
"(/Tasks/{}/->SetCountRateViewTwoHours())", GetName());
74 const auto graph_view_four_hours = fmt::format(R
"(/Tasks/{}/->SetCountRateViewfourHours())", GetName());
76 run->GetHttpServer()->Register("/Tasks",
this);
77 run->GetHttpServer()->RegisterCommand(
"/Tasks/Reset_Neuland", reset_neuland_cmd.c_str());
78 run->GetHttpServer()->RegisterCommand(
"/Tasks/Reset_Neuland_Mapped", reset_neuland_mapped_cmd.c_str());
79 run->GetHttpServer()->RegisterCommand(
"/Tasks/save_all_histograms", save_neuland_hists_cmd.c_str());
80 run->GetHttpServer()->RegisterCommand(
"/Tasks/restart_ucesb_server", restart_server_cmd.c_str());
81 run->GetHttpServer()->RegisterCommand(
"/Tasks/graph_full_view", graph_view_full.c_str());
82 run->GetHttpServer()->RegisterCommand(
"/Tasks/graph_two_hours_view", graph_view_two_hours.c_str());
83 run->GetHttpServer()->RegisterCommand(
"/Tasks/graph_four_hours_view", graph_view_four_hours.c_str());
96 if (ucesb_source_ ==
nullptr)
98 R3BLOG(warn,
"Ucesb source is not set. Cannot restart the server.");
101 ucesb_source_->RestartUcesbServer();
#define R3BLOG(severity, x)
ClassImp(R3B::Neuland::Cal2HitPar)
void register_canvases(FairRun *run)
auto GetHistMonitor() -> DataMonitor &
virtual void DataInit()=0
virtual void CanvasInit(DataMonitor &histograms)=0
auto IsTriggered() const -> bool
virtual void CanvasFill(DataMonitor &histograms)=0
void TriggeredExec() override
void HistogramInit(DataMonitor &histograms) override
void RestartUcesbServer()
void ActionToSpectra(UnaryOp &&optn)
void ExtraInit(FairRootManager *rootMan) override
OnlineSpectra(std::string_view name="R3BNeulandOnlineSpectra", int iVerbose=1)
~OnlineSpectra() override
void SetExtraPar(FairRuntimeDb *rtdb) override
Simulation of NeuLAND Bar/Paddle.