|
ATLAS Offline Software
|
Go to the documentation of this file.
18 declareInterface<CaloClusterCollectionProcessor> (
this);
28 return StatusCode::SUCCESS;
40 if ( !cell_collection.
isValid() )
42 ATH_MSG_ERROR(
" Cannot retrieve CaloCellContainer: " << cell_collection.
name() );
43 return StatusCode::FAILURE;
49 ret_clusts.allocate();
53 ret_info->energy[
i] = 0;
54 ret_info->gain[
i] = GainConversion::invalid_gain();
55 ret_info->time[
i] = 0;
56 ret_info->qualityProvenance[
i] = 0;
58 ret_state->clusterTag[
i] = ClusterTag::make_invalid_tag();
70 const unsigned int gain = GainConversion::from_standard_gain(
cell->gain());
79 size_t shared_count = 0;
81 const auto cluster_end = cluster_collection->
end();
82 auto cluster_iter = cluster_collection->
begin();
84 for (
int cluster_number = 0; cluster_iter != cluster_end; ++cluster_iter, ++cluster_number )
90 ATH_MSG_ERROR(
"Can't get valid links to CaloCells (CaloClusterCellLink)!");
91 return StatusCode::FAILURE;
95 ret_clusts->clusterEnergy[cluster_number] = cluster->
e();
96 ret_clusts->clusterEt[cluster_number] = cluster->
et();
97 ret_clusts->clusterEta[cluster_number] = cluster->
eta();
98 ret_clusts->clusterPhi[cluster_number] = cluster->
phi();
102 ret_clusts->seedCellID[cluster_number] = seed_cell_index;
104 for (
auto it = cell_links->
begin();
it != cell_links->
end(); ++
it)
107 const int cell_ID =
m_calo_id->calo_cell_hash(
it->ID());
111 std::memcpy(&weight_as_int, &
weight,
sizeof(
float));
116 if (weight_as_int == 0)
124 const ClusterTag other_tag = ret_state->clusterTag[cell_ID];
132 ret_state->clusterTag[cell_ID] = ClusterTag::make_tag(cluster_number, weight_as_int, 0);
136 ret_state->clusterTag[cell_ID] = ClusterTag::make_tag(cluster_number);
141 ret_state->clusterTag[cell_ID] = ClusterTag::make_tag(cluster_number, other_tag.
secondary_cluster_weight(), other_index);
147 const int max_cluster = cluster_number > other_index ? cluster_number : other_index;
148 const int min_cluster = cluster_number > other_index ? other_index : cluster_number;
149 ret_state->clusterTag[cell_ID] = ClusterTag::make_tag(max_cluster, weight_as_int, min_cluster);
154 ret_state->clusterTag[cell_ID] = ClusterTag::make_tag(other_index, weight_as_int, cluster_number);
160 ret_clusts->number = cluster_collection->
size();
168 ret_info, ret_state, ret_clusts,
173 return StatusCode::FAILURE;
186 return StatusCode::FAILURE;
190 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
virtual double phi() const
The azimuthal angle ( ) of the particle.
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Const iterator class for DataVector/DataList.
const std::string & name() const
Return the StoreGate ID for the referenced object.
Holds one objects of type \T in memory context Context.
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)
const_iterator begin() const
const begin method
Gaudi::Property< unsigned int > m_numWidth
The number of digits to reserve for the events.
virtual StatusCode initialize() override
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Gaudi::Property< bool > m_saveCellInfo
If true, also outputs the cell energies, times, gains, qualities and provenances.
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
constexpr int32_t cluster_index() const
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *cluster_collection) const override
Execute on an entire collection of clusters.
Description of a calorimeter cluster.
virtual double eta() const
The pseudorapidity ( ) of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Property< std::string > m_savePath
The path specifying the folder to which the files should be saved.
static ErrorState save_cell_state_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
const_iterator end() const
const end method
constexpr bool is_part_of_cluster() const
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Gaudi::Property< std::string > m_fileSuffix
The suffix of the saved files.
Gaudi::Property< std::string > m_filePrefix
The prefix of the saved files.
Data object for each calorimeter readout cell.
static ErrorState save_clusters_to_folder(const size_t event_number, const std::filesystem::path &folder, 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)
CaloCPUOutput(const std::string &type, const std::string &name, const IInterface *parent)
const CaloCell_ID * m_calo_id
Pointer to Calo ID Helper.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual double e() const
The total energy of the particle.
constexpr int32_t secondary_cluster_weight() const
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.