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
53template <typename T1, typename T2>
54std::array<int, 10> perChamber(gsl::span<const T1> items, gsl::span<const T2> subitems);
55
57template <typename T>
58std::array<int, 5> perStation(gsl::span<const T> items)
59{
60 std::array<int, 5> st{};
61 std::array<int, 10> ch = perChamber(items);
62 for (auto i = 0; i < st.size(); ++i) {
63 st[i] = ch[2 * i] + ch[2 * i + 1];
64 }
65 return st;
66}
67
68} // namespace o2::mch
69
70#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:20
std::array< int, 10 > perChamber(gsl::span< const T > items)
std::array< int, 5 > perStation(gsl::span< const T > items)
Definition Trackable.h:58