-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Currently only proper collections can be passed as input (and output) collections in Functional algorithms. In some cases it might be useful to have the possibility to pass a vector of interface types instead, e.g.
class TrackFinder : public k4FWCore::Transformer<edm4hep::TrackCollection(const std::vector<edm4hep::TrackerHit>&)> {
// the rest
};In some cases it might be possible to work around this, by simply accepting a vector of collections, e.g.
class TrackFinder : public k4FWCore::Transformer<edm4hep::TrackCollection(const std::vector<edm4hep::TrackerHitPlaneCollection>&)> {
// the rest
};However, that immediately limits the usability to exactly one of the potential types that are modeled by the interface and would require to pass multiple input vectors of collection (types). That would in turn require some more complicated logic in the implementation. Instead if it would be possible to simply pass the vector of interface objects, most of the logic could be externalized and would effectively amount to merging all the input collections into the interface vector. The actual algorithm could then most probably be implemented as a simple loop over that vector instead of having to collect it first.