Project
Loading...
Searching...
No Matches
IndexTableUtils.cxx
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.
15
17
18namespace o2
19{
20namespace its
21{
22
23const std::vector<std::pair<int, int>> index_table_utils::selectClusters(
24 const std::array<int, constants::index_table::ZBins * constants::index_table::PhiBins + 1>& indexTable,
25 const std::array<int, 4>& selectedBinsRect)
26{
27 std::vector<std::pair<int, int>> filteredBins{};
28
29 int phiBinsNum{selectedBinsRect[3] - selectedBinsRect[1] + 1};
30
31 if (phiBinsNum < 0) {
32 phiBinsNum += constants::index_table::PhiBins;
33 }
34
35 filteredBins.reserve(phiBinsNum);
36
37 for (int iPhiBin{selectedBinsRect[1]}, iPhiCount{0}; iPhiCount < phiBinsNum;
38 iPhiBin = ++iPhiBin == constants::index_table::PhiBins ? 0 : iPhiBin, iPhiCount++) {
39
40 const int firstBinIndex{index_table_utils::getBinIndex(selectedBinsRect[0], iPhiBin)};
41
42 filteredBins.emplace_back(indexTable[firstBinIndex],
43 countRowSelectedBins(indexTable, iPhiBin, selectedBinsRect[0], selectedBinsRect[2]));
44 }
45
46 return filteredBins;
47}
48} // namespace its
49} // namespace o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...