R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandHitModulePar.cxx
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
15
16#include "FairLogger.h"
17#include "FairParamList.h" // for FairParamList
18
19#include "TString.h"
20
21R3BNeulandHitModulePar::R3BNeulandHitModulePar(const char* name, const char* title, const char* context, Bool_t own)
22 : FairParGenericSet(name, title, context, own)
23 , fModuleId(0)
24{
25 // Reset all parameters
26 clear();
27}
28
30
31void R3BNeulandHitModulePar::putParams(FairParamList* list)
32{
33 LOG(info) << "R3BNeulandHitModulePar::putParams() called";
34 if (!list)
35 {
36 return;
37 }
38 list->add("module_id", fModuleId);
39 list->add("tdiff", fTDiff);
40 list->add("tsync", fTSync);
41 list->add("pedestal_1", fPedestal[0]);
42 list->add("pedestal_2", fPedestal[1]);
43 list->add("energygain_1", fEnergyGain[0]);
44 list->add("energygain_2", fEnergyGain[1]);
45 list->add("effectivespeed", fEffectiveSpeed);
46 list->add("lightattenuationlength", fLightAttenuationLength);
47 list->add("pmtsaturation_1", fPMTSaturation[0]);
48 list->add("pmtsaturation_2", fPMTSaturation[1]);
49 list->add("pmtthreshold_1", fPMTThreshold[0]);
50 list->add("pmtthreshold_2", fPMTThreshold[1]);
51}
52
53Bool_t R3BNeulandHitModulePar::getParams(FairParamList* list)
54{
55 if (!list)
56 {
57 return kFALSE;
58 }
59 if (!list->fill("module_id", &fModuleId))
60 {
61 return kFALSE;
62 }
63 if (!list->fill("tdiff", &fTDiff))
64 {
65 return kFALSE;
66 }
67 if (!list->fill("tsync", &fTSync))
68 {
69 return kFALSE;
70 }
71 if (!list->fill("pedestal_1", &fPedestal[0]))
72 {
73 return kFALSE;
74 }
75 if (!list->fill("pedestal_2", &fPedestal[1]))
76 {
77 return kFALSE;
78 }
79 if (!list->fill("energygain_1", &fEnergyGain[0]))
80 {
81 return kFALSE;
82 }
83 if (!list->fill("energygain_2", &fEnergyGain[1]))
84 {
85 return kFALSE;
86 }
87 if (!list->fill("effectivespeed", &fEffectiveSpeed))
88 {
89 return kFALSE;
90 }
91 if (!list->fill("lightattenuationlength", &fLightAttenuationLength))
92 {
93 return kFALSE;
94 }
95 if (!list->fill("pmtsaturation_1", &fPMTSaturation[0]))
96 {
97 return kFALSE;
98 }
99 if (!list->fill("pmtsaturation_2", &fPMTSaturation[1]))
100 {
101 return kFALSE;
102 }
103 if (!list->fill("pmtthreshold_1", &fPMTThreshold[0]))
104 {
105 return kFALSE;
106 }
107 if (!list->fill("pmtthreshold_2", &fPMTThreshold[1]))
108 {
109 return kFALSE;
110 }
111
112 return kTRUE;
113}
114
116
118{
119 LOG(info) << "R3BNeulandHitModulePar: Calibration Parameters:";
120 LOG(info) << " Bar ID: " << fModuleId;
121 LOG(info) << TString::Format(" TDiff: %4.2f", fTDiff);
122 LOG(info) << TString::Format(" TSync: %4.2f", fTSync);
123 LOG(info) << TString::Format(" Effective Speed: %4.2f", fEffectiveSpeed);
124 LOG(info) << TString::Format(" Light Attenuation Length: %4.1f", fLightAttenuationLength);
125 LOG(info) << TString::Format(" Energy Gain R/B: %4.2f", fEnergyGain[0]);
126 LOG(info) << TString::Format(" Energy Gain L/T: %4.2f\n", fEnergyGain[1]);
127 LOG(info) << TString::Format(" Pedestal R/B: %4d\n", fPedestal[0]);
128 LOG(info) << TString::Format(" Pedestal L/T: %4d\n", fPedestal[1]);
129 LOG(info) << TString::Format(" PMT Saturation R/B: %4.2f\n", fPMTSaturation[0]);
130 LOG(info) << TString::Format(" PMT Saturation L/T: %4.2f\n", fPMTSaturation[1]);
131 LOG(info) << TString::Format(" PMT Threshold R/B: %4.2f\n", fPMTThreshold[0]);
132 LOG(info) << TString::Format(" PMT Threshold L/T: %4.2f\n", fPMTThreshold[1]);
133}
134
ClassImp(R3BNeulandHitModulePar)
virtual ~R3BNeulandHitModulePar(void)
Destructor.
R3BNeulandHitModulePar(const char *name="NeulandHitModulePar", const char *title="Calibration of a NeuLAND module", const char *context="TestDefaultContext", Bool_t own=kTRUE)
Standard constructor.
void clear(void)
A method to reset the parameter values.
void printParams()
A method to print value of parameters to the standard output using FairLogger.
Bool_t getParams(FairParamList *list)
A method to read parameters using RuntimeDB.
void putParams(FairParamList *list)
A method to write parameters using RuntimeDB.