17#include "benchmark/benchmark.h"
20static void segmentationList(benchmark::internal::Benchmark*
b)
34 int detElemId =
state.range(0);
45 std::vector<int> deids;
47 [&deids](
int detElemId) { deids.push_back(detElemId); });
52static void benchSegmentationCtorAll(benchmark::State&
state)
55 for (
auto _ :
state) {
56 for (
auto detElemId : deids) {
62static void benchSegmentationCtorMap(benchmark::State&
state)
65 std::map<int, o2::mch::mapping::Segmentation> cache;
67 for (
auto _ :
state) {
68 for (
auto detElemId : deids) {
74static void benchSegmentationCtorMapPtr(benchmark::State&
state)
77 std::map<int, o2::mch::mapping::Segmentation*> cache;
79 for (
auto _ :
state) {
80 for (
auto detElemId : deids) {
85BENCHMARK(benchSegmentationCtorAll)->Unit(benchmark::kMillisecond);
86BENCHMARK(benchSegmentationCtorMap)->Unit(benchmark::kMillisecond);
87BENCHMARK(benchSegmentationCtorMapPtr)->Unit(benchmark::kMillisecond);
o2::mch::mapping::CathodeSegmentation seg
std::vector< int > getDetElemIds()
BENCHMARK_REGISTER_F(BenchSegO2, ctor) -> Apply(segmentationList) ->Unit(benchmark::kMicrosecond)
BENCHMARK(benchSegmentationCtorAll) -> Unit(benchmark::kMillisecond)
A Segmentation lets you find pads of a detection element and then inspect those pads.
GLboolean GLboolean GLboolean b
int detElemId(Chamber chamber, Side side, int number)
void forOneDetectionElementOfEachSegmentationType(CALLABLE &&func)
void forEachDetectionElement(CALLABLE &&func)