Add indexer method to ICalorimeterTool.#377
Add indexer method to ICalorimeterTool.#377scott-snyder wants to merge 3 commits intokey4hep:mainfrom
Conversation
Add an indexer() method to ICalorimeterTool, which returns a pointer to a new ICaloIndexer object. This provides an interface for translating cellIDs to indices.
|
To support performance improvements in cell/cluster reconstruction when all cells are present (i.e., with noise). |
| #define K4INTERFACE_ICALOINDEXER_H | ||
|
|
||
| #include <cstdint> | ||
| #include <memory> |
There was a problem hiding this comment.
| #include <memory> |
Not used here
|
|
||
| // Gaudi | ||
| #include "GaudiKernel/IAlgTool.h" | ||
|
|
There was a problem hiding this comment.
| #include <memory> | |
| /** | ||
| * @brief Return the IDs of the detector(s) that we index. | ||
| */ | ||
| virtual std::span<const int> detIDs() const = 0; |
There was a problem hiding this comment.
Will this ID come from DD4hep's BitFieldCoder? If so it's an int64_t and then this span can not be constructed trivially.
There was a problem hiding this comment.
It will actually be a uint64_t, I think: https://github.com/AIDASoft/DD4hep/blob/f211417464fd0d53f5aa0581db3f56425723395f/DDCore/include/DDSegmentation/BitFieldCoder.h#L25
Why not make this a dd4hep::CellID directly?
We did similar things in the past, e.g. in several PRs linked from this one: AIDASoft/DD4hep#1125
Is it a problem that the span cannot be constructed trivially?
There was a problem hiding this comment.
But this is not cellID, cellID is set to uint64_t. And the point of the span is to have a view to a contiguous array, if the array is a different type then a new one has to be constructed, which would happen also for std::vector.
There was a problem hiding this comment.
Ah OK. I didn't read carefully enough and thought this returns cell / volume Ids for the sensor. In that case, ignore my comment for this one, but there might be cases where one could consider going to dd4hep::CellID in other signatures above.
Add an indexer() method to ICalorimeterTool, which returns a pointer to a new ICaloIndexer object. This provides an interface for translating cellIDs to indices.
BEGINRELEASENOTES
ENDRELEASENOTES