ATLAS Offline Software
Loading...
Searching...
No Matches
CaloGPUClusterAndCellDataMonitor.cxx File Reference
#include "CaloGPUClusterAndCellDataMonitor.h"
#include "CaloRecGPU/Helpers.h"
#include "CaloRecGPU/CUDAFriendlyClasses.h"
#include "CaloUtils/CaloClusterCollectionProcessor.h"
#include "CaloRecGPU/CaloClusterGPUProcessor.h"
#include "CaloRecUtilities.h"
#include "AthenaMonitoringKernel/Monitored.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include <map>
#include <numeric>
#include <algorithm>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  ClusterProperties
namespace  ExtraClusterComparisons
namespace  CellProperties
namespace  CellTypes

Macros

#define CALORECGPU_DATA_MONITOR_EXTRA_PRINTOUTS   0
#define CALORECGPU_BASIC_CLUSTER_PROPERTY(NAME, ...)
#define CALORECGPU_CLUSTER_MOMENT(...)
#define CALORECGPU_CLUSTER_MOMENT_INNER(NAME, PROPERTY, UNIT, ...)
#define CALORECGPU_COMPARED_CLUSTER_PROPERTY(NAME, ...)
#define CALORECGPU_BASIC_CELL_PROPERTY(NAME, ...)
#define CALORECGPU_BASIC_CELL_TYPE(NAME, ...)

Functions

template<class WeighMatch, class WeighNotMatch>
static void build_similarity_map_helper (const CaloRecGPU::CellInfoArr &, const CaloRecGPU::CellInfoArr &, const std::vector< int > &cells_prefix_sum_1, const std::vector< int > &cells_prefix_sum_2, const CaloRecGPU::ClusterInfoArr &cluster_info_1, const CaloRecGPU::ClusterInfoArr &cluster_info_2, WeighMatch match, WeighNotMatch not_match)

Macro Definition Documentation

◆ CALORECGPU_BASIC_CELL_PROPERTY

