Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:03

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : Ranking                                                               *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Virtual ranking class                                                     *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0016  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0017  *                                                                                *
0018  * Copyright (c) 2005:                                                            *
0019  *      CERN, Switzerland                                                         *
0020  *      MPI-K Heidelberg, Germany                                                 *
0021  *                                                                                *
0022  * Redistribution and use in source and binary forms, with or without             *
0023  * modification, are permitted according to the terms listed in LICENSE           *
0024  * (see tmva/doc/LICENSE)                                          *
0025  *                                                                                *
0026  **********************************************************************************/
0027 
0028 #ifndef ROOT_TMVA_Ranking
0029 #define ROOT_TMVA_Ranking
0030 
0031 //////////////////////////////////////////////////////////////////////////
0032 //                                                                      //
0033 // Ranking                                                              //
0034 //                                                                      //
0035 // Defines vector of rank                                               //
0036 //                                                                      //
0037 //////////////////////////////////////////////////////////////////////////
0038 
0039 #include <vector>
0040 
0041 #include "TString.h"
0042 
0043 namespace TMVA {
0044 
0045    class MsgLogger;
0046    class Rank;
0047 
0048    class Ranking {
0049 
0050    public:
0051 
0052       Ranking();
0053       Ranking( const TString& context, const TString& rankingDiscriminatorName );
0054       virtual ~Ranking();
0055 
0056       virtual void AddRank( const Rank& rank );
0057       virtual void Print() const;
0058 
0059       void SetContext  ( const TString& context   );
0060       void SetDiscrName( const TString& discrName ) { fRankingDiscriminatorName = discrName; }
0061 
0062    private:
0063 
0064       std::vector<TMVA::Rank> fRanking;                  ///< vector of ranks
0065       TString                 fContext;                  ///< the ranking context
0066       TString                 fRankingDiscriminatorName; ///< the name of the ranking discriminator
0067 
0068       mutable MsgLogger*      fLogger;                   ///<! message logger
0069       MsgLogger& Log() const { return *fLogger; }
0070 
0071       ClassDef(Ranking,0); // Method-specific ranking for input variables
0072    };
0073 
0074    // --------------------------------------------------------------------------
0075 
0076    class Rank {
0077 
0078    public:
0079 
0080       Rank( const TString& variable, Double_t rankValue );
0081       virtual ~Rank();
0082 
0083       // comparison between rank
0084       Bool_t operator <  ( const Rank& other ) const;
0085       Bool_t operator >  ( const Rank& other ) const;
0086 
0087       const TString& GetVariable()  const { return fVariable; }
0088       Double_t       GetRankValue() const { return fRankValue; }
0089       Int_t          GetRank()      const { return fRank; }
0090       void           SetRank( Int_t rank ) { fRank = rank; }
0091 
0092    private:
0093 
0094       TString  fVariable;   // the variable name
0095       Double_t fRankValue;  // the rank value
0096 
0097       Int_t    fRank;
0098    };
0099 }
0100 
0101 #endif