CbmRoot
Loading...
Searching...
No Matches
Server.h
Go to the documentation of this file.
1/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#pragma once
5
6#include <Rtypes.h>
7#include <TNamed.h>
8
9#include <memory>
10
11#include "HistogramCollection.h"
13
14class THttpServer;
15class TH1;
16class TH1F;
17class TH1I;
18
19namespace cbm::explore
20{
21
22 class Server : public TNamed {
23
24 public:
25 struct Settings {
26 int port;
27 std::optional<uint32_t> sensor; // optional sensor to filter on
28 std::shared_ptr<algo::RecoResultsInputArchive> archive;
29 std::shared_ptr<HistogramCollection> histograms;
30
31 // Optional second archive and histograms for comparison
32 // histograms will be divided by this one, if provided
33 std::shared_ptr<algo::RecoResultsInputArchive> archive2;
34 std::shared_ptr<HistogramCollection> histograms2;
35 };
36
37 Server(Settings settings);
38
39 virtual ~Server();
40
41 int Run();
42
43 // Server commands
44 void RequestNextTS() { fRequestNextTS = true; }
45
46 private:
47 static constexpr int SleepPerTick_ms = 50;
48
49 // Internal state
50 THttpServer* fServer = nullptr;
52
53 // Server commands
54 bool fRequestNextTS = false;
55
56 void NextTS();
57
59 };
60
61} // namespace cbm::explore
THttpServer * fServer
Definition Server.h:50
Server(Settings settings)
Definition Server.cxx:18
virtual ~Server()
Definition Server.cxx:67
static constexpr int SleepPerTick_ms
Definition Server.h:47
void RequestNextTS()
Definition Server.h:44
std::shared_ptr< HistogramCollection > histograms2
Definition Server.h:34
std::shared_ptr< HistogramCollection > histograms
Definition Server.h:29
std::shared_ptr< algo::RecoResultsInputArchive > archive
Definition Server.h:28
std::optional< uint32_t > sensor
Definition Server.h:27
std::shared_ptr< algo::RecoResultsInputArchive > archive2
Definition Server.h:33