Skip to content
Snippets Groups Projects
XSM_SFR.hxx 3.77 KiB
Newer Older
#ifndef _XSM_SFR_HXX
#define _XSM_SFR_HXX

/*!
 \file
 \brief Header file for XSM_SFR class.
 
 
 @version 1.0
 */
#include <string>
#include <fstream>
#include <iostream>
#include <map>
#include <vector>

Ernoult's avatar
Ernoult committed
#include "TTree.h"

BaM's avatar
BaM committed
#include "XSM_MLP.hxx"

typedef long long int cSecond;
using namespace std;


class XSM_SFR;
#ifndef __CINT__
typedef void (XSM_SFR::*XS_SFR_DMthPtr)( const string & ) ;
#endif
//-----------------------------------------------------------------------------//
//! Defines a XSModel getting mean cross sections from neural network execution

/*!
 Define a XSM_SFR.
 This is the class to predict cross sections with a
 set of Multi Layer Perceptrons (MLP)
 
Ernoult's avatar
Ernoult committed
 @authors Marc
 @version 1.0
 */
//________________________________________________________________________


BaM's avatar
BaM committed
class XSM_SFR : public XSM_MLP
BaM's avatar
BaM committed
    public :
    
    /*!
     \name Constructor/Desctructor
     */
    //@{
    
    //{
    /// Normal Constructor
    /*!
     \param TMVA_Weight_Directory : The directory where all the TMVA weight are located
     \param InformationFile : Name of the information file located in TMVA_Weight_Directory (default : Data_Base_Info.nfo)
     \param IsTimeStep : if true , one TMVA weihgt per step time is requiered otherwise it assumes time is part of the MLP inputs
     
     */
    XSM_SFR(string TMVA_Weight_Directory,map<string,double> FixedParameters,string InformationFile = "/Data_Base_Info.nfo");
    //}
    
    //{
    /// CLASSLogger Constructor
    /*!
     \param log : The CLASSLogger
     \param TMVA_Weight_Directory : The directory where all the TMVA weight are located
     \param InformationFile : Name of the information file located in TMVA_Weight_Directory (default : Data_Base_Info.nfo)
     \param IsTimeStep : if true , one TMVA weihgt per step time is requiered otherwise it assumes time is part of the MLP inputs
     
     */
    XSM_SFR(CLASSLogger* Log,string TMVA_Weight_Directory,map<string,double> FixedParameters,string InformationFile = "/Data_Base_Info.nfo");
    //}
    
    ~XSM_SFR();
    //@}
    
    /*!
     \name Reading NFO related Method
     */
    //@{
    
    //{
    /// LoadKeyword() : make the correspondance between keyword and reading method
    void LoadKeyword();
    //}
    
    //{
    /// ReadTimeSteps : read the time step of the model
    /*!
     \param line : line suppossed to contain the time step information starts with "k_timestep" keyword
     */
    void ReadTimeSteps(const string &line);
    //}
    
    //{
    /// ReadZAIName : read the zai name in the TMWA MLP model
    /*!
     \param line : line suppossed to contain the ZAI name  starts with "k_zainame" keyword
     */
    void ReadNonZaiTMVAVariables(const string &line);
    //}
    //{
    /// ReadLine : read a line
    /*!
     \param line : line to read
     */
    void ReadLine(string line);
    //}
    
    //@}
    void FixTMVAVariable(string VariableName,double VariableValue);
BaM's avatar
BaM committed
    void SetFixedVariablesValues(map<string,double> FixedParameters);
    void BookTMVAReader();
    
    private :
    
    void GetMLPWeightFiles();                //!< Find all .xml file in TMVA_Weight_Directory
    vector<float> CreateTMVAInput(IsotopicVector isotopicvector,int TimeStep = 0);    //!<Create input tmva to be read by ExecuteTMVA
BaM's avatar
BaM committed
    vector<string> fTMVAVariableNames;//!<  List of TMVA input variable names (read from fMLPInformationFile ) , name depends on the training step
BaM's avatar
BaM committed
    string fTMVAWeightFolder;    //!<  folder containing all the weight file
    bool fIsStepTime;        //!<  true if one TMVA weihgt per step time is requiered otherwise it assumes time is part of the MLP inputs
    vector<double> fTMVAFixedVariableValues;//!< List of value for TMVA that have to be used for all 
BaM's avatar
BaM committed

#ifndef __CINT__
BaM's avatar
BaM committed
    map<string, XS_SFR_DMthPtr> fDKeyword;