R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandEventHeaderCanvas.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
15#include "R3BDataMonitor.h"
18#include <TH1.h>
19#include <fmt/core.h>
20
21namespace R3B::Neuland
22{
25 {
26 auto& canvas = CreateNewCanvas(histograms);
27 canvas.divide(1, 2);
28 h_tpats_ = canvas.add<1, TH1I>("tpats", "tpat value distribution", 1, 0., 0.);
29 h_tpats_.pad()->SetLogy();
30
31 h_spill_stat_ = canvas.add<2, TH1I>("spill", "spill statistics", 1, 0., 0.);
32 h_spill_stat_.pad()->SetLogy();
33 }
35 {
36 auto* eventHeader = GetOnlineSpectra()->GetEventHeader();
37 const auto offspill_bit = GetOnlineSpectra()->GetBasePar()->get_offspill_tpat_pos();
38 const auto tpat = eventHeader->GetTpat();
39 h_tpats_->Fill(fmt::format("{:016b}", tpat).c_str(), 1);
40
41 if (CheckTriggerWithTpat(CalTrigger::onspill, tpat, offspill_bit))
42 {
43 h_spill_stat_->Fill("onspill", 1);
44 }
45 else if (CheckTriggerWithTpat(CalTrigger::offspill, tpat, offspill_bit))
46 {
47 h_spill_stat_->Fill("offspill", 1);
48 }
49 else
50 {
51 h_spill_stat_->Fill("others", 1);
52 }
53 }
55} // namespace R3B::Neuland
void CanvasInit(DataMonitor &histograms) override
void CanvasFill(DataMonitor &histograms) override
auto CreateNewCanvas(DataMonitor &histograms) -> DataMonitorCanvas &
auto GetOnlineSpectra() const -> OnlineSpectra *
Simulation of NeuLAND Bar/Paddle.
auto CheckTriggerWithTpat(CalTrigger trigger, int tpat, int off_spill_bit) -> bool