ATLAS Offline Software
Loading...
Searching...
No Matches
CaloRecGPU::ClusterInfoArr Class Reference

cellsPrefixSum. More...

#include <EventInfoDefinitions.h>

Inheritance diagram for CaloRecGPU::ClusterInfoArr:
Collaboration diagram for CaloRecGPU::ClusterInfoArr:

Classes

struct  ClusterMomentsArr

Public Member Functions

template<class F, class ... Args>
constexpr void for_all_moments (F &&f, Args &&... args) const
 F receives the array associated with the moment and any additional arguments.
template<class F, class ... Args>
constexpr void for_all_moments (F &&f, Args &&... args)
 F receives the array associated with the moment and any additional arguments.
constexpr const tag_typeget_extra_cell_info (const int idx) const
 Extra representation for the cell tags, to save time for calculating the isolation moment after building the list of cells per cluster.
constexpr tag_typeget_extra_cell_info (const int idx)
template<class NewT = tag_type>
constexpr const NewT * secondary_tag_array () const
template<class NewT = tag_type>
constexpr NewT * secondary_tag_array ()
template<class NewT = tag_type>
constexpr const NewT & secondary_tag_array (const int idx) const
template<class NewT = tag_type>
constexpr NewT & secondary_tag_array (const int idx)
template<class NewT = tag_type>
constexpr const NewT * tertiary_tag_array () const
template<class NewT = tag_type>
constexpr NewT * tertiary_tag_array ()
template<class NewT = tag_type>
constexpr const NewT & tertiary_tag_array (const int idx) const
template<class NewT = tag_type>
constexpr NewT & tertiary_tag_array (const int idx)
constexpr bool has_cells_per_cluster () const
constexpr bool has_basic_info (const ClusterInformationState this_state) const
constexpr bool has_basic_info () const
constexpr bool has_moments () const

Static Public Member Functions

static constexpr bool has_cells_per_cluster (const ClusterInformationState this_state)
static constexpr bool has_moments (const ClusterInformationState this_state)

Public Attributes

float clusterEnergy [NMaxClusters]
float clusterEt [NMaxClusters]
float clusterEta [NMaxClusters]
float clusterPhi [NMaxClusters]
int seedCellIndex [NMaxClusters]
 Invalid(ated) clusters have seedCellIndex < 0.
