R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandCountRateCanvas.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2023 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#pragma once
15
16#include "R3BDataMonitor.h"
19#include <R3BIOConnector.h>
20#include <R3BNeulandCalData2.h>
21#include <R3BNeulandHit.h>
23#include <TGraph.h>
24#include <chrono>
25#include <cstdint>
26#include <string_view>
27
28constexpr auto DEFAULT_COUNTING_DURATION = std::chrono::seconds{ 10 };
29
30namespace R3B::Neuland
31{
33 {
34 public:
35 enum class RangeViewMode : uint8_t
36 {
40 };
41
42 explicit CountRateCanvas(std::string_view name)
43 : OnlineCanvas(name)
44 {
45 }
46 void ResetCount();
47
48 private:
52
57
58 int los_counter_ = 0;
59 int map_counter_ = 0;
60 int cal_counter_ = 0;
61 int hit_counter_ = 0;
62
63 std::chrono::time_point<std::chrono::steady_clock> start_time_ = std::chrono::steady_clock::now();
64 std::chrono::time_point<std::chrono::steady_clock> timer_;
67
68 void DataInit() override;
69 void CanvasInit(DataMonitor& histograms) override;
70 void CanvasFill(DataMonitor& histograms) override;
71 void CanvasFinish() override;
72
73 void los_count();
74 void map_count();
75 void cal_count();
76 void hit_count();
78 void adjust_graph_view();
79
80 inline void set_view(double width);
81 inline void set_full_view();
82 inline void set_two_hour_view();
83 inline void set_four_hour_view();
84
85 template <typename UnaryOp>
86 void do_each_graph(UnaryOp optn);
87 };
88
89 template <typename UnaryOp>
91 {
92 optn(los_count_rate_);
93 optn(map_count_rate_);
94 optn(cal_count_rate_);
95 optn(hit_count_rate_);
96 }
97} // namespace R3B::Neuland
constexpr auto DEFAULT_COUNTING_DURATION
InputVectorConnector< BarCalData > cal_data_
std::chrono::time_point< std::chrono::steady_clock > timer_
void CanvasFill(DataMonitor &histograms) override
InputVectorConnector< R3BNeulandHit > hit_data_
InputVectorConnector< PaddleTamexMappedData > mapped_data_
void CanvasInit(DataMonitor &histograms) override
std::chrono::time_point< std::chrono::steady_clock > start_time_
OnlineCanvas(const OnlineCanvas &)=default
Simulation of NeuLAND Bar/Paddle.
InputConnector< std::vector< ElementType > > InputVectorConnector