CbmRoot
Loading...
Searching...
No Matches
CbmRichUnpackMonitor.h
Go to the documentation of this file.
1/* Copyright (C) 2022 UGiessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Adrian Weber [committer]*/
4
5
19#ifndef CbmRichUnpackMonitor_H
20#define CbmRichUnpackMonitor_H
21
22#include "CbmMcbm2018RichPar.h"
23#include "Rtypes.h"
24#include "TH1.h"
25#include "TH2.h"
26
27#include <cstdint>
28
30 public:
32
33 virtual ~CbmRichUnpackMonitor();
34
35 //Variables for debugging info
36 std::vector<uint32_t> vNbMessType;
37 std::string sMessPatt = "";
38 bool bError = false;
39
41 void PrintDebugInfo(const uint64_t MsStartTime, const size_t NrProcessedTs, const uint16_t msDescriptorFlags,
42 const uint32_t uSize);
43
45 Bool_t Init(CbmMcbm2018RichPar* parset);
46
47 Bool_t CreateHistograms(CbmMcbm2018RichPar* pUnpackPar);
48 Bool_t ResetHistograms();
49
50 Bool_t CreateDebugHistograms(CbmMcbm2018RichPar* pUnpackPar);
51 Bool_t ResetDebugHistograms();
52
53
55 void Finish();
56
57 void SetHistoFileName(TString nameIn) { fHistoFileName = nameIn; }
58
59 void AddHistoToVector(TNamed* pointer, std::string sFolder = "")
60 {
61 fvpAllHistoPointers.push_back(std::pair<TNamed*, std::string>(pointer, sFolder));
62 }
63 std::vector<std::pair<TNamed*, std::string>> GetHistoVector() { return fvpAllHistoPointers; }
64
65
67 void FillVectorSize(ULong64_t TsIdx, UInt_t Size) { fhVectorSize->Fill(TsIdx, Size); }
68 void FillVectorCapacity(ULong64_t TsIdx, UInt_t Capacity) { fhVectorCapacity->Fill(TsIdx, Capacity); }
69
70 void FillDigisTimeInRun(Double_t Time) { fhDigisTimeInRun->Fill(Time * 1e-9); }
71
72 void FillDigisToT(Double_t ToT) { fhDigisToT->Fill(ToT); }
73 void FillDigisToTDiRICH(Int_t Address, Double_t ToT);
74
76
78 bool GetDebugMode() { return fDebugMode; }
79
81 void SetDebugMode(bool value) { fDebugMode = value; }
82
83 private:
84 TString fHistoFileName = "HistosUnpackerRich.root";
85
86
87 double_t dFirstTsStartTime = 0;
88
90 TH1* fhDigisTimeInRun = nullptr;
91 TH1* fhDigisToT = nullptr;
92 TH1* fhVectorSize = nullptr;
93 TH1* fhVectorCapacity = nullptr;
94
95 std::vector<TH2*> fhDigisToTDiRICH;
96
98
100 bool fDebugMode = false;
101
102
114 std::vector<std::pair<TNamed*, std::string>>
116
119
120 ClassDef(CbmRichUnpackMonitor, 1)
121};
122
123#endif
static double dTsStartTime
void PrintDebugInfo(const uint64_t MsStartTime, const size_t NrProcessedTs, const uint16_t msDescriptorFlags, const uint32_t uSize)
Bool_t CreateDebugHistograms(CbmMcbm2018RichPar *pUnpackPar)
void FillDigisToTDiRICH(Int_t Address, Double_t ToT)
void SetDebugMode(bool value)
Activate the debug mode.
void Finish()
Write all histograms to file.
CbmMcbm2018RichPar * pUnpackParameters
std::vector< std::pair< TNamed *, std::string > > fvpAllHistoPointers
bool fDebugMode
Flag if debug mode is active or not.
void SetHistoFileName(TString nameIn)
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
std::vector< TH2 * > fhDigisToTDiRICH
Bool_t CreateHistograms(CbmMcbm2018RichPar *pUnpackPar)
CbmRichUnpackMonitor operator=(const CbmRichUnpackMonitor &)
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
void FillDigisTimeInRun(Double_t Time)
void FillVectorSize(ULong64_t TsIdx, UInt_t Size)
Fill general histograms.
void FillVectorCapacity(ULong64_t TsIdx, UInt_t Capacity)
CbmRichUnpackMonitor(const CbmRichUnpackMonitor &)
Vector of pointers to histograms + optional folder name.
Bool_t Init(CbmMcbm2018RichPar *parset)
Init all required parameter informations and histograms.
void FillDigisToT(Double_t ToT)
std::vector< uint32_t > vNbMessType
bool GetDebugMode()
Activate the debug mode.
void FillPerTimesliceCountersHistos(double_t dTsStartTime)
TH1 * fhDigisTimeInRun
General histograms.