CLASS  5.1
Fuel Cycle Simulator
CLASSReader.hxx
Go to the documentation of this file.
1 #ifndef _READER_HXX
2 #define _READER_HXX
3 
4 #include <iostream>
5 #include <vector>
6 #include <list>
7 #include <map>
8 
9 #include "TTree.h"
10 #include "TString.h"
11 #include "TMVA/Reader.h"
12 #include "TMVA/Tools.h"
13 #include "TMVA/MethodCuts.h"
14 
15 using namespace std;
16 
18 {
19  public :
20  CLASSReader ();
21  CLASSReader ( const std::vector<std::string> & );
22  template < typename T >
23  CLASSReader ( const std::map<T,std::string> & );
24 
25  ~CLASSReader ();
26 
27  void AddVariable ( const std::string & );
28  void SetInputData ( vector<float> inputdata );
29 
30  TMVA::IMethod * BookMVA ( const std::string & , const std::string & );
31  const std::vector<float> & EvaluateRegression ( const std::string & );
32 
33  std::size_t GetNVariables () const { return freader->DataInfo().GetNVariables(); }
34  std::vector< TString > GetListOfVariables () const { return freader->DataInfo().GetListOfVariables(); }
35 
36  private :
37  TMVA::Reader * freader;
38  std::list<float> finputTMVA; // changer vector en list !!!
39 };
40 
41 template < typename T >
42 CLASSReader::CLASSReader ( const std::map<T,std::string> & a ) :
43  freader( new TMVA::Reader( "silent" ) ) , finputTMVA( a.size() )
44 {
45  std::list<float>::iterator l_it = finputTMVA.begin();
46  for ( typename std::map<T,std::string>::const_iterator m_it = a.begin() ; m_it != a.end() ; ++m_it, ++l_it )
47  {
48  freader->AddVariable( m_it->second.c_str() , &(*l_it) );
49  }
50 }
51 
52 #endif
std::vector< TString > GetListOfVariables() const
Definition: CLASSReader.hxx:34
Definition: CLASSBackEndDict.cxx:37
Definition: CLASSReader.hxx:17
std::size_t GetNVariables() const
Definition: CLASSReader.hxx:33
CLASSReader()
Definition: CLASSReader.cxx:4