PandaRoot
PndPDEFoamTrain.h
Go to the documentation of this file.
1 /* ***************************************
2  * PDEFoam Trainerer *
3  * Author: M.Babai@rug.nl *
4  * LICENSE: *
5  * Version: 0.1 beta1. *
6  * License: *
7  * ***************************************
8  */
9 #pragma once
10 #ifndef PND_PDE_FOAM_TRAIN_H
11 #define PND_PDE_FOAM_TRAIN_H
12 
13 #include "PndMvaTrainer.h"
14 
15 //#ifdef _OPENMP
16 //#undef _OPENMP
17 //#include<omp.h>
18 //#endif
19 
21  public:
22  PndPDEFoamTrain(const std::string &InPutFile, const std::vector<std::string> &ClassNames, const std::vector<std::string> &VarNames, bool trim = true);
23 
24  virtual ~PndPDEFoamTrain();
25 
26  void Train();
27  void TrainPar();
28 
29  protected:
30  void WriteFoamsToFile();
31  void InitFoam(TMVA::PDEFoam *pdefoam, TMVA::EFoamType ft);
32  void SetXminXmax(TMVA::PDEFoam *pdefoam);
33 
34  // calculate Xmin and Xmax for Foam
35  void CalcXminXmax();
36 
37  // fill variable names into foam
38  void FillVariableNamesToFoam() const;
39 
40  private:
41  PndPDEFoamTrain(const PndPDEFoamTrain &other);
42  PndPDEFoamTrain &operator=(const PndPDEFoamTrain &other);
43 
44  void Init();
45 
46  std::vector<TMVA::PDEFoam *> m_foams;
47 
48  // range for histograms and foams
49  std::vector<float> Xmin, Xmax;
50 
51  int m_VolFrac;
52  int m_nCells;
53  int m_nSampl;
54  int m_nBin;
55  int m_OptRej;
56  int m_OptDrive;
57  int m_EvPerBin;
58  int m_Chat;
59  bool m_SigBgSeparated;
60  double m_Frac;
61  int m_nActiveCells;
62 
63  TMVA::EKernel m_Kernel; // default: use no kernel
64 
65  // cuts
66  bool m_CutNmin; // cut on minimal number of events per cell
67  int m_Nmin;
68  bool m_CutRMSmin; // cut on minimal RMS in cell
69  double m_RMSmin;
70 
71  TRandom3 *PseRan;
72 };
73 #endif
void FillVariableNamesToFoam() const
void Train()
Derived classes need to implement this methode.
void InitFoam(TMVA::PDEFoam *pdefoam, TMVA::EFoamType ft)
virtual ~PndPDEFoamTrain()
PndPDEFoamTrain(const std::string &InPutFile, const std::vector< std::string > &ClassNames, const std::vector< std::string > &VarNames, bool trim=true)
void WriteFoamsToFile()
void SetXminXmax(TMVA::PDEFoam *pdefoam)