CbmRoot
Loading...
Searching...
No Matches
CbmFsdDigiPar.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 Physikalisches Institut, Eberhard Karls Universitaet Tuebingen, Tuebingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig, Lukas Chlad [committer] */
4
5#include "CbmFsdDigiPar.h"
6
7#include <FairParGenericSet.h> // for FairParGenericSet
8#include <FairParamList.h> // for FairParamList
9#include <Logger.h> // for LOG, Logger
10
12
13 CbmFsdDigiPar::CbmFsdDigiPar(const char* name, const char* title, const char* context)
14 : FairParGenericSet(name, title, context)
15 , fNumPhotoDets(-1)
16 , fTimeResolution(-1.)
17 , fEnergyResolution(-1.)
18{
19 detName = "Fsd";
20}
21
23
25{
26 status = kFALSE;
27 resetInputVersions();
28}
29
30void CbmFsdDigiPar::putParams(FairParamList* l)
31{
32 if (!l) { return; }
33
34 l->add("NumPhotoDets", fNumPhotoDets);
35 l->add("NumUnits", fNumUnits);
36 l->add("TimeResolution", fTimeResolution);
37 l->add("EnergyResolution", fEnergyResolution);
38 l->add("DeadTime", fDeadTime);
39}
40
41Bool_t CbmFsdDigiPar::getParams(FairParamList* l)
42{
43 if (!l) { return kFALSE; }
44
45 LOG(debug2) << "Get the FSD digitization parameters.";
46
47 if (!l->fill("NumPhotoDets", &fNumPhotoDets)) return kFALSE;
48 if (!l->fill("NumUnits", &fNumUnits)) return kFALSE;
49
53 if (!l->fill("TimeResolution", &fTimeResolution)) return kFALSE;
54 if (!l->fill("EnergyResolution", &fEnergyResolution)) return kFALSE;
55 if (!l->fill("DeadTime", &fDeadTime)) return kFALSE;
56
57 return kTRUE;
58}
59
60Double_t CbmFsdDigiPar::GetTimeResolution(Int_t iUnitId) const
61{
62 if (iUnitId < fNumUnits) return fTimeResolution[iUnitId];
63 else
64 return -1.;
65}
66
67Double_t CbmFsdDigiPar::GetEnergyResolution(Int_t iUnitId) const
68{
69 if (iUnitId < fNumUnits) return fEnergyResolution[iUnitId];
70 else
71 return -1.;
72}
73
74Double_t CbmFsdDigiPar::GetDeadTime(Int_t iUnitId) const
75{
76 if (iUnitId < fNumUnits) return fDeadTime[iUnitId];
77 else
78 return -1.;
79}
ClassImp(CbmFsdDigiPar) CbmFsdDigiPar
Bool_t getParams(FairParamList *)
CbmFsdDigiPar(const char *name="CbmFsdDigiPar", const char *title="Digitization parameters for the FSD detector", const char *context="Needed parameters to adjust FsdDigitizer according to the geometry and read-out propetries")
void clear(void)
Double_t GetTimeResolution(Int_t iUnitId) const
Double_t GetEnergyResolution(Int_t iUnitId) const
Double_t GetDeadTime(Int_t iUnitId) const
void putParams(FairParamList *)
TArrayD fEnergyResolution
TArrayD fDeadTime
TArrayD fTimeResolution