FairRoot/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 {
22  public:
23  PndPDEFoamTrain(const std::string& InPutFile,
24  const std::vector<std::string>& ClassNames,
25  const std::vector<std::string>& VarNames,
26  bool trim = true);
27 
28  virtual ~PndPDEFoamTrain();
29 
30  void Train();
31  void TrainPar();
32 
33  protected:
34  void WriteFoamsToFile();
35  void InitFoam(TMVA::PDEFoam *pdefoam, TMVA::EFoamType ft);
36  void SetXminXmax( TMVA::PDEFoam *pdefoam );
37 
38  // calculate Xmin and Xmax for Foam
39  void CalcXminXmax();
40 
41  // fill variable names into foam
42  void FillVariableNamesToFoam() const;
43 
44  private:
45  PndPDEFoamTrain(const PndPDEFoamTrain& other);
47 
48  void Init();
49 
50  std::vector<TMVA::PDEFoam*> m_foams;
51 
52  // range for histograms and foams
53  std::vector<float> Xmin, Xmax;
54 
55  int m_VolFrac;
56  int m_nCells;
57  int m_nSampl;
58  int m_nBin;
59  int m_OptRej;
62  int m_Chat;
64  double m_Frac;
66 
67  TMVA::EKernel m_Kernel; // default: use no kernel
68 
69  // cuts
70  bool m_CutNmin;// cut on minimal number of events per cell
71  int m_Nmin;
72  bool m_CutRMSmin; // cut on minimal RMS in cell
73  double m_RMSmin;
74 
75  TRandom3 *PseRan;
76 };
77 #endif
void Train()
Derived classes need to implement this methode.
void InitFoam(TMVA::PDEFoam *pdefoam, TMVA::EFoamType ft)
std::vector< float > Xmin
virtual ~PndPDEFoamTrain()
TRandom3 * PseRan
TMVA::EKernel m_Kernel
std::vector< float > Xmax
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)
void FillVariableNamesToFoam() const
std::vector< TMVA::PDEFoam * > m_foams
PndPDEFoamTrain & operator=(const PndPDEFoamTrain &other)