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 "R3BDigitizingEngine.h"
21#include "R3BDigitizingPaddle.h"
24#include "R3BDigitizingTamex.h"
25#include "R3BIOConnector.h"
26#include "R3BNeulandGeoPar.h"
27#include "R3BNeulandHit.h"
28#include "R3BNeulandPoint.h"
29#include <Rtypes.h>
30#include <RtypesCore.h>
31#include <TClonesArray.h>
32#include <TH1.h>
33#include <memory>
34#include <string>
35#include <string_view>
36#include <unordered_map>
37#include <utility>
38
39class TGeoNode;
40class TH1F;
41class TH2F;
42
48
49namespace R3B::Neuland
50{
66 {
67 bool enable = false;
68 std::string name = "NeulandDigitizer";
73 std::string channel = "tamex";
78 std::string paddle = "neuland";
80 bool enable_sim_cal = false;
82 bool enable_hit_par = false;
84 bool enable_size_monitor = false;
89
91 PeakPileUpStrategy::width;
93 std::string read = "NeulandPoints;NeulandHitPar";
94 std::string write = "NeulandHits;NeulandSimCal";
95
97 };
98
109 class Digitizer : public FairTask
110 {
111 public:
115 template <typename Type>
117 template <typename Type>
119
123 Digitizer();
124
134 explicit Digitizer(std::unique_ptr<Digitizing::EngineInterface> engine,
135 std::string_view points_name = "NeulandPoints",
136 std::string_view hits_name = "NeulandHits",
137 std::string_view cal_hits_name = "NeulandSimCal");
138
147 static auto Create(const R3B::Neuland::DigiTaskOptions& option, FairRun* run) -> std::unique_ptr<Digitizer>;
148
155 void SetEngine(std::unique_ptr<Digitizing::EngineInterface> engine);
156
163 void AddFilter(const Filterable<R3BNeulandHit&>::Filter& filter) { hit_filters_.Add(filter); }
164
172
181
190 void EnableCalDataOutput(bool is_enabled) { has_cal_output_ = is_enabled; }
191
200 void EnableSizeMonitor(bool is_enabled = true) { has_size_monitor_ = is_enabled; }
201
208 [[nodiscard]] auto HasCalDataOutput() const -> bool { return has_cal_output_; }
209
210 private:
211 bool has_cal_output_ = false;
212 bool has_size_monitor_ = false;
213
217
218 std::unique_ptr<Digitizing::EngineInterface> digitizing_engine_; // owning
219
223
224 R3BNeulandGeoPar* neuland_geo_par_ = nullptr; // non-owning
225 std::unordered_map<int, int>
226 point_size_tracker_; //<! Tracker to calculate point number per paddle with the paddle number as the key
227
229 TH1I* hist_multi_one_ = nullptr;
230 TH1I* hist_multi_two_ = nullptr;
231 TH1F* hist_rl_time_to_trig_ = nullptr;
232
233 TH1D* hist_point_size_ = nullptr;
235 TH1D* hist_channel_hit_size_ = nullptr;
236 TH1D* hist_paddle_hit_size_ = nullptr;
237
241 void fill_histograms();
243 void init_histograms();
244
245 auto Init() -> InitStatus override;
246 void FinishTask() override;
247 void FinishEvent() override;
248 void SetParContainers() override;
249 void Exec(Option_t* /*option*/) override;
250
251 public:
252 ClassDefOverride(Digitizer, 1) // NOLINT
253 };
254
255} // namespace R3B::Neuland
256
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_
R3BNeulandGeoPar * neuland_geo_par_
Digitizing::UsePaddle< Type > UsePaddle
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
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.
Filterable< R3B::Neuland::SimCalData & > cal_hit_filter_
R3B::InputVectorConnector< R3BNeulandPoint > neuland_points_
void SetPointFilter(R3B::Neuland::ParticleFilter filter)
Add a new point level filter.
Digitizing::UseChannel< Type > UseChannel
R3B::OutputVectorConnector< R3B::Neuland::SimCalData > neuland_cal_hits_
NeuLAND geometry parameter storage.
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
Pileup strategy for the tamex channel.
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
Tamex parameters used in the Digitizer.
std::string write
Output data names from the digitizer.
std::string name
Name of the task.
Option structure to create a filter.