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 480 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 717 of file EventInfoDefinitions.h.

718 {
720 }
#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 707 of file EventInfoDefinitions.h.

◆ get_extra_cell_info() [1/2]

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

Definition at line 752 of file EventInfoDefinitions.h.

753 {
754 constexpr auto max_size = NMaxClusters * sizeof(float) / sizeof(tag_type);
755
756 const int outer_idx = idx / max_size;
757 const int inner_idx = idx % max_size;
758
759 using PtrType = tag_type *;
760
761 auto get_laundered_pointer = [&](auto * ptr) -> PtrType
762 {
763 return std::launder(static_cast<PtrType>(static_cast<void *>(ptr)));
764 };
765
766 PtrType arr[6] = { get_laundered_pointer(this->moments.engCalibTot),
767 get_laundered_pointer(this->moments.engCalibOutL),
768 get_laundered_pointer(this->moments.engCalibOutM),
769 get_laundered_pointer(this->moments.engCalibOutT),
770 get_laundered_pointer(this->moments.engCalibDeadL),
771 get_laundered_pointer(this->moments.engCalibDeadM) };
772
773 return *(arr[outer_idx] + inner_idx);
774 }
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 728 of file EventInfoDefinitions.h.

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

◆ has_basic_info() [1/2]

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

Definition at line 441 of file EventInfoDefinitions.h.

442 {
443 return has_basic_info(state);
444 }
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 424 of file EventInfoDefinitions.h.

◆ has_cells_per_cluster() [1/2]

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

Definition at line 419 of file EventInfoDefinitions.h.

420 {
422 }
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 402 of file EventInfoDefinitions.h.

403 {
404 switch(this_state)
405 {
407 return true;
409 return true;
411 return true;
413 return true;
414 default:
415 return false;
416 }
417 }

◆ has_moments() [1/2]

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

Definition at line 459 of file EventInfoDefinitions.h.

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

◆ has_moments() [2/2]

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

Definition at line 446 of file EventInfoDefinitions.h.

447 {
448 switch(this_state)
449 {
451 return true;
453 return true;
454 default:
455 return false;
456 }
457 }

◆ secondary_tag_array() [1/4]

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

Definition at line 782 of file EventInfoDefinitions.h.

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

◆ secondary_tag_array() [2/4]

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

Definition at line 777 of file EventInfoDefinitions.h.

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

◆ secondary_tag_array() [3/4]

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

Definition at line 792 of file EventInfoDefinitions.h.

793 {
794 return this->template secondary_tag_array<NewT>()[idx];
795 }
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 787 of file EventInfoDefinitions.h.

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

◆ tertiary_tag_array() [1/4]

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

Definition at line 803 of file EventInfoDefinitions.h.

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

◆ tertiary_tag_array() [2/4]

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

Definition at line 798 of file EventInfoDefinitions.h.

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

◆ tertiary_tag_array() [3/4]

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

Definition at line 813 of file EventInfoDefinitions.h.

814 {
815 return this->template tertiary_tag_array<NewT>()[idx];
816 }
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 808 of file EventInfoDefinitions.h.

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

Member Data Documentation

◆ [union]

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

◆ cellsPrefixSum

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

Definition at line 491 of file EventInfoDefinitions.h.

◆ cellWeights

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

Definition at line 499 of file EventInfoDefinitions.h.

◆ clusterEnergy

float CaloRecGPU::ClusterInfoArr::clusterEnergy[NMaxClusters]

Definition at line 482 of file EventInfoDefinitions.h.

◆ clusterEt

float CaloRecGPU::ClusterInfoArr::clusterEt[NMaxClusters]

Definition at line 483 of file EventInfoDefinitions.h.

◆ clusterEta

float CaloRecGPU::ClusterInfoArr::clusterEta[NMaxClusters]

Definition at line 484 of file EventInfoDefinitions.h.

◆ clusterIndices

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

Definition at line 501 of file EventInfoDefinitions.h.

◆ clusterPhi

float CaloRecGPU::ClusterInfoArr::clusterPhi[NMaxClusters]

Definition at line 485 of file EventInfoDefinitions.h.

◆ has_deleted_clusters

bool CaloRecGPU::ClusterBaseInfo::has_deleted_clusters
inherited

Definition at line 398 of file EventInfoDefinitions.h.

◆ indices

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

Definition at line 495 of file EventInfoDefinitions.h.

◆ moments

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

◆ number

int CaloRecGPU::ClusterBaseInfo::number
inherited

Definition at line 399 of file EventInfoDefinitions.h.

◆ number_cells

int CaloRecGPU::ClusterBaseInfo::number_cells
inherited

Definition at line 400 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 489 of file EventInfoDefinitions.h.

◆ state

ClusterInformationState CaloRecGPU::ClusterBaseInfo::state
inherited

Definition at line 397 of file EventInfoDefinitions.h.

◆ tags

tag_type CaloRecGPU::ClusterInfoArr::tags[NCaloCells]

Definition at line 496 of file EventInfoDefinitions.h.


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