Belle II Software development
HopfieldNetworkTest Class Reference

Test of HopfieldNetwork Class. More...

Inheritance diagram for HopfieldNetworkTest:

Protected Member Functions

vector< OverlapResolverNodeInfogetInput ()
 Create sample for test.
 

Protected Attributes

vector< OverlapResolverNodeInfom_trackCandidateInfos
 Container on which the Hopfield Algorithm runs.
 
vector< OverlapResolverNodeInfom_qiTrackOverlap
 Container on which the Greedy Algorithm (Scrooge) runs.
 
unsigned int myTrueTracks = 10
 Number of true tracks.
 

Detailed Description

Test of HopfieldNetwork Class.

Definition at line 23 of file hopfieldNetwork.cc.

Member Function Documentation

◆ getInput()

vector< OverlapResolverNodeInfo > getInput ( )
inlineprotected

Create sample for test.

Returns
test sample info

Definition at line 41 of file hopfieldNetwork.cc.

42 {
43 vector<OverlapResolverNodeInfo> trackCandidateInfos;
44 unsigned int myNTrackCands = 200;
45 unsigned int diff = myNTrackCands - myTrueTracks;
46 unsigned int nOverlaps = 6;
47
48 //Create competitor IDs
49 vector <vector <unsigned short> > competitorIDMatrix(myNTrackCands);
50 for (unsigned int ii = 0; ii < myNTrackCands; ii++) {
51 for (unsigned int jj = 0; jj < nOverlaps; jj++) {
52 unsigned short bkgIndex = (rand() % diff) + myTrueTracks;
53 competitorIDMatrix[ii].push_back(bkgIndex);
54 competitorIDMatrix[bkgIndex].push_back(ii);
55 }
56 }
57
58 //Make the actual OverlapResolverNodeInfos
59 for (unsigned int ii = 0; ii < myNTrackCands; ii++) {
60 float qualityIndicator = 0;
61 if (ii < myTrueTracks) {
62 qualityIndicator = static_cast<float>(rand() % 100) / 100.;
63 B2INFO("Track Index" << ii << ", TrueQI: " << qualityIndicator);
64 } else {
65 qualityIndicator = 1 / (static_cast<float>(rand() % 100) + 1.2);
66 B2INFO("Track Index" << ii << ", FakeQI: " << qualityIndicator);
67 }
68 trackCandidateInfos.emplace_back(qualityIndicator, ii, competitorIDMatrix[ii], 0.8);
69 }
70 return trackCandidateInfos;
71 }
unsigned int myTrueTracks
Number of true tracks.

Member Data Documentation

◆ m_qiTrackOverlap

vector<OverlapResolverNodeInfo> m_qiTrackOverlap
protected

Container on which the Greedy Algorithm (Scrooge) runs.

Output comes in form of qiTrackOverlap.isActive, which is simply a bool, if the corresponding track was taken or not.

Definition at line 34 of file hopfieldNetwork.cc.

◆ m_trackCandidateInfos

vector<OverlapResolverNodeInfo> m_trackCandidateInfos
protected

Container on which the Hopfield Algorithm runs.

Output comes in form of tcInfo4Hopfield.neuronValue. Typically > 0.7 signal, < 0.7 bkg;

Definition at line 29 of file hopfieldNetwork.cc.

◆ myTrueTracks

unsigned int myTrueTracks = 10
protected

Number of true tracks.

Definition at line 36 of file hopfieldNetwork.cc.


The documentation for this class was generated from the following file: