9#include "tracking/modules/trackSetEvaluatorVXD/BestVXDTrackCandidatesSelectorModule.h"
20 setDescription(
"Module that selects a subset with a fixed size x out of all SpacePointTrackCandidates. Based on qualityIndicator.");
27 "If True copy selected SpacePoints to new StoreArray, if False deactivate remaining SpacePoints.",
bool(
false));
29 "Only required if 'CreateNewStoreArray' is true. Name of StoreArray to store the subset. If the target name is equal to the source candidates not matching the selection criteria are deleted.",
30 std::string(
"BestSpacePointTrackCands"));
61 for (
int iTracks = 0; iTracks < nTracks -
m_subsetSize; ++iTracks) {
62 int iCandidate = sortedTrackCandIndices[iTracks];
78 std::set<int> subset(sortedTrackCandIndices.cbegin(), sortedTrackCandIndices.cbegin() +
m_subsetSize);
93 std::iota(sortedTrackCandIndices.begin(), sortedTrackCandIndices.end(), 0);
95 std::sort(sortedTrackCandIndices.begin(), sortedTrackCandIndices.end(),
96 [
this, increasing](
const int lhs,
const int rhs) {
97 if (increasing) return m_spacePointTrackCands[lhs]->getQualityIndicator() <
98 m_spacePointTrackCands[rhs]->getQualityIndicator();
99 else return m_spacePointTrackCands[lhs]->getQualityIndicator() > m_spacePointTrackCands[rhs]->getQualityIndicator();
102 return sortedTrackCandIndices;
void initialize() override final
Requires SpacePointTrackCands.
std::string m_newNameSpacePointTrackCands
Name of optional output StoreArray containing SpacePointTrackCands.
std::vector< int > getSortedTrackCandIndices(bool increasing)
Return StoreArrayIndices of all candidates sorted by their qualityIndicator.
void event() override final
Application of the cut.
SelectSubset< SpacePointTrackCand > m_bestCandidates
SubsetSelector operating on a custom selection criteria.
void selectSubset()
Copy or delete candidates to achieve a subset creation.
BestVXDTrackCandidatesSelectorModule()
Constructor of the module.
unsigned short m_subsetSize
target size of subset
bool m_subsetCreation
If True copy selected SpacePointTrackCands to new StoreArray, If False deactivate remaining SpacePoin...
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
StoreArray for input SpacePointTrackCands.
void deactivateCandidates()
Don't copy/delete candidates but rather deactivate them by setting a SpacePointTrackCandidate flag.
std::string m_nameSpacePointTrackCands
Name of input StoreArray containing SpacePointTrackCands.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
Storage for (VXD) SpacePoint-based track candidates.
@ c_isActive
bit 11: SPTC is active (i.e.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
int getEntries() const
Get the number of objects in the array.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.