File indexing completed on 2025-01-18 10:10:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_TMVA_Envelope
0012 #define ROOT_TMVA_Envelope
0013
0014 #include <memory>
0015 #include <vector>
0016
0017 #include <TString.h>
0018 #include <TROOT.h>
0019 #include <TStopwatch.h>
0020
0021 #ifndef _MSC_VER
0022 #include <TProcPool.h>
0023 #endif
0024
0025 #include <TMVA/OptionMap.h>
0026 #include <TMVA/Config.h>
0027 #include <TMVA/Tools.h>
0028 #include <TMVA/DataLoader.h>
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 namespace TMVA {
0042
0043 class Envelope:public Configurable
0044 {
0045 protected:
0046 std::vector<OptionMap> fMethods;
0047 std::shared_ptr<DataLoader> fDataLoader;
0048 std::shared_ptr<TFile> fFile;
0049 Bool_t fModelPersistence;
0050 Bool_t fVerbose;
0051 TString fTransformations;
0052 Bool_t fSilentFile;
0053 #ifndef _MSC_VER
0054 TProcPool fWorkers;
0055 #endif
0056 UInt_t fJobs;
0057 TStopwatch fTimer;
0058
0059 Envelope(const TString &name, DataLoader *dataloader = nullptr, TFile *file = nullptr,
0060 const TString options = "");
0061
0062 public:
0063
0064
0065
0066 ~Envelope();
0067
0068 virtual void BookMethod( TString methodname, TString methodtitle, TString options = "");
0069 virtual void BookMethod( Types::EMVA method, TString methodtitle, TString options = "");
0070
0071
0072 virtual void ParseOptions();
0073
0074 Bool_t IsSilentFile();
0075 TFile* GetFile();
0076 void SetFile(TFile *file);
0077 Bool_t HasMethod(TString methodname, TString methodtitle);
0078
0079 DataLoader *GetDataLoader();
0080 void SetDataLoader(DataLoader *dalaloader);
0081 Bool_t IsModelPersistence();
0082 void SetModelPersistence(Bool_t status=kTRUE);
0083 Bool_t IsVerbose();
0084 void SetVerbose(Bool_t status);
0085
0086
0087
0088
0089 virtual void Evaluate() = 0;
0090
0091 std::vector<OptionMap> &GetMethods();
0092
0093 protected:
0094
0095
0096
0097
0098 DataInputHandler &GetDataLoaderDataInput() { return fDataLoader->DataInput(); }
0099
0100
0101
0102
0103
0104 DataSetInfo &GetDataLoaderDataSetInfo() { return fDataLoader->GetDataSetInfo(); }
0105
0106
0107
0108
0109
0110 DataSetManager *GetDataLoaderDataSetManager()
0111 {
0112 return fDataLoader->GetDataSetInfo().GetDataSetManager();
0113 }
0114
0115
0116
0117
0118
0119 TDirectory *RootBaseDir() { return (TDirectory *)fFile.get(); }
0120
0121 void WriteDataInformation(TMVA::DataSetInfo &fDataSetInfo, TMVA::Types::EAnalysisType fAnalysisType);
0122
0123 ClassDef(Envelope, 0);
0124 };
0125 }
0126
0127 #endif