Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Outputs counts of cells, both by type and cluster presence, with each cluster being identified by its cell with the largest signal-to-noise ratio.
More...
#include <CaloCellsCounterGPU.h>
|
| CaloCellsCounterGPU (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | execute (const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override |
| Process the clusters on GPU. More...
|
|
virtual | ~CaloCellsCounterGPU ()=default |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
virtual size_t | size_of_temporaries () const |
| The size (in bytes) of the temporary object(s) that the algorithm will use. More...
|
|
| DeclareInterfaceID (CaloClusterGPUProcessor, 1, 0) |
|
|
Gaudi::Property< std::string > | m_savePath {this, "SavePath", "./cell_counts", "Path to where the files should be saved"} |
| The path specifying the folder to which the files should be saved. More...
|
|
Gaudi::Property< std::string > | m_filePrefix {this, "FilePrefix", "", "Prefix of the saved files"} |
| The prefix of the saved files. More...
|
|
Gaudi::Property< std::string > | m_fileSuffix {this, "FileSuffix", "", "Suffix of the saved files"} |
| The suffix of the saved files. More...
|
|
Gaudi::Property< unsigned int > | m_numWidth {this, "NumberWidth", 9, "The number of digits to reserve for the events"} |
| The number of digits to reserve for the events. More...
|
|
Gaudi::Property< float > | m_seedThreshold {this, "SeedThresholdOnEorAbsEinSigma", 4., "Seed threshold (in units of noise Sigma)"} |
| Value to consider for the seed threshold. More...
|
|
Gaudi::Property< float > | m_growThreshold {this, "NeighborThresholdOnEorAbsEinSigma", 2., "Neighbor (grow) threshold (in units of noise Sigma)"} |
| Value to consider for the seed threshold. More...
|
|
Gaudi::Property< float > | m_cellThreshold {this, "CellThresholdOnEorAbsEinSigma", 0., "Cell (terminal) threshold (in units of noise Sigma)"} |
| Value to consider for the seed threshold. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Outputs counts of cells, both by type and cluster presence, with each cluster being identified by its cell with the largest signal-to-noise ratio.
- Author
- Nuno Fernandes nuno..nosp@m.dos..nosp@m.santo.nosp@m.s.fe.nosp@m.rnand.nosp@m.es@c.nosp@m.ern.c.nosp@m.h
- Date
- 22 July 2022
Definition at line 22 of file CaloCellsCounterGPU.h.
◆ StoreGateSvc_t
◆ CaloCellsCounterGPU()
CaloCellsCounterGPU::CaloCellsCounterGPU |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~CaloCellsCounterGPU()
virtual CaloCellsCounterGPU::~CaloCellsCounterGPU |
( |
| ) |
|
|
virtualdefault |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ DeclareInterfaceID()
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
Process the clusters on GPU.
- Parameters
-
ctx | The event context. |
constant_data | Data held in GPU memory that is common to all events (cell noise and geometry). |
event_data | Data held in GPU memory that is specific to this event (including the description of the clusters themselves). |
temporary_buffer | A pointer to an \array in GPU memory that is at least as large as size_of_temporaries() , to hold temporary information for the algorithms. Given the way CUDA memory allocations work, casting this to a pointer (or a CaloRecGPU::Helpers::CUDA_kernel_object ) to the intended type and then using it will be perfectly valid. |
Implements CaloClusterGPUProcessor.
Definition at line 54 of file CaloCellsCounterGPU.cxx.
65 unsigned int gain_counts[GainConversion::num_gain_values()] = {0};
67 size_struct global_counts, global_cluster_counts;
69 std::vector<int> cluster_max_cell(
clusters->number, -1);
70 std::vector<float> cluster_max_snr(
clusters->number, -9e99);
71 std::vector<float> cluster_max_energy(
clusters->number, -9e99);
73 std::vector<size_struct> cluster_counts(
clusters->number);
75 std::vector<int> shared_cells;
79 if (!cell_info->is_valid(
i))
84 const int gain = cell_info->gain[
i];
85 ++gain_counts[
gain - GainConversion::min_gain_value()];
87 const float energy = cell_info->energy[
i];
89 const float SNR = std::abs(
energy / cell_noise->get_noise(
i,
gain) );
93 const bool is_cluster =
tag.is_part_of_cluster();
95 global_cluster_counts.total += is_cluster;
100 global_cluster_counts.seed += is_cluster;
104 ++global_counts.grow;
105 global_cluster_counts.grow += is_cluster;
109 ++global_counts.term;
110 global_cluster_counts.term += is_cluster;
114 ++global_counts.invalid;
115 global_cluster_counts.invalid += is_cluster;
120 if (
tag.is_shared_between_clusters())
122 shared_cells.push_back(
i);
125 const int other_cluster =
tag.is_shared_between_clusters() ?
tag.secondary_cluster_index() :
cluster;
126 if (!
tag.is_shared_between_clusters() && (SNR > cluster_max_snr[cluster] || (SNR == cluster_max_snr[cluster] &&
i > cluster_max_cell[cluster])))
128 cluster_max_snr[
cluster] = SNR;
132 ++cluster_counts[
cluster].total;
133 cluster_counts[other_cluster].total += (
cluster != other_cluster);
135 global_cluster_counts.shared +=
tag.is_shared_between_clusters();
136 cluster_counts[
cluster].shared +=
tag.is_shared_between_clusters();
137 cluster_counts[other_cluster].shared +=
tag.is_shared_between_clusters();
141 ++cluster_counts[
cluster].seed;
142 cluster_counts[other_cluster].seed += (
cluster != other_cluster);
146 ++cluster_counts[
cluster].grow;
147 cluster_counts[other_cluster].grow += (
cluster != other_cluster);
151 ++cluster_counts[
cluster].term;
152 cluster_counts[other_cluster].term += (
cluster != other_cluster);
156 ++cluster_counts[
cluster].invalid;
157 cluster_counts[other_cluster].invalid += (
cluster != other_cluster);
162 std::map<int, cluster_info_struct> cluster_sizes;
166 if (cluster_max_cell[
i] >= 0)
168 cluster_sizes[cluster_max_cell[
i]] = cluster_info_struct{cluster_counts[
i], cluster_max_snr[
i], cluster_max_energy[
i]};
172 std::sort(shared_cells.begin(), shared_cells.end());
178 return StatusCode::FAILURE;
188 return StatusCode::FAILURE;
191 out_file <<
"Cell counts: " << global_counts <<
"\n\n";
193 out_file <<
"Cells in clusters count: "<< global_cluster_counts <<
"\n\n";
196 for (
const auto &
it : cluster_sizes)
205 return StatusCode::FAILURE;
210 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ size_of_temporaries()
virtual size_t CaloClusterGPUProcessor::size_of_temporaries |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_cellThreshold
Gaudi::Property<float> CaloCellsCounterGPU::m_cellThreshold {this, "CellThresholdOnEorAbsEinSigma", 0., "Cell (terminal) threshold (in units of noise Sigma)"} |
|
private |
Value to consider for the seed threshold.
Should be consistent with the one used in Topological Clustering to ensure cell classification is correct.
Definition at line 73 of file CaloCellsCounterGPU.h.
◆ m_detStore
◆ m_evtStore
◆ m_filePrefix
Gaudi::Property<std::string> CaloCellsCounterGPU::m_filePrefix {this, "FilePrefix", "", "Prefix of the saved files"} |
|
private |
◆ m_fileSuffix
Gaudi::Property<std::string> CaloCellsCounterGPU::m_fileSuffix {this, "FileSuffix", "", "Suffix of the saved files"} |
|
private |
◆ m_growThreshold
Gaudi::Property<float> CaloCellsCounterGPU::m_growThreshold {this, "NeighborThresholdOnEorAbsEinSigma", 2., "Neighbor (grow) threshold (in units of noise Sigma)"} |
|
private |
Value to consider for the seed threshold.
Should be consistent with the one used in Topological Clustering to ensure cell classification is correct.
Definition at line 68 of file CaloCellsCounterGPU.h.
◆ m_numWidth
Gaudi::Property<unsigned int> CaloCellsCounterGPU::m_numWidth {this, "NumberWidth", 9, "The number of digits to reserve for the events"} |
|
private |
◆ m_savePath
Gaudi::Property<std::string> CaloCellsCounterGPU::m_savePath {this, "SavePath", "./cell_counts", "Path to where the files should be saved"} |
|
private |
◆ m_seedThreshold
Gaudi::Property<float> CaloCellsCounterGPU::m_seedThreshold {this, "SeedThresholdOnEorAbsEinSigma", 4., "Seed threshold (in units of noise Sigma)"} |
|
private |
Value to consider for the seed threshold.
Should be consistent with the one used in Topological Clustering to ensure cell classification is correct.
Definition at line 63 of file CaloCellsCounterGPU.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
static std::string build_filename(const std::string &prefix, const std::string &text, const std::string &suffix, const std::string &ext)
Gaudi::Property< float > m_cellThreshold
Value to consider for the seed threshold.
path
python interpreter configuration --------------------------------------—
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::CellInfoArr > m_cell_info_dev
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Property< unsigned int > m_numWidth
The number of digits to reserve for the events.
Gaudi::Property< float > m_growThreshold
Value to consider for the seed threshold.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::CellNoiseArr > m_cell_noise_dev
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< float > m_seedThreshold
Value to consider for the seed threshold.
static ErrorState prepare_folder_for_output(const std::filesystem::path &folder, const bool output_errors=true)
Gaudi::Property< std::string > m_filePrefix
The prefix of the saved files.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Gaudi::Property< std::string > m_fileSuffix
The suffix of the saved files.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< std::string > m_savePath
The path specifying the folder to which the files should be saved.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>