17#include "benchmark/benchmark.h"
32 std::vector<o2::mid::Cluster>
clusters;
34 std::vector<o2::mid::Track> tracks = trackGen.
generate(nTracks);
35 for (
auto& track : tracks) {
36 for (
int ich = 0; ich < 4; ++ich) {
39 for (
auto& hit : hits) {
41 float xPos = hit.xCoor;
42 float yPos = hit.yCoor;
43 stripIndex = mapping.stripByPosition(xPos, yPos, 0, deId,
false);
48 area = mapping.stripByLocation(stripIndex.
strip, 0, stripIndex.
line, stripIndex.
column, deId);
49 cl.
yCoor = area.getCenterY();
50 cl.
yErr = area.getHalfSizeY() / std::sqrt(3.);
51 stripIndex = mapping.stripByPosition(xPos, yPos, 1, deId,
false);
52 area = mapping.stripByLocation(stripIndex.
strip, 1, stripIndex.
line, stripIndex.
column, deId);
53 cl.
xCoor = area.getCenterX();
54 cl.
xErr = area.getHalfSizeX() / std::sqrt(3.);
62static void BM_TRACKER(benchmark::State&
state)
70 int nTracksPerEvent =
state.range(0);
71 tracker.init((
state.range(1) == 1));
76 for (
auto _ :
state) {
84 state.counters[
"num"] = benchmark::Counter(
num, benchmark::Counter::kIsRate);
87static void CustomArguments(benchmark::internal::Benchmark* bench)
89 for (
int itrack = 1; itrack <= 8; ++itrack) {
90 for (
int imethod = 0; imethod < 2; ++imethod) {
91 bench->Args({itrack, imethod});
96BENCHMARK(BM_TRACKER)->Apply(CustomArguments)->Unit(benchmark::kNanosecond);
Track reconstruction algorithm for MID.
Fast track generator for MID.
std::vector< o2::mid::ColumnData > inputData
std::vector< o2::mid::Cluster > generateTestData(int nTracks, o2::mid::TrackGenerator &trackGen, const o2::mid::HitFinder &hitFinder, const o2::mid::Mapping &mapping)
BENCHMARK(BM_TRACKER) -> Apply(CustomArguments) ->Unit(benchmark::kNanosecond)
Class to find the impact point of a track on the chamber.
std::vector< Cluster > getLocalPositions(const Track &track, int chamber, bool withUncertainties=false) const
Class to generate tracks for MID.
std::vector< Track > generate()
Tracking algorithm for MID.
constexpr std::array< std::string_view, BasicOp::Conditional+1 > mapping
a map between BasicOp and tokens in string expressions
GeometryTransformer createDefaultTransformer()
cluster structure for MID
float yErr
Cluster resolution along y.
float xErr
Cluster resolution along x.
uint8_t deId
Detection element ID.
Indexes required to define a strip in the detection element.
int strip
Line of the local board in the column.
bool isValid()
Check if Strip is Valid.
int line
Column in the DE.
std::vector< Cluster > clusters