CbmRoot
Loading...
Searching...
No Matches
services/archive_explorer/app/Application.cxx
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#include "Application.h"
5
6#include <log.hpp>
7
8#include "Histograms.h"
10#include "Server.h"
11
12using namespace cbm::explore;
13using namespace cbm::algo;
14
15Application::Application(const Options& options) : fOpts(options)
16{
17 L_(info) << "Starting application with port " << fOpts.Port();
18
19 L_(info) << "Opening archive " << fOpts.Input();
20
21 auto archive = std::make_shared<RecoResultsInputArchive>(fOpts.Input().string());
22 auto histograms = std::make_shared<Histograms>();
23
24 std::shared_ptr<RecoResultsInputArchive> archive2;
25 std::shared_ptr<Histograms> histograms2;
26 if (not fOpts.Input2().empty()) {
27 L_(info) << "Opening second archive " << fOpts.Input2();
28 archive2 = std::make_shared<RecoResultsInputArchive>(fOpts.Input2().string());
29 histograms2 = std::make_shared<Histograms>();
30 }
31
32 Server::Settings settings {
33 .port = fOpts.Port(),
34 .sensor = fOpts.Sensor(),
35 .archive = archive,
36 .histograms = histograms,
37 .archive2 = archive2,
38 .histograms2 = histograms2,
39 };
40
41 fServer = std::make_unique<Server>(settings);
42}
43
45
47{
48 fServer->Run();
49 return 0;
50}
#define L_(level)
Application(ProgramOptions const &opt)
Standard constructor, initialize the application.
std::optional< uint32_t > Sensor() const