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
16#include <fmt/format.h>
17
18namespace R3B::Neuland
19{
22 {
23 auto& canvas = CreateNewCanvas(histograms);
24 canvas.divide(1, 2);
25 h_tpats_ = canvas.add<1, TH1I>("tpats", "tpat value distribution", 1, 0., 0.);
26 h_tpats_.pad()->SetLogy();
27
28 h_spill_stat_ = canvas.add<2, TH1I>("spill", "spill statistics", 1, 0., 0.);
29 h_spill_stat_.pad()->SetLogy();
30 }
32 {
33 auto* eventHeader = GetOnlineSpectra()->GetEventHeader();
34 const auto offspill_bit = GetOnlineSpectra()->GetBasePar()->GetOffSpillTpatPos();
35 const auto tpat = eventHeader->GetTpat();
36 h_tpats_->Fill(fmt::format("{:016b}", tpat).c_str(), 1);
37
38 if (CheckTriggerWithTpat(CalTrigger::onspill, tpat, offspill_bit))
39 {
40 h_spill_stat_->Fill("onspill", 1);
41 }
42 else if (CheckTriggerWithTpat(CalTrigger::offspill, tpat, offspill_bit))
43 {
44 h_spill_stat_->Fill("offspill", 1);
45 }
46 else
47 {
48 h_spill_stat_->Fill("others", 1);
49 }
50 }
52} // 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