Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:04

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : Results                                                               *
0008  *                                                                                *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Base-class for result-vectors                                             *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Peter Speckmayer <Peter.Speckmayer@cern.ch>  - CERN, Switzerland          *
0016  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0017  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0018  *                                                                                *
0019  * Copyright (c) 2006:                                                            *
0020  *      CERN, Switzerland                                                         *
0021  *      U. of Victoria, Canada                                                    *
0022  *      MPI-K Heidelberg, Germany                                                 *
0023  *                                                                                *
0024  * Redistribution and use in source and binary forms, with or without             *
0025  * modification, are permitted according to the terms listed in LICENSE           *
0026  * (see tmva/doc/LICENSE)                                                         *
0027  **********************************************************************************/
0028 
0029 #ifndef ROOT_TMVA_Results
0030 #define ROOT_TMVA_Results
0031 
0032 //////////////////////////////////////////////////////////////////////////
0033 //                                                                      //
0034 // Results                                                              //
0035 //                                                                      //
0036 // Class that is the base-class for a vector of results                 //
0037 //                                                                      //
0038 //////////////////////////////////////////////////////////////////////////
0039 
0040 #include <vector>
0041 #include <map>
0042 
0043 #include "TList.h"
0044 
0045 #include "TMVA/Types.h"
0046 #include "TMVA/DataSetInfo.h"
0047 
0048 class TH1;
0049 class TH2;
0050 class TGraph;
0051 
0052 namespace TMVA {
0053 
0054 class DataSet;
0055 class MsgLogger;
0056 
0057 class Results : public TObject {
0058 
0059 public:
0060    Results(const DataSetInfo *dsi, TString resultsName);
0061    Results();
0062    virtual ~Results();
0063 
0064    // setters
0065    void Store(TObject *obj, const char *alias = nullptr);
0066    void SetTreeType(Types::ETreeType type) { fTreeType = type; }
0067 
0068    // getters
0069    Types::ETreeType GetTreeType() const { return fTreeType; }
0070    const DataSetInfo *GetDataSetInfo() const { return fDsi; }
0071    DataSet *GetDataSet() const { return fDsi->GetDataSet(); }
0072    TList *GetStorage() const { return fStorage; }
0073    TObject *GetObject(const TString &alias) const;
0074    TH1 *GetHist(const TString &alias) const;
0075    TH2 *GetHist2D(const TString &alias) const;
0076    TGraph *GetGraph(const TString &alias) const;
0077    virtual Types::EAnalysisType GetAnalysisType() { return Types::kNoAnalysisType; }
0078    // test
0079    Bool_t DoesExist(const TString &alias) const;
0080 
0081    // delete all stored data
0082    //       using TObject::Delete;
0083    void Delete(Option_t *option = "") override;
0084 
0085    virtual const std::vector<Float_t> &operator[](Int_t ievt) const = 0;
0086 
0087 private:
0088    Types::ETreeType fTreeType;               ///< tree type for this result
0089    const DataSetInfo *fDsi;                  ///<-> a pointer to the datasetinfo-object
0090    TList *fStorage;                          ///<-> stores all the result-histograms
0091    std::map<TString, TObject *> *fHistAlias; ///<-> internal map for quick access to stored histograms
0092    mutable MsgLogger *fLogger;               ///<! message logger
0093    MsgLogger &Log() const { return *fLogger; }
0094 
0095 public:
0096    ClassDefOverride(Results, 2);
0097 };
0098 } // namespace TMVA
0099 
0100 #endif