12 #include "FairLogger.h"
13 #include "RootSerializer.h"
16 #include "THttpServer.h"
18 #include "TObjArray.h"
24 , fInputChannelName(
"histogram-in")
27 , fServer(
"http:8088")
29 , fStopThread(false) {}
45 TObject* tempObject =
nullptr;
46 #ifdef HAVE_RootDeserializer
47 Deserialize<RootDeserializer>(*msg, tempObject);
49 Deserialize<RootSerializer>(*msg, tempObject);
52 if (TString(tempObject->ClassName()).EqualTo(
"TObjArray")) {
53 std::lock_guard<std::mutex> lk(
mtx);
54 TObjArray* arrayHisto =
static_cast<TObjArray*
>(tempObject);
56 TH1* histogram_existing;
57 for (Int_t
i = 0;
i < arrayHisto->GetEntriesFast();
i++) {
58 TObject* obj = arrayHisto->At(
i);
59 TH1* histogram =
static_cast<TH1*
>(obj);
62 histogram_new =
static_cast<TH1*
>(histogram->Clone());
64 fServer.Register(
"Histograms", histogram_new);
66 histogram_existing =
static_cast<TH1*
>(
fArrayHisto.At(index1));
67 histogram_existing->Add(histogram);
88 std::this_thread::sleep_for(std::chrono::milliseconds(10));
89 std::lock_guard<std::mutex> lk(
mtx);
110 if (TString(obj->GetName()).EqualTo(name)) {
return i; }