CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018PsdPar.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin, Florian Uhlig [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMcbm2018PsdPar header file -----
7// ----- Created 26.09.2019 by N.Karpushkin -----
8// ----- based on CbmMcbm2018TofPar by P.-A. Loizeau -----
9// -------------------------------------------------------------------------
10
11#include "CbmMcbm2018PsdPar.h"
12
13#include "FairDetParIo.h"
14#include "FairParIo.h"
15#include "FairParamList.h"
16#include <Logger.h>
17
18#include "TString.h"
19
20// ----- Standard constructor ------------------------------------------
21CbmMcbm2018PsdPar::CbmMcbm2018PsdPar(const char* name, const char* title, const char* context)
22 : FairParGenericSet(name, title, context)
23 , fiDataVersion(-1)
24 , fiNrOfGdpb(-1)
25 , fiGdpbIdArray()
26 , fiNrOfFeesPerGdpb(-1)
27 , fiNrOfChannelsPerFee(-1)
28 , fiNrOfGbtx(-1)
29 , fiNrOfModules(-1)
30 , fiModuleId()
31 , fiNrOfSections(-1)
32 , fdMipCalibration()
33 , fiNbMsTot(0)
34 , fiNbMsOverlap(0)
35 , fdSizeMsInNs(0.0)
36 , fdTsDeadtimePeriod(0.0)
37{
38 detName = "Psd";
39}
40// -------------------------------------------------------------------------
41
42
43// ----- Destructor ----------------------------------------------------
45// -------------------------------------------------------------------------
46
47
48// ----- Public method clear -------------------------------------------
50{
51 status = kFALSE;
52 resetInputVersions();
53}
54// -------------------------------------------------------------------------
55
56// -------------------------------------------------------------------------
57
58void CbmMcbm2018PsdPar::putParams(FairParamList* l)
59{
60 if (!l) return;
61 l->add("DataVersion", fiDataVersion);
62 l->add("NrOfGdpbs", fiNrOfGdpb);
63 l->add("GdpbIdArray", fiGdpbIdArray);
64 l->add("NrOfFeesPerGdpb", fiNrOfFeesPerGdpb);
65 l->add("NrOfChannelsPerFee", fiNrOfChannelsPerFee);
66 l->add("NrOfGbtx", fiNrOfGbtx);
67 l->add("NrOfModules", fiNrOfModules);
68 l->add("NrOfSections", fiNrOfSections);
69 l->add("MipCalibration", fdMipCalibration);
70 l->add("ModuleId", fiModuleId);
71 l->add("NbMsTot", fiNbMsTot);
72 l->add("NbMsOverlap", fiNbMsOverlap);
73 l->add("SizeMsInNs", fdSizeMsInNs);
74 l->add("TsDeadtimePeriod", fdTsDeadtimePeriod);
75}
76
77//------------------------------------------------------
78
79Bool_t CbmMcbm2018PsdPar::getParams(FairParamList* l)
80{
81
82 if (!l) return kFALSE;
83
84 if (!l->fill("DataVersion", &fiDataVersion)) return kFALSE;
85
86 if (!l->fill("NrOfGdpbs", &fiNrOfGdpb)) return kFALSE;
87
89 if (!l->fill("GdpbIdArray", &fiGdpbIdArray)) return kFALSE;
90
91 if (!l->fill("NrOfFeesPerGdpb", &fiNrOfFeesPerGdpb)) return kFALSE;
92
93 if (!l->fill("NrOfChannelsPerFee", &fiNrOfChannelsPerFee)) return kFALSE;
94
95 if (!l->fill("NrOfGbtx", &fiNrOfGbtx)) return kFALSE;
96
97 if (!l->fill("NrOfModules", &fiNrOfModules)) return kFALSE;
98
99 if (!l->fill("NrOfSections", &fiNrOfSections)) return kFALSE;
100
102 if (!l->fill("MipCalibration", &fdMipCalibration)) return kFALSE;
103
105 if (!l->fill("ModuleId", &fiModuleId)) return kFALSE;
106
107 if (!l->fill("NbMsTot", &fiNbMsTot)) return kFALSE;
108 if (!l->fill("NbMsOverlap", &fiNbMsOverlap)) return kFALSE;
109 if (!l->fill("SizeMsInNs", &fdSizeMsInNs)) return kFALSE;
110
111 if (!l->fill("TsDeadtimePeriod", &fdTsDeadtimePeriod)) return kFALSE;
112
113 return kTRUE;
114}
115// -------------------------------------------------------------------------
116Int_t CbmMcbm2018PsdPar::FeeChanToGbtChan(UInt_t uChannelInFee)
117{
118 if (uChannelInFee < kuNbChannelsPerFee) return kuFeeToGbt[uChannelInFee];
119 else {
120 LOG(fatal) << "CbmMcbm2018PsdPar::FeeChanToGbtChan => Index out of bound, " << uChannelInFee << " vs "
121 << static_cast<uint32_t>(kuNbChannelsPerFee) << ", returning crazy value!";
122 return -1;
123 } // else of if( uChannelInFee < kuNbChannelsPerFee )
124}
125
126// -------------------------------------------------------------------------
127
128
ClassImp(CbmConverterManager)
Bool_t getParams(FairParamList *)
CbmMcbm2018PsdPar(const char *name="CbmMcbm2018PsdPar", const char *title="Psd unpacker parameters", const char *context="Default")
const UInt_t kuFeeToGbt[kuNbChannelsPerFee]
Mapping.
void putParams(FairParamList *)
Int_t FeeChanToGbtChan(UInt_t uChannelInFee)
static const uint32_t kuNbChannelsPerFee
Readout chain.
Int_t fiDataVersion
Map from Psd channel to Gbt channel.