Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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:
32  Int_t fReady; //!
33  Int_t fNIn;
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,2) //1-Dim Nearest Kth neighbour method
60 };
61 
62 #endif