CbmRoot
CbmMcbm2018PsdPar.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMcbm2018PsdPar header file -----
3 // ----- Created 26.09.2019 by N.Karpushkin -----
4 // ----- based on CbmMcbm2018TofPar by P.-A. Loizeau -----
5 // -------------------------------------------------------------------------
6 
7 #include "CbmMcbm2018PsdPar.h"
8 
9 #include "FairDetParIo.h"
10 #include "FairLogger.h"
11 #include "FairParIo.h"
12 #include "FairParamList.h"
13 
14 #include "TString.h"
15 
16 // ----- Standard constructor ------------------------------------------
18  const char* title,
19  const char* context)
20  : FairParGenericSet(name, title, context)
21  , fiMonitorMode(-1)
22  , fiDebugMonitorMode(-1)
23  , fiNrOfGdpb(-1)
24  , fiGdpbIdArray()
25  , fiNrOfFeesPerGdpb(-1)
26  , fiNrOfChannelsPerFee(-1)
27  , fiNrOfGbtx(-1)
28  , fiNrOfModules(-1)
29  , fiModuleId()
30  , fiNbMsTot(0)
31  , fiNbMsOverlap(0)
32  , fdSizeMsInNs(0.0)
33  , fdTsDeadtimePeriod(0.0) {
34  detName = "Psd";
35 }
36 // -------------------------------------------------------------------------
37 
38 
39 // ----- Destructor ----------------------------------------------------
41 // -------------------------------------------------------------------------
42 
43 
44 // ----- Public method clear -------------------------------------------
46  status = kFALSE;
47  resetInputVersions();
48 }
49 // -------------------------------------------------------------------------
50 
51 // -------------------------------------------------------------------------
52 
53 void CbmMcbm2018PsdPar::putParams(FairParamList* l) {
54  if (!l) return;
55  l->add("NrOfGdpbs", fiNrOfGdpb);
56  l->add("GdpbIdArray", fiGdpbIdArray);
57  l->add("NrOfFeesPerGdpb", fiNrOfFeesPerGdpb);
58  l->add("NrOfChannelsPerFee", fiNrOfChannelsPerFee);
59  l->add("NrOfGbtx", fiNrOfGbtx);
60  l->add("NrOfModules", fiNrOfModules);
61  l->add("ModuleId", fiModuleId);
62  l->add("NbMsTot", fiNbMsTot);
63  l->add("NbMsOverlap", fiNbMsOverlap);
64  l->add("SizeMsInNs", fdSizeMsInNs);
65  l->add("TsDeadtimePeriod", fdTsDeadtimePeriod);
66 }
67 
68 //------------------------------------------------------
69 
70 Bool_t CbmMcbm2018PsdPar::getParams(FairParamList* l) {
71 
72  if (!l) return kFALSE;
73 
74  if (!l->fill("NrOfGdpbs", &fiNrOfGdpb)) return kFALSE;
75 
77  if (!l->fill("GdpbIdArray", &fiGdpbIdArray)) return kFALSE;
78 
79  if (!l->fill("NrOfFeesPerGdpb", &fiNrOfFeesPerGdpb)) return kFALSE;
80 
81  if (!l->fill("NrOfChannelsPerFee", &fiNrOfChannelsPerFee)) return kFALSE;
82 
83  if (!l->fill("NrOfGbtx", &fiNrOfGbtx)) return kFALSE;
84 
85  if (!l->fill("NrOfModules", &fiNrOfModules)) return kFALSE;
86 
88  if (!l->fill("ModuleId", &fiModuleId)) return kFALSE;
89 
90  if (!l->fill("NbMsTot", &fiNbMsTot)) return kFALSE;
91  if (!l->fill("NbMsOverlap", &fiNbMsOverlap)) return kFALSE;
92  if (!l->fill("SizeMsInNs", &fdSizeMsInNs)) return kFALSE;
93 
94  if (!l->fill("TsDeadtimePeriod", &fdTsDeadtimePeriod)) return kFALSE;
95 
96  return kTRUE;
97 }
98 // -------------------------------------------------------------------------
99 Int_t CbmMcbm2018PsdPar::FeeChanToGbtChan(UInt_t uChannelInFee) {
100  if (uChannelInFee < kuNbChannelsPerFee)
101  return kuFeeToGbt[uChannelInFee];
102  else {
103  LOG(fatal) << "CbmMcbm2018PsdPar::FeeChanToGbtChan => Index out of bound, "
104  << uChannelInFee << " vs "
105  << static_cast<const uint32_t>(kuNbChannelsPerFee)
106  << ", returning crazy value!";
107  return -1;
108  } // else of if( uChannelInFee < kuNbChannelsPerFee )
109 }
110 
111 // -------------------------------------------------------------------------
112 
113 
CbmMcbm2018PsdPar::fiNrOfGbtx
Int_t fiNrOfGbtx
Definition: CbmMcbm2018PsdPar.h:104
CbmMcbm2018PsdPar.h
CbmMcbm2018PsdPar::fiNbMsOverlap
Int_t fiNbMsOverlap
Definition: CbmMcbm2018PsdPar.h:110
CbmMcbm2018PsdPar::kuFeeToGbt
const UInt_t kuFeeToGbt[kuNbChannelsPerFee]
Mapping.
Definition: CbmMcbm2018PsdPar.h:91
CbmMcbm2018PsdPar::fiNrOfModules
Int_t fiNrOfModules
Definition: CbmMcbm2018PsdPar.h:105
CbmMcbm2018PsdPar::~CbmMcbm2018PsdPar
virtual ~CbmMcbm2018PsdPar()
Definition: CbmMcbm2018PsdPar.cxx:40
CbmMcbm2018PsdPar::kuNbChannelsPerFee
static const uint32_t kuNbChannelsPerFee
Readout chain.
Definition: CbmMcbm2018PsdPar.h:82
CbmMcbm2018PsdPar::fdSizeMsInNs
Double_t fdSizeMsInNs
Definition: CbmMcbm2018PsdPar.h:112
CbmMcbm2018PsdPar::clear
virtual void clear()
Definition: CbmMcbm2018PsdPar.cxx:45
CbmMcbm2018PsdPar::fiNrOfGdpb
Int_t fiNrOfGdpb
Definition: CbmMcbm2018PsdPar.h:98
CbmMcbm2018PsdPar::putParams
void putParams(FairParamList *)
Definition: CbmMcbm2018PsdPar.cxx:53
CbmMcbm2018PsdPar::fiNbMsTot
Int_t fiNbMsTot
Definition: CbmMcbm2018PsdPar.h:109
CbmMcbm2018PsdPar
Definition: CbmMcbm2018PsdPar.h:19
CbmMcbm2018PsdPar::fdTsDeadtimePeriod
Double_t fdTsDeadtimePeriod
Definition: CbmMcbm2018PsdPar.h:115
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018PsdPar::FeeChanToGbtChan
Int_t FeeChanToGbtChan(UInt_t uChannelInFee)
Definition: CbmMcbm2018PsdPar.cxx:99
CbmMcbm2018PsdPar::fiNrOfChannelsPerFee
Int_t fiNrOfChannelsPerFee
Definition: CbmMcbm2018PsdPar.h:102
CbmMcbm2018PsdPar::fiGdpbIdArray
TArrayI fiGdpbIdArray
Definition: CbmMcbm2018PsdPar.h:99
CbmMcbm2018PsdPar::fiModuleId
TArrayI fiModuleId
Definition: CbmMcbm2018PsdPar.h:107
CbmMcbm2018PsdPar::CbmMcbm2018PsdPar
CbmMcbm2018PsdPar(const char *name="CbmMcbm2018PsdPar", const char *title="Psd unpacker parameters", const char *context="Default")
Definition: CbmMcbm2018PsdPar.cxx:17
CbmMcbm2018PsdPar::getParams
Bool_t getParams(FairParamList *)
Definition: CbmMcbm2018PsdPar.cxx:70
CbmMcbm2018PsdPar::fiNrOfFeesPerGdpb
Int_t fiNrOfFeesPerGdpb
Definition: CbmMcbm2018PsdPar.h:101