Logo ROOT  
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 #include "TString.h"
42 
43 namespace 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
TMVA::Rank::Rank
Rank(const TString &variable, Double_t rankValue)
constructor
Definition: Ranking.cxx:139
TMVA::Ranking::AddRank
virtual void AddRank(const Rank &rank)
Add a new rank take ownership of it.
Definition: Ranking.cxx:86
TMVA::Ranking::Print
virtual void Print() const
get maximum length of variable names
Definition: Ranking.cxx:111
TMVA::Rank::fRank
Int_t fRank
Definition: Ranking.h:97
TMVA::Ranking
Ranking for variables in method (implementation)
Definition: Ranking.h:48
TMVA::Rank::SetRank
void SetRank(Int_t rank)
Definition: Ranking.h:90
TMVA::Rank
Definition: Ranking.h:76
TMVA::Rank::fVariable
TString fVariable
Definition: Ranking.h:94
TMVA::Rank::GetVariable
const TString & GetVariable() const
Definition: Ranking.h:87
TString
Basic string class.
Definition: TString.h:136
TString.h
bool
TMVA::Ranking::Log
MsgLogger & Log() const
message logger
Definition: Ranking.h:69
TMVA::Rank::fRankValue
Double_t fRankValue
Definition: Ranking.h:95
TMVA::Ranking::fRankingDiscriminatorName
TString fRankingDiscriminatorName
Definition: Ranking.h:66
TMVA::Ranking::SetDiscrName
void SetDiscrName(const TString &discrName)
Definition: Ranking.h:60
TMVA::Ranking::~Ranking
virtual ~Ranking()
destructor
Definition: Ranking.cxx:68
TMVA::Rank::GetRankValue
Double_t GetRankValue() const
Definition: Ranking.h:88
TMVA::Rank::~Rank
virtual ~Rank()
destructor
Definition: Ranking.cxx:149
TMVA::Ranking::SetContext
void SetContext(const TString &context)
Definition: Ranking.cxx:76
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MsgLogger
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
TMVA::Ranking::fLogger
MsgLogger * fLogger
Definition: Ranking.h:68
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::Rank::GetRank
Int_t GetRank() const
Definition: Ranking.h:89
TMVA::Rank::operator<
Bool_t operator<(const Rank &other) const
comparison operator <
Definition: Ranking.cxx:156
TMVA::Ranking::fRanking
std::vector< TMVA::Rank > fRanking
Definition: Ranking.h:64
TMVA::Ranking::Ranking
Ranking()
default constructor
Definition: Ranking.cxx:46
TMVA::Ranking::fContext
TString fContext
Definition: Ranking.h:65
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int
TMVA::Rank::operator>
Bool_t operator>(const Rank &other) const
comparison operator >
Definition: Ranking.cxx:165