24 : fInputChannelName(
"histogram-in")
27 , fServer(
"http:8080")
28 , fCanvasDrawer(nullptr)
39 fCanvasDrawer->CreateCanvases(fServer);
45 TObject* tempObject =
nullptr;
46 Deserialize<RootSerializer>(*msg, tempObject);
48 if (TString(tempObject->ClassName()).EqualTo(
"TObjArray")) {
49 std::lock_guard<std::mutex> lk(
mtx);
50 TObjArray* arrayHisto =
static_cast<TObjArray*
>(tempObject);
52 TH1* histogram_existing;
53 for (
int i = 0; i < arrayHisto->GetEntriesFast(); i++) {
54 TObject* obj = arrayHisto->At(i);
55 TH1* histogram =
static_cast<TH1*
>(obj);
56 int index1 = FindHistogram(histogram->GetName());
58 histogram_new =
static_cast<TH1*
>(histogram->Clone());
59 fArrayHisto.Add(histogram_new);
60 fServer.Register(
"Histograms", histogram_new);
62 histogram_existing =
static_cast<TH1*
>(fArrayHisto.At(index1));
63 histogram_existing->Add(histogram);
85 while (!fStopThread) {
86 std::this_thread::sleep_for(std::chrono::milliseconds(10));
87 std::lock_guard<std::mutex> lk(
mtx);
90 fCanvasDrawer->DrawHistograms(fArrayHisto);
93 fServer.ProcessRequests();
103 int FairMQExHistoServer::FindHistogram(
const std::string& name)
105 for (
int i = 0; i < fArrayHisto.GetEntriesFast(); i++) {
106 TObject* obj = fArrayHisto.At(i);
107 if (TString(obj->GetName()).EqualTo(name)) {
bool ReceiveData(FairMQMessagePtr &msg, int index)
virtual ~FairMQExHistoServer()