16#ifndef TRACKINGITSU_INCLUDE_TRACKER_H_
17#define TRACKINGITSU_INCLUDE_TRACKER_H_
53 using LogFunc = std::function<
void(
const std::string& s)>;
60 void clustersToTracks(LogFunc = [](std::string s) { std::cout << s << std::endl; }, LogFunc = [](std::string s) { std::cerr << s << std::endl; });
73 void initialiseTimeFrame(
int& iteration);
74 void computeTracklets(
int& iteration,
int& iROFslice,
int& iVertex);
75 void computeCells(
int& iteration);
76 void findCellsNeighbours(
int& iteration);
77 void findRoads(
int& iteration);
78 void findShortPrimaries();
79 void extendTracks(
int& iteration);
82 void computeRoadsMClabels();
83 void computeTracksMClabels();
84 void rectifyClusterIndices();
86 template <
typename... T>
87 float evaluateTask(
void (
Tracker::*)(T...), const
char*, LogFunc logger, T&&... args);
92 std::vector<TrackingParameters> mTrkParams;
95 unsigned int mNumberOfDroppedTFs{0};
96 unsigned int mTimeFrameCounter{0};
102 mTrkParams = trkPars;
105template <
typename... T>
106float Tracker::evaluateTask(
void (
Tracker::*task)(T...), const
char* taskName, LogFunc logger, T&&... args)
111 auto start = std::chrono::high_resolution_clock::now();
112 (this->*task)(std::forward<T>(args)...);
113 auto end = std::chrono::high_resolution_clock::now();
115 std::chrono::duration<double, std::milli> diff_t{
end -
start};
116 diff = diff_t.count();
118 std::stringstream sstream;
119 if (taskName ==
nullptr) {
120 sstream << diff <<
"\t";
122 sstream << std::setw(2) <<
" - " << taskName <<
" completed in: " << diff <<
" ms";
124 logger(sstream.str());
126 if (mTrkParams[0].SaveTimeBenchmarks) {
127 std::stringstream str2file;
128 std::string taskNameStr(taskName);
129 std::transform(taskNameStr.begin(), taskNameStr.end(), taskNameStr.begin(),
130 [](
unsigned char c) { return std::tolower(c); });
131 std::replace(taskNameStr.begin(), taskNameStr.end(),
' ',
'_');
132 str2file << taskNameStr <<
"\t" << diff;
134 file.open(
"its_time_benchmarks.txt", std::ios::app);
135 file << str2file.str() << std::endl;
140 (this->*task)(std::forward<T>(args)...);
Definition of the ITS track.
void adoptTimeFrame(TimeFrame &tf)
void setCorrType(const o2::base::PropagatorImpl< float >::MatCorrType type)
void setParameters(const std::vector< TrackingParameters > &)
void printSummary() const
std::vector< TrackingParameters > & getParameters()
void getGlobalConfiguration()
void clustersToTracks(LogFunc=[](std::string s) { std::cout<< s<< std::endl;}, LogFunc=[](std::string s) { std::cerr<< s<< std::endl;})
GLint GLint GLsizei GLint GLenum GLenum type
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
constexpr bool DoTimeBenchmarks
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf