Result.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file Result.h
3 /// \brief Result for CVN
4 /// \author Alexander Radovic - a.radovic@gmail.com
5 /// Leigh Whitehead - leigh.howard.whitehead@cern.ch
6 ////////////////////////////////////////////////////////////////////////
7 
8 #ifndef CVN_RESULT_H
9 #define CVN_RESULT_H
10 
11 #include <math.h>
12 #include <vector>
14 
15 namespace cvn
16 {
17  /// Result, basic output of CVN neural net
18  class Result
19  {
20  public:
21  Result(const float* output, unsigned int& nOutputs);
22  // Vector version of the constructor
23  Result(const std::vector< std::vector<float> > output);
24  //Result(const float* output, unsigned int& nOutputs, const float* features, unsigned int& nFeatures);
25  Result();
26 
27  /// Index of maximum value in vector
28  unsigned int ArgMax(int output_n) const;
29 
30  /// Maximum value in vector
31  float Max();
32 
33  /// Return the predicted is_antineutrino
35 
36  /// Return the predicted flavour
38 
39  /// Return the predicted interaction
41 
42  /// Return the predicted protons
44 
45  /// Return the predicted pions
47 
48  /// Return the predicted pizeros
50 
51  /// Return the predicted neutrons
53 
54  /// Return the is_antineutrino probability
55  float GetIsAntineutrinoProbability() const;
56 
57  /// Return the numu flavour probability
58  float GetNumuProbability() const;
59 
60  /// Return the nue flavour probability
61  float GetNueProbability() const;
62 
63  /// Return the nutau flavour probability
64  float GetNutauProbability() const;
65 
66  /// Return the NC probability
67  float GetNCProbability() const;
68 
69  /// Return the CC QE interaction probability
70  float GetQEProbability() const;
71 
72  /// Return the CC Res interaction probability
73  float GetResProbability() const;
74 
75  /// Return the CC DIS interaction probability
76  float GetDISProbability() const;
77 
78  /// Return the CC Other interaction probability
79  float GetOtherProbability() const;
80 
81  /// Return the 0 protons topology probability
82  float Get0protonsProbability() const;
83 
84  /// Return the 1 protons topology probability
85  float Get1protonsProbability() const;
86 
87  /// Return the 2 protons topology probability
88  float Get2protonsProbability() const;
89 
90  /// Return the >2 protons topology probability
91  float GetNprotonsProbability() const;
92 
93  /// Return the 0 pions topology probability
94  float Get0pionsProbability() const;
95 
96  /// Return the 1 pions topology probability
97  float Get1pionsProbability() const;
98 
99  /// Return the 2 pions topology probability
100  float Get2pionsProbability() const;
101 
102  /// Return the >2 pions topology probability
103  float GetNpionsProbability() const;
104 
105  /// Return the 0 pizeros topology probability
106  float Get0pizerosProbability() const;
107 
108  /// Return the 1 pizeros topology probability
109  float Get1pizerosProbability() const;
110 
111  /// Return the 2 pizeros topology probability
112  float Get2pizerosProbability() const;
113 
114  /// Return the >2 pizeros topology probability
115  float GetNpizerosProbability() const;
116 
117  /// Return the 0 neutrons topology probability
118  float Get0neutronsProbability() const;
119 
120  /// Return the 1 neutrons topology probability
121  float Get1neutronsProbability() const;
122 
123  /// Return the 2 neutrons topology probability
124  float Get2neutronsProbability() const;
125 
126  /// Return the >2 neutrons topology probability
127  float GetNneutronsProbability() const;
128 
129  /// Number of outputs, i.e. size of vector
130  unsigned int NOutput();
131 
132  std::vector< std::vector<float> > fOutput; ///< Vector of outputs from neural net
133 
134  };
135 }
136 
137 #endif // CVN_RESULT_H
138 
float Get2neutronsProbability() const
Return the 2 neutrons topology probability.
Definition: Result.cxx:342
float Get1protonsProbability() const
Return the 1 protons topology probability.
Definition: Result.cxx:212
float Get0pizerosProbability() const
Return the 0 pizeros topology probability.
Definition: Result.cxx:282
float GetNpionsProbability() const
Return the >2 pions topology probability.
Definition: Result.cxx:272
float Get2pionsProbability() const
Return the 2 pions topology probability.
Definition: Result.cxx:262
unsigned int ArgMax(int output_n) const
Index of maximum value in vector.
Definition: Result.cxx:38
float Get1pizerosProbability() const
Return the 1 pizeros topology probability.
Definition: Result.cxx:292
float GetNpizerosProbability() const
Return the >2 pizeros topology probability.
Definition: Result.cxx:312
TFTopologyNeutrons PredictedNeutrons() const
Return the predicted neutrons.
Definition: Result.cxx:92
TFTopologyNeutrons
float Get0protonsProbability() const
Return the 0 protons topology probability.
Definition: Result.cxx:202
struct vector vector
float GetNneutronsProbability() const
Return the >2 neutrons topology probability.
Definition: Result.cxx:352
float Get0pionsProbability() const
Return the 0 pions topology probability.
Definition: Result.cxx:242
TFTopologyPions PredictedPions() const
Return the predicted pions.
Definition: Result.cxx:82
TFTopologyPizeros PredictedPizeros() const
Return the predicted pizeros.
Definition: Result.cxx:87
Utility class for truth labels.
float Max()
Maximum value in vector.
float GetNCProbability() const
Return the NC probability.
Definition: Result.cxx:140
float Get2pizerosProbability() const
Return the 2 pizeros topology probability.
Definition: Result.cxx:302
float GetResProbability() const
Return the CC Res interaction probability.
Definition: Result.cxx:172
float GetNumuProbability() const
Return the numu flavour probability.
Definition: Result.cxx:107
TFInteraction PredictedInteraction() const
Return the predicted interaction.
Definition: Result.cxx:72
TFIsAntineutrino PredictedIsAntineutrino() const
Return the predicted is_antineutrino.
Definition: Result.cxx:61
TFIsAntineutrino
float Get0neutronsProbability() const
Return the 0 neutrons topology probability.
Definition: Result.cxx:322
float GetIsAntineutrinoProbability() const
Return the is_antineutrino probability.
Definition: Result.cxx:97
float GetNutauProbability() const
Return the nutau flavour probability.
Definition: Result.cxx:129
unsigned int NOutput()
Number of outputs, i.e. size of vector.
TFTopologyProtons
Result, basic output of CVN neural net.
Definition: Result.h:18
TFFlavour PredictedFlavour() const
Return the predicted flavour.
Definition: Result.cxx:66
float GetDISProbability() const
Return the CC DIS interaction probability.
Definition: Result.cxx:182
float GetNueProbability() const
Return the nue flavour probability.
Definition: Result.cxx:118
std::vector< std::vector< float > > fOutput
Vector of outputs from neural net.
Definition: Result.h:132
TFTopologyProtons PredictedProtons() const
Return the predicted protons.
Definition: Result.cxx:77
float GetNprotonsProbability() const
Return the >2 protons topology probability.
Definition: Result.cxx:232
TFTopologyPizeros
float GetQEProbability() const
Return the CC QE interaction probability.
Definition: Result.cxx:162
float Get2protonsProbability() const
Return the 2 protons topology probability.
Definition: Result.cxx:222
float GetOtherProbability() const
Return the CC Other interaction probability.
Definition: Result.cxx:192
float Get1neutronsProbability() const
Return the 1 neutrons topology probability.
Definition: Result.cxx:332
float Get1pionsProbability() const
Return the 1 pions topology probability.
Definition: Result.cxx:252