32class TGraphAsymmErrors;
35#if !defined(GPUCA_BUILD_QA) || defined(GPUCA_GPUCODE)
46 void RunQA(
bool matchOnly =
false) {}
81struct ClusterNativeAccess;
89class GPUChainTracking;
92struct checkClusterStateResult;
95struct GPUQAGarbageCollection;
102 GPUQA(GPUChainTracking*
chain,
const GPUSettingsQA* config =
nullptr,
const GPUParam*
param =
nullptr);
106 using mcLabels_t = gsl::span<const o2::MCCompLabel>;
119 void UpdateParam(
const GPUParam*
param) { mParam =
param; }
121 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);
123 void DrawQAHistogramsCleanup();
131 void InitO2MCData(GPUTrackingInOutPointers* updateIOPtr =
nullptr);
138 const std::vector<TH1F>& getHistograms1D()
const {
return *mHist1D; }
139 const std::vector<TH2F>& getHistograms2D()
const {
return *mHist2D; }
140 const std::vector<TH1D>& getHistograms1Dd()
const {
return *mHist1Dd; }
141 const std::vector<TGraphAsymmErrors>& getGraphs()
const {
return *mHistGraph; }
143 int32_t loadHistograms(std::vector<TH1F>& i1, std::vector<TH2F>& i2, std::vector<TH1D>& i3, std::vector<TGraphAsymmErrors>& i4,
int32_t tasks = -1);
146 static constexpr int32_t N_CLS_HIST = 8;
147 static constexpr int32_t N_CLS_TYPE = 3;
149 static constexpr int32_t MC_LABEL_INVALID = -1e9;
154 struct additionalMCParameters {
155 float pt,
phi, theta, eta, nWeightCls;
158 struct additionalClusterParameters {
159 int32_t attached, fakeAttached, adjacent, fakeAdjacent;
163 int32_t InitQACreateHistograms();
166 void CopyO2MCtoIOPtr(GPUTrackingInOutPointers*
ptr);
168 void SetAxisSize(T*
e);
169 void SetLegend(TLegend* l,
bool bigText =
false);
170 double* CreateLogAxis(
int32_t nbins,
float xmin,
float xmax);
171 void ChangePadTitleSize(TPad* p,
float size);
172 void DrawHisto(TH1* histo,
char*
filename,
char* options);
173 void doPerfFigure(
float x,
float y,
float size);
174 void GetName(
char* fname,
int32_t k,
bool noDash =
false);
176 T* GetHist(T*& ee, std::vector<std::unique_ptr<TFile>>& tin,
int32_t k,
int32_t nNewInput);
178 using mcInfo_t = GPUTPCMCInfo;
184 int32_t getTrackID()
const {
return AbsLabelID(track); }
185 int32_t getEventID()
const {
return 0; }
186 int32_t getSourceID()
const {
return 0; }
187 int64_t getTrackEventSourceID()
const {
return getTrackID(); }
188 bool isFake()
const {
return track < 0; }
189 bool isValid()
const {
return track != MC_LABEL_INVALID; }
190 bool isNoise()
const {
return false; }
191 void invalidate() {
track = MC_LABEL_INVALID; }
192 void setFakeFlag(
bool v =
true) {
track =
v ? FakeLabelID(track) : AbsLabelID(
track); }
193 void setNoise() {
track = MC_LABEL_INVALID; }
195 bool operator!=(
const mcLabel_t& l) {
return !(*
this == l); }
200 const mcLabels_t& GetMCLabel(
uint32_t i);
207 auto& GetMCTrackObj(T& obj,
const mcLabelI_t& l);
214 const mcInfo_t& GetMCTrack(
const mcLabel_t&
label);
223 float GetMCLabelWeight(
const mcLabel_t&
label);
225 const auto& GetClusterLabels();
228 template <
bool COUNT = false,
class T =
void>
229 checkClusterStateResult checkClusterState(
uint32_t attach, T* counts =
nullptr)
const;
231 GPUChainTracking* mTracking;
232 const GPUSettingsQA& mConfig;
233 const GPUParam* mParam;
237 std::vector<mcLabelI_t> mTrackMCLabels;
239 std::vector<std::vector<int32_t>> mTrackMCLabelsReverse;
240 std::vector<std::vector<int32_t>> mRecTracks;
241 std::vector<std::vector<int32_t>> mFakeTracks;
242 std::vector<std::vector<additionalMCParameters>> mMCParam;
244 std::vector<int32_t> mTrackMCLabelsReverse[1];
245 std::vector<int32_t> mRecTracks[1];
246 std::vector<int32_t> mFakeTracks[1];
247 std::vector<additionalMCParameters> mMCParam[1];
249 std::vector<mcInfo_t> mMCInfos;
250 std::vector<GPUTPCMCInfoCol> mMCInfosCol;
251 std::vector<uint32_t> mMCNEvents;
252 std::vector<uint32_t> mMCEventOffset;
254 std::vector<additionalClusterParameters> mClusterParam;
257 TH1F* mEff[6][2][2][5];
258 TGraphAsymmErrors* mEffResult[4][2][2][5];
269 TH1F* mPull[5][5][2];
275 enum CL_types { CL_attached = 0,
283 TH1D* mClusters[N_CLS_TYPE * N_CLS_HIST - 1];
284 TCanvas* mCClust[N_CLS_TYPE];
285 TPad* mPClust[N_CLS_TYPE];
286 TLegend* mLClust[N_CLS_TYPE];
289 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;
290 int64_t nMergedLooperConnected = 0, nMergedLooperUnconnected = 0, nCorrectlyAttachedNormalized = 0, nCorrectlyAttachedNormalizedNonFake = 0;
291 double nUnaccessible = 0;
296 TCanvas* mCTracks[3];
298 TLegend* mLTracks[3];
321 TH2F* mLowestRowDifferenceVsPad;
322 TH1F* mLowestRowTrackMultiplicity;
325 TCanvas* mCPadRow[4];
328 std::vector<TH2F*> mHistClusterCount;
330 std::vector<TH1F>* mHist1D =
nullptr;
331 std::vector<TH2F>* mHist2D =
nullptr;
332 std::vector<TH1D>* mHist1Dd =
nullptr;
333 std::vector<TGraphAsymmErrors>* mHistGraph =
nullptr;
334 bool mHaveExternalHists =
false;
335 std::vector<TH1F**> mHist1D_pos{};
336 std::vector<TH2F**> mHist2D_pos{};
337 std::vector<TH1D**> mHist1Dd_pos{};
338 std::vector<TGraphAsymmErrors**> mHistGraph_pos{};
341 template <
class T,
typename... Args>
342 void createHist(T*&
h,
const char*
name, Args... args);
344 std::unique_ptr<internal::GPUQAGarbageCollection> mGarbageCollector;
345 template <
class T,
typename... Args>
346 T* createGarbageCollected(Args... args);
347 void clearGarbagageCollector();
350 bool mQAInitialized =
false;
351 bool mO2MCDataLoaded =
false;
353 std::vector<std::vector<int32_t>> mcEffBuffer;
354 std::vector<std::vector<int32_t>> mcLabelBuffer;
355 std::vector<std::vector<bool>> mGoodTracks;
356 std::vector<std::vector<bool>> mGoodHits;
358 std::vector<uint64_t> mTrackingScratchBuffer;
360 static std::vector<TColor*> mColors;
363 int32_t mMCTrackMin = -1, mMCTrackMax = -1;
366 FILE* mTextDump =
nullptr;
370inline bool GPUQA::SuppressHit(
int32_t iHit)
const {
return (mConfig.matchMCLabels.size() && !mGoodHits[mNEvents - 1][iHit]); }
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h internal
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
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
const bool const int TrackITSInternal< NLayers > & track
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)
bool isValid(std::string alias)