CbmRoot
CbmMcbm2018UnpackerAlgoHodo.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018UnpackerAlgoHodo -----
4 // ----- Created 31/07/19 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmMcbm2018UnpackerAlgoHodo_H
9 #define CbmMcbm2018UnpackerAlgoHodo_H
10 
11 #include "CbmStar2019Algo.h"
12 
13 // Data
14 #include "CbmStsDigi.h"
15 #include "StsXyterFinalHit.h"
16 #include "StsXyterMessage.h"
17 
18 // CbmRoot
19 
20 // C++11
21 #include <chrono>
22 
23 // C/C++
24 #include <map>
25 #include <vector>
26 
27 class CbmMcbm2018HodoPar;
28 /*
29 class TCanvas;
30 class THttpServer;
31 */
32 class TH1;
33 class TH2;
34 class TProfile;
35 
36 class CbmMcbm2018UnpackerAlgoHodo : public CbmStar2019Algo<CbmStsDigi> {
37 public:
40 
41  virtual Bool_t Init();
42  virtual void Reset();
43  virtual void Finish();
44 
45  Bool_t InitContainers();
46  Bool_t ReInitContainers();
47  TList* GetParList();
48 
49  Bool_t InitParameters();
50 
51  Bool_t ProcessTs(const fles::Timeslice& ts);
52  Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) {
53  return ProcessTs(ts);
54  }
55  Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
56 
57  void AddMsComponentToList(size_t component, UShort_t usDetectorId);
58 
59  Bool_t CreateHistograms();
60  Bool_t FillHistograms();
61  Bool_t ResetHistograms();
62 
63  inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) {
64  fbMonitorMode = bFlagIn;
65  }
66  inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) {
67  fdTimeOffsetNs = dOffsetIn;
68  }
69  void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn = 0.0);
70 
71  inline void SetVectCapInc(Double_t dIncFact) {
72  fdCapacityIncFactor = dIncFact;
73  }
74 
75 private:
77  Bool_t
79  Bool_t
81  std::vector<Bool_t> fvbMaskedComponents;
82 
85  UInt_t fuNbModules;
87  std::vector<Int_t>
89  UInt_t fuNrOfDpbs;
90  std::map<UInt_t, UInt_t>
92  std::vector<std::vector<Bool_t>>
94  UInt_t fuNbFebs;
95  UInt_t fuNbStsXyters;
96  std::vector<std::vector<std::vector<Int_t>>>
98  std::vector<std::vector<std::vector<Double_t>>>
100  std::vector<std::vector<std::vector<Double_t>>>
102  std::vector<Int_t>
104  std::vector<Int_t>
106 
108  Double_t fdTimeOffsetNs;
109  std::vector<Double_t> fvdTimeOffsetNsAsics;
110 
112  static const Int_t kiMaxNbFlibLinks = 32;
113 
116  ULong64_t fulCurrentTsIdx;
117  ULong64_t fulCurrentMsIdx;
118  Double_t
120  Double_t
122  Double_t
124  UInt_t fuMsIndex;
125  std::map<stsxyter::MessType, UInt_t> fmMsgCounter;
127  UInt_t
129  UInt_t
131  UInt_t
133  Int_t
136  std::vector<ULong64_t> fvulCurrentTsMsb;
138  std::vector<UInt_t> fvuCurrentTsMsbCycle;
139  Double_t
142  Double_t
144  std::chrono::steady_clock::time_point
147  std::vector<stsxyter::FinalHit>
150 
153  /*
154  std::vector< TH1* > fvhHitsTimeToTriggerRaw; //! [sector]
155  std::vector< TH1* > fvhMessDistributionInMs; //! [sector], extra monitor for debug
156  TH1 * fhEventNbPerTs; //!
157  TCanvas * fcTimeToTrigRaw; //! All sectors
158 */
159  TH1* fhVectorSize = nullptr;
160  TH1* fhVectorCapacity = nullptr;
161  size_t fuTsMaxVectorSize = 0;
162  Double_t fdCapacityIncFactor = 1.1;
163 
164  void ProcessHitInfo(const stsxyter::Message& mess,
165  const UShort_t& usElinkIdx,
166  const UInt_t& uAsicIdx,
167  const UInt_t& uMsIdx);
168  void ProcessTsMsbInfo(const stsxyter::Message& mess,
169  UInt_t uMessIdx = 0,
170  UInt_t uMsIdx = 0);
171  void ProcessEpochInfo(const stsxyter::Message& mess);
172  void ProcessStatusInfo(const stsxyter::Message& mess);
173 
176 
177  ClassDef(CbmMcbm2018UnpackerAlgoHodo, 1)
178 };
179 
180 #endif // CbmMcbm2018UnpackerAlgoHodo_H
CbmMcbm2018UnpackerAlgoHodo::fdCapacityIncFactor
Double_t fdCapacityIncFactor
Definition: CbmMcbm2018UnpackerAlgoHodo.h:162
CbmMcbm2018UnpackerAlgoHodo::InitParameters
Bool_t InitParameters()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:126
CbmMcbm2018UnpackerAlgoHodo::fdTimeOffsetNs
Double_t fdTimeOffsetNs
Module for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
Definition: CbmMcbm2018UnpackerAlgoHodo.h:108
CbmMcbm2018UnpackerAlgoHodo::fhVectorSize
TH1 * fhVectorSize
Definition: CbmMcbm2018UnpackerAlgoHodo.h:159
CbmMcbm2018UnpackerAlgoHodo::fdTsStopTimeCore
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:121
CbmMcbm2018UnpackerAlgoHodo::fDpbIdIndexMap
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:91
CbmMcbm2018UnpackerAlgoHodo::fvdTimeOffsetNsAsics
std::vector< Double_t > fvdTimeOffsetNsAsics
Definition: CbmMcbm2018UnpackerAlgoHodo.h:109
CbmMcbm2018UnpackerAlgoHodo::fviFebModuleIdx
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx
Number of StsXyter ASICs.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:97
CbmMcbm2018UnpackerAlgoHodo::fviFebAddress
std::vector< Int_t > fviFebAddress
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018UnpackerAlgoHodo.h:103
CbmMcbm2018UnpackerAlgoHodo::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmMcbm2018UnpackerAlgoHodo.h:116
CbmMcbm2018UnpackerAlgoHodo::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Definition: CbmMcbm2018UnpackerAlgoHodo.h:126
CbmMcbm2018UnpackerAlgoHodo::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmMcbm2018UnpackerAlgoHodo.h:143
CbmMcbm2018UnpackerAlgoHodo::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:130
stsxyter::Message
Definition: StsXyterMessage.h:165
CbmMcbm2018UnpackerAlgoHodo::fvbCrobActiveFlag
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:93
CbmMcbm2018UnpackerAlgoHodo::ftStartTimeUnix
std::chrono::steady_clock::time_point ftStartTimeUnix
Definition: CbmMcbm2018UnpackerAlgoHodo.h:145
CbmMcbm2018UnpackerAlgoHodo::SetTimeOffsetNs
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
Definition: CbmMcbm2018UnpackerAlgoHodo.h:66
CbmMcbm2018UnpackerAlgoHodo::fvbMaskedComponents
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:81
CbmMcbm2018UnpackerAlgoHodo::ProcessEpochInfo
void ProcessEpochInfo(const stsxyter::Message &mess)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:692
CbmMcbm2018UnpackerAlgoHodo::FillHistograms
Bool_t FillHistograms()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:993
CbmMcbm2018UnpackerAlgoHodo::fvuCurrentTsMsbCycle
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:138
CbmMcbm2018UnpackerAlgoHodo::Finish
virtual void Finish()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:94
CbmMcbm2018UnpackerAlgoHodo::fviModAddress
std::vector< Int_t > fviModAddress
Total number of STS modules in the setup.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:88
CbmMcbm2018UnpackerAlgoHodo::SetMonitorMode
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
Definition: CbmMcbm2018UnpackerAlgoHodo.h:63
CbmMcbm2018UnpackerAlgoHodo::SetVectCapInc
void SetVectCapInc(Double_t dIncFact)
Definition: CbmMcbm2018UnpackerAlgoHodo.h:71
CbmMcbm2018UnpackerAlgoHodo::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
Definition: CbmMcbm2018UnpackerAlgoHodo.h:52
CbmMcbm2018UnpackerAlgoHodo
Definition: CbmMcbm2018UnpackerAlgoHodo.h:36
CbmMcbm2018UnpackerAlgoHodo::ProcessTsMsbInfo
void ProcessTsMsbInfo(const stsxyter::Message &mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:629
CbmMcbm2018UnpackerAlgoHodo::Reset
virtual void Reset()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:93
CbmStsDigi.h
CbmMcbm2018UnpackerAlgoHodo::fvdFebAdcOffs
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018UnpackerAlgoHodo.h:101
CbmStar2019Algo.h
CbmMcbm2018UnpackerAlgoHodo::fvulCurrentTsMsb
std::vector< ULong64_t > fvulCurrentTsMsb
Definition: CbmMcbm2018UnpackerAlgoHodo.h:137
CbmMcbm2018UnpackerAlgoHodo::ResetHistograms
Bool_t ResetHistograms()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:999
CbmMcbm2018UnpackerAlgoHodo::fuNbFebs
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
Definition: CbmMcbm2018UnpackerAlgoHodo.h:94
CbmStar2019Algo
Definition: CbmStar2019Algo.h:43
CbmMcbm2018UnpackerAlgoHodo::fiRunStartDateTimeSec
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:134
CbmMcbm2018UnpackerAlgoHodo::fuTsMaxVectorSize
size_t fuTsMaxVectorSize
Definition: CbmMcbm2018UnpackerAlgoHodo.h:161
CbmMcbm2018UnpackerAlgoHodo::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
Constants.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:112
CbmMcbm2018UnpackerAlgoHodo::GetParList
TList * GetParList()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:119
CbmMcbm2018UnpackerAlgoHodo::fiBinSizeDatePlots
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:135
StsXyterMessage.h
CbmMcbm2018UnpackerAlgoHodo::fuMsIndex
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:124
CbmMcbm2018UnpackerAlgoHodo::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:107
CbmMcbm2018UnpackerAlgoHodo::fuNbStsXyters
UInt_t fuNbStsXyters
Number of FEBs with StsXyter ASICs.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:95
CbmMcbm2018UnpackerAlgoHodo::CreateHistograms
Bool_t CreateHistograms()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:732
CbmMcbm2018UnpackerAlgoHodo::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:132
CbmMcbm2018UnpackerAlgoHodo::ProcessStatusInfo
void ProcessStatusInfo(const stsxyter::Message &mess)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:707
CbmMcbm2018UnpackerAlgoHodo::fvmHitsInMs
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:149
CbmMcbm2018UnpackerAlgoHodo::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:273
CbmMcbm2018UnpackerAlgoHodo::fhDigisTimeInRun
TH1 * fhDigisTimeInRun
All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:152
CbmMcbm2018UnpackerAlgoHodo::AddMsComponentToList
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:258
CbmMcbm2018UnpackerAlgoHodo::fbDebugMonitorMode
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:80
CbmMcbm2018UnpackerAlgoHodo::SetTimeOffsetNsAsic
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:1036
CbmMcbm2018UnpackerAlgoHodo::fdTsStartTime
Double_t fdTsStartTime
Definition: CbmMcbm2018UnpackerAlgoHodo.h:119
CbmMcbm2018UnpackerAlgoHodo::fdStartTime
Double_t fdStartTime
Definition: CbmMcbm2018UnpackerAlgoHodo.h:141
CbmMcbm2018UnpackerAlgoHodo::fdMsTime
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:123
StsXyterFinalHit.h
CbmMcbm2018UnpackerAlgoHodo::fbMonitorMode
Bool_t fbMonitorMode
Control flags.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:78
CbmMcbm2018UnpackerAlgoHodo::CbmMcbm2018UnpackerAlgoHodo
CbmMcbm2018UnpackerAlgoHodo()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:29
CbmMcbm2018UnpackerAlgoHodo::fviFebModule
std::vector< Int_t > fviFebModule
STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
Definition: CbmMcbm2018UnpackerAlgoHodo.h:105
CbmMcbm2018UnpackerAlgoHodo::CbmMcbm2018UnpackerAlgoHodo
CbmMcbm2018UnpackerAlgoHodo(const CbmMcbm2018UnpackerAlgoHodo &)
CbmMcbm2018UnpackerAlgoHodo::fuNbModules
UInt_t fuNbModules
Definition: CbmMcbm2018UnpackerAlgoHodo.h:86
CbmMcbm2018UnpackerAlgoHodo::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018UnpackerAlgoHodo.h:117
CbmMcbm2018UnpackerAlgoHodo::fvdFebAdcGain
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:99
CbmMcbm2018UnpackerAlgoHodo::fhVectorCapacity
TH1 * fhVectorCapacity
Definition: CbmMcbm2018UnpackerAlgoHodo.h:160
CbmMcbm2018UnpackerAlgoHodo::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:101
CbmMcbm2018UnpackerAlgoHodo::~CbmMcbm2018UnpackerAlgoHodo
~CbmMcbm2018UnpackerAlgoHodo()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:76
CbmMcbm2018UnpackerAlgoHodo::operator=
CbmMcbm2018UnpackerAlgoHodo operator=(const CbmMcbm2018UnpackerAlgoHodo &)
CbmMcbm2018HodoPar
Definition: CbmMcbm2018HodoPar.h:18
CbmMcbm2018UnpackerAlgoHodo::Init
virtual Bool_t Init()
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:88
CbmMcbm2018UnpackerAlgoHodo::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018UnpackerAlgoHodo.h:128
CbmMcbm2018UnpackerAlgoHodo::ProcessMs
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:375
CbmMcbm2018UnpackerAlgoHodo::fUnpackPar
CbmMcbm2018HodoPar * fUnpackPar
Settings from parameter file.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:84
CbmMcbm2018UnpackerAlgoHodo::ProcessHitInfo
void ProcessHitInfo(const stsxyter::Message &mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Definition: CbmMcbm2018UnpackerAlgoHodo.cxx:542
CbmMcbm2018UnpackerAlgoHodo::fuNrOfDpbs
UInt_t fuNrOfDpbs
STS address for the first strip of each module.
Definition: CbmMcbm2018UnpackerAlgoHodo.h:89