9#include "tracking/modules/trackSetEvaluatorVXD/BestVXDFamilyCandidateSelectorModule.h"
10#include <unordered_map>
19 setDescription(
"Module that selects the best candidate for each SPTC family");
34 std::unordered_map<unsigned short, std::pair<int, float>> familyToCand;
38 float qi = sptc.getQualityIndicator();
39 unsigned short family = sptc.getFamily();
40 auto iter = familyToCand.find(family);
41 if (iter != familyToCand.end()) {
42 auto& entry = iter->second;
43 if (entry.second < qi) {
44 entry.first = sptc.getArrayIndex();
48 familyToCand.emplace(std::piecewise_construct, std::forward_as_tuple(family), std::forward_as_tuple(sptc.getArrayIndex(), qi));
53 int bestCandIndex = familyToCand.at(sptc.getFamily()).first;
54 if (sptc.getArrayIndex() != bestCandIndex) {
void initialize() override final
Requires SpacePointTrackCands.
void event() override final
Application of the cut.
BestVXDFamilyCandidateSelectorModule()
Constructor of the module.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
StoreArray for input SpacePointTrackCands.
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...
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.
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.