Closed jmcarcell closed 2 months ago
I had a quick look. There are still a few occurrences of 'map' where 'vector' should be used
Functions
detail::readMapInputs
anddetail::putMapOutputs
could also be renamed since they operate on vectorsI think
const *
are acceptableIn case the information about collection keys will be needed: In Gaudi there is
inputLocation()
andoutputLocation()
(defined inDataHandleMixing
) that can be used to get keys of inputs and outputs (like tuple either by index or type if unique). From what I seen they are not accessible from k4FWCore functional algorithms. It might be good idea to add something similar here. Alternatively something likestd::get<n>(m_outputs).at(m).fullKey().key()
could be used to get key ofn
-th output andm
-th collection (given n-th output is a vector of collections)
There is also m_inputLocations
and m_outputLocations
that can be used like here: https://github.com/key4hep/k4Reco/pull/2/files#diff-fd32a841abe95600867a31e1e8a8f06232c5fe7e654319fdfad0d14b55760bc0R256. I don't have a strong opinion on implementing inputLocation()
and outputLocation()
or not.
I added a inputLocations
and outputLocations
to retrieve those and they are used in a couple of tests. Now I notice the Gaudi version is in singular but here it can be more than one. I think them being views is fine, but they can easily be changed to a vector.
Any more comments or comments about the functions to get the locations? @m-fila
Any more comments or comments about the functions to get the locations? @m-fila
Sorry I was busy with other things, I'll take another look
I'll merge this later today, #209 has to be rebased on top of this. Note to myself: fix formatting, clang-format
with Clang 18 gives different results from what you get from the nightlies...
The current implementation with std::map is not easy to use. The collections get ordered alphabetically in std::map so the order set in the steering file is lost, which means if there is some kind of mapping (like one output collection for each input collection) then one has to reproduce this map in the algorithm and the way I found to do it is to have another property with the input and output names again. For output one creates the collections and then puts them in a vector, I think it can't get simpler than that. For input, since there can't be vectors to references one gets a pointer to the collection, which is not ideal but not so bad. With a custom type it would be possible to have a vector that when using [] can get a reference but then that introduces a custom type which I don't like.
BEGINRELEASENOTES
inputLocations
andoutputLocations
methods to be able to retrieve the locations set in the steering file.ENDRELEASENOTES