 |
Belle II Software
release-05-01-25
|
11 #include "tracking/modules/trackSetEvaluatorVXD/BestVXDTrackCandidatesSelectorModule.h"
22 setDescription(
"Module that selects a subset with a fixed size x out of all SpacePointTrackCandidates. Based on qualityIndicator.");
23 setPropertyFlags(c_ParallelProcessingCertified);
26 addParam(
"NameSpacePointTrackCands", m_nameSpacePointTrackCands,
"Name of expected StoreArray.", std::string(
""));
27 addParam(
"SubsetSize", m_subsetSize,
"Target size of selected subset.", (
unsigned short)(1000));
28 addParam(
"SubsetCreation", m_subsetCreation,
29 "If True copy selected SpacePoints to new StoreArray, if False deactivate remaining SpacePoints.",
bool(
false));
30 addParam(
"NewNameSpacePointTrackCands", m_newNameSpacePointTrackCands,
31 "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.",
32 std::string(
"BestSpacePointTrackCands"));
63 for (
int iTracks = 0; iTracks < nTracks -
m_subsetSize; ++iTracks) {
64 int iCandidate = sortedTrackCandIndices[iTracks];
80 std::set<int> subset(sortedTrackCandIndices.cbegin(), sortedTrackCandIndices.cbegin() +
m_subsetSize);
95 std::iota(sortedTrackCandIndices.begin(), sortedTrackCandIndices.end(), 0);
97 std::sort(sortedTrackCandIndices.begin(), sortedTrackCandIndices.end(),
98 [
this, increasing](
const int lhs,
const int rhs) {
99 if (increasing) return m_spacePointTrackCands[lhs]->getQualityIndicator() <
100 m_spacePointTrackCands[rhs]->getQualityIndicator();
101 else return m_spacePointTrackCands[lhs]->getQualityIndicator() > m_spacePointTrackCands[rhs]->getQualityIndicator();
104 return sortedTrackCandIndices;
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void deactivateCandidates()
Don't copy/delete candidates but rather deactivate them by setting a SpacePointTrackCandidate flag.
@ c_isActive
bit 11: SPTC is active (i.e.
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.
Abstract base class for different kinds of events.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
unsigned short m_subsetSize
target size of subset
bool m_subsetCreation
If True copy selected SpacePointTrackCands to new StoreArray, If False deactivate remaining SpacePoin...
std::string m_nameSpacePointTrackCands
Name of input StoreArray containing SpacePointTrackCands.
void event() override final
Application of the cut.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
StoreArray for input SpacePointTrackCands.
void selectSubset()
Copy or delete candidates to achieve a subset creation.
Module that selects a subset with a fixed size x out of all SpacePointTrackCandidates.
SelectSubset< SpacePointTrackCand > m_bestCandidates
SubsetSelector operating on a custom selection criteria.
int getEntries() const
Get the number of objects in the array.
Storage for (VXD) SpacePoint-based track candidates.