R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandHitPar.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#ifndef R3BNEULANDHITPAR_H
15#define R3BNEULANDHITPAR_H
16
17#include "FairParGenericSet.h" // for FairParGenericSet
19#include "TObjArray.h"
20
21#include <array>
22
23class FairParamList;
24
25class R3BNeulandHitPar : public FairParGenericSet
26{
27
28 public:
36 R3BNeulandHitPar(const char* name = "NeulandHitPar",
37 const char* title = "Calibration",
38 const char* context = "TestDefaultContext",
39 Bool_t own = kTRUE);
43 virtual ~R3BNeulandHitPar(void);
44
48 void clear(void);
49
54 void putParams(FairParamList* list);
55
61 Bool_t getParams(FairParamList* list);
62
67 void printParams();
68
74 void AddModulePar(R3BNeulandHitModulePar* tch) { fParams->Add(tch); }
75
80 TObjArray* GetListOfModulePar() const { return fParams; }
81
86 Int_t GetNumModulePar() const { return fParams->GetEntriesFast(); }
87
93 [[nodiscard]] auto GetModuleParAt(Int_t idx) const -> R3BNeulandHitModulePar*
94 {
95 return dynamic_cast<R3BNeulandHitModulePar*>(fParams->At(idx));
96 }
97
98 // Global time offset in ns
99 inline Double_t GetGlobalTimeOffset() const { return fGlobalTimeOffset; }
100 inline void SetGlobalTimeOffset(Double_t t0_ns) { fGlobalTimeOffset = t0_ns; }
101
102 // Distance to Target in cm
103 inline Double_t GetDistanceToTarget(Int_t plane = 0) const
104 {
105 return fDistanceToTarget + fDistancesToFirstPlane.at(plane);
106 }
107 inline void SetDistanceToTarget(Double_t distance_cm) { fDistanceToTarget = distance_cm; }
108
109 // Energy Cutoff for all Hits in MeV
110 inline Double_t GetEnergyCutoff() const { return fEnergyCut; }
111 inline void SetEnergyCutoff(Double_t energy_MeV) { fEnergyCut = energy_MeV; }
112
113 // Number of Planes
114 inline Int_t GetNumberOfPlanes() const { return fDistancesToFirstPlane.size(); }
115 inline void SetNumberOfPlanes(const Int_t nPlanes) { fDistancesToFirstPlane.resize(nPlanes); }
116
117 // Distance to first Plane in cm
118 inline Double_t GetDistanceToFirstPlane(Int_t plane) const { return fDistancesToFirstPlane.at(plane); }
119 inline void SetDistanceToFirstPlane(Int_t plane, Double_t distance_cm)
120 {
121 fDistancesToFirstPlane.at(plane) = distance_cm;
122 }
123
124 inline std::vector<Double_t> GetDistancesToFirstPlane() const { return fDistancesToFirstPlane; }
125
126 private:
127 TObjArray* fParams;
128
129 Double_t fGlobalTimeOffset;
130 Double_t fDistanceToTarget;
131 Double_t fEnergyCut;
132 std::vector<Double_t> fDistancesToFirstPlane;
133
134 ClassDef(R3BNeulandHitPar, 3);
135};
136
137#endif /* !R3BNEULANDHITPAR_H*/
std::vector< Double_t > GetDistancesToFirstPlane() const
void SetEnergyCutoff(Double_t energy_MeV)
void clear(void)
Method to reset the values of parameters.
Double_t GetDistanceToFirstPlane(Int_t plane) const
Double_t GetGlobalTimeOffset() const
void putParams(FairParamList *list)
Method to store parameters using FairRuntimeDB.
void SetGlobalTimeOffset(Double_t t0_ns)
auto GetModuleParAt(Int_t idx) const -> R3BNeulandHitModulePar *
Method to get single parameter container for a specific module.
void SetNumberOfPlanes(const Int_t nPlanes)
Double_t GetDistanceToTarget(Int_t plane=0) const
void printParams()
Method to print value of parameters to the standard output.
R3BNeulandHitPar(const char *name="NeulandHitPar", const char *title="Calibration", const char *context="TestDefaultContext", Bool_t own=kTRUE)
Standard constructor.
Int_t GetNumModulePar() const
Method to get number of modules storred in array.
Bool_t getParams(FairParamList *list)
Method to retrieve parameters using FairRuntimeDB.
virtual ~R3BNeulandHitPar(void)
Destructor.
void SetDistanceToTarget(Double_t distance_cm)
Int_t GetNumberOfPlanes() const
void SetDistanceToFirstPlane(Int_t plane, Double_t distance_cm)
Double_t GetEnergyCutoff() const
TObjArray * GetListOfModulePar() const
Method to retrieve the arrray with module containers.
void AddModulePar(R3BNeulandHitModulePar *tch)
Method to add parameter container for a module.
constexpr Int_t nPlanes