|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef CALORECGPU_CONSTANTINFODEFINITIONS_H
8 #define CALORECGPU_CONSTANTINFODEFINITIONS_H
202 const carrier intra_calo_sampling,
206 const bool HECIW_or_FCal):
238 #if CALORECGPU_ADD_FULL_PAIRS_LIST_TO_CONSTANT_INFORMATION
260 return cell_info.
is_PS();
284 return cell_info.
region();
292 constexpr
int get_neighbours(
const unsigned int neigh_options,
const int cell,
int * neigh_arr)
const
309 struct DeAllocWrapper
320 CUDA_HOS_DEV DeAllocWrapper (
const DeAllocWrapper &) =
delete;
321 CUDA_HOS_DEV DeAllocWrapper (DeAllocWrapper &&) =
delete;
322 CUDA_HOS_DEV DeAllocWrapper & operator=(
const DeAllocWrapper &) =
delete;
323 CUDA_HOS_DEV DeAllocWrapper & operator=(DeAllocWrapper &&) =
delete;
347 else if (n_cells == 1)
356 for (
int i = 0;
i < n_cells; ++
i)
358 const int this_cell =
cells[
i];
360 const float delta_eta =
eta[this_cell] - test_eta;
361 const float delta_phi = Helpers::angular_difference(
phi[this_cell], test_phi);
479 const float sigma_1 = this->double_gaussian_constants[0][delta_from_tile_start][
gain];
480 const float sigma_2 = this->double_gaussian_constants[1][delta_from_tile_start][
gain];
481 const float ratio = this->double_gaussian_constants[2][delta_from_tile_start][
gain];
483 if ((sigma_1 == 0.
f && sigma_2 == 0.
f) ||
energy == 0.
f)
487 else if (sigma_1 == 0.
f)
491 else if (
ratio == 0.
f || sigma_2 == 0.
f)
496 const float x_1 =
energy / sigma_1;
497 const float x_2 =
energy / sigma_2;
498 const float x_1_abs = fabsf(x_1);
499 const float x_2_abs = fabsf(x_2);
501 const float min_abs =
min(x_1_abs, x_2_abs);
503 const float max_abs =
max(x_1_abs, x_2_abs);
514 const float y_1 = erff(Helpers::Constants::inv_sqrt2<float> * x_1);
515 const float y_2 = erff(Helpers::Constants::inv_sqrt2<float> * x_2);
518 const float z = (y_1 * sigma_1 +
ratio * y_2 * sigma_2) / (sigma_1 +
ratio * sigma_2);
520 const float ret = Helpers::Constants::sqrt2<float> * Helpers::erf_inv_wrapper(
z);
557 return sqrtf(first_factor * first_factor + second_factor * second_factor * this->luminosity);
559 return first_factor + second_factor * this->
luminosity;
static constexpr carrier invalid_value()
constexpr int intra_calorimeter_sampling(const int cell) const
constexpr OtherCellInfo & operator=(const carrier v)
constexpr OtherCellInfo(const carrier v)
constexpr bool is_PS(const int cell) const
constexpr carrier subcalo() const
constexpr bool is_total_noise() const
constexpr int get_closest_cell(const int sampling, const float test_eta, const float test_phi) const
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...
constexpr bool is_invalid() const
constexpr int int_ceil_div(const int num, const int denom)
Returns the ceiling of num/denom, with proper rounding.
CUDA_HOS_DEV float get_double_gaussian_noise(const int cell, const int gain, const float energy) const
Calculates the double gaussian noise for a Tile cell.
EtaPhiToCellMap etaPhiToCell
constexpr static int to_subcalo_enum(const int subcalo)
static constexpr carrier s_is_PS_flag
constexpr int region(const int cell) const
constexpr CellNoiseProperties & operator=(const carrier v)
CellNoiseProperties::carrier noise_properties
static constexpr carrier s_region_offset
constexpr bool is_pile_up_noise() const
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...
constexpr int get_number_of_neighbours(const unsigned int neigh_options, const int cell) const
static constexpr carrier s_sampling_offset
constexpr static int s_region_unknown
constexpr carrier version() const
static constexpr carrier s_last_16_bit_mask
static constexpr carrier s_region_mask
constexpr int TileCellAfterEnd
static constexpr carrier s_bits_unused
constexpr static bool is_tile(const int cell)
constexpr OtherCellInfo(const carrier sampling, const carrier intra_calo_sampling, const carrier subcalo, const carrier region, const bool PS, const bool HECIW_or_FCal)
constexpr static int to_intra_calorimeter_sampling_enum(const int sampling)
static constexpr carrier s_bits_used
constexpr int sampling(const int cell) const
constexpr CellNoiseProperties(const carrier version, const carrier noise_type)
static constexpr carrier s_invalid_double_gaussian
float noise[NCaloCells][NumGainStates]
constexpr static int from_intra_calorimeter_sampling_enum(const int sampling)
constexpr bool is_electronic_noise() const
static constexpr carrier s_subcalo_offset
constexpr bool is_HECIW_or_FCal() const
static constexpr carrier s_first_16_bit_mask
CUDA_HOS_DEV void finish_initializing(void *buffer)
!
static constexpr int s_max_overlap_cells
constexpr size_t finish_initializing_buffer_size() const
constexpr int NumGainStates
static constexpr carrier s_sampling_mask
constexpr int subcalo(const int cell) const
OtherCellInfo::carrier otherCellInfo[NCaloCells]
float double_gaussian_constants[s_numDoubleGaussianConstants][NTileCells][NumGainStates]
constexpr void register_cell(const int cell, const int sampling, const float cell_eta, const float cell_phi, const float cell_deta, const float cell_dphi)
constexpr float get_noise(const int cell, const int gain) const
def delta_phi(phi1, phi2)
constexpr static int from_region_enum(const int region)
constexpr carrier noise_type() const
constexpr static int s_region_unknown_replacement
static constexpr carrier s_subcalo_mask
CUDA_HOS_DEV float get_double_gaussian_significance(const int cell, const int gain, const float energy) const
constexpr carrier sampling() const
static constexpr carrier s_intra_sampling_offset
static constexpr int s_numDoubleGaussianConstants
constexpr static int s_sampling_unknown
constexpr static int to_region_enum(const int region)
constexpr carrier intra_calorimeter_sampling() const
constexpr static int s_sampling_unknown_replacement
CUDA_HOS_DEV void fill_eta_phi_map()
constexpr static int s_subcalo_unknown
constexpr int get_number_of_neighbours(const unsigned int neigh_options, const int cell) const
constexpr carrier region() const
constexpr bool is_valid() const
constexpr bool is_HECIW_or_FCal(const int cell) const
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
constexpr static int s_subcalo_unknown_replacement
static constexpr carrier s_intra_sampling_mask
constexpr int TileCellStart
constexpr CellNoiseProperties(const carrier v)
constexpr int get_possible_cells_from_coords(const int sampling, const float test_eta, const float test_phi, int *cell_arr) const
We assume cell_arr is large enough.
constexpr bool is_PS() const
constexpr static int from_subcalo_enum(const int subcalo)
static constexpr carrier s_is_HECIW_FCal_flag