Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Victor Perevoztchikov <perev@bnl.gov> 21/02/2001
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  *************************************************************************/
12 #ifndef ROOT_TH1K
13 #define ROOT_TH1K
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TH1K //
19 // //
20 // 1-Dim histogram nearest K Neighbour class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
24 #include "TH1.h"
25 //________________________________________________________________________
27 class TH1K : public TH1, public TArrayF {
29 private:
30  void Sort();
31 protected:
34  Int_t fKOrd; //!
35  Int_t fKCur; //!
36 public:
37  TH1K();
38  TH1K(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Int_t k=0);
39  virtual ~TH1K();
41  virtual void Copy(TObject &obj) const;
42  virtual Int_t Fill(Double_t x);
43  virtual Int_t Fill(Double_t x,Double_t w){return TH1::Fill(x,w);}
44  virtual Int_t Fill(const char *name,Double_t w){return TH1::Fill(name,w);}
45  virtual Double_t GetBinContent(Int_t bin) const;
46  virtual Double_t GetBinContent(Int_t bin,Int_t) const {return GetBinContent(bin);}
47  virtual Double_t GetBinContent(Int_t bin,Int_t,Int_t) const {return GetBinContent(bin);}
49  virtual Double_t GetBinError(Int_t bin) const;
50  virtual Double_t GetBinError(Int_t bin,Int_t) const {return GetBinError(bin);}
51  virtual Double_t GetBinError(Int_t bin,Int_t,Int_t) const {return GetBinError(bin);}
54  virtual void Reset(Option_t *option="");
55  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
57  void SetKOrd(Int_t k){fKOrd=k;}
59  ClassDef(TH1K,1) //1-Dim Nearest Kth neighbour method
60 };
62 #endif
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3125
virtual Int_t Fill(Double_t x, Double_t w)
Increment bin with abscissa X with a weight w.
Definition: TH1K.h:43
Int_t fReady
Definition: TH1K.h:32
Int_t fNIn
Definition: TH1K.h:33
const char Option_t
Definition: RtypesCore.h:62
Array of floats (32 bits per element).
Definition: TArrayF.h:29
virtual ~TH1K()
Definition: TH1K.cxx:67
int Int_t
Definition: RtypesCore.h:41
void Reset()
Definition: TArrayF.h:49
virtual Double_t GetBinError(Int_t bin, Int_t) const
Definition: TH1K.h:50
virtual Double_t GetBinError(Int_t bin, Int_t, Int_t) const
Definition: TH1K.h:51
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH1K.h:46
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t fKOrd
Definition: TH1K.h:34
Definition: TH1K.cxx:39
virtual void Copy(TObject &obj) const
Copy this histogram structure to newth1.
Definition: TH1K.cxx:77
Int_t fKCur
Definition: TH1K.h:35
virtual Double_t GetBinContent(Int_t bin) const
Return content of global bin number bin.
Definition: TH1K.cxx:116
virtual Int_t Fill(const char *name, Double_t w)
Increment bin with namex with a weight w.
Definition: TH1K.h:44
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out Note the following restrictions in the code...
Definition: TH1K.cxx:168
TH1K class supports the nearest K Neighbours method, widely used in cluster analysis.
Definition: TH1K.h:27
virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const
Definition: TH1K.h:47
double Double_t
Definition: RtypesCore.h:55
The TH1 histogram class.
Definition: TH1.h:80
void SetKOrd(Int_t k)
Definition: TH1K.h:57
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1K.cxx:93
void Sort()
Definition: TH1K.cxx:231
char name[80]
Definition: TGX11.cxx:109
virtual Double_t GetBinError(Int_t bin) const
Return content of global bin error.
Definition: TH1K.cxx:144