Logo ROOT   6.08/07
Reference Guide
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:public TObject {
64 
65  public:
66 
67  Results( const DataSetInfo* dsi, TString resultsName );
68  Results();
69  virtual ~Results();
70 
71  // setters
72  void Store( TObject* obj, const char* alias=0 );
74 
75  // getters
77  const DataSetInfo* GetDataSetInfo() const { return fDsi; }
78  DataSet* GetDataSet() const { return fDsi->GetDataSet(); }
79  TList* GetStorage() const { return fStorage; }
80  TObject* GetObject(const TString & alias) const;
81  TH1* GetHist(const TString & alias) const;
82  TH2* GetHist2D(const TString & alias) const;
83  TGraph* GetGraph(const TString & alias) const;
85  //test
86  Bool_t DoesExist(const TString & alias) const;
87 
88  // delete all stored data
89 // using TObject::Delete;
90  virtual void Delete(Option_t *option="");
91 
92  virtual const std::vector< Float_t >& operator [] ( Int_t ievt ) const = 0;
93 
94  private:
95  Types::ETreeType fTreeType; // tree type for this result
96  const DataSetInfo* fDsi; // a pointer to the datasetinfo-object
97  TList* fStorage; // stores all the result-histograms
98  std::map<TString, TObject*>* fHistAlias; // internal map for quick access to stored histograms
99  mutable MsgLogger* fLogger; //! message logger
100  MsgLogger& Log() const { return *fLogger; }
101  public:
102 
103  ClassDef(Results,1);
104 
105  };
106 }
107 
108 #endif
virtual void Delete(Option_t *option="")
delete all stored histograms
Definition: Results.cxx:153
const char Option_t
Definition: RtypesCore.h:62
std::map< TString, TObject * > * fHistAlias
Definition: Results.h:98
EAnalysisType
Definition: Types.h:129
const DataSetInfo * GetDataSetInfo() const
Definition: Results.h:77
DataSet * GetDataSet() const
Definition: Results.h:78
void SetTreeType(Types::ETreeType type)
Definition: Results.h:73
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:73
virtual Types::EAnalysisType GetAnalysisType()
Definition: Results.h:84
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t DoesExist(const TString &alias) const
Definition: Results.cxx:118
A doubly linked list.
Definition: TList.h:47
MsgLogger * fLogger
Definition: Results.h:99
Service class for 2-Dim histogram classes.
Definition: TH2.h:36
TGraph * GetGraph(const TString &alias) const
Definition: Results.cxx:144
TList * fStorage
Definition: Results.h:97
TList * GetStorage() const
Definition: Results.h:79
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0
TH1 * GetHist(const TString &alias) const
Definition: Results.cxx:127
int type
Definition: TGX11.cxx:120
The TH1 histogram class.
Definition: TH1.h:80
Mother of all ROOT objects.
Definition: TObject.h:37
TObject * GetObject(const TString &alias) const
Definition: Results.cxx:107
Abstract ClassifierFactory template that handles arbitrary types.
TH2 * GetHist2D(const TString &alias) const
Definition: Results.cxx:136
Types::ETreeType fTreeType
Definition: Results.h:95
A Graph is a graphics object made of two arrays X and Y with npoints each.
Definition: TGraph.h:53
Types::ETreeType GetTreeType() const
Definition: Results.h:76
const DataSetInfo * fDsi
Definition: Results.h:96
void Store(TObject *obj, const char *alias=0)
Definition: Results.cxx:83
DataSet * GetDataSet() const
returns data set
MsgLogger & Log() const
message logger
Definition: Results.h:100