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::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 1177 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

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

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

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

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

◆ CALORECGPU_CLUSTER_MOMENT

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

Definition at line 963 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 964 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 1129 of file CaloGPUClusterAndCellDataMonitor.cxx.

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

◆ 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::ClusterInfoArr & cluster_info_1,
const CaloRecGPU::ClusterInfoArr & cluster_info_2,
WeighMatch match,
WeighNotMatch not_match )
static

Definition at line 436 of file CaloGPUClusterAndCellDataMonitor.cxx.

440{
441 int it_1 = 0, it_2 = 0;
442
443 std::vector<std::pair<int, float>> cluster_weights_1, cluster_weights_2;
444 int this_index_1 = -1;
445 int this_index_2 = -1;
446
447 while (it_1 < cluster_info_1.number_cells || it_2 < cluster_info_2.number_cells)
448 {
449 if (it_1 < cluster_info_1.number_cells)
450 {
451 this_index_1 = cluster_info_1.cells.indices[it_1];
452 }
453 else
454 {
455 this_index_1 = -1;
456 }
457
458 if (it_2 < cluster_info_2.number_cells)
459 {
460 this_index_2 = cluster_info_2.cells.indices[it_2];
461 }
462 else
463 {
464 this_index_2 = -1;
465 }
466
467 if (cluster_weights_1.size() == 0)
468 {
469 while (it_1 < cluster_info_1.number_cells && cluster_info_1.cells.indices[it_1] == this_index_1)
470 {
471 cluster_weights_1.push_back({cluster_info_1.clusterIndices[it_1], cluster_info_1.cellWeights[it_1] + 1e-8});
472 ++it_1;
473 }
474 }
475
476 if (cluster_weights_2.size() == 0)
477 {
478 while (it_2 < cluster_info_2.number_cells && cluster_info_2.cells.indices[it_2] == this_index_2)
479 {
480 cluster_weights_2.push_back({cluster_info_2.clusterIndices[it_2], cluster_info_2.cellWeights[it_2] + 1e-8});
481 ++it_2;
482 }
483 }
484
485 if (this_index_1 == this_index_2 and this_index_1 >= 0)
486 {
487 match(this_index_1, cluster_weights_1, cluster_weights_2);
488 cluster_weights_1.clear();
489 cluster_weights_2.clear();
490 }
491 else if ((this_index_1 > this_index_2) and this_index_2 >= 0)
492 {
493 not_match(true, this_index_2, cluster_weights_2);
494 cluster_weights_2.clear();
495 }
496 else if ((this_index_2 > this_index_1) and this_index_1 >= 0 )
497 {
498 not_match(false, this_index_1, cluster_weights_1);
499 cluster_weights_1.clear();
500 }
501 else
502 {
503 cluster_weights_1.clear();
504 cluster_weights_2.clear();
505 }
506 }
507}
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:357
union CaloRecGPU::ClusterInfoArr::@223264020040143137243361055037275307306030322160 cells