CbmRoot
CbmMcbm2018UnpackerAlgoMuch.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018UnpackerAlgoMuch -----
4 // ----- Created 02.02.2019 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmMcbm2018UnpackerAlgoMuch_H
9 #define CbmMcbm2018UnpackerAlgoMuch_H
10 
11 #include "CbmStar2019Algo.h"
12 
13 // Data
14 #include "CbmMuchBeamTimeDigi.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 CbmMcbm2018MuchPar;
28 /*
29 class TCanvas;
30 class THttpServer;
31 */
32 class TH1;
33 class TH2;
34 class TProfile;
35 
37  public CbmStar2019Algo<CbmMuchBeamTimeDigi> {
38 public:
41 
42  virtual Bool_t Init();
43  virtual void Reset();
44  virtual void Finish();
45 
46  Bool_t InitContainers();
47  Bool_t ReInitContainers();
48  TList* GetParList();
49 
50  Bool_t InitParameters();
51 
52  Bool_t ProcessTs(const fles::Timeslice& ts);
53  Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) {
54  return ProcessTs(ts);
55  }
56  Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
57 
58  void AddMsComponentToList(size_t component, UShort_t usDetectorId);
59 
60  Bool_t CreateHistograms();
61  Bool_t FillHistograms();
62  Bool_t ResetHistograms();
63 
64  inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) {
65  fbMonitorMode = bFlagIn;
66  }
67  inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) {
68  fdTimeOffsetNs = dOffsetIn;
69  }
70  void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn = 0.0);
71  void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked = kTRUE);
72  void EnableAsicType(Int_t flag = 0) { fiFlag = flag; }
73 
75  void SetBinningFwFlag(Bool_t bEnable = kTRUE) { fbBinningFw = bEnable; }
76 
77  inline void SetVectCapInc(Double_t dIncFact) {
78  fdCapacityIncFactor = dIncFact;
79  }
80 
81  void SetAdcCut(UInt_t uAdc) { fdAdcCut = uAdc; }
82 
83 
85 
86 
87 private:
89  Bool_t
91  Bool_t
93  std::vector<Bool_t> fvbMaskedComponents;
95  Bool_t fbBinningFw = kFALSE;
96 
97  Int_t
99 
102  UInt_t fuNrOfDpbs;
104  std::map<UInt_t, UInt_t>
106  std::vector<std::vector<Bool_t>>
108  UInt_t fuNbFebs;
109  UInt_t fuNbStsXyters;
110 
112  Double_t fdTimeOffsetNs;
113  std::vector<Double_t> fvdTimeOffsetNsAsics;
114  //std::vector< Int_t > fviFebAddress; //! Much address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ]
115 
117  std::vector<std::vector<bool>>
119  UInt_t fdAdcCut;
121  static const Int_t kiMaxNbFlibLinks = 32;
122 
125  ULong64_t fulCurrentTsIdx;
126  ULong64_t fulCurrentMsIdx;
127  Double_t
129  Double_t
131  Double_t
133  UInt_t fuMsIndex;
134  std::map<stsxyter::MessType, UInt_t> fmMsgCounter;
136  UInt_t
138  UInt_t
140  UInt_t
142  Int_t
145  std::vector<ULong64_t> fvulCurrentTsMsb;
147  std::vector<UInt_t> fvuCurrentTsMsbCycle;
148  Double_t
151  Double_t
153  std::chrono::steady_clock::time_point
156  std::vector<stsxyter::FinalHit>
159 
161  static const UInt_t kuMaxTsMsbDiffDuplicates =
162  32;
163  std::vector<std::vector<UShort_t>>
165  std::vector<std::vector<UShort_t>>
167  std::vector<std::vector<UShort_t>>
169  std::vector<std::vector<UShort_t>>
171 
174  /*
175  std::vector< TH1* > fvhHitsTimeToTriggerRaw; //! [sector]
176  std::vector< TH1* > fvhMessDistributionInMs; //! [sector], extra monitor for debug
177  TH1 * fhEventNbPerTs; //!
178  TCanvas * fcTimeToTrigRaw; //! All sectors
179 */
180  TH1* fhVectorSize = nullptr;
181  TH1* fhVectorCapacity = nullptr;
182  size_t fuTsMaxVectorSize = 0;
183  Double_t fdCapacityIncFactor = 1.1;
184 
185  void ProcessHitInfo(const stsxyter::Message& mess,
186  const UShort_t& usElinkIdx,
187  const UInt_t& uAsicIdx,
188  const UInt_t& uMsIdx);
189  void ProcessTsMsbInfo(const stsxyter::Message& mess,
190  UInt_t uMessIdx = 0,
191  UInt_t uMsIdx = 0);
192  void ProcessEpochInfo(const stsxyter::Message& mess);
193  void ProcessStatusInfo(const stsxyter::Message& mess, const UInt_t& uAsicIdx);
194 
197 
198  ClassDef(CbmMcbm2018UnpackerAlgoMuch, 1)
199 };
200 
201 #endif
CbmMcbm2018UnpackerAlgoMuch::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Definition: CbmMcbm2018UnpackerAlgoMuch.h:135
CbmMcbm2018UnpackerAlgoMuch::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmMcbm2018UnpackerAlgoMuch.h:152
CbmMcbm2018UnpackerAlgoMuch::MaskNoisyChannel
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:1258
CbmMcbm2018UnpackerAlgoMuch::fdAdcCut
UInt_t fdAdcCut
Vector of channel masks, [ NbFeb ][ NbCHanInFeb ], used only if fbUseChannelMask is true.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:119
CbmMcbm2018UnpackerAlgoMuch::CreateHistograms
Bool_t CreateHistograms()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:944
CbmMcbm2018UnpackerAlgoMuch::ProcessHitInfo
void ProcessHitInfo(const stsxyter::Message &mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:673
CbmMcbm2018UnpackerAlgoMuch::fbBinningFw
Bool_t fbBinningFw
=> Quick and dirty hack for binning FW!!!
Definition: CbmMcbm2018UnpackerAlgoMuch.h:95
stsxyter::Message
Definition: StsXyterMessage.h:165
CbmMcbm2018UnpackerAlgoMuch::fdTsStartTime
Double_t fdTsStartTime
Definition: CbmMcbm2018UnpackerAlgoMuch.h:128
CbmMuchBeamTimeDigi
Definition: CbmMuchBeamTimeDigi.h:29
CbmMcbm2018UnpackerAlgoMuch::fvulCurrentTsMsb
std::vector< ULong64_t > fvulCurrentTsMsb
Definition: CbmMcbm2018UnpackerAlgoMuch.h:146
CbmMcbm2018UnpackerAlgoMuch::EnableAsicType
void EnableAsicType(Int_t flag=0)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:72
CbmMcbm2018UnpackerAlgoMuch::InitParameters
Bool_t InitParameters()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:133
CbmMcbm2018UnpackerAlgoMuch::fbMonitorMode
Bool_t fbMonitorMode
Control flags.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:90
CbmMcbm2018UnpackerAlgoMuch::kuMaxTsMsbDiffDuplicates
static const UInt_t kuMaxTsMsbDiffDuplicates
All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:161
CbmMcbm2018UnpackerAlgoMuch::fvvusLastTsMsbCycleChan
std::vector< std::vector< UShort_t > > fvvusLastTsMsbCycleChan
TS MSB of last hit message for each channel, [ AsicIdx ][ Chan ].
Definition: CbmMcbm2018UnpackerAlgoMuch.h:170
CbmMcbm2018UnpackerAlgoMuch::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:242
CbmMcbm2018UnpackerAlgoMuch::operator=
CbmMcbm2018UnpackerAlgoMuch operator=(const CbmMcbm2018UnpackerAlgoMuch &)
CbmMcbm2018UnpackerAlgoMuch::fbDebugMonitorMode
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:92
CbmMcbm2018UnpackerAlgoMuch::SetVectCapInc
void SetVectCapInc(Double_t dIncFact)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:77
CbmMcbm2018UnpackerAlgoMuch::Finish
virtual void Finish()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:101
CbmMcbm2018UnpackerAlgoMuch::ftStartTimeUnix
std::chrono::steady_clock::time_point ftStartTimeUnix
Definition: CbmMcbm2018UnpackerAlgoMuch.h:154
CbmMcbm2018UnpackerAlgoMuch::fhVectorSize
TH1 * fhVectorSize
Definition: CbmMcbm2018UnpackerAlgoMuch.h:180
CbmMcbm2018UnpackerAlgoMuch::GetParList
TList * GetParList()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:126
CbmMcbm2018UnpackerAlgoMuch::SetTimeOffsetNsAsic
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:1249
CbmMcbm2018UnpackerAlgoMuch::fdStartTime
Double_t fdStartTime
Definition: CbmMcbm2018UnpackerAlgoMuch.h:150
CbmMcbm2018UnpackerAlgoMuch::ProcessStatusInfo
void ProcessStatusInfo(const stsxyter::Message &mess, const UInt_t &uAsicIdx)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:901
CbmMcbm2018UnpackerAlgoMuch::fvuCurrentTsMsbCycle
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:147
CbmMcbm2018UnpackerAlgoMuch::~CbmMcbm2018UnpackerAlgoMuch
~CbmMcbm2018UnpackerAlgoMuch()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:80
CbmStar2019Algo.h
CbmMcbm2018UnpackerAlgoMuch::SetTimeOffsetNs
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:67
CbmMcbm2018UnpackerAlgoMuch::fhVectorCapacity
TH1 * fhVectorCapacity
Definition: CbmMcbm2018UnpackerAlgoMuch.h:181
CbmMcbm2018UnpackerAlgoMuch::ProcessMs
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:455
CbmStar2019Algo
Definition: CbmStar2019Algo.h:43
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
CbmMcbm2018UnpackerAlgoMuch::FillHistograms
Bool_t FillHistograms()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:1206
CbmMcbm2018UnpackerAlgoMuch::fDpbIdIndexMap
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:105
CbmMcbm2018UnpackerAlgoMuch::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:141
CbmMuchBeamTimeDigi.h
CbmMcbm2018UnpackerAlgoMuch::SetAdcCut
void SetAdcCut(UInt_t uAdc)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:81
CbmMcbm2018UnpackerAlgoMuch::ProcessEpochInfo
void ProcessEpochInfo(const stsxyter::Message &mess)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:886
CbmMcbm2018UnpackerAlgoMuch::Reset
virtual void Reset()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:100
CbmMcbm2018UnpackerAlgoMuch::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:114
CbmMcbm2018UnpackerAlgoMuch::fvvusLastTsChan
std::vector< std::vector< UShort_t > > fvvusLastTsChan
Limit how many different TS_MSB are checked for same duplicate hit => set to 1 uS.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:164
CbmMcbm2018UnpackerAlgoMuch::fvvusLastAdcChan
std::vector< std::vector< UShort_t > > fvvusLastAdcChan
TS of last hit message for each channel, [ AsicIdx ][ Chan ].
Definition: CbmMcbm2018UnpackerAlgoMuch.h:166
CbmMcbm2018UnpackerAlgoMuch::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:139
CbmMcbm2018UnpackerAlgoMuch::fdCapacityIncFactor
Double_t fdCapacityIncFactor
Definition: CbmMcbm2018UnpackerAlgoMuch.h:183
CbmMcbm2018UnpackerAlgoMuch::fuNrOfDpbs
UInt_t fuNrOfDpbs
Definition: CbmMcbm2018UnpackerAlgoMuch.h:103
CbmMcbm2018UnpackerAlgoMuch::fuMsIndex
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:133
StsXyterMessage.h
CbmMcbm2018UnpackerAlgoMuch::fdTimeOffsetNs
Double_t fdTimeOffsetNs
Number of StsXyter ASICs.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:112
CbmMcbm2018UnpackerAlgoMuch::fUnpackPar
CbmMcbm2018MuchPar * fUnpackPar
Switch to smx2.0/smx2.1 data-> fiFlag = 0 for 2.0 and fiFlag = 1 for 2.1.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:101
CbmMcbm2018UnpackerAlgoMuch::ResetHistograms
Bool_t ResetHistograms()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:1212
CbmMcbm2018UnpackerAlgoMuch::fuTsMaxVectorSize
size_t fuTsMaxVectorSize
Definition: CbmMcbm2018UnpackerAlgoMuch.h:182
CbmMcbm2018UnpackerAlgoMuch::ProcessTsMsbInfo
void ProcessTsMsbInfo(const stsxyter::Message &mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:806
CbmMcbm2018UnpackerAlgoMuch::fvvbMaskedChannels
std::vector< std::vector< bool > > fvvbMaskedChannels
Definition: CbmMcbm2018UnpackerAlgoMuch.h:118
CbmMcbm2018UnpackerAlgoMuch::CbmMcbm2018UnpackerAlgoMuch
CbmMcbm2018UnpackerAlgoMuch(const CbmMcbm2018UnpackerAlgoMuch &)
CbmMcbm2018UnpackerAlgoMuch::fdTsStopTimeCore
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:130
CbmMcbm2018UnpackerAlgoMuch::SetMonitorMode
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:64
CbmMcbm2018UnpackerAlgoMuch
Definition: CbmMcbm2018UnpackerAlgoMuch.h:37
CbmMcbm2018UnpackerAlgoMuch::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmMcbm2018UnpackerAlgoMuch.h:125
CbmMcbm2018UnpackerAlgoMuch::fiFlag
Int_t fiFlag
Definition: CbmMcbm2018UnpackerAlgoMuch.h:98
CbmMcbm2018MuchPar
Definition: CbmMcbm2018MuchPar.h:19
CbmMcbm2018UnpackerAlgoMuch::fuNbStsXyters
UInt_t fuNbStsXyters
Number of FEBs with StsXyter ASICs.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:109
CbmMcbm2018UnpackerAlgoMuch::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
Constants.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:121
CbmMcbm2018UnpackerAlgoMuch::fhDigisTimeInRun
TH1 * fhDigisTimeInRun
TS MSB cycle of last hit message for each channel, [ AsicIdx ][ Chan ].
Definition: CbmMcbm2018UnpackerAlgoMuch.h:173
CbmMcbm2018UnpackerAlgoMuch::fvmHitsInMs
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:158
CbmMcbm2018UnpackerAlgoMuch::Init
virtual Bool_t Init()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:95
CbmMcbm2018UnpackerAlgoMuch::fdMsTime
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:132
CbmMcbm2018UnpackerAlgoMuch::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
Definition: CbmMcbm2018UnpackerAlgoMuch.h:53
CbmMcbm2018UnpackerAlgoMuch::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018UnpackerAlgoMuch.h:137
CbmMcbm2018UnpackerAlgoMuch::fvvusLastTsMsbChan
std::vector< std::vector< UShort_t > > fvvusLastTsMsbChan
ADC of last hit message for each channel, [ AsicIdx ][ Chan ].
Definition: CbmMcbm2018UnpackerAlgoMuch.h:168
StsXyterFinalHit.h
CbmMcbm2018UnpackerAlgoMuch::CreateMuchDigi
CbmMuchBeamTimeDigi * CreateMuchDigi(stsxyter::FinalHit *)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:341
CbmMcbm2018UnpackerAlgoMuch::fiRunStartDateTimeSec
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:143
CbmMcbm2018UnpackerAlgoMuch::fvbMaskedComponents
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:93
CbmMcbm2018UnpackerAlgoMuch::CbmMcbm2018UnpackerAlgoMuch
CbmMcbm2018UnpackerAlgoMuch()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:29
CbmMcbm2018UnpackerAlgoMuch::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:108
CbmMcbm2018UnpackerAlgoMuch::fvdTimeOffsetNsAsics
std::vector< Double_t > fvdTimeOffsetNsAsics
Definition: CbmMcbm2018UnpackerAlgoMuch.h:113
CbmMcbm2018UnpackerAlgoMuch::fuNbFebs
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
Definition: CbmMcbm2018UnpackerAlgoMuch.h:108
CbmMcbm2018UnpackerAlgoMuch::fbUseChannelMask
Bool_t fbUseChannelMask
Definition: CbmMcbm2018UnpackerAlgoMuch.h:116
CbmMcbm2018UnpackerAlgoMuch::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018UnpackerAlgoMuch.h:126
CbmMcbm2018UnpackerAlgoMuch::SetBinningFwFlag
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!
Definition: CbmMcbm2018UnpackerAlgoMuch.h:75
CbmMcbm2018UnpackerAlgoMuch::fvbCrobActiveFlag
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:107
CbmMcbm2018UnpackerAlgoMuch::AddMsComponentToList
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018UnpackerAlgoMuch.cxx:227
CbmMcbm2018UnpackerAlgoMuch::fiBinSizeDatePlots
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
Definition: CbmMcbm2018UnpackerAlgoMuch.h:144