Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
48class TH1;
49class TH2;
50class TGraph;
51
52namespace 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
98
99 };
100}
101
102#endif
bool Bool_t
Definition RtypesCore.h:63
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
int type
Definition TGX11.cxx:121
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Service class for 2-Dim histogram classes.
Definition TH2.h:30
A doubly linked list.
Definition TList.h:44
Class that contains all the data information.
Definition DataSetInfo.h:62
DataSet * GetDataSet() const
returns data set
Class that contains all the data information.
Definition DataSet.h:58
ostringstream derivative to redirect and format output
Definition MsgLogger.h:59
Class that is the base-class for a vector of result.
Definition Results.h:57
TGraph * GetGraph(const TString &alias) const
Definition Results.cxx:153
MsgLogger & Log() const
message logger
Definition Results.h:94
TList * fStorage
Definition Results.h:91
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
TH2 * GetHist2D(const TString &alias) const
Definition Results.cxx:145
TObject * GetObject(const TString &alias) const
Returns a stored object if it exists.
Definition Results.cxx:112
std::map< TString, TObject * > * fHistAlias
Definition Results.h:92
virtual Types::EAnalysisType GetAnalysisType()
Definition Results.h:78
void SetTreeType(Types::ETreeType type)
Definition Results.h:67
DataSet * GetDataSet() const
Definition Results.h:72
virtual ~Results()
destructor
Definition Results.cxx:76
Types::ETreeType fTreeType
Definition Results.h:89
TList * GetStorage() const
Definition Results.h:73
const DataSetInfo * GetDataSetInfo() const
Definition Results.h:71
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
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0
virtual void Delete(Option_t *option="")
delete all stored histograms
Definition Results.cxx:162
MsgLogger * fLogger
Definition Results.h:93
@ kNoAnalysisType
Definition Types.h:132
Mother of all ROOT objects.
Definition TObject.h:37
Basic string class.
Definition TString.h:136
const char * GetHist()
create variable transformations