Logo ROOT  
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
DataSetInfo.h
TMVA::DataSetInfo::GetDataSet
DataSet * GetDataSet() const
returns data set
Definition: DataSetInfo.cxx:480
TMVA::Results::fLogger
MsgLogger * fLogger
Definition: Results.h:93
TMVA::Results::GetHist
TH1 * GetHist(const TString &alias) const
Definition: Results.cxx:136
TList.h
TMVA::Results::GetStorage
TList * GetStorage() const
Definition: Results.h:73
TString
Definition: TString.h:136
TMVA::Results::fStorage
TList * fStorage
Definition: Results.h:91
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMVA::Results::fDsi
const DataSetInfo * fDsi
Definition: Results.h:90
TMVA::Results::GetDataSet
DataSet * GetDataSet() const
Definition: Results.h:72
TMVA::Results::fTreeType
Types::ETreeType fTreeType
Definition: Results.h:89
TMVA::Results::GetDataSetInfo
const DataSetInfo * GetDataSetInfo() const
Definition: Results.h:71
TMVA::DataSetInfo
Definition: DataSetInfo.h:62
TMVA::Results::Store
void Store(TObject *obj, const char *alias=0)
Definition: Results.cxx:86
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TMVA::Results::GetObject
TObject * GetObject(const TString &alias) const
Returns a stored object if it exists.
Definition: Results.cxx:112
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:150
TMVA::Types::ETreeType
ETreeType
Definition: Types.h:166
TMVA::Results::Log
MsgLogger & Log() const
message logger
Definition: Results.h:94
TMVA::Results::GetTreeType
Types::ETreeType GetTreeType() const
Definition: Results.h:70
TMVA::DataSet
Definition: DataSet.h:81
TH2
Definition: TH2.h:30
TMVA::Results::SetTreeType
void SetTreeType(Types::ETreeType type)
Definition: Results.h:67
TMVA::Results::DoesExist
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
Types.h
TMVA::Results
Definition: Results.h:57
TMVA::Results::Delete
virtual void Delete(Option_t *option="")
delete all stored histograms
Definition: Results.cxx:162
TMVA::Results::~Results
virtual ~Results()
destructor
Definition: Results.cxx:76
TGraph
Definition: TGraph.h:41
TMVA::MsgLogger
Definition: MsgLogger.h:83
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TH1
Definition: TH1.h:57
TMVA::Results::Results
Results()
Definition: Results.cxx:62
TMVA::Results::GetHist2D
TH2 * GetHist2D(const TString &alias) const
Definition: Results.cxx:145
TMVA::Results::fHistAlias
std::map< TString, TObject * > * fHistAlias
Definition: Results.h:92
TMVA::Results::GetAnalysisType
virtual Types::EAnalysisType GetAnalysisType()
Definition: Results.h:78
TMVA::Results::GetGraph
TGraph * GetGraph(const TString &alias) const
Definition: Results.cxx:153
type
int type
Definition: TGX11.cxx:121
TMVA::Types::kNoAnalysisType
@ kNoAnalysisType
Definition: Types.h:154
TList
Definition: TList.h:44
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int
TMVA::Results::operator[]
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0