ROOT  6.06/09
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 //________________________________________________________________________
26 
27 class TH1K : public TH1, public TArrayF {
28 
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();
40 
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);}
48 
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);}
52 
53 
54  virtual void Reset(Option_t *option="");
55  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
56 
57  void SetKOrd(Int_t k){fKOrd=k;}
58 
59  ClassDef(TH1K,1) //1-Dim Nearest Kth neighbour method
60 };
61 
62 #endif
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3159
virtual Int_t Fill(Double_t x, Double_t w)
Increment bin with abscissa X with a weight w.
Definition: TH1K.h:43
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH1K.h:46
Int_t fReady
Definition: TH1K.h:32
Int_t fNIn
Definition: TH1K.h:33
const char Option_t
Definition: RtypesCore.h:62
virtual Double_t GetBinError(Int_t bin, Int_t) const
Definition: TH1K.h:50
Array of floats (32 bits per element).
Definition: TArrayF.h:29
virtual ~TH1K()
Destructor.
Definition: TH1K.cxx:67
int Int_t
Definition: RtypesCore.h:41
void Reset()
Definition: TArrayF.h:49
Double_t x[n]
Definition: legend1.C:17
Int_t fKOrd
Definition: TH1K.h:34
ClassDef(TAttLine, 2)
char * out
Definition: TBase64.cxx:29
virtual Double_t GetBinError(Int_t bin, Int_t, Int_t) const
Definition: TH1K.h:51
Int_t fKCur
Definition: TH1K.h:35
virtual Double_t GetBinError(Int_t bin) const
Return content of global bin error.
Definition: TH1K.cxx:144
virtual void Copy(TObject &obj) const
Copy this histogram structure to newth1.
Definition: TH1K.cxx:77
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
double Double_t
Definition: RtypesCore.h:55
The TH1 histogram class.
Definition: TH1.h:80
virtual Double_t GetBinContent(Int_t bin) const
Return content of global bin number bin.
Definition: TH1K.cxx:116
void SetKOrd(Int_t k)
Definition: TH1K.h:57
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1K.cxx:93
void Sort()
Sort.
Definition: TH1K.cxx:231
TObject * obj
virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const
Definition: TH1K.h:47