ATLAS Offline Software
Loading...
Searching...
No Matches
CaloGPUClusterAndCellDataMonitor.cxx File Reference
#include "CaloGPUClusterAndCellDataMonitor.h"
#include "CaloRecGPU/Helpers.h"
#include "CaloRecGPU/CUDAFriendlyClasses.h"
#include "StoreGate/DataHandle.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 1171 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

◆ 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 1339 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

◆ 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 924 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

◆ CALORECGPU_CLUSTER_MOMENT

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

Definition at line 957 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 958 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 1123 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

◆ 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 451 of file CaloGPUClusterAndCellDataMonitor.cxx.

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