Logo ROOT   6.21/01
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 #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 );
68 
69  // getters
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;
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
virtual void Delete(Option_t *option="")
delete all stored histograms
Definition: Results.cxx:162
const char Option_t
Definition: RtypesCore.h:62
EAnalysisType
Definition: Types.h:127
const DataSetInfo * GetDataSetInfo() const
Definition: Results.h:71
DataSet * GetDataSet() const
Definition: Results.h:72
void SetTreeType(Types::ETreeType type)
Definition: Results.h:67
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~Results()
destructor
Definition: Results.cxx:76
virtual Types::EAnalysisType GetAnalysisType()
Definition: Results.h:78
#define ClassDef(name, id)
Definition: Rtypes.h:326
Bool_t DoesExist(const TString &alias) const
Returns true if there is an object stored in the result for a given alias, false otherwise.
Definition: Results.cxx:127
Class that contains all the data information.
Definition: DataSetInfo.h:60
A doubly linked list.
Definition: TList.h:44
Class that contains all the data information.
Definition: DataSet.h:69
MsgLogger * fLogger
Definition: Results.h:93
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
TGraph * GetGraph(const TString &alias) const
Definition: Results.cxx:153
TList * fStorage
Definition: Results.h:91
TList * GetStorage() const
Definition: Results.h:73
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0
std::map< TString, TObject * > * fHistAlias
Definition: Results.h:92
TH1 * GetHist(const TString &alias) const
Definition: Results.cxx:136
int type
Definition: TGX11.cxx:120
The TH1 histogram class.
Definition: TH1.h:56
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
Mother of all ROOT objects.
Definition: TObject.h:37
TObject * GetObject(const TString &alias) const
Returns a stored object if it exists.
Definition: Results.cxx:112
create variable transformations
TH2 * GetHist2D(const TString &alias) const
Definition: Results.cxx:145
Types::ETreeType fTreeType
Definition: Results.h:89
Class that is the base-class for a vector of result.
Definition: Results.h:57
A TGraph is an object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
Types::ETreeType GetTreeType() const
Definition: Results.h:70
const DataSetInfo * fDsi
Definition: Results.h:90
void Store(TObject *obj, const char *alias=0)
Definition: Results.cxx:86
DataSet * GetDataSet() const
returns data set
MsgLogger & Log() const
message logger
Definition: Results.h:94