ROOT  6.06/09
Reference Guide
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 #ifndef ROOT_TString
42 #include "TString.h"
43 #endif
44 
45 namespace TMVA {
46 
47  class MsgLogger;
48  class Rank;
49 
50  class Ranking {
51 
52  public:
53 
54  Ranking();
55  Ranking( const TString& context, const TString& rankingDiscriminatorName );
56  virtual ~Ranking();
57 
58  virtual void AddRank( const Rank& rank );
59  virtual void Print() const;
60 
61  void SetContext ( const TString& context );
62  void SetDiscrName( const TString& discrName ) { fRankingDiscriminatorName = discrName; }
63 
64  private:
65 
66  std::vector<TMVA::Rank> fRanking; // vector of ranks
67  TString fContext; // the ranking context
68  TString fRankingDiscriminatorName; // the name of the ranking discriminator
69 
70  mutable MsgLogger* fLogger; //! message logger
71  MsgLogger& Log() const { return *fLogger; }
72 
73  ClassDef(Ranking,0) // Method-specific ranking for input variables
74  };
75 
76  // --------------------------------------------------------------------------
77 
78  class Rank {
79 
80  public:
81 
82  Rank( const TString& variable, Double_t rankValue );
83  virtual ~Rank();
84 
85  // comparison between rank
86  Bool_t operator < ( const Rank& other ) const;
87  Bool_t operator > ( const Rank& other ) const;
88 
89  const TString& GetVariable() const { return fVariable; }
90  Double_t GetRankValue() const { return fRankValue; }
91  Int_t GetRank() const { return fRank; }
92  void SetRank( Int_t rank ) { fRank = rank; }
93 
94  private:
95 
96  TString fVariable; // the variable name
97  Double_t fRankValue; // the rank value
98 
100  };
101 }
102 
103 #endif
const TString & GetVariable() const
Definition: Ranking.h:89
MsgLogger * fLogger
Definition: Ranking.h:70
MsgLogger & Log() const
message logger
Definition: Ranking.h:71
Basic string class.
Definition: TString.h:137
Double_t GetRankValue() const
Definition: Ranking.h:90
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~Rank()
destructor
Definition: Ranking.cxx:149
TString fVariable
Definition: Ranking.h:96
void SetContext(const TString &context)
Definition: Ranking.cxx:74
void SetDiscrName(const TString &discrName)
Definition: Ranking.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t operator>(const Rank &other) const
comparison operator >
Definition: Ranking.cxx:165
Int_t GetRank() const
Definition: Ranking.h:91
std::vector< TMVA::Rank > fRanking
Definition: Ranking.h:66
Rank(const TString &variable, Double_t rankValue)
constructor
Definition: Ranking.cxx:139
TString fContext
Definition: Ranking.h:67
void SetRank(Int_t rank)
Definition: Ranking.h:92
virtual ~Ranking()
destructor
Definition: Ranking.cxx:66
double Double_t
Definition: RtypesCore.h:55
Double_t fRankValue
Definition: Ranking.h:97
Abstract ClassifierFactory template that handles arbitrary types.
virtual void AddRank(const Rank &rank)
Add a new rank take ownership of it.
Definition: Ranking.cxx:84
virtual void Print() const
get maximum length of variable names
Definition: Ranking.cxx:109
Bool_t operator<(const Rank &other) const
comparison operator <
Definition: Ranking.cxx:156
Int_t fRank
Definition: Ranking.h:99
TString fRankingDiscriminatorName
Definition: Ranking.h:68