CbmRoot
Loading...
Searching...
No Matches
CbmCosy2019UnpackerAlgoHodo.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: Pierre-Alain Loizeau, Florian Uhlig [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmCosy2019UnpackerAlgoHodo -----
8// ----- Created 31/07/19 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmCosy2019UnpackerAlgoHodo_H
13#define CbmCosy2019UnpackerAlgoHodo_H
14
15#include "CbmStar2019Algo.h"
16
17// Data
18#include "CbmStsDigi.h"
19
20#include "StsXyterFinalHit.h"
21#include "StsXyterMessage.h"
22
23// CbmRoot
24
25// ROOT
26#include "TCanvas.h"
27#include "TH1.h"
28
29// C++11
30#include <chrono>
31
32// C/C++
33#include <map>
34#include <vector>
35
37
38class TProfile;
39
40class CbmCosy2019UnpackerAlgoHodo : public CbmStar2019Algo<CbmStsDigi> {
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 void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn = 0.0);
68
69 inline void SetVectCapInc(Double_t dIncFact) { fdCapacityIncFactor = dIncFact; }
70
71private:
75 std::vector<Bool_t> fvbMaskedComponents;
76
80 UInt_t fuNbModules;
81 std::vector<Int_t> fviModAddress;
82 UInt_t fuNrOfDpbs;
83 std::map<UInt_t, UInt_t> fDpbIdIndexMap;
84 std::vector<std::vector<Bool_t>>
86 UInt_t fuNbFebs;
88 std::vector<std::vector<std::vector<Int_t>>>
90 std::vector<std::vector<std::vector<Double_t>>>
92 std::vector<std::vector<std::vector<Double_t>>>
94 std::vector<Int_t> fviFebAddress;
95 std::vector<Int_t> fviFebModule;
96
99 std::vector<Double_t> fvdTimeOffsetNsAsics;
100
102 static const Int_t kiMaxNbFlibLinks = 32;
103
108 Double_t fdTsStartTime;
110 Double_t fdMsTime;
111 UInt_t fuMsIndex;
113 std::map<stsxyter::MessType, UInt_t> fmMsgCounter;
115 UInt_t fuCurrDpbId;
120 std::vector<ULong64_t> fvulCurrentTsMsb;
121 std::vector<UInt_t> fvuCurrentTsMsbCycle;
123 Double_t fdStartTime;
125 std::chrono::steady_clock::time_point
129 std::vector<stsxyter::FinalHit>
131
134 /*
135 std::vector< TH1* > fvhHitsTimeToTriggerRaw; //! [sector]
136 std::vector< TH1* > fvhMessDistributionInMs; //! [sector], extra monitor for debug
137 TH1 * fhEventNbPerTs; //!
138 TCanvas * fcTimeToTrigRaw; //! All sectors
139*/
140 TH1* fhVectorSize = nullptr;
141 TH1* fhVectorCapacity = nullptr;
143 Double_t fdCapacityIncFactor = 1.1;
144
145 void ProcessHitInfo(const stsxyter::Message& mess, const UShort_t& usElinkIdx, const UInt_t& uAsicIdx,
146 const UInt_t& uMsIdx);
147 void ProcessTsMsbInfo(const stsxyter::Message& mess, UInt_t uMessIdx = 0, UInt_t uMsIdx = 0);
148 void ProcessEpochInfo(const stsxyter::Message& mess);
149 void ProcessStatusInfo(const stsxyter::Message& mess);
150
153
154 ClassDef(CbmCosy2019UnpackerAlgoHodo, 1)
155};
156
157#endif // CbmCosy2019UnpackerAlgoHodo_H
std::chrono::steady_clock::time_point ftStartTimeUnix
CbmCosy2019UnpackerAlgoHodo(const CbmCosy2019UnpackerAlgoHodo &)
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
void ProcessStatusInfo(const stsxyter::Message &mess)
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
std::vector< ULong64_t > fvulCurrentTsMsb
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
std::vector< Double_t > fvdTimeOffsetNsAsics
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
void ProcessTsMsbInfo(const stsxyter::Message &mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
CbmCosy2019HodoPar * fUnpackPar
Settings from parameter file.
void ProcessEpochInfo(const stsxyter::Message &mess)
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Double_t fdTimeOffsetNs
Module for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
std::vector< Int_t > fviFebAddress
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
UInt_t fuNrOfDpbs
STS address for the first strip of each module.
std::vector< Int_t > fviFebModule
STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
static const Int_t kiMaxNbFlibLinks
Constants.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx
Number of StsXyter ASICs.
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
TH1 * fhDigisTimeInRun
All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator.
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
std::vector< Int_t > fviModAddress
Total number of STS modules in the setup.
UInt_t fuNbStsXyters
Number of FEBs with StsXyter ASICs.
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
void ProcessHitInfo(const stsxyter::Message &mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
CbmCosy2019UnpackerAlgoHodo operator=(const CbmCosy2019UnpackerAlgoHodo &)