CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018UnpackerAlgoPsd.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin, David Emschermann [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018UnpackerAlgoPsd -----
8// ----- Created 09.10.2019 by N.Karpushkin -----
9// ----- based on CbmMcbm2018UnpackerAlgoTof by P.-A. Loizeau -----
10// ----- -----
11// -----------------------------------------------------------------------------
12
13#ifndef CbmMcbm2018UnpackerAlgoPsd_H
14#define CbmMcbm2018UnpackerAlgoPsd_H
15
16#include "CbmStar2019Algo.h"
17
18// Data
19#include "CbmPsdDigi.h"
20#include "CbmPsdDsp.h"
21
22#include "PronyFitter.h"
23#include "PsdGbtReader-v0.00.h"
24#include "PsdGbtReader-v1.00.h"
25
26// CbmRoot
27
28// C++11
29#include <chrono>
30#include <numeric>
31
32// C/C++
33#include <map>
34#include <vector>
35
37
38class CbmMcbm2018UnpackerAlgoPsd : public CbmStar2019Algo<CbmPsdDigi> {
39public:
42
47
48 virtual Bool_t Init();
49 virtual void Reset();
50 virtual void Finish();
51
52 Bool_t InitContainers();
53 Bool_t ReInitContainers();
54 TList* GetParList();
55
56 Bool_t InitParameters();
57
58 Bool_t ProcessTs(const fles::Timeslice& ts);
59 Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
60 Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
61
62 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
63
64 Bool_t SetDigiOutputPointer(std::vector<CbmPsdDigi>* const pVector);
65 Bool_t SetDspOutputPointer(std::vector<CbmPsdDsp>* const pVector);
66 std::unique_ptr<CbmPsdDigi> MakeDigi(CbmPsdDsp dsp);
67
68 Bool_t CreateHistograms();
69 Bool_t FillHistograms();
70 Bool_t ResetHistograms();
71
72 inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; }
73 inline void SetDspWriteMode(Bool_t bFlagIn = kTRUE) { fbDebugWriteOutput = bFlagIn; }
74 inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { fdTimeOffsetNs = dOffsetIn; }
75
76 std::pair<std::vector<CbmPsdDigi>*, std::vector<CbmPsdDsp>*> unpack(const fles::Timeslice* ts, std::uint16_t icomp);
77
78private:
80 Bool_t fbMonitorMode = kFALSE;
81 Bool_t fbDebugMonitorMode = kFALSE;
82 Bool_t fbDebugWriteOutput = kFALSE;
83
85 std::vector<CbmPsdDigi>* fPsdDigiVector =
86 nullptr;
87 std::vector<CbmPsdDsp>* fPsdDspVector =
88 nullptr;
89
90 std::vector<Bool_t> fvbMaskedComponents = {};
91
94 UInt_t fuRawDataVersion = 0;
96 UInt_t fuNrOfGdpbs = 0;
97 std::map<UInt_t, UInt_t> fGdpbIdIndexMap = {};
98 UInt_t fuNrOfFeePerGdpb = 0;
101
103 UInt_t fuNrOfGbtx = 0;
104 UInt_t fuNrOfModules = 0;
105 std::vector<Int_t> fviPsdChUId = {};
106
108 Double_t fdTimeOffsetNs = 0.0;
109
111 static const Int_t kiMaxNbFlibLinks = 32;
112 static const UInt_t kuBytesPerMessage = 8;
113 static const UInt_t kuDetMask = 0x0001FFFF;
114
117 ULong64_t fulCurrentTsIdx = 0;
118 ULong64_t fulCurrentMsIdx = 0;
119 size_t fuCurrentMsSysId = 0;
120 Double_t fdTsStartTime = -1.0;
122 -1.0;
123 Double_t fdMsTime = -1.0;
124 UInt_t fuMsIndex = 0;
125
128 UInt_t fuCurrDpbId = 0;
129 UInt_t fuCurrDpbIdx = 0;
130
131
133 Double_t fdStartTime = -1.0;
134 Double_t fdStartTimeMsSz = 0.0;
135 std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
136 now();
138 ClassDef(CbmMcbm2018UnpackerAlgoPsd, 2)
139};
140
141#endif
Bool_t ProcessTs(const fles::Timeslice &ts)
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
UInt_t fuCurrentEquipmentId
Index of current MS within the TS.
static const Int_t kiMaxNbFlibLinks
Constants.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
Double_t fdTimeOffsetNs
User settings: Data correction parameters.
UInt_t fuNrOfGbtx
Number of channels per GDPB.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
CbmMcbm2018UnpackerAlgoPsd & operator=(const CbmMcbm2018UnpackerAlgoPsd &)=delete
Copy assignment operator - not implemented.
Bool_t SetDigiOutputPointer(std::vector< CbmPsdDigi > *const pVector)
UInt_t fuNrOfChannelsPerFee
Number of FEBs per GDPB.
CbmMcbm2018UnpackerAlgoPsd(const CbmMcbm2018UnpackerAlgoPsd &)=delete
Copy constructor - not implemented.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
std::vector< Bool_t > fvbMaskedComponents
Output Dsp vector /* TODO CHECK The exclamation mark signals the transientness *‍/.
UInt_t fuNrOfChannelsPerGdpb
Number of channels in each FEE.
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Double_t fdTsStartTime
SysId of the current MS in TS (0 to fuTotalMsNb)
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
std::unique_ptr< CbmPsdDigi > MakeDigi(CbmPsdDsp dsp)
void SetDspWriteMode(Bool_t bFlagIn=kTRUE)
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
Bool_t fbDebugWriteOutput
Switch ON the filling of a additional set of histograms.
std::chrono::steady_clock::time_point ftStartTimeUnix
std::vector< CbmPsdDigi > * fPsdDigiVector
If ON the output vector of dsp debug information is written to disk.
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
ULong64_t fulCurrentMsIdx
Idx of the current TS.
Double_t fdStartTime
Index of the DPB from which the MS currently unpacked is coming.
size_t fuCurrentMsSysId
Idx of the current MS in TS (0 to fuTotalMsNb)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
CbmMcbm2018PsdPar * fUnpackPar
Settings from parameter file.
std::pair< std::vector< CbmPsdDigi > *, std::vector< CbmPsdDsp > * > unpack(const fles::Timeslice *ts, std::uint16_t icomp)
Bool_t SetDspOutputPointer(std::vector< CbmPsdDsp > *const pVector)
std::vector< CbmPsdDsp > * fPsdDspVector
Output Digi vector /* TODO CHECK The exclamation mark signals the transientness *‍/.
Data class for PSD digital signal processing (DSP)
Definition CbmPsdDsp.h:30