R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandCalCanvas.cxx
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#include "R3BNeulandCalCanvas.h"
15#include <R3BNeulandCommon.h>
17#include <TH2.h>
18
19namespace R3B::Neuland
20{
21 // void CalOnlineCanvas::DataInit() {}
22 // void CalOnlineCanvas::CanvasInit(HistMonitor& histograms) {}
23 // void CalOnlineCanvas::CanvasFill(HistMonitor& histograms) {}
24 // void CalOnlineCanvas::CanvasFinish() {}
25
26 void CalCanvas::DataInit() { cal_data_.init(); }
28 {
29 auto& canvas = CreateNewCanvas(histograms);
30 auto bar_numbers = GetBarNumber();
31
32 canvas.divide(2, 2);
33
34 constexpr auto TIME_BIN_SIZE = 2000;
35 constexpr auto TIME_MIN = -5000.;
36 constexpr auto TIME_MAX = 15000.;
37 constexpr auto TOT_BIN_SIZE = 600;
38
39 hCalTvsBar_L = canvas.add<1, TH2D>("hCalTvsBar_L",
40 "CalLevel_left: Time vs Bars ",
41 bar_numbers,
42 0.5,
43 bar_numbers + 0.5,
44 TIME_BIN_SIZE,
45 TIME_MIN,
46 TIME_MAX);
47 hCalTvsBar_R = canvas.add<2, TH2D>("hCalTvsBar_R",
48 "CalLevel_right: Time vs Bars ",
49 bar_numbers,
50 0.5,
51 bar_numbers + 0.5,
52 TIME_BIN_SIZE,
53 TIME_MIN,
54 TIME_MAX);
55 hCalToTvsBar_L = canvas.add<3, TH2D>("hCalToTvsBar_L",
56 "CalLevel_left: ToT vs Bars",
57 bar_numbers,
58 0.5,
59 bar_numbers + 0.5,
60 TOT_BIN_SIZE,
61 0.,
62 TOT_BIN_SIZE + 0.);
63 hCalToTvsBar_R = canvas.add<4, TH2D>("hCalToTvsBar_R",
64 "CalLevel_right: ToT vs Bars",
65 bar_numbers,
66 0.5,
67 bar_numbers + 0.5,
68 TOT_BIN_SIZE,
69 0.,
70 TOT_BIN_SIZE + 0.);
71 }
72
74 {
75 for (const auto& bar_signal : cal_data_)
76 {
77 const auto module_num = bar_signal.module_num;
78 for (const auto& left_signal : bar_signal.left)
79 {
80 histograms.get("hCalTvsBar_L")
81 ->Fill(module_num, (left_signal.leading_time - left_signal.trigger_time).value);
82 histograms.get("hCalToTvsBar_L")->Fill(module_num, left_signal.time_over_threshold.value);
83 }
84 for (const auto& right_signal : bar_signal.right)
85 {
86 histograms.get("hCalTvsBar_R")
87 ->Fill(module_num, (right_signal.leading_time - right_signal.trigger_time).value);
88 histograms.get("hCalToTvsBar_R")->Fill(module_num, right_signal.time_over_threshold.value);
89 }
90 }
91 }
93} // namespace R3B::Neuland
auto get(const std::string &histName) -> TH1 *
void CanvasFill(DataMonitor &histograms) override
void CanvasInit(DataMonitor &histograms) override
auto CreateNewCanvas(DataMonitor &histograms) -> DataMonitorCanvas &
Simulation of NeuLAND Bar/Paddle.