#define CALORECGPU_BASIC_CELL_PROPERTY ( NAME,
... )
Value:
struct cells_ ## NAME \
{ \
static std::string name() \
{ \
return # NAME; \
} \
static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
[[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
[[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
[[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
[[maybe_unused]] const int cell ) \
{ \
__VA_ARGS__ \
} \
};
Holds CPU and GPU versions of the geometry and cell noise information, which are assumed to be consta...
Definition DataHolders.h:27
Contains the per-event cell information: energy, timing, gain, quality and provenance.

Definition at line 1170 of file CaloGPUClusterAndCellDataMonitor.cxx.

1170#define CALORECGPU_BASIC_CELL_PROPERTY(NAME, ...) \
1171 struct cells_ ## NAME \
1172 { \
1173 static std::string name() \
1174 { \
1175 return # NAME; \
1176 } \
1177 static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
1178 [[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
1179 [[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
1180 [[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
1181 [[maybe_unused]] const int cell ) \
1182 { \
1183 __VA_ARGS__ \
1184 } \
1185 };

◆ CALORECGPU_BASIC_CELL_TYPE

#define CALORECGPU_BASIC_CELL_TYPE ( NAME,
... )
Value:
struct cell_type_ ## NAME \
{ \
static std::string name() \
{ \
return # NAME; \
} \
static bool is_type([[maybe_unused]] const ConstantDataHolder & constant_data, \
[[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
[[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
[[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
[[maybe_unused]] const int cell ) \
{ \
__VA_ARGS__ \
} \
};

Definition at line 1338 of file CaloGPUClusterAndCellDataMonitor.cxx.

1338#define CALORECGPU_BASIC_CELL_TYPE(NAME, ...) \
1339 struct cell_type_ ## NAME \
1340 { \
1341 static std::string name() \
1342 { \
1343 return # NAME; \
1344 } \
1345 static bool is_type([[maybe_unused]] const ConstantDataHolder & constant_data, \
1346 [[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
1347 [[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
1348 [[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
1349 [[maybe_unused]] const int cell ) \
1350 { \
1351 __VA_ARGS__ \
1352 } \
1353 };

◆ CALORECGPU_BASIC_CLUSTER_PROPERTY

#define CALORECGPU_BASIC_CLUSTER_PROPERTY ( NAME,
... )
Value:
struct clusters_ ## NAME \
{ \
static std::string name() \
{ \
return # NAME; \
} \
static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
[[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
[[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
[[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
[[maybe_unused]] const int cluster_index ) \
{ \
__VA_ARGS__ \
} \
};

Definition at line 923 of file CaloGPUClusterAndCellDataMonitor.cxx.

923#define CALORECGPU_BASIC_CLUSTER_PROPERTY(NAME, ...) \
924 struct clusters_ ## NAME \
925 { \
926 static std::string name() \
927 { \
928 return # NAME; \
929 } \
930 static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
931 [[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info, \
932 [[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info, \
933 [[maybe_unused]] const std::vector<int> & cells_prefix_sum, \
934 [[maybe_unused]] const int cluster_index ) \
935 { \
936 __VA_ARGS__ \
937 } \
938 };

◆ CALORECGPU_CLUSTER_MOMENT

#define CALORECGPU_CLUSTER_MOMENT ( ...)
Value:
#define CALORECGPU_CLUSTER_MOMENT_INNER(NAME, PROPERTY, UNIT,...)

Definition at line 956 of file CaloGPUClusterAndCellDataMonitor.cxx.

◆ CALORECGPU_CLUSTER_MOMENT_INNER

#define CALORECGPU_CLUSTER_MOMENT_INNER ( NAME,
PROPERTY,
UNIT,
... )
Value:
CALORECGPU_BASIC_CLUSTER_PROPERTY(moments_ ## NAME, return cluster_info.moments. PROPERTY [cluster_index] / UNIT;)
#define CALORECGPU_BASIC_CLUSTER_PROPERTY(NAME,...)
#define UNIT(NAME)
Definition Units.h:74

Definition at line 957 of file CaloGPUClusterAndCellDataMonitor.cxx.

◆ CALORECGPU_COMPARED_CLUSTER_PROPERTY

#define CALORECGPU_COMPARED_CLUSTER_PROPERTY ( NAME,
... )
Value:
struct clusters_ ## NAME \
{ \
static std::string name() \
{ \
return # NAME; \
} \
static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
[[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info_1, \
[[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info_1, \
[[maybe_unused]] const std::vector<int> & cells_prefix_sum_1, \
[[maybe_unused]] const int cluster_index_1, \
[[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info_2, \
[[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info_2, \
[[maybe_unused]] const std::vector<int> & cells_prefix_sum_2, \
[[maybe_unused]] const int cluster_index_2) \
{ \
__VA_ARGS__ \
} \
};

Definition at line 1122 of file CaloGPUClusterAndCellDataMonitor.cxx.

1122#define CALORECGPU_COMPARED_CLUSTER_PROPERTY(NAME, ...) \
1123 struct clusters_ ## NAME \
1124 { \
1125 static std::string name() \
1126 { \
1127 return # NAME; \
1128 } \
1129 static double get_property([[maybe_unused]] const ConstantDataHolder & constant_data, \
1130 [[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info_1, \
1131 [[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info_1, \
1132 [[maybe_unused]] const std::vector<int> & cells_prefix_sum_1, \
1133 [[maybe_unused]] const int cluster_index_1, \
1134 [[maybe_unused]] const CaloRecGPU::CellInfoArr & cell_info_2, \
1135 [[maybe_unused]] const CaloRecGPU::ClusterInfoArr & cluster_info_2, \
1136 [[maybe_unused]] const std::vector<int> & cells_prefix_sum_2, \
1137 [[maybe_unused]] const int cluster_index_2) \
1138 { \
1139 __VA_ARGS__ \
1140 } \
1141 };

◆ CALORECGPU_DATA_MONITOR_EXTRA_PRINTOUTS

#define CALORECGPU_DATA_MONITOR_EXTRA_PRINTOUTS   0

Definition at line 10 of file CaloGPUClusterAndCellDataMonitor.cxx.

Function Documentation

◆ build_similarity_map_helper()

template<class WeighMatch, class WeighNotMatch>
void build_similarity_map_helper ( const CaloRecGPU::CellInfoArr & ,
const CaloRecGPU::CellInfoArr & ,
const std::vector< int > & cells_prefix_sum_1,
const std::vector< int > & cells_prefix_sum_2,
const CaloRecGPU::ClusterInfoArr & cluster_info_1,
const CaloRecGPU::ClusterInfoArr & cluster_info_2,
WeighMatch match,
WeighNotMatch not_match )
static

Definition at line 450 of file CaloGPUClusterAndCellDataMonitor.cxx.

458{
459 std::vector<std::pair<int, float>> cluster_weights_1, cluster_weights_2;
460
461 for (unsigned int this_hash_ID = 0; this_hash_ID < NCaloCells; ++this_hash_ID)
462 {
463 cluster_weights_1.clear();
464 cluster_weights_2.clear();
465
466 for (int i = cells_prefix_sum_1[this_hash_ID]; i < cells_prefix_sum_1[this_hash_ID + 1]; ++i)
467 {
468 cluster_weights_1.push_back({cluster_info_1.clusterIndices[i], cluster_info_1.cellWeights[i] + 1e-8});
469 }
470 for (int i = cells_prefix_sum_2[this_hash_ID]; i < cells_prefix_sum_2[this_hash_ID + 1]; ++i)
471 {
472 cluster_weights_2.push_back({cluster_info_2.clusterIndices[i], cluster_info_2.cellWeights[i] + 1e-8});
473 }
474
475 if (cluster_weights_1.size() != 0 && cluster_weights_2.size() != 0)
476 {
477 match(this_hash_ID, cluster_weights_1, cluster_weights_2);
478 }
479 else if (cluster_weights_1.size() != 0)
480 {
481 not_match(false, this_hash_ID, cluster_weights_1);
482 }
483 else if (cluster_weights_2.size() != 0)
484 {
485 not_match(true, this_hash_ID, cluster_weights_2);
486 }
487 }
488}
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:357
constexpr int NCaloCells