ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
CaloRecGPU::NeighArr Struct Reference

#include <NeighArr.h>

Collaboration diagram for CaloRecGPU::NeighArr:

Public Member Functions

constexpr int get_total_number_of_neighbours (const int cell) const
 
constexpr int get_neighbour (const int cell, const int neigh_number) const
 
constexpr void set_neighbour (const int cell, const int neigh_number, const int neigh_v)
 
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 of such neighbours (not the total number of neighbours of the cell). More...
 
constexpr int get_number_of_neighbours (const unsigned int neigh_options, const int cell) const
 

Public Attributes

NeighOffset::carrier offsets [NCaloCells]
 
int cells [NCaloCells][NMaxNeighbours]
 

Detailed Description

Definition at line 170 of file NeighArr.h.

Member Function Documentation

◆ get_neighbour()

constexpr int CaloRecGPU::NeighArr::get_neighbour ( const int  cell,
const int  neigh_number 
) const
inlineconstexpr

Definition at line 187 of file NeighArr.h.

188  {
189  return cells[cell][neigh_number];
190  }

◆ get_neighbours()

constexpr int CaloRecGPU::NeighArr::get_neighbours ( const unsigned int  neigh_options,
const int  cell,
int *  neigh_arr 
) const
inlineconstexpr

Places the neighbours according to the option(s) in neigh_options in the array and returns the number of such neighbours (not the total number of neighbours of the cell).

We're using C arrays for more immediate CUDA compatibility.

Definition at line 202 of file NeighArr.h.

203  {
204  const NeighOffset neigh_off = offsets[cell];
205 
206  int neigh_arr_len = 0;
207  int limit = 0;
208  int neigh = 0;
209 
210  for (int i = 0; i < NumNeighOptions; ++i)
211  {
212  limit = neigh_off.get_end_cell(i);
213  if ( neigh_options & (1U << i) )
214  {
215  for (; neigh < limit; ++neigh)
216  {
217  neigh_arr[neigh_arr_len] = cells[cell][neigh];
218  ++neigh_arr_len;
219  }
220  }
221  neigh = limit;
222  }
223  return neigh_arr_len;
224  }

◆ get_number_of_neighbours()

constexpr int CaloRecGPU::NeighArr::get_number_of_neighbours ( const unsigned int  neigh_options,
const int  cell 
) const
inlineconstexpr

Definition at line 226 of file NeighArr.h.

227  {
228  const NeighOffset neigh_off = offsets[cell];
229  int ret = 0;
230  for (int i = 0; i < NumNeighOptions; ++i)
231  {
232  if ( neigh_options & (1U << i) )
233  {
234  ret += neigh_off.get_num_cells(i);
235  }
236  }
237  return ret;
238  }

◆ get_total_number_of_neighbours()

constexpr int CaloRecGPU::NeighArr::get_total_number_of_neighbours ( const int  cell) const
inlineconstexpr

Definition at line 181 of file NeighArr.h.

182  {
183  const NeighOffset neigh_off = offsets[cell];
184  return neigh_off.get_total_number();
185  }

◆ set_neighbour()

constexpr void CaloRecGPU::NeighArr::set_neighbour ( const int  cell,
const int  neigh_number,
const int  neigh_v 
)
inlineconstexpr

Definition at line 192 of file NeighArr.h.

193  {
194  cells[cell][neigh_number] = neigh_v;
195  }

Member Data Documentation

◆ cells

int CaloRecGPU::NeighArr::cells[NCaloCells][NMaxNeighbours]

Definition at line 173 of file NeighArr.h.

◆ offsets

NeighOffset::carrier CaloRecGPU::NeighArr::offsets[NCaloCells]

Definition at line 172 of file NeighArr.h.


The documentation for this struct was generated from the following file:
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloRecGPU::NeighArr::offsets
NeighOffset::carrier offsets[NCaloCells]
Definition: NeighArr.h:172
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloRecGPU::NeighArr::cells
int cells[NCaloCells][NMaxNeighbours]
Definition: NeighArr.h:173
CaloRecGPU::NumNeighOptions
constexpr int NumNeighOptions
Definition: BaseDefinitions.h:47
updateCoolNtuple.limit
int limit
Definition: updateCoolNtuple.py:45