Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Ranking.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
3
4/**********************************************************************************
5 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6 * Package: TMVA *
7 * Class : Ranking *
8 * Web : http://tmva.sourceforge.net *
9 * *
10 * Description: *
11 * Virtual ranking class *
12 * *
13 * Authors (alphabetical): *
14 * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15 * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17 * *
18 * Copyright (c) 2005: *
19 * CERN, Switzerland *
20 * MPI-K Heidelberg, Germany *
21 * *
22 * Redistribution and use in source and binary forms, with or without *
23 * modification, are permitted according to the terms listed in LICENSE *
24 * (http://tmva.sourceforge.net/LICENSE) *
25 * *
26 **********************************************************************************/
27
28#ifndef ROOT_TMVA_Ranking
29#define ROOT_TMVA_Ranking
30
31//////////////////////////////////////////////////////////////////////////
32// //
33// Ranking //
34// //
35// Defines vector of rank //
36// //
37//////////////////////////////////////////////////////////////////////////
38
39#include <vector>
40
41#include "TString.h"
42
43namespace TMVA {
44
45 class MsgLogger;
46 class Rank;
47
48 class Ranking {
49
50 public:
51
52 Ranking();
53 Ranking( const TString& context, const TString& rankingDiscriminatorName );
54 virtual ~Ranking();
55
56 virtual void AddRank( const Rank& rank );
57 virtual void Print() const;
58
59 void SetContext ( const TString& context );
60 void SetDiscrName( const TString& discrName ) { fRankingDiscriminatorName = discrName; }
61
62 private:
63
64 std::vector<TMVA::Rank> fRanking; // vector of ranks
65 TString fContext; // the ranking context
66 TString fRankingDiscriminatorName; // the name of the ranking discriminator
67
68 mutable MsgLogger* fLogger; //! message logger
69 MsgLogger& Log() const { return *fLogger; }
70
71 ClassDef(Ranking,0); // Method-specific ranking for input variables
72 };
73
74 // --------------------------------------------------------------------------
75
76 class Rank {
77
78 public:
79
80 Rank( const TString& variable, Double_t rankValue );
81 virtual ~Rank();
82
83 // comparison between rank
84 Bool_t operator < ( const Rank& other ) const;
85 Bool_t operator > ( const Rank& other ) const;
86
87 const TString& GetVariable() const { return fVariable; }
88 Double_t GetRankValue() const { return fRankValue; }
89 Int_t GetRank() const { return fRank; }
90 void SetRank( Int_t rank ) { fRank = rank; }
91
92 private:
93
94 TString fVariable; // the variable name
95 Double_t fRankValue; // the rank value
96
98 };
99}
100
101#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
Int_t fRank
Definition Ranking.h:97
Int_t GetRank() const
Definition Ranking.h:89
Double_t fRankValue
Definition Ranking.h:95
TString fVariable
Definition Ranking.h:94
const TString & GetVariable() const
Definition Ranking.h:87
virtual ~Rank()
destructor
Definition Ranking.cxx:149
Double_t GetRankValue() const
Definition Ranking.h:88
Bool_t operator>(const Rank &other) const
comparison operator >
Definition Ranking.cxx:165
void SetRank(Int_t rank)
Definition Ranking.h:90
Bool_t operator<(const Rank &other) const
comparison operator <
Definition Ranking.cxx:156
Ranking for variables in method (implementation)
Definition Ranking.h:48
virtual void AddRank(const Rank &rank)
Add a new rank take ownership of it.
Definition Ranking.cxx:86
virtual void Print() const
get maximum length of variable names
Definition Ranking.cxx:111
MsgLogger & Log() const
message logger
Definition Ranking.h:69
TString fRankingDiscriminatorName
Definition Ranking.h:66
MsgLogger * fLogger
Definition Ranking.h:68
void SetDiscrName(const TString &discrName)
Definition Ranking.h:60
TString fContext
Definition Ranking.h:65
std::vector< TMVA::Rank > fRanking
Definition Ranking.h:64
void SetContext(const TString &context)
Definition Ranking.cxx:76
virtual ~Ranking()
destructor
Definition Ranking.cxx:68
Ranking()
default constructor
Definition Ranking.cxx:46
Basic string class.
Definition TString.h:136
create variable transformations