15#ifndef GPUTPCGMMERGER_H
16#define GPUTPCGMMERGER_H
29#if !defined(GPUCA_GPUCODE)
45class GPUTPCSectorTrack;
46class GPUTPCGMTrackParam;
48class GPUChainTracking;
49class GPUTPCGMPolynomialField;
50struct GPUTPCGMLoopData;
53struct MergeLooperParam;
125 GPUhdi()
uint32_t NMaxMergedTrackClusters()
const {
return mNMaxMergedTrackClusters; }
126 GPUhdi()
uint32_t NMergedTrackClusters()
const {
return mMemory->nMergedTrackClusters; }
140 GPUhdi() internal::MergeLooperParam* LooperCandidates() {
return mLooperCandidates; }
142 GPUhdi() gputpcgmmergertypes::GPUTPCGMBorderRange* BorderRange(
int32_t i) {
return mBorderRange[
i]; }
143 GPUhdi()
const gputpcgmmergertypes::GPUTPCGMBorderRange* BorderRange(
int32_t i)
const {
return mBorderRange[
i]; }
151 GPUhdi()
int32_t NMaxSingleSectorTracks()
const {
return mNMaxSingleSectorTracks; }
157 GPUd()
uint16_t MemoryResOutputState()
const {
return mMemoryResOutputState; }
158 GPUd()
uint16_t MemoryResOutputO2()
const {
return mMemoryResOutputO2; }
159 GPUd()
uint16_t MemoryResOutputO2Clus()
const {
return mMemoryResOutputO2Clus; }
160 GPUd()
uint16_t MemoryResOutputO2MC()
const {
return mMemoryResOutputO2MC; }
161 GPUd()
uint16_t MemoryResOutputO2Scratch()
const {
return mMemoryResOutputO2Scratch; }
213 void DumpTrackClusters(std::ostream& out,
bool non0StateOnly =
false,
bool noNDF0 =
false)
const;
215 template <
int32_t mergeType>
223 void DebugStreamerUpdate(
int32_t iTrk,
int32_t ihit,
float xx,
float yy,
float zz,
const GPUTPCGMMergedTrackHit& cluster,
const o2::tpc::ClusterNative& clusterNative,
const GPUTPCGMTrackParam& track,
const GPUTPCGMPropagator& prop,
const gputpcgmmergertypes::InterpolationErrorHit& interpolation,
int8_t rejectChi2,
bool refit,
int32_t retVal,
float avgInvCharge,
float posY,
float posZ, int16_t clusterState,
int32_t retValReject,
float err2Y,
float err2Z)
const;
230 GPUdi()
int32_t SectorTrackInfoLocalTotal()
const {
return mSectorTrackInfoIndex[NSECTORS]; }
231 GPUdi()
int32_t SectorTrackInfoTotal()
const {
return mSectorTrackInfoIndex[2 * NSECTORS]; }
239 GPUd()
void MergeBorderTracks(
int32_t nBlocks,
int32_t nThreads,
int32_t iBlock,
int32_t iThread,
int32_t iSector1,
const GPUTPCGMBorderTrack* B1,
int32_t N1,
int32_t iSector2,
const GPUTPCGMBorderTrack* B2,
int32_t N2,
uint8_t mergeMode = 0);
245 template <
class T,
class S>
246 int64_t GetTrackLabelA(
const S& trk)
const;
248 int64_t GetTrackLabel(
const S& trk)
const;
254 int32_t mNextSectorInd[NSECTORS];
255 int32_t mPrevSectorInd[NSECTORS];
257 int32_t* mTrackLinks =
nullptr;
262 uint32_t mNMaxSingleSectorTracks = 0;
263 uint32_t mNMaxMergedTrackClusters = 0;
280 int32_t* mSectorTrackInfoIndex =
nullptr;
283 o2::tpc::
TrackTPC* mOutputTracksTPCO2 =
nullptr;
284 uint32_t* mOutputClusRefsTPCO2 =
nullptr;
286 internal::MergeLooperParam* mLooperCandidates =
nullptr;
288 uint32_t* mTrackOrderAttach =
nullptr;
289 uint32_t* mTrackOrderProcess =
nullptr;
290 uint8_t* mClusterStateExt =
nullptr;
291 uint2* mClusRefTmp =
nullptr;
293 int32_t* mTmpSortMemory =
nullptr;
295 tmpSort* mTrackSortO2 =
nullptr;
299 gputpcgmmergertypes::GPUTPCGMBorderRange* mBorderRangeMemory =
nullptr;
300 gputpcgmmergertypes::GPUTPCGMBorderRange* mBorderRange[NSECTORS];
301 memory* mMemory =
nullptr;
unsigned short int uint16_t
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
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 false
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
std::vector< o2::its::TrackITS > tracks
void * SetPointersRefitScratch(void *mem)
GPUd() uint16_t MemoryResOutputO2Clus() const
void DumpTrackParam(std::ostream &out) const
GPUhdi() uint32_t NMergedTrackClusters() const
void CheckCollectedTracks()
void RegisterMemoryAllocation()
GPUhdi() const gputpcgmmergertypes
GPUhdi() uint32_t NOutputTracksTPCO2() const
int32_t int32_t int32_t int32_t uint8_t mergeMode
void DumpMergeCE(std::ostream &out) const
void DumpMergedBetweenSectors(std::ostream &out) const
GPUd() uint16_t MemoryResOutputO2Scratch() const
GPUhdi() GPUdEdxInfo *MergedTracksdEdxAlt()
GPUhdi() uint32_t NClusters() const
void DumpFitPrepare(std::ostream &out) const
void * SetPointersMemory(void *mem)
int32_t int32_t int32_t gputpcgmmergertypes::GPUTPCGMBorderRange int32_t int32_t cmpMax
GPUhdi() int32_t NMergedTracks() const
GPUhdi() uint32_t *TrackOrderAttach() const
GPUdi() int32_t SectorTrackInfoFirst(int32_t iSector) const
void DebugRefitMergedTrack(const GPUTPCGMMergedTrack &track) const
GPUd() uint16_t MemoryResOutputO2() const
int32_t int32_t int32_t bool output
GPUdi() int32_t SectorTrackInfoLocalTotal() const
int32_t int32_t int32_t gputpcgmmergertypes::GPUTPCGMBorderRange int32_t N
GPUhdi() GPUAtomic(uint32_t) *TmpCounter()
const GPUTPCTrack * inTrack
int32_t GPUTPCGMBorderTrack GPUTPCGMBorderTrack *& b2
GPUhdi() uint32_t NMaxClusters() const
void DumpTrackLinks(std::ostream &out, bool output, const char *type) const
GPUhdi() uint32_t NOutputClusRefsTPCO2() const
GPUhdi() uint32_t *RetryRefitIds() const
void DumpFinal(std::ostream &out) const
GPUhdi() uint32_t *TrackOrderProcess() const
void * SetPointersOutput(void *mem)
GPUhdi() GPUAtomic(uint32_t) *ClusterAttachment() const
void MergedTrackStreamer(const GPUTPCGMBorderTrack &b1, const GPUTPCGMBorderTrack &b2, const char *name, int32_t sector1, int32_t sector2, uint8_t mergeMode, float weight, float frac) const
std::vector< float > StreamerUncorrectedZY(int32_t iSector, int32_t iRow, const GPUTPCGMTrackParam &track, const GPUTPCGMPropagator &prop) const
GPUhdi() GPUTPCGMMergedTrackHit *Clusters()
void InitializeProcessor()
GPUhdi() int32_t *TmpSortMemory()
void * SetPointersOutputO2MC(void *mem)
GPUhdi() GPUdEdxInfo *MergedTracksdEdx()
GPUd() uint16_t MemoryResOutputO2MC() const
const GPUTPCGMMerger & operator=(const GPUTPCGMMerger &) const =delete
GPUTPCGMMerger(const GPUTPCGMMerger &)=delete
GPUd() uint16_t MemoryResOutput() const
void * SetPointersOutputO2Scratch(void *mem)
GPUhdi() const GPUdEdxInfo *MergedTracksdEdx() const
void * SetPointersMerger(void *mem)
std::vector< uint32_t > StreamerOccupancyBin(int32_t iSector, int32_t iRow, float time) const
@ mergeWithOriginalParameters
GPUhdi() GPUTPCGMSectorTrack *SectorTrackInfos()
GPUhdi() uint8_t *ClusterStateExt() const
void DumpRefit(std::ostream &out) const
void DumpMergedWithinSectors(std::ostream &out) const
GPUhdi() gputpcgmmergertypes
GPUhdi() uint2 *ClusRefTmp()
void DumpCollected(std::ostream &out) const
void DumpMergeRanges(std::ostream &out, uint8_t mergeMode) const
void * SetPointersOutputO2Clus(void *mem)
void * SetPointersOutputState(void *mem)
GPUhdi() uint32_t *OutputClusRefsTPCO2()
GPUhdi() GPUAtomic(uint32_t) *SharedCount()
int32_t GPUTPCGMBorderTrack GPUTPCGMBorderTrack int32_t & jSector
void DumpTrackClusters(std::ostream &out, bool non0StateOnly=false, bool noNDF0=false) const
const GPUTPCGMBorderTrack & MergedTrackStreamerFindBorderTrack(const GPUTPCGMBorderTrack *tracks, int32_t N, int32_t trackId) const
GPUhdi() const GPUTPCGMMergedTrack *MergedTracks() const
int32_t int32_t int32_t int32_t border0
void DumpLoopers(std::ostream &out) const
GPUhdi() uint32_t NMaxTracks() const
GPUdi() int32_t SectorTrackInfoGlobalFirst(int32_t iSector) const
~GPUTPCGMMerger()=default
GPUhdi() GPUTPCGMMergedTrack *MergedTracks()
void DebugStreamerUpdate(int32_t iTrk, int32_t ihit, float xx, float yy, float zz, const GPUTPCGMMergedTrackHit &cluster, const o2::tpc::ClusterNative &clusterNative, const GPUTPCGMTrackParam &track, const GPUTPCGMPropagator &prop, const gputpcgmmergertypes::InterpolationErrorHit &interpolation, int8_t rejectChi2, bool refit, int32_t retVal, float avgInvCharge, float posY, float posZ, int16_t clusterState, int32_t retValReject, float err2Y, float err2Z) const
GPUhdi() int32_t *TrackIDs()
static GPUglobalconstexpr() const int32_t NSECTORS
int32_t int32_t int32_t iThread
GPUdi() int32_t SectorTrackInfoGlobalLast(int32_t iSector) const
GPUhdi() GPUTPCGMLoopData *LoopData() const
GPUd() uint16_t MemoryResOutputState() const
const GPUTPCTrack float int32_t sector
int32_t GPUTPCGMBorderTrack *& b1
GPUdi() int32_t SectorTrackInfoLast(int32_t iSector) const
int32_t int32_t int32_t int32_t int32_t int8_t useOrigTrackParam
GPUd() uint16_t MemoryResMemory()
void MergedTrackStreamerInternal(const GPUTPCGMBorderTrack &b1, const GPUTPCGMBorderTrack &b2, const char *name, int32_t sector1, int32_t sector2, uint8_t mergeMode, float weight, float frac) const
GPUdi() int32_t SectorTrackInfoTotal() const
GPUhdi() int32_t NMaxSingleSectorTracks() const
GPUhdi() const GPUTPCGMMergedTrackHit *Clusters() const
GPUhdi() tmpSort *TrackSortO2()
GPUhdi() memory *Memory() const
int32_t GPUTPCGMBorderTrack GPUTPCGMBorderTrack int32_t int32_t uint8_t mergeMode const
int32_t const GPUTPCTrack * sectorTr
void DumpSectorTracks(std::ostream &out) const
void SetMaxData(const GPUTrackingInOutPointers &io)
int32_t int32_t int32_t int32_t int32_t border1
GPUhdi() const GPUdEdxInfo *MergedTracksdEdxAlt() const
void * SetPointersOutputO2(void *mem)
GPUhdi() uint32_t *TrackSort()
GPUhdi() uint32_t NMaxMergedTrackClusters() const
GLfloat GLfloat GLfloat alpha
GLuint const GLchar * name
GLuint GLuint GLfloat weight
GLint GLint GLsizei GLint GLenum GLenum type
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
Global TPC definitions and constants.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUAtomic(uint32_t) nRetryRefit
GPUAtomic(uint32_t) nMergedTracks
GPUAtomic(uint32_t) nLoopData
GPUAtomic(uint32_t) nO2Tracks
GPUAtomic(uint32_t) nUnpackedTracks
GPUAtomic(uint32_t) nLooperMatchCandidates
GPUAtomic(uint32_t) nMergedTrackClusters
GPUAtomic(uint32_t) nO2ClusRefs
GPUAtomic(uint32_t) tmpCounter[2 *NSECTORS]