R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandMappedCanvas.cxx
Go to the documentation of this file.
1/*************16:59:11**********************************************************
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
15#include "R3BDataMonitor.h"
16#include <R3BNeulandCommon.h>
17#include <Rtypes.h>
18#include <TH1.h>
19
20namespace R3B::Neuland
21{
24 {
25 auto& canvas = CreateNewCanvas(histograms);
26 auto bar_numbers = GetBarNumber();
27
28 canvas.divide(1, 2);
29 canvas.add<1, TH1D>("hMappedBar1fLE", "Mapped: Bars fine 1LE", bar_numbers, 0.5, bar_numbers + 0.5)
30 ->SetLineColor(kBlue);
31 canvas.add<1, TH1D>("hMappedBar1fTE", "Mapped: Bars fine 1TE", bar_numbers, 0.5, bar_numbers + 0.5)
32 ->SetLineColor(kBlack);
33 canvas.add<1, TH1D>("hMappedBar1cLE", "Mapped: Bars coarse 1LE", bar_numbers, 0.5, bar_numbers + 0.5)
34 ->SetLineColor(kRed);
35 canvas.add<1, TH1D>("hMappedBar1cTE", "Mapped: Bars coarse 1TE", bar_numbers, 0.5, bar_numbers + 0.5)
36 ->SetLineColor(kOrange);
37
38 canvas.add<2, TH1D>("hMappedBar2fLE", "Mapped: Bars fine 2LE", bar_numbers, 0.5, bar_numbers + 0.5)
39 ->SetLineColor(kBlue);
40 canvas.add<2, TH1D>("hMappedBar2fTE", "Mapped: Bars fine 2TE", bar_numbers, 0.5, bar_numbers + 0.5)
41 ->SetLineColor(kBlack);
42 canvas.add<2, TH1D>("hMappedBar2cLE", "Mapped: Bars coarse 2LE", bar_numbers, 0.5, bar_numbers + 0.5)
43 ->SetLineColor(kRed);
44 canvas.add<2, TH1D>("hMappedBar2cTE", "Mapped: Bars coarse 2TE", bar_numbers, 0.5, bar_numbers + 0.5)
45 ->SetLineColor(kOrange);
46 }
47
49 {
50 auto fill_if_positive = [](double check_value, TH1* histogram, double fill_value)
51 {
52 if (check_value > 0)
53 {
54 histogram->Fill(fill_value);
55 }
56 };
57
58 for (const auto& plane_data : mapped_data_)
59 {
60 const auto plane_num = plane_data.plane_num;
61 for (const auto& [bar_num, bar_data] : plane_data.bars)
62 {
63 const auto module_num = Neuland_PlaneBar2ModuleNum(plane_num, bar_num);
64 for (const auto& left_signal : bar_data.left)
65 {
66 fill_if_positive(left_signal.leading.fine, histograms.get("hMappedBar1fLE"), module_num);
67 fill_if_positive(left_signal.leading.coarse, histograms.get("hMappedBar1cLE"), module_num);
68 fill_if_positive(left_signal.trailing.fine, histograms.get("hMappedBar1fTE"), module_num);
69 fill_if_positive(left_signal.trailing.coarse, histograms.get("hMappedBar1cTE"), module_num);
70 }
71 for (const auto& right_signal : bar_data.right)
72 {
73 fill_if_positive(right_signal.leading.fine, histograms.get("hMappedBar2fLE"), module_num);
74 fill_if_positive(right_signal.leading.coarse, histograms.get("hMappedBar2cLE"), module_num);
75 fill_if_positive(right_signal.trailing.fine, histograms.get("hMappedBar2fTE"), module_num);
76 fill_if_positive(right_signal.trailing.coarse, histograms.get("hMappedBar2cTE"), module_num);
77 }
78 }
79 }
80 }
81
83
84} // namespace R3B::Neuland
auto get(const std::string &histName) -> TH1 *
void CanvasInit(DataMonitor &histograms) override
InputVectorConnector< PaddleTamexMappedData > mapped_data_
void CanvasFill(DataMonitor &histograms) override
auto CreateNewCanvas(DataMonitor &histograms) -> DataMonitorCanvas &
Simulation of NeuLAND Bar/Paddle.
constexpr auto Neuland_PlaneBar2ModuleNum(unsigned int planeNum, unsigned int barNum) -> unsigned int