Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include <unordered_map>
17 m_constantDataSaved(false)
25 std::lock_guard<std::mutex> lock_guard(
m_mutex);
32 return StatusCode::FAILURE;
46 return StatusCode::FAILURE;
49 return StatusCode::SUCCESS;
56 std::unordered_map<int, int> tag_map;
60 std::vector<int> cluster_order(
clusters->number);
62 std::iota(cluster_order.begin(), cluster_order.end(), 0);
64 std::sort(cluster_order.begin(), cluster_order.end(), [&](
const int a,
const int b)
66 if (clusters->seedCellID[a] < 0)
80 int real_cluster_numbers =
clusters->number;
82 for (
size_t i = 0;
i < cluster_order.size(); ++
i)
84 const int this_id = cluster_order[
i];
85 if (
clusters->seedCellID[this_id] < 0)
87 tag_map[this_id] = -1;
88 --real_cluster_numbers;
98 clusters->number = real_cluster_numbers;
100 for (
int i = 0;
i < temp_clusters->number; ++
i)
102 clusters->clusterEnergy[
i] = temp_clusters->clusterEnergy[cluster_order[
i]];
103 clusters->clusterEt[
i] = temp_clusters->clusterEt[cluster_order[
i]];
104 clusters->clusterEta[
i] = temp_clusters->clusterEta[cluster_order[
i]];
105 clusters->clusterPhi[
i] = temp_clusters->clusterPhi[cluster_order[
i]];
106 clusters->seedCellID[
i] = temp_clusters->seedCellID[cluster_order[
i]];
110 size_t shared_count = 0;
113 if (!cell_info->is_valid(
i))
117 const ClusterTag this_tag = cell_state->clusterTag[
i];
120 cell_state->clusterTag[
i] = ClusterTag::make_invalid_tag();
125 const int new_idx = tag_map[old_idx];
127 const int new_idx2 = old_idx2 >= 0 ? tag_map[old_idx2] : -1;
128 if (new_idx < 0 && new_idx2 < 0)
130 cell_state->clusterTag[
i] = ClusterTag::make_invalid_tag();
132 else if (new_idx < 0)
134 cell_state->clusterTag[
i] = ClusterTag::make_tag(new_idx2);
136 else if (new_idx2 < 0)
138 cell_state->clusterTag[
i] = ClusterTag::make_tag(new_idx);
154 m_filePrefix, m_fileSuffix, m_numWidth);
158 return StatusCode::FAILURE;
161 return StatusCode::SUCCESS;
static ErrorState save_constants_to_folder(const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const std::string &prefix="", const std::string &suffix="", const bool output_errors=true)
constexpr int32_t secondary_cluster_index() const
constexpr bool is_shared_between_clusters() const
virtual StatusCode execute(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override
Holds one objects of type \T in memory context Context.
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::CellStateArr > m_cell_state_dev
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::ClusterInfoArr > m_clusters_dev
static ErrorState save_event_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > &clusters, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::CellInfoArr > m_cell_info_dev
constexpr int32_t cluster_index() const
Gaudi::Property< bool > m_onlyCellInfo
If true, only output cell info (useful for reducing disk usage when running the full standalone versi...
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< unsigned int > m_numWidth
The number of digits to reserve for the events.
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::CellNoiseArr > m_cell_noise_dev
Gaudi::Property< std::string > m_savePath
The path specifying the folder to which the files should be saved.
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::GeometryArr > m_geometry_dev
CaloGPUOutput(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< std::string > m_filePrefix
The prefix of the saved files.
constexpr bool is_part_of_cluster() const
std::mutex m_mutex
This mutex is locked when saving the constant data on the first event to ensure thread safety.
static ErrorState save_cell_info_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
std::atomic< bool > m_constantDataSaved
A flag to signal that the constant data has been adequately saved.
Gaudi::Property< std::string > m_fileSuffix
The suffix of the saved files.
constexpr int32_t secondary_cluster_weight() const
Gaudi::Property< bool > m_sortedAndCutClusters
If true, sort the clusters by transverse energy and compactify the tags to ensure sequentiality.