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 * *
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 * (see tmva/doc/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 results //
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
54class DataSet;
55class MsgLogger;
56
57class Results : public TObject {
58
59public:
60 Results(const DataSetInfo *dsi, TString resultsName);
61 Results();
62 virtual ~Results();
63
64 // setters
65 void Store(TObject *obj, const char *alias = nullptr);
67
68 // getters
70 const DataSetInfo *GetDataSetInfo() const { return fDsi; }
71 DataSet *GetDataSet() const { return fDsi->GetDataSet(); }
72 TList *GetStorage() const { return fStorage; }
73 TObject *GetObject(const TString &alias) const;
74 TH1 *GetHist(const TString &alias) const;
75 TH2 *GetHist2D(const TString &alias) const;
76 TGraph *GetGraph(const TString &alias) const;
78 // test
79 Bool_t DoesExist(const TString &alias) const;
80
81 // delete all stored data
82 // using TObject::Delete;
83 void Delete(Option_t *option = "") override;
84
85 virtual const std::vector<Float_t> &operator[](Int_t ievt) const = 0;
86
87private:
88 Types::ETreeType fTreeType; ///< tree type for this result
89 const DataSetInfo *fDsi; ///<-> a pointer to the datasetinfo-object
90 TList *fStorage; ///<-> stores all the result-histograms
91 std::map<TString, TObject *> *fHistAlias; ///<-> internal map for quick access to stored histograms
92 mutable MsgLogger *fLogger; ///<! message logger
93 MsgLogger &Log() const { return *fLogger; }
94
95public:
97};
98} // namespace TMVA
99
100#endif
bool Bool_t
Definition RtypesCore.h:63
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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:59
Service class for 2-D histogram classes.
Definition TH2.h:30
A doubly linked list.
Definition TList.h:38
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:57
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
Definition Results.h:93
TList * fStorage
-> stores all the result-histograms
Definition Results.h:90
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
void Store(TObject *obj, const char *alias=nullptr)
Definition Results.cxx:86
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
-> internal map for quick access to stored histograms
Definition Results.h:91
virtual Types::EAnalysisType GetAnalysisType()
Definition Results.h:77
void SetTreeType(Types::ETreeType type)
Definition Results.h:66
DataSet * GetDataSet() const
Definition Results.h:71
virtual ~Results()
destructor
Definition Results.cxx:76
Types::ETreeType fTreeType
tree type for this result
Definition Results.h:88
TList * GetStorage() const
Definition Results.h:72
const DataSetInfo * GetDataSetInfo() const
Definition Results.h:70
Types::ETreeType GetTreeType() const
Definition Results.h:69
const DataSetInfo * fDsi
-> a pointer to the datasetinfo-object
Definition Results.h:89
virtual const std::vector< Float_t > & operator[](Int_t ievt) const =0
MsgLogger * fLogger
! message logger
Definition Results.h:92
void Delete(Option_t *option="") override
delete all stored histograms
Definition Results.cxx:162
@ kNoAnalysisType
Definition Types.h:130
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
const char * GetHist()
create variable transformations