Logo ROOT  
Reference Guide
TH1K.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Victor Perevoztchikov <perev@bnl.gov> 21/02/2001
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TH1K
13#define ROOT_TH1K
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TH1K //
19// //
20// 1-Dim histogram nearest K Neighbour class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TH1.h"
25
26class TH1K : public TH1, public TArrayF {
27
28private:
29 void Sort();
30protected:
35public:
36 TH1K();
37 TH1K(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Int_t k=0);
38 ~TH1K() override;
39
40 void Copy(TObject &obj) const override;
41 Int_t Fill(Double_t x) override;
42 Int_t Fill(Double_t x,Double_t w) override{return TH1::Fill(x,w);}
43 Int_t Fill(const char *name,Double_t w) override{return TH1::Fill(name,w);}
44 Double_t GetBinContent(Int_t bin) const override;
45 Double_t GetBinContent(Int_t bin,Int_t) const override {return GetBinContent(bin);}
46 Double_t GetBinContent(Int_t bin,Int_t,Int_t) const override {return GetBinContent(bin);}
47
48 Double_t GetBinError(Int_t bin) const override;
49 Double_t GetBinError(Int_t bin,Int_t) const override {return GetBinError(bin);}
50 Double_t GetBinError(Int_t bin,Int_t,Int_t) const override {return GetBinError(bin);}
51
52
53 void Reset(Option_t *option="") override;
54 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
55
56 void SetKOrd(Int_t k){fKOrd=k;}
57
58 ClassDefOverride(TH1K,2) //1-Dim Nearest Kth neighbour method
59};
60
61#endif
int Int_t
Definition: RtypesCore.h:45
double Double_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t option
char name[80]
Definition: TGX11.cxx:110
Array of floats (32 bits per element).
Definition: TArrayF.h:27
void Reset()
Definition: TArrayF.h:47
TH1K class supports the nearest K Neighbours method, widely used in cluster analysis.
Definition: TH1K.h:26
~TH1K() override
Destructor.
Definition: TH1K.cxx:67
Double_t GetBinContent(Int_t bin, Int_t, Int_t) const override
Definition: TH1K.h:46
Double_t GetBinError(Int_t bin) const override
Return content of global bin error.
Definition: TH1K.cxx:144
Int_t fReady
Definition: TH1K.h:31
Int_t fKOrd
Definition: TH1K.h:33
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out Note the following restrictions in the code...
Definition: TH1K.cxx:168
Int_t Fill(Double_t x, Double_t w) override
Increment bin with abscissa X with a weight w.
Definition: TH1K.h:42
Int_t fKCur
Definition: TH1K.h:34
Double_t GetBinError(Int_t bin, Int_t, Int_t) const override
Definition: TH1K.h:50
Int_t fNIn
Definition: TH1K.h:32
Int_t Fill(const char *name, Double_t w) override
Increment bin with namex with a weight w.
Definition: TH1K.h:43
Int_t Fill(Double_t x) override
Increment bin with abscissa X by 1.
Definition: TH1K.cxx:93
void Copy(TObject &obj) const override
Copy this histogram structure to newth1.
Definition: TH1K.cxx:77
Double_t GetBinError(Int_t bin, Int_t) const override
Definition: TH1K.h:49
TH1K()
Constructor.
Definition: TH1K.cxx:39
void Sort()
Sort.
Definition: TH1K.cxx:231
void SetKOrd(Int_t k)
Definition: TH1K.h:56
Double_t GetBinContent(Int_t bin) const override
Return content of global bin number bin.
Definition: TH1K.cxx:116
Double_t GetBinContent(Int_t bin, Int_t) const override
Definition: TH1K.h:45
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3348
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17