31class TGraphAsymmErrors;
34#if !defined(GPUCA_BUILD_QA) || defined(GPUCA_GPUCODE)
44 int32_t
InitQA(int32_t tasks = 0) {
return 1; }
45 void RunQA(
bool matchOnly =
false) {}
68#ifdef GPUCA_TPC_GEOMETRY_O2
78struct ClusterNativeAccess;
86class GPUChainTracking;
91struct GPUQAGarbageCollection;
98 GPUQA(GPUChainTracking*
chain,
const GPUSettingsQA* config =
nullptr,
const GPUParam*
param =
nullptr);
101#ifdef GPUCA_TPC_GEOMETRY_O2
102 using mcLabels_t = gsl::span<const o2::MCCompLabel>;
115 void UpdateParam(
const GPUParam*
param) { mParam =
param; }
116 int32_t
InitQA(int32_t tasks = -1);
117 void RunQA(
bool matchOnly =
false,
const std::vector<o2::tpc::TrackTPC>* tracksExternal =
nullptr,
const std::vector<o2::MCCompLabel>* tracksExtMC =
nullptr,
const o2::tpc::ClusterNativeAccess* clNative =
nullptr);
119 void DrawQAHistogramsCleanup();
125 uint32_t GetMCLabelCol(
const mcLabel_t&
label)
const;
127 void InitO2MCData(GPUTrackingInOutPointers* updateIOPtr =
nullptr);
134 const std::vector<TH1F>& getHistograms1D()
const {
return *mHist1D; }
135 const std::vector<TH2F>& getHistograms2D()
const {
return *mHist2D; }
136 const std::vector<TH1D>& getHistograms1Dd()
const {
return *mHist1Dd; }
137 const std::vector<TGraphAsymmErrors>& getGraphs()
const {
return *mHistGraph; }
139 int32_t loadHistograms(std::vector<TH1F>& i1, std::vector<TH2F>& i2, std::vector<TH1D>& i3, std::vector<TGraphAsymmErrors>& i4, int32_t tasks = -1);
142 static constexpr int32_t N_CLS_HIST = 8;
143 static constexpr int32_t N_CLS_TYPE = 3;
145 static constexpr int32_t MC_LABEL_INVALID = -1e9;
150 taskTrackingResPull = 4,
151 taskClusterAttach = 8,
152 taskTrackStatistics = 16,
153 taskClusterCounts = 32,
155 taskDefaultPostprocess = 31,
160 struct additionalMCParameters {
161 float pt,
phi, theta, eta, nWeightCls;
164 struct additionalClusterParameters {
165 int32_t attached, fakeAttached, adjacent, fakeAdjacent;
169 int32_t InitQACreateHistograms();
170 int32_t DoClusterCounts(uint64_t* attachClusterCounts, int32_t
mode = 0);
171 void PrintClusterCount(int32_t
mode, int32_t&
num,
const char*
name, uint64_t
n, uint64_t normalization);
172 void CopyO2MCtoIOPtr(GPUTrackingInOutPointers*
ptr);
174 void SetAxisSize(T* e);
175 void SetLegend(TLegend* l);
176 double* CreateLogAxis(int32_t nbins,
float xmin,
float xmax);
177 void ChangePadTitleSize(TPad* p,
float size);
178 void DrawHisto(TH1* histo,
char*
filename,
char* options);
179 void doPerfFigure(
float x,
float y,
float size);
180 void GetName(
char* fname, int32_t k);
182 T* GetHist(T*& ee, std::vector<std::unique_ptr<TFile>>& tin, int32_t k, int32_t nNewInput);
184 using mcInfo_t = GPUTPCMCInfo;
185#ifdef GPUCA_TPC_GEOMETRY_O2
186 mcLabels_t GetMCLabel(uint32_t
i);
187 mcLabel_t GetMCLabel(uint32_t
i, uint32_t
j);
190 int32_t getTrackID()
const {
return AbsLabelID(track); }
191 int32_t getEventID()
const {
return 0; }
192 int32_t getSourceID()
const {
return 0; }
193 int64_t getTrackEventSourceID()
const {
return getTrackID(); }
194 bool isFake()
const {
return track < 0; }
195 bool isValid()
const {
return track != MC_LABEL_INVALID; }
196 void invalidate() { track = MC_LABEL_INVALID; }
197 void setFakeFlag(
bool v =
true) { track =
v ? FakeLabelID(track) : AbsLabelID(track); }
198 void setNoise() { track = MC_LABEL_INVALID; }
200 bool operator!=(
const mcLabel_t& l) {
return !(*
this == l); }
203 int32_t track = MC_LABEL_INVALID;
205 const mcLabels_t& GetMCLabel(uint32_t
i);
206 const mcLabel_t& GetMCLabel(uint32_t
i, uint32_t
j);
208 static int32_t FakeLabelID(
const int32_t
id);
209 static int32_t AbsLabelID(
const int32_t
id);
212 auto& GetMCTrackObj(T& obj,
const mcLabelI_t& l);
214 uint32_t GetNMCCollissions()
const;
215 uint32_t GetNMCTracks(int32_t iCol)
const;
217 uint32_t GetNMCLabels()
const;
218 const mcInfo_t& GetMCTrack(uint32_t iTrk, uint32_t iCol);
219 const mcInfo_t& GetMCTrack(
const mcLabel_t&
label);
220 int32_t GetMCLabelNID(
const mcLabels_t&
label);
221 int32_t GetMCLabelNID(uint32_t
i);
222 int32_t GetMCLabelID(uint32_t
i, uint32_t
j);
223 uint32_t GetMCLabelCol(uint32_t
i, uint32_t
j);
224 static int32_t GetMCLabelID(
const mcLabels_t&
label, uint32_t
j);
225 static int32_t GetMCLabelID(
const mcLabel_t&
label);
226 float GetMCLabelWeight(uint32_t
i, uint32_t
j);
227 float GetMCLabelWeight(
const mcLabels_t&
label, uint32_t
j);
228 float GetMCLabelWeight(
const mcLabel_t&
label);
229 const auto& GetClusterLabels();
232 GPUChainTracking* mTracking;
233 const GPUSettingsQA& mConfig;
234 const GPUParam* mParam;
236 const char* str_perf_figure_1 =
"ALICE Performance 2018/03/20";
238 const char* str_perf_figure_2 =
"2015, MC Pb-Pb, #sqrt{s_{NN}} = 5.02 TeV";
241 std::vector<mcLabelI_t> mTrackMCLabels;
242#ifdef GPUCA_TPC_GEOMETRY_O2
243 std::vector<std::vector<int32_t>> mTrackMCLabelsReverse;
244 std::vector<std::vector<int32_t>> mRecTracks;
245 std::vector<std::vector<int32_t>> mFakeTracks;
246 std::vector<std::vector<additionalMCParameters>> mMCParam;
248 std::vector<int32_t> mTrackMCLabelsReverse[1];
249 std::vector<int32_t> mRecTracks[1];
250 std::vector<int32_t> mFakeTracks[1];
251 std::vector<additionalMCParameters> mMCParam[1];
253 std::vector<mcInfo_t> mMCInfos;
254 std::vector<GPUTPCMCInfoCol> mMCInfosCol;
255 std::vector<uint32_t> mMCNEvents;
256 std::vector<uint32_t> mMCEventOffset;
258 std::vector<additionalClusterParameters> mClusterParam;
259 int32_t mNTotalFakes = 0;
261 TH1F* mEff[4][2][2][5];
262 TGraphAsymmErrors* mEffResult[4][2][2][5];
273 TH1F* mPull[5][5][2];
279 enum CL_types { CL_attached = 0,
287 TH1D* mClusters[N_CLS_TYPE * N_CLS_HIST - 1];
288 TCanvas* mCClust[N_CLS_TYPE];
289 TPad* mPClust[N_CLS_TYPE];
290 TLegend* mLClust[N_CLS_TYPE];
293 int64_t nRejected = 0, nTube = 0, nTube200 = 0, nLoopers = 0, nLowPt = 0, n200MeV = 0, nPhysics = 0, nProt = 0, nUnattached = 0, nTotal = 0, nHighIncl = 0, nAbove400 = 0, nFakeRemove400 = 0, nFullFakeRemove400 = 0, nBelow40 = 0, nFakeProtect40 = 0, nMergedLooper = 0;
294 double nUnaccessible = 0;
311 std::vector<TH2F*> mHistClusterCount;
313 std::vector<TH1F>* mHist1D =
nullptr;
314 std::vector<TH2F>* mHist2D =
nullptr;
315 std::vector<TH1D>* mHist1Dd =
nullptr;
316 std::vector<TGraphAsymmErrors>* mHistGraph =
nullptr;
317 bool mHaveExternalHists =
false;
318 std::vector<TH1F**> mHist1D_pos{};
319 std::vector<TH2F**> mHist2D_pos{};
320 std::vector<TH1D**> mHist1Dd_pos{};
321 std::vector<TGraphAsymmErrors**> mHistGraph_pos{};
324 template <
class T,
typename... Args>
325 void createHist(T*&
h,
const char*
name, Args... args);
327 std::unique_ptr<internal::GPUQAGarbageCollection> mGarbageCollector;
328 template <
class T,
typename... Args>
329 T* createGarbageCollected(Args... args);
330 void clearGarbagageCollector();
332 int32_t mNEvents = 0;
333 bool mQAInitialized =
false;
334 bool mO2MCDataLoaded =
false;
335 int32_t mQATasks = 0;
336 std::vector<std::vector<int32_t>> mcEffBuffer;
337 std::vector<std::vector<int32_t>> mcLabelBuffer;
338 std::vector<std::vector<bool>> mGoodTracks;
339 std::vector<std::vector<bool>> mGoodHits;
341 std::vector<uint64_t> mTrackingScratchBuffer;
343 static std::vector<TColor*> mColors;
344 static int32_t initColors();
346 int32_t mMCTrackMin = -1, mMCTrackMax = -1;
351inline bool GPUQA::SuppressTrack(int32_t iTrack)
const {
return (mConfig.matchMCLabels.size() && !mGoodTracks[mNEvents][iTrack]); }
352inline bool GPUQA::SuppressHit(int32_t iHit)
const {
return (mConfig.matchMCLabels.size() && !mGoodHits[mNEvents - 1][iHit]); }
353inline int32_t
GPUQA::HitAttachStatus(int32_t iHit)
const {
return (mClusterParam.size() && mClusterParam[iHit].fakeAttached ? (mClusterParam[iHit].attached ? 1 : 2) : 0); }
Class for time synchronization of RawReader instances.
int32_t ReadO2MCData(const char *filename)
bool clusterRemovable(int32_t attach, bool prot) const
int32_t HitAttachStatus(int32_t iHit) const
void * AllocateScratchBuffer(size_t nBytes)
static bool QAAvailable()
void SetMCTrackRange(int32_t min, int32_t max)
bool SuppressTrack(int32_t iTrack) const
mcLabelI_t GetMCTrackLabel(uint32_t trackId) const
int32_t DrawQAHistograms()
void UpdateChain(GPUChainTracking *chain)
static bool IsInitialized()
bool SuppressHit(int32_t iHit) const
int32_t InitQA(int32_t tasks=0)
void DumpO2MCData(const char *filename) const
void RunQA(bool matchOnly=false)
GLuint const GLchar * name
GLuint GLsizei const GLchar * label
bool isValid(std::string_view dcsAlias)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool operator!=(const observer_ptr< W1 > &p1, const observer_ptr< W2 > &p2)
bool operator==(const observer_ptr< W1 > &p1, const observer_ptr< W2 > &p2)