R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandCalToHitParTask.h
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
14#pragma once
15
16#include "R3BDataMonitor.h"
17#include "R3BNeulandBasePar.h"
18#include "R3BNeulandCalData2.h"
22#include "R3BNeulandMillepede.h"
24
25#include <FairRootManager.h>
26#include <FairRuntimeDb.h>
27#include <R3BIOConnector.h>
28#include <cstdint>
29#include <memory>
30#include <string>
31#include <string_view>
32
33#ifdef HAS_CPP_STANDARD_17
34#include <type_traits>
35#else
36#include <concepts>
37#endif
38
39class TH1L;
40
41namespace R3B::Neuland
42{
43 enum class Cal2HitParMethod : uint8_t
44 {
48 };
49 constexpr auto DEFAULT_MIN_STAT = 10;
50
51 class Cal2HitParTask;
52
54 {
56 bool enable = false;
61 std::string name = "NeulandCal2HitParTask";
62 std::string read = "NeulandCalData;NeulandCalibrationBasePar";
63 std::string write = "NeulandHitPar";
64 };
65
67 {
68 public:
70 explicit Cal2HitParTask(const Config& config);
71 void SetMinStat(int min);
72 void SetErrorScale(float scale);
73 auto GetCal2HitPar() -> auto* { return hit_par_; }
74 void SetMethod(Cal2HitParMethod method);
75
76#ifdef HAS_CPP_STANDARD_17
77 template <typename Engine,
78 typename = std::enable_if_t<std::is_base_of_v<Calibration::CosmicEngineInterface, Engine>>>
79#else
80 template <std::derived_from<Calibration::CosmicEngineInterface> Engine>
81#endif
82 void SetMethod(std::unique_ptr<Engine> engine)
83 {
84 engine_ = std::move(engine);
85 }
86
87 private:
90
91 CalibrationBasePar* base_par_ = nullptr; // input par
92 Cal2HitPar* hit_par_ = nullptr; // output par
93
94 std::unique_ptr<Calibration::CosmicEngineInterface> engine_;
95
96 // overriden functions:
97 void HistogramInit(DataMonitor& histograms) override;
98 void ExtraInit(FairRootManager* rootMan) override;
99 void BeginOfEvent() override;
100 void SetExtraPar(FairRuntimeDb* rtdb) override;
101 void TriggeredExec() override;
102 void EndOfTask() override;
103 [[nodiscard]] auto CheckConditions([[maybe_unused]] TH1L* hist_condition) const -> bool override;
104
105 // private non virtual functions:
106 };
107
108} // namespace R3B::Neuland
void SetMethod(std::unique_ptr< Engine > engine)
InputVectorConnector< BarCalData > cal_data_
void ExtraInit(FairRootManager *rootMan) override
std::unique_ptr< Calibration::CosmicEngineInterface > engine_
void SetExtraPar(FairRuntimeDb *rtdb) override
void SetMethod(Cal2HitParMethod method)
void HistogramInit(DataMonitor &histograms) override
auto CheckConditions(TH1L *hist_condition) const -> bool override
Simulation of NeuLAND Bar/Paddle.
constexpr auto DEFAULT_MIN_STAT
InputConnector< std::vector< ElementType > > InputVectorConnector
Calibration::MillepedeOptions millepede