9#include "tracking/modules/trackSetEvaluatorVXD/TrackSetEvaluatorHopfieldNNDEVModule.h"
11#include "tracking/trackFindingVXD/trackSetEvaluator/HopfieldNetwork.h"
20 setDescription(
"This module expects a container of SpacePointTrackCandidates and an OverlapNetwork\
21 and thenselects a subset of non-overlapping TCs determined using a neural network of Hopfield type.");
25 addParam(
"NameSpacePointTrackCands",
m_PARAMtcArrayName,
"Sets the name of expected StoreArray with SpacePointTrackCand in it.",
44 std::vector<OverlapResolverNodeInfo> overlapResolverNodeInfos;
48 overlapResolverNodeInfos.emplace_back(sPTC.getQualityIndicator(), sPTC.getArrayIndex(),
55 unsigned maxIterations = 20;
56 if (hopfieldNetwork.
doHopfield(overlapResolverNodeInfos, maxIterations) == maxIterations) {
57 B2INFO(
"Hopfield Network failed converge.");
62 unsigned int nSurvivors = 0;
63 for (
const auto& overlapResolverNodeInfo : overlapResolverNodeInfos) {
72 if (nSurvivors == 0) {
73 B2WARNING(
"Hopfield network - had no survivors!");
85 B2INFO(
"TrackSetEvaluatorHopfieldNNDEVModule-endRun: " <<
86 " nTCs per event: " <<
float(
m_nTCsTotal)*invEvents <<
87 " nFinalTCs per event: " <<
float(
m_nFinalTCs)*invEvents <<
Hopfield Algorithm with number based inputs.
unsigned short doHopfield(std::vector< OverlapResolverNodeInfo > &overlapResolverNodeInfos, unsigned short nIterations=20)
Performance of the actual algorithm.
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.
int getEntries() const
Get the number of objects in the array.
unsigned int m_eventCounter
knows current event number.
float m_minActivityState
************************************** Member variables *********************************************...
TrackSetEvaluatorHopfieldNNDEVModule()
Constructor of the module.
void event() override final
Applies the Hopfield neural network algorithm at given sets of SpacePointTrackCandidates.
std::string m_PARAMtcNetworkName
sets the name of the StoreObjPtr used for storing a TC network.
void endRun() override final
Report on performance.
std::string m_PARAMtcArrayName
************************************** Module Parameters ********************************************...
unsigned int m_nFinalTCs
number of TCs found for final sets of non-overlapping TCs so far.
unsigned int m_nTCsTotal
total number of TCs evaluated so far.
StoreArray< OverlapNetwork > m_overlapNetworks
access to tcNetwork, which will be produced by this module.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
the storeArray for SpacePointTrackCands as member, is faster than recreating link for each event.
unsigned int m_nHopfieldFails
counts number of times when Hopfield was not able to clean overlaps.
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.