int cellsPrefixSum [NMaxClusters+1]
union { 
   int   indices [2 *NCaloCells
   tag_type   tags [NCaloCells
cells
float cellWeights [2 *NCaloCells]
int clusterIndices [2 *NCaloCells]
struct CaloRecGPU::ClusterInfoArr::ClusterMomentsArr moments
ClusterInformationState state
bool has_deleted_clusters
int number
int number_cells

Detailed Description

cellsPrefixSum.

Contains the per-event information of the clusters, including both the kinematic variables and the moments.

In the latter case, we store cell index, cell weight and cluster index so that it is easy to iterate through all cells inside clusters.

Also includes an easy look-up for the index of the seed cell, with clusters with seed cells less than zero being invalid; this is useful for e. g. applying cuts on the GPU without requiring re-sorting everything. Cluster assignment depends on the ClusterInformationState as reported by the ClusterBaseInfo: we may have an array of tags (which assumes primary_weight = 1 - secondary_weight) or an actual jagged vector expressed by the

Definition at line 481 of file EventInfoDefinitions.h.

Member Function Documentation

◆ for_all_moments() [1/2]

template<class F, class ... Args>
void CaloRecGPU::ClusterInfoArr::for_all_moments ( F && f,
Args &&... args )
inlineconstexpr

F receives the array associated with the moment and any additional arguments.

Given that the moments are of different types, it must be a functor or lambda ready to deal with that!

Definition at line 719 of file EventInfoDefinitions.h.

720 {
722 }
#define CALORECGPU_FORALLMOMENTS_HELPER(MOMENTNAME,...)
#define CALORECGPU_FORALLMOMENTS_INSTANTIATE(MACRO,...)

◆ for_all_moments() [2/2]

template<class F, class ... Args>
void CaloRecGPU::ClusterInfoArr::for_all_moments ( F && f,
Args &&... args ) const
inlineconstexpr

F receives the array associated with the moment and any additional arguments.

Given that the moments are of different types, it must be a functor or lambda ready to deal with that!

Definition at line 708 of file EventInfoDefinitions.h.

709 {
710 // call f as an lvalue every time
712 }

◆ get_extra_cell_info() [1/2]

tag_type & CaloRecGPU::ClusterInfoArr::get_extra_cell_info ( const int idx)
inlineconstexpr

Definition at line 754 of file EventInfoDefinitions.h.

755 {
756 constexpr auto max_size = NMaxClusters * sizeof(float) / sizeof(tag_type);
757
758 const int outer_idx = idx / max_size;
759 const int inner_idx = idx % max_size;
760
761 using PtrType = tag_type *;
762
763 auto get_laundered_pointer = [&](auto * ptr) -> PtrType
764 {
765 return std::launder(static_cast<PtrType>(static_cast<void *>(ptr)));
766 };
767
768 PtrType arr[6] = { get_laundered_pointer(this->moments.engCalibTot),
769 get_laundered_pointer(this->moments.engCalibOutL),
770 get_laundered_pointer(this->moments.engCalibOutM),
771 get_laundered_pointer(this->moments.engCalibOutT),
772 get_laundered_pointer(this->moments.engCalibDeadL),
773 get_laundered_pointer(this->moments.engCalibDeadM) };
774
775 return *(arr[outer_idx] + inner_idx);
776 }
TagBase::carrier tag_type
__host__ __device__ T * get_laundered_pointer(unsigned int idx, PtrLikes &&... p)
constexpr int NMaxClusters
void * ptr(T *p)
Definition SGImplSvc.cxx:74
struct CaloRecGPU::ClusterInfoArr::ClusterMomentsArr moments

◆ get_extra_cell_info() [2/2]

const tag_type & CaloRecGPU::ClusterInfoArr::get_extra_cell_info ( const int idx) const
inlineconstexpr

Extra representation for the cell tags, to save time for calculating the isolation moment after building the list of cells per cluster.

Can (and should) also be used if any other processing (before calculating the relevant moments...) needs some sort of cell -> cluster mapping.

Definition at line 730 of file EventInfoDefinitions.h.

731 {
732 constexpr auto max_size = NMaxClusters * sizeof(float) / sizeof(tag_type);
733
734 const int outer_idx = idx / max_size;
735 const int inner_idx = idx % max_size;
736
737 using PtrType = const tag_type *;
738
739 auto get_laundered_pointer = [&](auto * ptr) -> PtrType
740 {
741 return std::launder(static_cast<PtrType>(static_cast<const void *>(ptr)));
742 };
743
744 PtrType arr[6] = { get_laundered_pointer(this->moments.engCalibTot),
745 get_laundered_pointer(this->moments.engCalibOutL),
746 get_laundered_pointer(this->moments.engCalibOutM),
747 get_laundered_pointer(this->moments.engCalibOutT),
748 get_laundered_pointer(this->moments.engCalibDeadL),
749 get_laundered_pointer(this->moments.engCalibDeadM) };
750
751 return *(arr[outer_idx] + inner_idx);
752 }

◆ has_basic_info() [1/2]

bool CaloRecGPU::ClusterBaseInfo::has_basic_info ( ) const
inlineconstexprinherited

Definition at line 442 of file EventInfoDefinitions.h.

443 {
444 return has_basic_info(state);
445 }
constexpr bool has_basic_info() const
ClusterInformationState state

◆ has_basic_info() [2/2]

bool CaloRecGPU::ClusterBaseInfo::has_basic_info ( const ClusterInformationState this_state) const
inlineconstexprinherited

Definition at line 425 of file EventInfoDefinitions.h.

◆ has_cells_per_cluster() [1/2]

bool CaloRecGPU::ClusterBaseInfo::has_cells_per_cluster ( ) const
inlineconstexprinherited

Definition at line 420 of file EventInfoDefinitions.h.

421 {
423 }
constexpr bool has_cells_per_cluster() const

◆ has_cells_per_cluster() [2/2]

constexpr bool CaloRecGPU::ClusterBaseInfo::has_cells_per_cluster ( const ClusterInformationState this_state)
inlinestaticconstexprinherited

Definition at line 403 of file EventInfoDefinitions.h.

404 {
405 switch(this_state)
406 {
408 return true;
410 return true;
412 return true;
414 return true;
415 default:
416 return false;
417 }
418 }

◆ has_moments() [1/2]

bool CaloRecGPU::ClusterBaseInfo::has_moments ( ) const
inlineconstexprinherited

Definition at line 460 of file EventInfoDefinitions.h.

461 {
462 return has_moments(state);
463 }
constexpr bool has_moments() const

◆ has_moments() [2/2]

constexpr bool CaloRecGPU::ClusterBaseInfo::has_moments ( const ClusterInformationState this_state)
inlinestaticconstexprinherited

Definition at line 447 of file EventInfoDefinitions.h.

448 {
449 switch(this_state)
450 {
452 return true;
454 return true;
455 default:
456 return false;
457 }
458 }

◆ secondary_tag_array() [1/4]

template<class NewT = tag_type>
NewT * CaloRecGPU::ClusterInfoArr::secondary_tag_array ( )
inlineconstexpr

Definition at line 784 of file EventInfoDefinitions.h.

785 {
786 return std::launder(static_cast<NewT *>(static_cast<void *>(this->cellWeights)));
787 }

◆ secondary_tag_array() [2/4]

template<class NewT = tag_type>
const NewT * CaloRecGPU::ClusterInfoArr::secondary_tag_array ( ) const
inlineconstexpr

Definition at line 779 of file EventInfoDefinitions.h.

780 {
781 return std::launder(static_cast<const NewT *>(static_cast<const void *>(this->cellWeights)));
782 }

◆ secondary_tag_array() [3/4]

template<class NewT = tag_type>
NewT & CaloRecGPU::ClusterInfoArr::secondary_tag_array ( const int idx)
inlineconstexpr

Definition at line 794 of file EventInfoDefinitions.h.

795 {
796 return this->template secondary_tag_array<NewT>()[idx];
797 }
constexpr const NewT * secondary_tag_array() const

◆ secondary_tag_array() [4/4]

template<class NewT = tag_type>
const NewT & CaloRecGPU::ClusterInfoArr::secondary_tag_array ( const int idx) const
inlineconstexpr

Definition at line 789 of file EventInfoDefinitions.h.

790 {
791 return this->template secondary_tag_array<NewT>()[idx];
792 }

◆ tertiary_tag_array() [1/4]

template<class NewT = tag_type>
NewT * CaloRecGPU::ClusterInfoArr::tertiary_tag_array ( )
inlineconstexpr

Definition at line 805 of file EventInfoDefinitions.h.

806 {
807 return std::launder(static_cast<NewT *>(static_cast<void *>(this->clusterIndices)));
808 }

◆ tertiary_tag_array() [2/4]

template<class NewT = tag_type>
const NewT * CaloRecGPU::ClusterInfoArr::tertiary_tag_array ( ) const
inlineconstexpr

Definition at line 800 of file EventInfoDefinitions.h.

801 {
802 return std::launder(static_cast<const NewT *>(static_cast<const void *>(this->clusterIndices)));
803 }

◆ tertiary_tag_array() [3/4]

template<class NewT = tag_type>
NewT & CaloRecGPU::ClusterInfoArr::tertiary_tag_array ( const int idx)
inlineconstexpr

Definition at line 815 of file EventInfoDefinitions.h.

816 {
817 return this->template tertiary_tag_array<NewT>()[idx];
818 }
constexpr const NewT * tertiary_tag_array() const

◆ tertiary_tag_array() [4/4]

template<class NewT = tag_type>
const NewT & CaloRecGPU::ClusterInfoArr::tertiary_tag_array ( const int idx) const
inlineconstexpr

Definition at line 810 of file EventInfoDefinitions.h.

811 {
812 return this->template tertiary_tag_array<NewT>()[idx];
813 }

Member Data Documentation

◆ [union]

union { ... } CaloRecGPU::ClusterInfoArr::cells

◆ cellsPrefixSum

int CaloRecGPU::ClusterInfoArr::cellsPrefixSum[NMaxClusters+1]

Definition at line 492 of file EventInfoDefinitions.h.

◆ cellWeights

float CaloRecGPU::ClusterInfoArr::cellWeights[2 *NCaloCells]

Definition at line 500 of file EventInfoDefinitions.h.

◆ clusterEnergy

float CaloRecGPU::ClusterInfoArr::clusterEnergy[NMaxClusters]

Definition at line 483 of file EventInfoDefinitions.h.

◆ clusterEt

float CaloRecGPU::ClusterInfoArr::clusterEt[NMaxClusters]

Definition at line 484 of file EventInfoDefinitions.h.

◆ clusterEta

float CaloRecGPU::ClusterInfoArr::clusterEta[NMaxClusters]

Definition at line 485 of file EventInfoDefinitions.h.

◆ clusterIndices

int CaloRecGPU::ClusterInfoArr::clusterIndices[2 *NCaloCells]

Definition at line 502 of file EventInfoDefinitions.h.

◆ clusterPhi

float CaloRecGPU::ClusterInfoArr::clusterPhi[NMaxClusters]

Definition at line 486 of file EventInfoDefinitions.h.

◆ has_deleted_clusters

bool CaloRecGPU::ClusterBaseInfo::has_deleted_clusters
inherited

Definition at line 399 of file EventInfoDefinitions.h.

◆ indices

int CaloRecGPU::ClusterInfoArr::indices[2 *NCaloCells]

Definition at line 496 of file EventInfoDefinitions.h.

◆ moments

struct CaloRecGPU::ClusterInfoArr::ClusterMomentsArr CaloRecGPU::ClusterInfoArr::moments

◆ number

int CaloRecGPU::ClusterBaseInfo::number
inherited

Definition at line 400 of file EventInfoDefinitions.h.

◆ number_cells

int CaloRecGPU::ClusterBaseInfo::number_cells
inherited

Definition at line 401 of file EventInfoDefinitions.h.

◆ seedCellIndex

int CaloRecGPU::ClusterInfoArr::seedCellIndex[NMaxClusters]

Invalid(ated) clusters have seedCellIndex < 0.

This is the index within the collection, not the hash ID.

Definition at line 490 of file EventInfoDefinitions.h.

◆ state

ClusterInformationState CaloRecGPU::ClusterBaseInfo::state
inherited

Definition at line 398 of file EventInfoDefinitions.h.

◆ tags

tag_type CaloRecGPU::ClusterInfoArr::tags[NCaloCells]

Definition at line 497 of file EventInfoDefinitions.h.


The documentation for this class was generated from the following file: