CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018UnpackerAlgoTof.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018UnpackerAlgoTof -----
8// ----- Created 10.02.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018UnpackerAlgoTof_H
13#define CbmMcbm2018UnpackerAlgoTof_H
14
15#include "CbmStar2019Algo.h"
16
17// Data
18#include "CbmTofDigi.h"
19
20#include "gDpbMessv100.h"
21
22// CbmRoot
23
24// C++11
25#include <chrono>
26
27// C/C++
28#include <map>
29#include <vector>
30
32/*
33class TCanvas;
34class THttpServer;
35*/
36class TH1;
37class TH2;
38class TProfile;
39
40class CbmMcbm2018UnpackerAlgoTof : public CbmStar2019Algo<CbmTofDigi> {
41public:
44
45 virtual Bool_t Init();
46 virtual void Reset();
47 virtual void Finish();
48
49 Bool_t InitContainers();
50 Bool_t ReInitContainers();
51 TList* GetParList();
52
53 Bool_t InitParameters();
54
55 Bool_t ProcessTs(const fles::Timeslice& ts);
56 Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
57 Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
58
59 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
60
61 Bool_t CreateHistograms();
62 Bool_t FillHistograms();
63 Bool_t ResetHistograms();
64
65 inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; }
66 inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { fdTimeOffsetNs = dOffsetIn; }
67 inline void SetDiamondDpbIdx(UInt_t uIdx = 2) { fuDiamondDpbIdx = uIdx; }
68
69 inline void SetVectCapInc(Double_t dIncFact) { fdCapacityIncFactor = dIncFact; }
70 inline void SetMaxAsicInactive(Int_t ival) { fMaxAsicInactive = ival; }
71
72private:
76 std::vector<Bool_t> fvbMaskedComponents;
77
81 UInt_t fuNrOfGdpbs;
82 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
87 UInt_t fuNrOfGet4;
91 UInt_t fuNrOfGbtx;
93 std::vector<Int_t> fviNrOfRpc;
94 std::vector<Int_t> fviRpcType;
95 std::vector<Int_t> fviRpcSide;
96 std::vector<Int_t> fviModuleId;
97 std::vector<Int_t> fviRpcChUId;
98
102
104 static const Int_t kiMaxNbFlibLinks = 32;
105 static const UInt_t kuDetMask = 0x0001FFFF;
106
109 ULong64_t fulCurrentTsIdx;
110 ULong64_t fulCurrentMsIdx;
112 Double_t fdTsStartTime;
114 Double_t fdMsTime;
115 UInt_t fuMsIndex;
118 UInt_t fuCurrDpbId;
120 UInt_t fuGet4Id;
121 UInt_t fuGet4Nr;
123 std::vector<ULong64_t> fvulCurrentEpoch;
124 std::vector<ULong64_t> fvulCurrentEpochCycle;
125 std::vector<ULong64_t> fvulCurrentEpochFull;
126
128 Double_t fdStartTime;
130 std::chrono::steady_clock::time_point
134 std::vector<std::vector<gdpbv100::Message>>
136 Bool_t fbEpochFoundInThisMs = kFALSE;
137
139 std::vector<ULong64_t> fvulGdpbTsMsb;
140 std::vector<ULong64_t> fvulGdpbTsLsb;
141 std::vector<ULong64_t> fvulStarTsMsb;
142 std::vector<ULong64_t> fvulStarTsMid;
143 std::vector<ULong64_t> fvulGdpbTsFullLast;
144 std::vector<ULong64_t> fvulStarTsFullLast;
145 std::vector<UInt_t> fvuStarTokenLast;
146 std::vector<UInt_t> fvuStarDaqCmdLast;
147 std::vector<UInt_t> fvuStarTrigCmdLast;
148
150 Double_t fdRefTime;
153 Double_t fdEvTime0;
160 std::vector<TH2*> fhRawTotCh;
161 std::vector<TH1*> fhChCount;
162 std::vector<TH1*> fhChCountRemap;
163 std::vector<Bool_t> fvbChanThere;
164 std::vector<TH2*> fhChanCoinc;
165 Bool_t fbDetChanThere[64];
167 /*
168 std::vector< TH1* > fvhHitsTimeToTriggerRaw; //! [sector]
169 std::vector< TH1* > fvhMessDistributionInMs; //! [sector], extra monitor for debug
170 TH1 * fhEventNbPerTs; //!
171 TCanvas * fcTimeToTrigRaw; //! All sectors
172*/
173 TH1* fhVectorSize = nullptr;
174 TH1* fhVectorCapacity = nullptr;
176 Double_t fdCapacityIncFactor = 1.1;
178
179 void ProcessEpochCycle(const uint64_t& ulCycleData);
180 void ProcessEpoch(const gdpbv100::Message& mess, uint32_t uMesgIdx);
181 void ProcessEndOfMsEpoch();
182 void ProcessStarTrigger(const gdpbv100::Message& mess);
183
185
186 void ProcessHit(const gdpbv100::FullMessage& mess);
187 void ProcessSlCtrl(const gdpbv100::FullMessage& mess);
188 void ProcessSysMess(const gdpbv100::FullMessage& mess);
189
190 void ProcessError(const gdpbv100::FullMessage& mess);
191 void ProcessPattern(const gdpbv100::FullMessage& mess);
192
193 inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) { return gdpbId * fuNrOfGet4PerGdpb + get4Id; }
194
197
198 ClassDef(CbmMcbm2018UnpackerAlgoTof, 1)
199};
200
201#endif
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Double_t fdTimeOffsetNs
User settings: Data correction parameters.
void ProcessEpoch(const gdpbv100::Message &mess, uint32_t uMesgIdx)
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
std::vector< ULong64_t > fvulStarTsFullLast
size_t fuCurrentMsSysId
Idx of the current MS in TS (0 to fuTotalMsNb)
void SetVectCapInc(Double_t dIncFact)
Bool_t ProcessTs(const fles::Timeslice &ts)
CbmMcbm2018UnpackerAlgoTof operator=(const CbmMcbm2018UnpackerAlgoTof &)
std::vector< ULong64_t > fvulStarTsMsb
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
void ProcessError(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
std::chrono::steady_clock::time_point ftStartTimeUnix
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
void ProcessSlCtrl(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfGet4
Number of channels in each FEE.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
void ProcessStarTrigger(const gdpbv100::Message &mess)
void ProcessPattern(const gdpbv100::FullMessage &mess)
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void ProcessEpochCycle(const uint64_t &ulCycleData)
std::vector< ULong64_t > fvulGdpbTsLsb
void ProcessSysMess(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
CbmMcbm2018UnpackerAlgoTof(const CbmMcbm2018UnpackerAlgoTof &)
std::vector< ULong64_t > fvulGdpbTsMsb
STAR TRIGGER detection.
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
Bool_t fbEpochFoundInThisMs
[DPB], FIXME: dimension to be removed as not needed with real MS
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
Double_t fdStartTime
Epoch + Epoch Cycle.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
static const Int_t kiMaxNbFlibLinks
Constants.
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
std::vector< ULong64_t > fvulStarTsMid
void ProcessHit(const gdpbv100::FullMessage &mess)
Double_t fdTsStartTime
SysId of the current MS in TS (0 to fuTotalMsNb)
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
std::vector< std::vector< gdpbv100::Message > > fvvmEpSupprBuffer
Buffers.
ULong64_t fulCurrentMsIdx
Idx of the current TS.
std::vector< ULong64_t > fvulGdpbTsFullLast