00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TObject.h"
00015 #include <vector>
00016 #include <cmath>
00017 #include <string>
00018 #include <iostream>
00019 #include "MCNNAnalysis/NueAnaReader.h"
00020 #include "MCNNAnalysis/LEMStandard.h"
00021 #include "NueAna/NueRecord.h"
00022
00023 #ifndef LEMNNPID_H
00024 #define LEMNNPID_H
00025
00026 class LEMNNpid {
00027
00028 public:
00029
00030 LEMNNpid();
00031
00032 ~LEMNNpid() {
00033
00034 }
00035
00036
00037
00038
00039 double GetMvaValue( const std::vector<double>& inputValues ) const;
00040
00041
00042 Double_t GetLEMpid(NueRecord *nr);
00043 Double_t GetLEMpid(NueAnaReader *nueana);
00044
00045 private:
00046
00047
00048 void Clear();
00049
00050
00051
00052 double fMin_1[3][4];
00053 double fMax_1[3][4];
00054 void InitTransform_1();
00055 void Transform_1( std::vector<double> & iv, int sigOrBgd ) const;
00056 void InitTransform();
00057 void Transform( std::vector<double> & iv, int sigOrBgd ) const;
00058
00059
00060 const char* fClassName;
00061
00062 char GetType( int ivar ) const { return fType[ivar]; }
00063
00064
00065
00066
00067 Bool_t IsNormalised() const { return false; }
00068 double fVmin[4];
00069 double fVmax[4];
00070 double NormVariable( double x, double xmin, double xmax ) const {
00071
00072 return 2*(x - xmin)/(xmax - xmin) - 1.0;
00073 }
00074
00075
00076 char fType[4];
00077
00078
00079 void Initialize();
00080 double GetMvaValue__( const std::vector<double>& inputValues ) const;
00081
00082
00083
00084 double ActivationFnc(double x) const;
00085
00086 int fLayers;
00087 int fLayerSize[3];
00088 double fWeightMatrix0to1[10][5];
00089 double fWeightMatrix1to2[1][10];
00090
00091 double * fWeights[3];
00092 };
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 #endif