7#ifndef CALORECGPU_CaloGPUClusterAndCellDataMonitor_H
8#define CALORECGPU_CaloGPUClusterAndCellDataMonitor_H
41 public extends<AthAlgTool, ICaloClusterGPUPlotter>
60 virtual StatusCode
update_plots(
const EventContext & ctx,
65 virtual StatusCode
update_plots(
const EventContext & ctx,
71 virtual StatusCode
update_plots(
const EventContext & ctx,
77 virtual StatusCode
update_plots(
const EventContext & ctx,
89 StatusCode
add_data(
const EventContext & ctx,
93 const std::vector<int> & cells_prefix_sum,
94 const std::string & tool_name)
const;
101 const std::string & prefix,
102 const bool match_in_energy,
103 const bool match_without_shared,
104 const bool match_perfectly)
const;
116 std::vector<int> & cells_prefix_sum)
const;
126 int r2t(
const int i)
const
132 int t2r(
const int i)
const
153 const bool match_in_energy,
154 const bool match_without_shared)
const;
161 const bool match_without_shared)
const;
172 Gaudi::Property<float>
m_termThreshold {
this,
"CellThreshold", 0.,
"Cell (terminal) threshold (in units of noise Sigma)"};
177 Gaudi::Property<float>
m_growThreshold {
this,
"NeighborThreshold", 2.,
"Neighbor (grow) threshold (in units of noise Sigma)"};
182 Gaudi::Property<float>
m_seedThreshold {
this,
"SeedThreshold", 4.,
"Seed threshold (in units of noise Sigma)"};
191 ToolHandle< GenericMonitoringTool >
m_moniTool {
this,
"MonitoringTool",
"",
"Monitoring tool" };
195 Gaudi::Property<std::vector<int>>
m_missingCellsToFill {
this,
"MissingCellsToFill", {},
"Force fill these cells as disabled on empty containers."};
208 {
this,
"ToolsToPlot", {},
"Tools to be plotted individually"};
213 {
this,
"PairsToPlot", {},
"Pairs of tools to be compared and plotted"};
218 {
this,
"ClusterMatchingParameters", {},
"Parameters for the cluster matching algorithm"};
Property holding a SG store/key/clid from which a ReadHandle is made.
Helper class for offline cell identifiers.
Base class for GPU-accelerated cluster processing tools to be called from CaloGPUHybridClusterProcess...
Gaudi::Property< float > m_seedThreshold
Seed threshold to use for cluster matching.
std::vector< bool > m_cellTypesToDo
Gaudi::Property< std::vector< SimpleSingleTool > > m_toolsToPlot
Tools to plot individually.
StatusCode match_clusters_perfectly(sample_comparisons_holder &sch, const CaloRecGPU::ConstantDataHolder &constant_data, const CaloRecGPU::CellInfoArr &cell_info, const CaloRecGPU::ClusterInfoArr &cluster_info_1, const CaloRecGPU::ClusterInfoArr &cluster_info_2, const bool match_without_shared) const
std::vector< bool > m_cellPropertiesToDo
Gaudi::Property< std::vector< SimpleToolPair > > m_pairsToPlot
Pairs of tools to compare.
std::atomic< bool > m_plottedVariablesInitialized
A flag to signal that the variables to be monitored have been detected based on the booked histograms...
virtual ~CaloGPUClusterAndCellDataMonitor()=default
StatusCode add_data(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const CaloRecGPU::CellInfoArr *cell_info, const CaloRecGPU::ClusterInfoArr *clusters, const std::vector< int > &cells_prefix_sum, const std::string &tool_name) const
virtual StatusCode initialize() override
virtual StatusCode update_plots_start(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const xAOD::CaloClusterContainer *cluster_collection_ptr) const override
std::vector< bool > m_comparedClusterPropertiesToDo
std::vector< bool > m_comparedCellPropertiesToDo
Gaudi::Property< float > m_termThreshold
Cell (terminal) threshold to use for cluster matching.
virtual StatusCode update_plots_end(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const xAOD::CaloClusterContainer *cluster_collection_ptr) const override
std::vector< bool > m_extraComparedClusterPropertiesToDo
std::vector< bool > m_clusterPropertiesToDo
Control which properties will actually be calculated and stored.
bool m_doCells
If no properties are asked for, skip the relevant loops entirely...
std::vector< bool > m_comparedCellTypesToDo
ToolHandle< GenericMonitoringTool > m_moniTool
Monitoring tool.
int m_numToolsToKeep
The number of tools that will actually need to be kept in memory for combined plotting.
StatusCode initialize_plotted_variables()
bool m_doCombinedClusters
StatusCode add_combination(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const int index_1, const int index_2, const std::string &prefix, const bool match_in_energy, const bool match_without_shared, const bool match_perfectly) const
std::map< std::string, std::atomic< size_t > > m_numClustersPerTool ATLAS_THREAD_SAFE
Counts the total number of clusters per tool.
std::vector< pair_to_plot > m_toolCombinations
std::map< std::string, std::string > m_toolToIdMap
Maps tools to their respective identifying prefix for variables.
Gaudi::Property< float > m_growThreshold
Neighbor (growing) threshold to use for cluster matching.
Gaudi::Property< MatchingOptions > m_matchingOptions
Option for adjusting the parameters for the cluster matching algorithm.
StatusCode match_clusters(sample_comparisons_holder &sch, const CaloRecGPU::ConstantDataHolder &constant_data, const CaloRecGPU::CellInfoArr &cell_info, const CaloRecGPU::ClusterInfoArr &cluster_info_1, const CaloRecGPU::ClusterInfoArr &cluster_info_2, const bool match_in_energy, const bool match_without_shared) const
Gaudi::Property< std::vector< int > > m_missingCellsToFill
Cell indices to fill as disabled cells (useful if the cell vector is always missing the same cells).
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
std::map< std::string, int > m_toolsToCheckFor
Map of the strings corresponding to all the tools that will be relevant for plotting (individually or...
size_t m_numEvents
Counts the number of events.
bool filter_tool_by_name(const std::string &tool_name) const
Returns true if this tool should be plotted for.
const CaloCell_ID * m_calo_id
Pointer to Calo ID Helper.
double m_min_similarity
Parameters for the cluster matching algorithm, for easier access.
virtual StatusCode update_plots(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const xAOD::CaloClusterContainer *cluster_collection_ptr, const CaloClusterCollectionProcessor *tool) const override
std::vector< bool > m_extraThingsToDo
CaloGPUClusterAndCellDataMonitor(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode update_cell_representation(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, const CaloRecGPU::CellInfoArr *cell_info, CaloRecGPU::ClusterInfoArr *clusters, std::vector< int > &cells_prefix_sum) const
Update the cell representation so the cells-in-clusters are ordered by index and have a prefix sum.
std::mutex m_mutex
This mutex is locked to ensure only one thread detects the monotired variables.
virtual StatusCode finalize_plots() const override
Holds CPU and GPU versions of the geometry and cell noise information, which are assumed to be consta...
Holds the mutable per-event information (clusters and cells) and provides utilities to convert betwee...
Manages objects of type T in a thread-safe way, ensuring that there's an object available for each se...
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
bool match_without_shared
int test_unmatched() const
Returns the number of unmatched clusters in the test (second) tool.
int ref_unmatched() const
Returns the number of unmatched clusters in the reference (first) tool.
std::vector< int > unmatched_test_list
int t2r(const int i) const
Converts a cluster index from the test tool (second) to the reference tool (first).
std::vector< int > t2r_table
std::vector< int > r2t_table
std::vector< int > unmatched_ref_list
int r2t(const int i) const
Converts a cluster index from the reference tool (first) to the test tool (second).
Contains the per-event cell information: energy, timing, gain, quality and provenance.