Logo ROOT   6.07/09
Reference Guide
LogInterval.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
3  * Package: TMVA *
4  * Class : Interval *
5  * Web : http://tmva.sourceforge.net *
6  * *
7  * Description: *
8  * Extension of the Interval to "logarithmic" invarvals *
9  * *
10  * *
11  * *
12  * Authors (alphabetical): *
13  * Helge Voss <helge.voss@cern.ch> - MPI-K Heidelberg, Germany *
14  * *
15  * Copyright (c) 2005: *
16  * CERN, Switzerland *
17  * MPI-K Heidelberg, Germany *
18  * *
19  * Redistribution and use in source and binary forms, with or without *
20  * modification, are permitted according to the terms listed in LICENSE *
21  * (http://tmva.sourceforge.net/LICENSE) *
22  **********************************************************************************/
23 
24 #ifndef ROOT_TMVA_LogInterval
25 #define ROOT_TMVA_LogInterval
26 
27 //////////////////////////////////////////////////////////////////////////////
28 // //
29 // Interval with non-equi distant bins //
30 // that are equi-distant in a logarithmic scale) //
31 // //
32 // Interval definition, continuous and discrete //
33 // //
34 // Note: **bin** counting starts from ZERO unlike in ROOT histograms //
35 // //
36 // ---------------- //
37 // LogInterval(1,10000,5) //
38 // i=0 --> 1 note: StepSize(ibin=0) = not defined !! //
39 // i=1 --> 10 StepSize(ibin=1) = 9 //
40 // i=2 --> 100 StepSize(ibin=2) = 99 //
41 // i=3 --> 1000 StepSize(ibin=3) = 999 //
42 // i=4 --> 10000 StepSize(ibin=4) = 9999 //
43 // //
44 // LogInterval(1,1000,11) //
45 // i=0 --> 1 //
46 // i=1 --> 1.99526 //
47 // i=2 --> 3.98107 //
48 // i=3 --> 7.94328 //
49 // i=4 --> 15.8489 //
50 // i=5 --> 31.6228 //
51 // i=6 --> 63.0957 //
52 // i=7 --> 125.893 //
53 // i=8 --> 251.189 //
54 // i=9 --> 501.187 //
55 // i=10 --> 1000 //
56 // //
57 // LogInterval(1,1024,11) //
58 // i=0 --> 1 //
59 // i=1 --> 2 //
60 // i=2 --> 4 //
61 // i=3 --> 8 //
62 // i=4 --> 16 //
63 // i=5 --> 32 //
64 // i=6 --> 64 //
65 // i=7 --> 128 //
66 // i=8 --> 256 //
67 // i=9 --> 512 //
68 // i=10 --> 1024 //
69 // //
70 //////////////////////////////////////////////////////////////////////////////
71 #ifndef ROOT_Rtypes
72 #include "Rtypes.h"
73 #endif
74 
75 #ifndef TMVA_Interval
76 #include "Interval.h"
77 #endif
78 
79 
80 
81 class TRandom3;
82 
83 namespace TMVA {
84 
85  class MsgLogger;
86 
87  class LogInterval : public Interval {
88 
89  public:
90 
91  LogInterval( Double_t min, Double_t max, Int_t nbins = 0 );
92  LogInterval( const LogInterval& other );
93  virtual ~LogInterval();
94 
95  // accessors
96  virtual Double_t GetMin() const { return fMin; }
97  virtual Double_t GetMax() const { return fMax; }
98  virtual Double_t GetWidth() const;
99  virtual Int_t GetNbins() const { return fNbins; }
100  virtual Double_t GetMean() const;
101  virtual Double_t GetRndm( TRandom3& ) const;
102  virtual Double_t GetElement( Int_t position ) const;
103  virtual Double_t GetStepSize(Int_t iBin=0) const;
104 
105  void SetMax( Double_t m ) { fMax = m; }
106  void SetMin( Double_t m ) { fMin = m; }
107 
108  MsgLogger& Log() const;
109 
110  ClassDef(Interval,0); // Interval definition, continous and discrete
111  };
112 
113 } // namespace TMVA
114 
115 #endif
LogInterval(Double_t min, Double_t max, Int_t nbins=0)
Definition: LogInterval.cxx:88
Double_t fMin
Definition: Interval.h:89
Random number generator class based on M.
Definition: TRandom3.h:29
Double_t fMax
Definition: Interval.h:89
int Int_t
Definition: RtypesCore.h:41
Int_t fNbins
Definition: Interval.h:90
int nbins[3]
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Int_t GetNbins() const
Definition: LogInterval.h:99
virtual Double_t GetWidth() const
virtual Double_t GetMin() const
Definition: LogInterval.h:96
MsgLogger & Log() const
void SetMax(Double_t m)
Definition: LogInterval.h:105
TMarker * m
Definition: textangle.C:8
virtual Double_t GetMax() const
Definition: LogInterval.h:97
virtual Double_t GetRndm(TRandom3 &) const
get uniformely distributed number within interval
virtual Double_t GetStepSize(Int_t iBin=0) const
retuns the step size between the numbers of a "discrete LogInterval"
double Double_t
Definition: RtypesCore.h:55
virtual Double_t GetElement(Int_t position) const
calculates the value of the "number" bin in a discrete interval.
Abstract ClassifierFactory template that handles arbitrary types.
virtual Double_t GetMean() const
void SetMin(Double_t m)
Definition: LogInterval.h:106
virtual ~LogInterval()
destructor