ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TList
44 #include "TList.h"
45 #endif
46 
47 #ifndef ROOT_TMVA_Types
48 #include "TMVA/Types.h"
49 #endif
50 #ifndef ROOT_TMVA_DataSetInfo
51 #include "TMVA/DataSetInfo.h"
52 #endif
53 
54 class TH1;
55 class TH2;
56 class TGraph;
57 
58 namespace TMVA {
59 
60  class DataSet;
61  class MsgLogger;
62 
63  class Results {
64 
65  public:
66 
67  Results( const DataSetInfo* dsi, TString resultsName );
68  virtual ~Results();
69 
70  // setters
71  void Store( TObject* obj, const char* alias=0 );
73 
74  // getters
76  const DataSetInfo* GetDataSetInfo() const { return fDsi; }
77  DataSet* GetDataSet() const { return fDsi->GetDataSet(); }
78  TList* GetStorage() const { return fStorage; }
79  TObject* GetObject(const TString & alias) const;
80  TH1* GetHist(const TString & alias) const;
81  TH2* GetHist2D(const TString & alias) const;
82  TGraph* GetGraph(const TString & alias) const;
84  //test
85  Bool_t DoesExist(const TString & alias) const;
86 
87  // delete all stored data
88  void Delete();
89 
90  virtual const std::vector< Float_t >& operator [] ( Int_t ievt ) const = 0;
91 
92  private:
93  Types::ETreeType fTreeType; //! tree type for this result
94  const DataSetInfo* fDsi; //! a pointer to the datasetinfo-object
95  TList* fStorage; //! stores all the result-histograms
96  std::map<TString, TObject*>* fHistAlias; //! internal map for quick access to stored histograms
97  mutable MsgLogger* fLogger; // message logger
98  MsgLogger& Log() const { return *fLogger; }
99  };
100 }
101 
102 #endif
TH1 * GetHist(const TString &alias) const
Definition: Results.cxx:113
Results(const DataSetInfo *dsi, TString resultsName)
constructor
Definition: Results.cxx:46
std::map< TString, TObject * > * fHistAlias
stores all the result-histograms
Definition: Results.h:96
EAnalysisType
Definition: Types.h:124
void SetTreeType(Types::ETreeType type)
Definition: Results.h:72
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~Results()
destructor
Definition: Results.cxx:59
virtual Types::EAnalysisType GetAnalysisType()
Definition: Results.h:83
DataSet * GetDataSet() const
returns data set
TH2 * GetHist2D(const TString &alias) const
Definition: Results.cxx:122
TObject * GetObject(const TString &alias) const
Definition: Results.cxx:93
A doubly linked list.
Definition: TList.h:47
MsgLogger * fLogger
internal map for quick access to stored histograms
Definition: Results.h:97
void Delete()
delete all stored histograms
Definition: Results.cxx:139
Service class for 2-Dim histogram classes.
Definition: TH2.h:36
Bool_t DoesExist(const TString &alias) const
Definition: Results.cxx:104
TList * fStorage
a pointer to the datasetinfo-object
Definition: Results.h:95
TList * GetStorage() const
Definition: Results.h:78
TGraph * GetGraph(const TString &alias) const
Definition: Results.cxx:130
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0
int type
Definition: TGX11.cxx:120
The TH1 histogram class.
Definition: TH1.h:80
DataSet * GetDataSet() const
Definition: Results.h:77
Mother of all ROOT objects.
Definition: TObject.h:58
MsgLogger & Log() const
Definition: Results.h:98
Types::ETreeType fTreeType
Definition: Results.h:93
const DataSetInfo * GetDataSetInfo() const
Definition: Results.h:76
A Graph is a graphics object made of two arrays X and Y with npoints each.
Definition: TGraph.h:53
const DataSetInfo * fDsi
tree type for this result
Definition: Results.h:94
void Store(TObject *obj, const char *alias=0)
Definition: Results.cxx:69
TObject * obj
Types::ETreeType GetTreeType() const
Definition: Results.h:75