# class TMVA::Interval

```
Interval

Interval definition, continuous and discrete

Interval(min,max)  : a continous interval [min,max]
Interval(min,max,n): a "discrete interval" [min,max], i.e the n numbers:
min, min+step, min+2*step,...., min+(n-1)*step, min+n*step=max
e.g.: Interval(1,5,5)=1,2,3,4,5
Interval(.5,1.,6)= .5, .6., .7, .8, .9, 1.0

Note: **bin** counting starts from ZERO unlike in ROOT histograms

```

## the TMVA::Interval Class

• Interval definition, continuous and discrete
• Interval(min,max) : a continous interval [min,max]
• Interval(min,max,n): a "discrete interval" [min,max], i.e the n numbers:
min, min+step, min+2*step,...., min+(n-1)*step=max
e.g.: Interval(1,5,5)=1,2,3,4,5
Interval(.5,1.,6)= .5, .6., .7, .8, .9, 1.0
```    Example:   Interval(.5,1.,6)
[ min                           max ]
------------------------------------------------------------
|     |     |     |     |     |
.5    .6    .7    .8    .9    1.0
bin    0     1     2     3     4     5
```
```
```

## Function Members (Methods)

public:
 virtual ~Interval() static TClass* Class() virtual Double_t GetElement(Int_t position) const virtual Double_t GetMax() const virtual Double_t GetMean() const virtual Double_t GetMin() const virtual Int_t GetNbins() const virtual Double_t GetRndm(TRandom3&) const virtual Double_t GetStepSize(Int_t iBin = 0) const virtual Double_t GetWidth() const TMVA::Interval Interval(const TMVA::Interval& other) TMVA::Interval Interval(Double_t min, Double_t max, Int_t nbins = 0) virtual TClass* IsA() const TMVA::Interval& operator=(const TMVA::Interval&) virtual void Print(ostream& os) const void SetMax(Double_t m) void SetMin(Double_t m) virtual void ShowMembers(TMemberInspector& insp) const virtual void Streamer(TBuffer&) void StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
private:
 TMVA::MsgLogger& Log() const

## Data Members

protected:
 Double_t fMax the constraints of the Interval Double_t fMin the constraints of the Interval Int_t fNbins when >0 : number of bins (discrete interval); when ==0 continuous interval

## Function documentation

Interval(Double_t min, Double_t max, Int_t nbins = 0)
``` defines minimum and maximum of an interval
when nbins > 0, interval describes a discrete distribution (equally distributed in the interval)
when nbins == 0, interval describes a continous interval

```
Interval(const TMVA::Interval& other)

``` destructor
```
Double_t GetElement(Int_t position) const
``` calculates the value of the "number" bin in a discrete interval.
Parameters:
Double_t position

```
Double_t GetStepSize(Int_t iBin = 0) const
``` retuns the step size between the numbers of a "discrete Interval"
```
Double_t GetRndm(TRandom3& ) const
``` get uniformely distributed number within interval
```
Double_t GetWidth() const
Double_t GetMean() const
void Print(ostream& os) const
TMVA::MsgLogger& Log() const
Double_t GetMin() const
``` accessors
accessors
```
`{ return fMin; }`
Double_t GetMax() const
`{ return fMax; }`
Int_t GetNbins() const
`{ return fNbins; }`
void SetMax(Double_t m)
`{ fMax = m; }`
void SetMin(Double_t m)
`{ fMin = m; }`