7#ifndef CALORECGPU_NEIGHARR_H
8#define CALORECGPU_NEIGHARR_H
58 1 <
sizeof(
carrier) * CHAR_BIT,
"All the offsets must fit within the carrier!" );
93 return (uint32_t) ret;
146 carrier mask = 0xFFFFFFFFFFFFFFFFULL;
189 return cells[cell][neigh_number];
192 constexpr void set_neighbour(
const int cell,
const int neigh_number,
const int neigh_v)
194 cells[cell][neigh_number] = neigh_v;
202 constexpr int get_neighbours(
const unsigned int neigh_options,
const int cell,
int * neigh_arr)
const
206 int neigh_arr_len = 0;
213 if ( neigh_options & (1U << i) )
215 for (; neigh < limit; ++neigh)
217 neigh_arr[neigh_arr_len] =
cells[cell][neigh];
223 return neigh_arr_len;
232 if ( neigh_options & (1U << i) )
255 constexpr int s_pairs_end[
NumNeighOptions] = {184128, 368256, 551424, 733312, 1483056, 1960492, 2437928, 2438824, 2439720, 2500008, 2530412, 2560816};
258 if (
pair < s_pairs_end[i])
266 constexpr bool is_valid(
const int pair,
const unsigned int options,
const bool limited_PS,
const bool limited_HECIW_FCal)
const
269 if (opt_idx < 0 || !(options & (1U << opt_idx)) )
276 constexpr int limited_option = 6;
287 constexpr int s_PS_start[
NumNeighOptions] = {173888, 358016, 541056, 723584, 1432784, 1954480, 2364410, 2438696, 2439336, 2500008, 2529160, 2559756};
288 constexpr int s_HECIW_FCal_start[
NumNeighOptions] = {183232, 367360, 550272, 732672, 1469392, 1954480, 2435450, 2438824, 2439720, 2500008, 2529160, 2559756};
290 if (limited_PS && opt_idx != limited_option)
292 if (
pair >= s_PS_start[opt_idx] &&
pair < s_HECIW_FCal_start[opt_idx])
298 if (limited_HECIW_FCal && opt_idx != limited_option)
300 if (
pair >= s_HECIW_FCal_start[opt_idx])
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
constexpr int NMaxNeighbours
constexpr int NumNeighOptions
constexpr int NExactPairs
constexpr int get_neighbours(const unsigned int neigh_options, const int cell, int *neigh_arr) const
Places the neighbours according to the option(s) in neigh_options in the array and returns the number...
int cells[NCaloCells][NMaxNeighbours]
constexpr int get_total_number_of_neighbours(const int cell) const
constexpr int get_number_of_neighbours(const unsigned int neigh_options, const int cell) const
constexpr void set_neighbour(const int cell, const int neigh_number, const int neigh_v)
constexpr int get_neighbour(const int cell, const int neigh_number) const
NeighOffset::carrier offsets[NCaloCells]
A class that expresses the offset from the beginning of the neighbours list for the several neighbour...
constexpr int get_total_number() const
static constexpr carrier s_offset_mask_last
static constexpr carrier s_offset_delta_pattern
static constexpr carrier s_last_bit_mask
static constexpr int s_more_bits_begin
constexpr NeighOffset & operator=(const carrier v)
constexpr NeighOffset(const carrier v)
constexpr int get_number(const int i) const
static constexpr carrier s_offset_mask
constexpr int get_start_cell(const int option) const
constexpr int get_num_cells(const int option) const
unsigned long long int carrier
static constexpr int s_bits_per_offset
static constexpr int s_bits_per_last_offset
constexpr int get_end_cell(const int option) const
To clarify, this cell no longer corresponds to the option, so it's one past the end (like the end ite...
static constexpr carrier s_only_numbers_mask
static constexpr carrier s_numbers_to_keep
static constexpr carrier offset_delta(const int i)
Returns, for each i, what must be added to the offset to increase the stores numbers appropriately wh...
constexpr bool is_valid(const int pair, const unsigned int options, const bool limited_PS, const bool limited_HECIW_FCal) const
constexpr int get_option(const int pair) const