R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandDigitizer.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 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#include "FairTask.h"
16#include "Filterable.h"
18#include "NeulandSimCalData.h"
19#include "R3BDataMonitor.h"
20#include "R3BDigitizingPaddle.h"
23#include "R3BDigitizingTamex.h"
24#include "R3BIOConnector.h"
25#include "R3BNeulandGeoPar.h"
26#include "R3BNeulandHit.h"
27#include "R3BNeulandPoint.h"
28#include <Rtypes.h>
29#include <RtypesCore.h>
30#include <TClonesArray.h>
31#include <TH1.h>
32#include <memory>
33#include <string>
34#include <string_view>
35#include <unordered_map>
36#include <utility>
37
38class TGeoNode;
39class TH1F;
40class TH2F;
41
47
48namespace R3B::Digitizing
49{
50 class EngineInterface;
51}
52namespace R3B::Neuland
53{
69 {
70 bool enable = false;
71 std::string name = "NeulandDigitizer";
76 std::string channel = "tamex";
81 std::string paddle = "neuland";
83 bool enable_sim_cal = false;
85 bool enable_hit_par = false;
87 bool enable_size_monitor = false;
92
94 PeakPileUpStrategy::width;
96 std::string read = "NeulandPoints;NeulandHitPar";
97 std::string write = "NeulandHits;NeulandSimCal";
98
100 };
101
112 class Digitizer : public FairTask
113 {
114 public:
118
122 Digitizer();
123
124 Digitizer(const Digitizer&) = delete;
125 Digitizer(Digitizer&&) = delete;
126 auto operator=(const Digitizer&) -> Digitizer& = delete;
127 auto operator=(Digitizer&&) -> Digitizer& = delete;
128 ~Digitizer() override;
129
139 explicit Digitizer(std::unique_ptr<Digitizing::EngineInterface> engine,
140 std::string_view points_name = "NeulandPoints",
141 std::string_view hits_name = "NeulandHits",
142 std::string_view cal_hits_name = "NeulandSimCal");
143
152 static auto Create(const R3B::Neuland::DigiTaskOptions& option, FairRun* run) -> std::unique_ptr<Digitizer>;
153
160 void SetEngine(std::unique_ptr<Digitizing::EngineInterface> engine);
161
168 void AddFilter(const Filterable<R3BNeulandHit&>::Filter& filter) { hit_filters_.Add(filter); }
169
177
186
195 void EnableCalDataOutput(bool is_enabled) { has_cal_output_ = is_enabled; }
196
205 void EnableSizeMonitor(bool is_enabled = true) { has_size_monitor_ = is_enabled; }
206
213 [[nodiscard]] auto HasCalDataOutput() const -> bool { return has_cal_output_; }
214
215 private:
216 bool has_cal_output_ = false;
217 bool has_size_monitor_ = false;
218
222
223 std::unique_ptr<Digitizing::EngineInterface> digitizing_engine_; // owning
224
228
229 R3BNeulandGeoPar* neuland_geo_par_ = nullptr; // non-owning
230 std::unordered_map<int, int>
231 point_size_tracker_; //<! Tracker to calculate point number per paddle with the paddle number as the key
232
234 TH1I* hist_multi_one_ = nullptr;
235 TH1I* hist_multi_two_ = nullptr;
236 TH1F* hist_rl_time_to_trig_ = nullptr;
237
238 TH1D* hist_point_size_ = nullptr;
240 TH1D* hist_channel_hit_size_ = nullptr;
241 TH1D* hist_paddle_hit_size_ = nullptr;
242
246 void fill_histograms();
248 void init_histograms();
249
250 auto Init() -> InitStatus override;
251 void FinishTask() override;
252 void FinishEvent() override;
253 void SetParContainers() override;
254 void Exec(Option_t* /*option*/) override;
255
256 public:
257 ClassDefOverride(Digitizer, 1) // NOLINT
258 };
259
260} // namespace R3B::Neuland
261
R3B::Neuland::Digitizer R3BNeulandDigitizer
std::function< bool(const T)> Filter
Definition Filterable.h:24
static auto GetDefaultRandomGen() -> TRandom3 &
Main digitizer task class for NeuLAND.
Digitizing::Neuland::TacQuila::Channel TacquilaChannel
void Exec(Option_t *) override
static auto Create(const R3B::Neuland::DigiTaskOptions &option, FairRun *run) -> std::unique_ptr< Digitizer >
Generator of the digitizing class.
Filterable< R3BNeulandHit & > hit_filters_
Digitizer()
Constructor with no input parameters.
R3B::Neuland::ParticleFilter neuland_point_filter_
Digitizer(Digitizer &&)=delete
R3BNeulandGeoPar * neuland_geo_par_
std::unique_ptr< Digitizing::EngineInterface > digitizing_engine_
void AddFilterCal(const Filterable< R3B::Neuland::SimCalData & >::Filter &filter)
Add a new cal level filter.
void fill_size_histograms(const Digitizing::AbstractPaddle &paddle)
Digitizing::Neuland::Tamex::Channel TamexChannel
std::unordered_map< int, int > point_size_tracker_
void AddFilter(const Filterable< R3BNeulandHit & >::Filter &filter)
Add a new hit filter.
R3B::OutputVectorConnector< R3BNeulandHit > neuland_hits_
auto Init() -> InitStatus override
auto operator=(const Digitizer &) -> Digitizer &=delete
void EnableSizeMonitor(bool is_enabled=true)
Enable the checking on sizes of different data levels.
void fill_hit_data(const R3B::Digitizing::AbstractPaddle &paddle)
void EnableCalDataOutput(bool is_enabled)
Enable sim cal data output.
auto HasCalDataOutput() const -> bool
Getter of the sim cal output flag.
Digitizing::Neuland::Paddle NeulandPaddle
void fill_cal_data(const R3B::Digitizing::AbstractPaddle &paddle)
void SetEngine(std::unique_ptr< Digitizing::EngineInterface > engine)
Setter of the internal engine.
auto operator=(Digitizer &&) -> Digitizer &=delete
Digitizer(const Digitizer &)=delete
Filterable< R3B::Neuland::SimCalData & > cal_hit_filter_
R3B::InputVectorConnector< R3BNeulandPoint > neuland_points_
void SetPointFilter(R3B::Neuland::ParticleFilter filter)
Add a new point level filter.
R3B::OutputVectorConnector< R3B::Neuland::SimCalData > neuland_cal_hits_
NeuLAND geometry parameter storage.
NeuLAND digitizing finder task.
Simulation of NeuLAND Bar/Paddle.
InputConnector< std::vector< ElementType > > InputVectorConnector
OutputConnector< std::vector< ElementType > > OutputVectorConnector
Configuration struct for R3B::Neuland::Digitizer used in R3B::Neuland::AnalysisApplication.
std::string channel
Channel name used in the task.
Digitizing::Neuland::Tamex::PeakPileUpStrategy pileup_strategy
bool enable_sim_cal
Flag to enable the simulated cal level data output.
bool enable_hit_par
Flag to enable the usage of cal_to_hit parameter.
std::string read
Input data names required by the digitizer.
bool enable_size_monitor
Flag to enable the checking of hit/signal sizes in histograms.
std::string paddle
Paddle name used in the task.
ClassDefNV(DigiTaskOptions, 1)
bool enable
Flag to enable task.
ParticleFilter::Options point_filter
Point level filter options used in the digitizer.
R3B::Digitizing::Neuland::Tamex::Params tamex_par
std::string write
Output data names from the digitizer.
std::string name
Name of the task.
Option structure to create a filter.