Project
Loading...
Searching...
No Matches
Trackable.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_MCH_TRACKABLE_H
13#define O2_MCH_TRACKABLE_H
14
15#include <array>
16#include <functional>
17#include <gsl/span>
18
19namespace o2::mch
20{
21
34bool isTrackable(std::array<int, 10> itemsPerChamber,
35 std::array<bool, 5> requestStation = {true, true, true, true, true},
36 bool moreCandidates = false);
37
43template <typename T>
44std::array<int, 10> perChamber(gsl::span<const T> items);
45
47template <typename T>
48std::array<int, 5> perStation(gsl::span<const T> items)
49{
50 std::array<int, 5> st{};
51 std::array<int, 10> ch = perChamber(items);
52 for (auto i = 0; i < st.size(); ++i) {
53 st[i] = ch[2 * i] + ch[2 * i + 1];
54 }
55 return st;
56}
57
58} // namespace o2::mch
59
60#endif
int32_t i
benchmark::State & st
bool isTrackable(std::array< int, 10 > itemsPerChamber, std::array< bool, 5 > requestStation={true, true, true, true, true}, bool moreCandidates=false)
Definition Trackable.cxx:18
std::array< int, 10 > perChamber(gsl::span< const T > items)
std::array< int, 5 > perStation(gsl::span< const T > items)
Definition Trackable.h:48