00001 // @(#)root/tmva $Id: Results.h 36966 2010-11-26 09:50:13Z evt $ 00002 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss 00003 00004 /********************************************************************************** 00005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00006 * Package: TMVA * 00007 * Class : Results * 00008 * Web : http://tmva.sourceforge.net * 00009 * * 00010 * Description: * 00011 * Base-class for result-vectors * 00012 * * 00013 * Authors (alphabetical): * 00014 * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland * 00015 * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland * 00016 * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland * 00017 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany * 00018 * * 00019 * Copyright (c) 2006: * 00020 * CERN, Switzerland * 00021 * U. of Victoria, Canada * 00022 * MPI-K Heidelberg, Germany * 00023 * * 00024 * Redistribution and use in source and binary forms, with or without * 00025 * modification, are permitted according to the terms listed in LICENSE * 00026 * (http://tmva.sourceforge.net/LICENSE) * 00027 **********************************************************************************/ 00028 00029 #ifndef ROOT_TMVA_Results 00030 #define ROOT_TMVA_Results 00031 00032 ////////////////////////////////////////////////////////////////////////// 00033 // // 00034 // Results // 00035 // // 00036 // Class that is the base-class for a vector of result // 00037 // // 00038 ////////////////////////////////////////////////////////////////////////// 00039 00040 #include <vector> 00041 #include <map> 00042 00043 #ifndef ROOT_TList 00044 #include "TList.h" 00045 #endif 00046 00047 #ifndef ROOT_TMVA_Types 00048 #include "TMVA/Types.h" 00049 #endif 00050 #ifndef ROOT_TMVA_DataSetInfo 00051 #include "TMVA/DataSetInfo.h" 00052 #endif 00053 00054 class TH1; 00055 00056 namespace TMVA { 00057 00058 class DataSet; 00059 class MsgLogger; 00060 00061 class Results { 00062 00063 public: 00064 00065 Results( const DataSetInfo* dsi ); 00066 virtual ~Results(); 00067 00068 // setters 00069 void Store( TObject* obj, const char* alias=0 ); 00070 void SetTreeType( Types::ETreeType type ) { fTreeType = type; } 00071 00072 // getters 00073 Types::ETreeType GetTreeType() const { return fTreeType; } 00074 const DataSetInfo* GetDataSetInfo() const { return fDsi; } 00075 DataSet* GetDataSet() const { return fDsi->GetDataSet(); } 00076 TList* GetStorage() const { return fStorage; } 00077 TObject* GetObject(const TString & alias) const; 00078 TH1* GetHist(const TString & alias) const; 00079 virtual Types::EAnalysisType GetAnalysisType() { return Types::kNoAnalysisType; } 00080 00081 // delete all stored data 00082 void Delete(); 00083 00084 virtual const std::vector< Float_t >& operator [] ( Int_t ievt ) const = 0; 00085 00086 private: 00087 Types::ETreeType fTreeType; //! tree type for this result 00088 const DataSetInfo* fDsi; //! a pointer to the datasetinfo-object 00089 TList* fStorage; //! stores all the result-histograms 00090 std::map<TString, TObject*>* fHistAlias; //! internal map for quick access to stored histograms 00091 mutable MsgLogger* fLogger; // message logger 00092 MsgLogger& Log() const { return *fLogger; } 00093 }; 00094 } 00095 00096 #endif