PandaRoot
PndPDEFoamTrain.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* ***************************************
14  * PDEFoam Trainerer *
15  * Author: M.Babai@rug.nl *
16  * LICENSE: *
17  * Version: 0.1 beta1. *
18  * License: *
19  * ***************************************
20  */
21 #pragma once
22 #ifndef PND_PDE_FOAM_TRAIN_H
23 #define PND_PDE_FOAM_TRAIN_H
24 
25 #include "PndMvaTrainer.h"
26 
27 //#ifdef _OPENMP
28 //#undef _OPENMP
29 //#include<omp.h>
30 //#endif
31 
33  public:
34  PndPDEFoamTrain(const std::string &InPutFile, const std::vector<std::string> &ClassNames, const std::vector<std::string> &VarNames, bool trim = true);
35 
36  virtual ~PndPDEFoamTrain();
37 
38  void Train();
39  void TrainPar();
40 
41  protected:
42  void WriteFoamsToFile();
43  void InitFoam(TMVA::PDEFoam *pdefoam, TMVA::EFoamType ft);
44  void SetXminXmax(TMVA::PDEFoam *pdefoam);
45 
46  // calculate Xmin and Xmax for Foam
47  void CalcXminXmax();
48 
49  // fill variable names into foam
50  void FillVariableNamesToFoam() const;
51 
52  private:
53  PndPDEFoamTrain(const PndPDEFoamTrain &other);
54  PndPDEFoamTrain &operator=(const PndPDEFoamTrain &other);
55 
56  void Init();
57 
58  std::vector<TMVA::PDEFoam *> m_foams;
59 
60  // range for histograms and foams
61  std::vector<float> Xmin, Xmax;
62 
63  int m_VolFrac;
64  int m_nCells;
65  int m_nSampl;
66  int m_nBin;
67  int m_OptRej;
68  int m_OptDrive;
69  int m_EvPerBin;
70  int m_Chat;
71  bool m_SigBgSeparated;
72  double m_Frac;
73  int m_nActiveCells;
74 
75  TMVA::EKernel m_Kernel; // default: use no kernel
76 
77  // cuts
78  bool m_CutNmin; // cut on minimal number of events per cell
79  int m_Nmin;
80  bool m_CutRMSmin; // cut on minimal RMS in cell
81  double m_RMSmin;
82 
83  TRandom3 *PseRan;
84 };
85 #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)