Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
Results.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : Results *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Base-class for result-vectors *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18  * *
19  * Copyright (c) 2006: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_Results
30 #define ROOT_TMVA_Results
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // Results //
35 // //
36 // Class that is the base-class for a vector of result //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #include <vector>
41 #include <map>
42 
43 #include "TList.h"
44 
45 #include "TMVA/Types.h"
46 #include "TMVA/DataSetInfo.h"
47 
48 class TH1;
49 class TH2;
50 class TGraph;
51 
52 namespace TMVA {
53 
54  class DataSet;
55  class MsgLogger;
56 
57  class Results:public TObject {
58 
59  public:
60 
61  Results( const DataSetInfo* dsi, TString resultsName );
62  Results();
63  virtual ~Results();
64 
65  // setters
66  void Store( TObject* obj, const char* alias=0 );
67  void SetTreeType( Types::ETreeType type ) { fTreeType = type; }
68 
69  // getters
70  Types::ETreeType GetTreeType() const { return fTreeType; }
71  const DataSetInfo* GetDataSetInfo() const { return fDsi; }
72  DataSet* GetDataSet() const { return fDsi->GetDataSet(); }
73  TList* GetStorage() const { return fStorage; }
74  TObject* GetObject(const TString & alias) const;
75  TH1* GetHist(const TString & alias) const;
76  TH2* GetHist2D(const TString & alias) const;
77  TGraph* GetGraph(const TString & alias) const;
78  virtual Types::EAnalysisType GetAnalysisType() { return Types::kNoAnalysisType; }
79  //test
80  Bool_t DoesExist(const TString & alias) const;
81 
82  // delete all stored data
83 // using TObject::Delete;
84  virtual void Delete(Option_t *option="");
85 
86  virtual const std::vector< Float_t >& operator [] ( Int_t ievt ) const = 0;
87 
88  private:
89  Types::ETreeType fTreeType; // tree type for this result
90  const DataSetInfo *fDsi; //-> a pointer to the datasetinfo-object
91  TList *fStorage; //-> stores all the result-histograms
92  std::map<TString, TObject *> *fHistAlias; //-> internal map for quick access to stored histograms
93  mutable MsgLogger* fLogger; //! message logger
94  MsgLogger& Log() const { return *fLogger; }
95  public:
96 
97  ClassDef(Results,1);
98 
99  };
100 }
101 
102 #endif