Belle II Software  release-08-01-10
CDCTriggerMLPData Class Reference

Struct for training data of a single MLP for the neuro trigger. More...

#include <CDCTriggerMLPData.h>

Inheritance diagram for CDCTriggerMLPData:
Collaboration diagram for CDCTriggerMLPData:

Classes

struct  HeaderSet
 
struct  NeuroSet
 Struct to keep one set of training data for either training, validation or testing. More...
 

Public Member Functions

 CDCTriggerMLPData ()
 default constructor.
 
 ~CDCTriggerMLPData ()
 destructor, empty because we don't allocate memory anywhere.
 
void addCounters (unsigned nWires)
 add hit counters for a layer with nWires
 
void addHit (unsigned iSL, int iTS)
 increase counter for super layer and track segment number in super layer. More...
 
void countTrack ()
 increase track counter
 
template<unsigned inLen, unsigned outLen>
void addSample (const NeuroSet< inLen, outLen > &dsample)
 
void addSample (const std::vector< float > &input, const std::vector< float > &target, const int &expnumber, const int &runnumber, const int &subrunnumber, const int &eventnumber, const int &tracknumber)
 add a pair of input and target
 
short getTrackCounter () const
 get track counter
 
unsigned short getHitCounter (unsigned iSL, int iTS) const
 get hit counter for super layer and track segment number is super layer. More...
 
unsigned nSamples () const
 get number of samples (same for input and target)
 
const std::vector< float > & getInput (unsigned i) const
 get input vector of sample i
 
const std::vector< float > & getTarget (unsigned i) const
 get target value of sample i
 
const std::vector< int > & getevtList () const
 
const std::vector< int > & getEvtList () const
 
const std::vector< int > & getExpList () const
 
const std::vector< int > & getRunList () const
 
const std::vector< int > & getSubRunList () const
 
const std::vector< int > & getTrackList () const
 
const int & getevtnum (unsigned i) const
 

Private Member Functions

 ClassDef (CDCTriggerMLPData, 3)
 Needed to make the ROOT object storable.
 

Private Attributes

std::vector< std::vector< float > > m_inputSamples
 list of input vectors for network training.
 
std::vector< std::vector< float > > m_targetSamples
 list of target values for network training.
 
std::vector< std::vector< unsigned short > > m_hitCounters
 hit counter of active track segment IDs, used to determine the relevant id range for an MLP.
 
short m_trackCounter
 number of tracks used for the hit counter.
 
std::vector< int > m_expList
 Vectors for experiment, run, event and tracknumber.
 
std::vector< int > m_runList
 
std::vector< int > m_subRunList
 
std::vector< int > m_evtList
 List for debug purposes to store the event number for every entry of input/target vector.
 
std::vector< int > m_trackList
 

Detailed Description

Struct for training data of a single MLP for the neuro trigger.

Definition at line 27 of file CDCTriggerMLPData.h.

Member Function Documentation

◆ addHit()

void addHit ( unsigned  iSL,
int  iTS 
)

increase counter for super layer and track segment number in super layer.

track segment number can be negative. hits in the wrong hemisphere (not in [-nWires/4, nWires/4]) are skipped.

Definition at line 13 of file CDCTriggerMLPData.cc.

14 {
15  if (iSL < m_hitCounters.size()) {
16  int N = m_hitCounters[iSL].size();
17  // shift negative indices
18  if (iTS < 0) iTS += N;
19  // check the range
20  // 0, N: hit is on the track
21  // [0, N/4]: hit is in quadrant left of the track
22  // [N/4, 3N/4]: hit is in hemisphere opposite of the track (skipped)
23  // [3N/4, N]: hit is in quadrant right of the track
24  if ((0 <= iTS && iTS <= N / 4) || (3 * N / 4 <= iTS && iTS < N)) {
25  ++m_hitCounters[iSL][iTS];
26  }
27  }
28 }
std::vector< std::vector< unsigned short > > m_hitCounters
hit counter of active track segment IDs, used to determine the relevant id range for an MLP.

◆ getHitCounter()

unsigned short getHitCounter ( unsigned  iSL,
int  iTS 
) const

get hit counter for super layer and track segment number is super layer.

track segment number can be negative.

Returns
counter or 0 (for invalid input)

Definition at line 31 of file CDCTriggerMLPData.cc.


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