 |
Belle II Software
release-05-02-19
|
11 #include "tracking/modules/trackSetEvaluatorVXD/TrackSetEvaluatorHopfieldNNDEVModule.h"
13 #include "tracking/trackFindingVXD/trackSetEvaluator/HopfieldNetwork.h"
22 setDescription(
"This module expects a container of SpacePointTrackCandidates and an OverlapNetwork\
23 and thenselects a subset of non-overlapping TCs determined using a neural network of Hopfield type.");
25 setPropertyFlags(c_ParallelProcessingCertified);
27 addParam(
"NameSpacePointTrackCands", m_PARAMtcArrayName,
"Sets the name of expected StoreArray with SpacePointTrackCand in it.",
29 addParam(
"NameOverlapNetworks", m_PARAMtcNetworkName,
"Sets the name of expected StoreArray<OverlapNetwork>.",
31 addParam(
"minActivityState", m_minActivityState,
"Sets the minimal value of activity (Neuron Value) for acceptance.",
46 std::vector<OverlapResolverNodeInfo> overlapResolverNodeInfos;
50 overlapResolverNodeInfos.emplace_back(sPTC.getQualityIndicator(), sPTC.getArrayIndex(),
57 unsigned maxIterations = 20;
58 if (hopfieldNetwork.
doHopfield(overlapResolverNodeInfos, maxIterations) == maxIterations) {
59 B2INFO(
"Hopfield Network failed converge.");
64 unsigned int nSurvivors = 0;
65 for (
const auto& overlapResolverNodeInfo : overlapResolverNodeInfos) {
74 if (nSurvivors == 0) {
75 B2WARNING(
"Hopfield network - had no survivors!");
87 B2INFO(
"TrackSetEvaluatorHopfieldNNDEVModule-endRun: " <<
88 " nTCs per event: " <<
float(
m_nTCsTotal)*invEvents <<
89 " nFinalTCs per event: " <<
float(
m_nFinalTCs)*invEvents <<
void endRun() override final
Report on performance.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
unsigned int m_nFinalTCs
number of TCs found for final sets of non-overlapping TCs so far.
void event() override final
Applies the Hopfield neural network algorithm at given sets of SpacePointTrackCandidates.
@ c_isActive
bit 11: SPTC is active (i.e.
unsigned int m_eventCounter
knows current event number.
The Hopfield algoritm Trackset Evaluator.
float m_minActivityState
************************************** Member variables *********************************************...
Abstract base class for different kinds of events.
Hopfield Algorithm with number based inputs.
unsigned int m_nTCsTotal
total number of TCs evaluated so far.
unsigned short doHopfield(std::vector< OverlapResolverNodeInfo > &overlapResolverNodeInfos, unsigned short nIterations=20)
Performance of the actual algorithm.
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.
int getEntries() const
Get the number of objects in the array.
Storage for (VXD) SpacePoint-based track candidates.