Struct for training data of a single MLP for the neuro trigger.
More...
#include <CDCTriggerMLPData.h>
|
struct | HeaderSet |
|
struct | NeuroSet |
| Struct to keep one set of training data for either training, validation or testing. More...
|
|
|
| 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.
|
|
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.
|
|
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 |
|
|
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 |
|
Struct for training data of a single MLP for the neuro trigger.
Definition at line 27 of file CDCTriggerMLPData.h.
◆ CDCTriggerMLPData()
default constructor.
Definition at line 248 of file CDCTriggerMLPData.h.
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.
short m_trackCounter
number of tracks used for the hit counter.
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.
◆ ~CDCTriggerMLPData()
destructor, empty because we don't allocate memory anywhere.
Definition at line 250 of file CDCTriggerMLPData.h.
◆ addCounters()
void addCounters |
( |
unsigned |
nWires | ) |
|
|
inline |
add hit counters for a layer with nWires
Definition at line 253 of file CDCTriggerMLPData.h.
254 {
255 std::vector<unsigned short> counters;
256 counters.assign(nWires, 0);
258 }
◆ 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{
17
18 if (iTS < 0) iTS += N;
19
20
21
22
23
24 if ((0 <= iTS && iTS <= N / 4) || (3 * N / 4 <= iTS && iTS < N)) {
26 }
27 }
28}
◆ addSample() [1/2]
void addSample |
( |
const NeuroSet< inLen, outLen > & |
dsample | ) |
|
|
inline |
Definition at line 266 of file CDCTriggerMLPData.h.
267 {
268 std::vector<float> in(dsample.input, dsample.input + sizeof dsample.input / sizeof dsample.input[0]);
270 std::vector<float> out(dsample.target, dsample.target + sizeof dsample.target / sizeof dsample.target[0]);
273 m_runList.push_back(dsample.run);
274 m_subRunList.push_back(dsample.subrun);
276 m_trackList.push_back(dsample.track);
277
278 }
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_expList
Vectors for experiment, run, event and tracknumber.
◆ addSample() [2/2]
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 |
|
) |
| |
|
inline |
add a pair of input and target
Definition at line 281 of file CDCTriggerMLPData.h.
283 {
287 m_runList.push_back(runnumber);
288 m_subRunList.push_back(subrunnumber);
290 m_trackList.push_back(tracknumber);
291 }
◆ countTrack()
◆ getevtList()
const std::vector< int > & getevtList |
( |
| ) |
const |
|
inline |
◆ getEvtList()
const std::vector< int > & getEvtList |
( |
| ) |
const |
|
inline |
◆ getevtnum()
const int & getevtnum |
( |
unsigned |
i | ) |
const |
|
inline |
◆ getExpList()
const std::vector< int > & getExpList |
( |
| ) |
const |
|
inline |
◆ 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.
32{
37 }
38 }
39 return 0;
40}
◆ getInput()
const std::vector< float > & getInput |
( |
unsigned |
i | ) |
const |
|
inline |
◆ getRunList()
const std::vector< int > & getRunList |
( |
| ) |
const |
|
inline |
◆ getSubRunList()
const std::vector< int > & getSubRunList |
( |
| ) |
const |
|
inline |
◆ getTarget()
const std::vector< float > & getTarget |
( |
unsigned |
i | ) |
const |
|
inline |
◆ getTrackCounter()
short getTrackCounter |
( |
| ) |
const |
|
inline |
◆ getTrackList()
const std::vector< int > & getTrackList |
( |
| ) |
const |
|
inline |
◆ nSamples()
unsigned nSamples |
( |
| ) |
const |
|
inline |
◆ m_evtList
std::vector<int> m_evtList |
|
private |
List for debug purposes to store the event number for every entry of input/target vector.
Definition at line 327 of file CDCTriggerMLPData.h.
◆ m_expList
std::vector<int> m_expList |
|
private |
◆ m_hitCounters
std::vector<std::vector<unsigned short> > m_hitCounters |
|
private |
hit counter of active track segment IDs, used to determine the relevant id range for an MLP.
Definition at line 319 of file CDCTriggerMLPData.h.
◆ m_inputSamples
std::vector<std::vector<float> > m_inputSamples |
|
private |
◆ m_runList
std::vector<int> m_runList |
|
private |
◆ m_subRunList
std::vector<int> m_subRunList |
|
private |
◆ m_targetSamples
std::vector<std::vector<float> > m_targetSamples |
|
private |
◆ m_trackCounter
◆ m_trackList
std::vector<int> m_trackList |
|
private |
The documentation for this class was generated from the following files: