CbmRoot
CbmMcbm2018RichPar.h
Go to the documentation of this file.
1 #ifndef CbmMcbm2018RichPar_H
2 #define CbmMcbm2018RichPar_H
3 
4 #include "FairParGenericSet.h" // mother class
5 
6 // STD
7 #include <map>
8 
9 // ROOT
10 #include <TArrayD.h>
11 #include <TArrayI.h>
12 
13 class CbmMcbm2018RichPar : public FairParGenericSet {
14 public:
15  CbmMcbm2018RichPar(const char* name = "CbmMcbm2018RichPar",
16  const char* title = "RICH unpacker parameters",
17  const char* context = "Default");
18 
19  virtual ~CbmMcbm2018RichPar();
20 
21  virtual void putParams(FairParamList*);
22 
23  virtual Bool_t getParams(FairParamList*);
24 
25 public:
26  Int_t GetNaddresses(void) const { return fTRBaddresses.GetSize(); }
27 
28  Int_t GetAddressIdx(Int_t addr) const;
29 
30  Int_t GetAddress(Int_t ind) const;
31 
36  Double_t GetToTshift(Int_t tdc, Int_t ch) const {
37  Int_t tdcIdx = this->GetAddressIdx(tdc);
38  return this->GetToTshift2(tdcIdx, ch);
39  }
40 
45  Double_t GetToTshift2(Int_t tdcIdx, Int_t ch) const {
46  return fToTshiftMap.at(tdcIdx * 33 + ch);
47  }
48 
49 private: // Stored in the par file
54  TArrayI fTRBaddresses;
55 
64  TArrayD fToTshifts;
65 
66 private: // Recalculated
70  std::map<Int_t, Int_t> fTRBaddrMap;
71 
75  std::map<Int_t, Double_t> fToTshiftMap;
76 
78 };
79 
80 #endif // CbmMcbm2018RichPar_H
CbmMcbm2018RichPar::GetToTshift
Double_t GetToTshift(Int_t tdc, Int_t ch) const
Definition: CbmMcbm2018RichPar.h:36
CbmMcbm2018RichPar::GetAddress
Int_t GetAddress(Int_t ind) const
Definition: CbmMcbm2018RichPar.cxx:71
CbmMcbm2018RichPar::~CbmMcbm2018RichPar
virtual ~CbmMcbm2018RichPar()
Definition: CbmMcbm2018RichPar.cxx:26
CbmMcbm2018RichPar::CbmMcbm2018RichPar
CbmMcbm2018RichPar(const char *name="CbmMcbm2018RichPar", const char *title="RICH unpacker parameters", const char *context="Default")
Definition: CbmMcbm2018RichPar.cxx:19
CbmMcbm2018RichPar::GetNaddresses
Int_t GetNaddresses(void) const
Definition: CbmMcbm2018RichPar.h:26
CbmMcbm2018RichPar
Definition: CbmMcbm2018RichPar.h:13
CbmMcbm2018RichPar::getParams
virtual Bool_t getParams(FairParamList *)
Definition: CbmMcbm2018RichPar.cxx:35
CbmMcbm2018RichPar::GetAddressIdx
Int_t GetAddressIdx(Int_t addr) const
Definition: CbmMcbm2018RichPar.cxx:58
CbmMcbm2018RichPar::putParams
virtual void putParams(FairParamList *)
Definition: CbmMcbm2018RichPar.cxx:28
CbmMcbm2018RichPar::fTRBaddresses
TArrayI fTRBaddresses
Definition: CbmMcbm2018RichPar.h:54
CbmMcbm2018RichPar::fTRBaddrMap
std::map< Int_t, Int_t > fTRBaddrMap
Definition: CbmMcbm2018RichPar.h:70
CbmMcbm2018RichPar::GetToTshift2
Double_t GetToTshift2(Int_t tdcIdx, Int_t ch) const
Definition: CbmMcbm2018RichPar.h:45
CbmMcbm2018RichPar::fToTshiftMap
std::map< Int_t, Double_t > fToTshiftMap
Definition: CbmMcbm2018RichPar.h:75
CbmMcbm2018RichPar::fToTshifts
TArrayD fToTshifts
Definition: CbmMcbm2018RichPar.h:64
CbmMcbm2018RichPar::ClassDef
ClassDef(CbmMcbm2018RichPar, 1)