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 161 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 178 of file NeighArr.h.

179  {
180  return cells[cell][neigh_number];
181  }

◆ 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 193 of file NeighArr.h.

194  {
195  const NeighOffset neigh_off = offsets[cell];
196 
197  int neigh_arr_len = 0;
198  int limit = 0;
199  int neigh = 0;
200 
201  for (int i = 0; i < NumNeighOptions; ++i)
202  {
203  limit = neigh_off.get_end_cell(i);
204  if ( neigh_options & (1U << i) )
205  {
206  for (; neigh < limit; ++neigh)
207  {
208  neigh_arr[neigh_arr_len] = cells[cell][neigh];
209  ++neigh_arr_len;
210  }
211  }
212  neigh = limit;
213  }
214  return neigh_arr_len;
215  }

◆ 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 217 of file NeighArr.h.

218  {
219  const NeighOffset neigh_off = offsets[cell];
220  int ret = 0;
221  for (int i = 0; i < NumNeighOptions; ++i)
222  {
223  if ( neigh_options & (1U << i) )
224  {
225  ret += neigh_off.get_num_cells(i);
226  }
227  }
228  return ret;
229  }

◆ get_total_number_of_neighbours()

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

Definition at line 172 of file NeighArr.h.

173  {
174  const NeighOffset neigh_off = offsets[cell];
175  return neigh_off.get_total_number();
176  }

◆ set_neighbour()

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

Definition at line 183 of file NeighArr.h.

184  {
185  cells[cell][neigh_number] = neigh_v;
186  }

Member Data Documentation

◆ cells

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

Definition at line 164 of file NeighArr.h.

◆ offsets

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

Definition at line 163 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:163
lumiFormat.i
int i
Definition: lumiFormat.py:92
ret
T ret(T t)
Definition: rootspy.cxx:260
CaloRecGPU::NeighArr::cells
int cells[NCaloCells][NMaxNeighbours]
Definition: NeighArr.h:164
CaloRecGPU::NumNeighOptions
constexpr int NumNeighOptions
Definition: BaseDefinitions.h:47
updateCoolNtuple.limit
int limit
Definition: updateCoolNtuple.py:45