Project
Loading...
Searching...
No Matches
SimpleEventDisplayGUI.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef TPC_SimpleEventDisplayGUI_H_
17#define TPC_SimpleEventDisplayGUI_H_
18
19#include <memory>
20#include <string>
21
22#include "TString.h"
23
27
28class TH2F;
29class TH1F;
30class TH1;
31class TGTextEntry;
32class TGTextButton;
33class TGCheckButton;
34class TGNumberEntry;
35class TGVButtonGroup;
36class TH2Poly;
37
38namespace o2::tpc
39{
40
42{
43 public:
44 enum RunMode {
45 Offline = 0,
46 Online = 1,
47 };
48
52 };
53
54 void toggleFFT();
55 void toggleOccupancy();
56 void togglePadTime();
58 void toggleClusters();
59 void monitorGui();
60 void exitRoot();
61 void update(TString clist);
62 void resetHists(int type, HistogramType histogramType);
63 void drawPadSignal(int event, int x, int y, TObject* o);
64 void fillHists(int type = 0, HistogramType histogramType = MaxValues);
65 void selectSector(int sector);
66 int FindROCFromXY(const float x, const float y, const int side);
67 void selectSectorExec(int event, int x, int y, TObject* o);
68 void initGUI();
69 void next(int eventNumber = -1);
70 void callEventNumber();
72 void selectTimeBin();
73 void showClusters(int roc, int row);
74
75 void runSimpleEventDisplay(std::string_view fileInfo, std::string_view pedestalFile = "", int firstTimeBin = 0, int lastTimeBin = 500, int nTimeBinsPerCall = 500, uint32_t verbosity = 0, uint32_t debugLevel = 0, int selectedSector = 0, bool showSides = 1);
76
77 SimpleEventDisplay& getEventDisplay() { return mEvDisp; }
78
79 void setMode(RunMode mode) { mRunMode = mode; }
80
81 // ===| for online processing |===
82 void startGUI(int maxTimeBins = 114048);
83 bool isStopRequested() const { return mStop; }
84 bool isProcessingEvent() const { return mProcessingEvent; }
85 bool isNextEventRequested() const { return mNextEvent; }
86 bool isWaitingForDigitUpdate() const { return mUpdatingDigits; }
87 void resetNextEventReqested() { mNextEvent = false; }
88 void resetUpdatingDigits() { mUpdatingDigits = false; }
89 void setDataAvailable(bool available) { mDataAvailable = available; }
90
91 private:
92 SimpleEventDisplay mEvDisp;
93
94 int mOldHooverdSector = -1;
95 int mSelectedSector = 0;
96 int mMaxEvents = 100000000;
97 bool mShowSides = true;
98
99 // ===| for onine processing |===
100 bool mNextEvent = false;
101 bool mProcessingEvent = false;
102 bool mUpdatingDigits = false;
103 bool mStop = false;
104 bool mDataAvailable = false;
105 RunMode mRunMode;
106
107 TH2F* mHMaxA = nullptr;
108 TH2F* mHMaxC = nullptr;
109 TH2F* mHMaxIROC = nullptr;
110 TH2F* mHMaxOROC = nullptr;
111 TH1* mHFFTO = nullptr;
112 TH1* mHFFTI = nullptr;
113 TH2F* mHOccupancyA = nullptr;
114 TH2F* mHOccupancyC = nullptr;
115 TH2F* mHOccupancyIROC = nullptr;
116 TH2F* mHOccupancyOROC = nullptr;
117 TH2F* mHPadTimeIROC = nullptr;
118 TH2F* mHPadTimeOROC = nullptr;
119 TH2Poly* mSectorPolyTimeBin = nullptr;
120 TPolyMarker* mClustersIROC = nullptr;
121 TPolyMarker* mClustersOROC = nullptr;
122 TPolyMarker* mClustersRowPad = nullptr;
123
124 TGCheckButton* mCheckSingleTB = nullptr;
125 TGCheckButton* mCheckFFT = nullptr;
126 TGCheckButton* mCheckOccupancy = nullptr;
127 TGCheckButton* mCheckPadTime = nullptr;
128 TGCheckButton* mCheckShowClusters = nullptr;
129 static constexpr int NCheckClFlags = 5;
130 TGCheckButton* mCheckClFlags[NCheckClFlags] = {};
131 TGVButtonGroup* mFlagGroup = nullptr;
132 TGTextEntry* mEventNumber = nullptr;
133 TGTextEntry* mSignalThresholdValue = nullptr;
134 TGNumberEntry* mSelTimeBin = nullptr;
135
136 std::string mInputFileInfo{};
137
138 o2::tpc::ClusterNativeHelper::Reader mTPCclusterReader;
139 o2::tpc::ClusterNativeAccess mClusterIndex;
140 std::unique_ptr<o2::tpc::ClusterNative[]> mClusterBuffer;
142
143 TH1* getBinInfoXY(int& binx, int& biny, float& bincx, float& bincy);
144
145 void initOccupancyHists();
146 void deleteOccupancyHists();
147
148 void initPadTimeHists();
149 void deletePadTimeHists();
150
151 void initSingleTBHists();
152 void deleteSingleTBHists();
153
154 void fillClusters(Long64_t entry);
155
156 ClassDefNV(SimpleEventDisplayGUI, 0);
157};
158
159} // namespace o2::tpc
160
161#endif
#define verbosity
Helper class to read the binary format of TPC ClusterNative.
Class of a TPC cluster in TPC-native coordinates (row, time)
bool o
uint32_t roc
Definition RawData.h:3
uint32_t side
Definition RawData.h:0
A reader class for the raw cluster native data.
ClusterNativeAccess::ConstMCLabelContainerViewWithBuffer ConstMCLabelContainerViewWithBuffer
void fillHists(int type=0, HistogramType histogramType=MaxValues)
@ Online
run online from decoded digits
void resetHists(int type, HistogramType histogramType)
void runSimpleEventDisplay(std::string_view fileInfo, std::string_view pedestalFile="", int firstTimeBin=0, int lastTimeBin=500, int nTimeBinsPerCall=500, uint32_t verbosity=0, uint32_t debugLevel=0, int selectedSector=0, bool showSides=1)
void drawPadSignal(int event, int x, int y, TObject *o)
int FindROCFromXY(const float x, const float y, const int side)
void startGUI(int maxTimeBins=114048)
void selectSectorExec(int event, int x, int y, TObject *o)
SimpleEventDisplay & getEventDisplay()
Base of a simple event display for digits.
struct _cl_event * event
Definition glcorearb.h:2982
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum mode
Definition glcorearb.h:266
GLuint entry
Definition glcorearb.h:5735
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
Global TPC definitions and constants.
Definition SimTraits.h:167
std::vector< int > row