// @(#)root/hist:$Id$
// Author: Victor Perevoztchikov <perev@bnl.gov>  21/02/2001

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TH1K
#define ROOT_TH1K


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TH1K                                                                 //
//                                                                      //
// 1-Dim histogram nearest K Neighbour class.                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TH1.h"
//________________________________________________________________________

class TH1K : public TH1, public TArrayF {

private:
   void Sort();
protected:
   Int_t fReady;  //!
   Int_t fNIn;
   Int_t fKOrd;   //!
   Int_t fKCur;   //!
public:
   TH1K();
   TH1K(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Int_t k=0);
   virtual ~TH1K();

   virtual void      Copy(TObject &obj) const;
   virtual Int_t     Fill(Double_t x);
   virtual Int_t     Fill(Double_t x,Double_t w){return TH1::Fill(x,w);}
   virtual Int_t     Fill(const char *name,Double_t w){return TH1::Fill(name,w);}
   virtual Double_t  GetBinContent(Int_t bin) const;
   virtual Double_t  GetBinContent(Int_t bin,Int_t) const {return GetBinContent(bin);}
   virtual Double_t  GetBinContent(Int_t bin,Int_t,Int_t) const {return GetBinContent(bin);}

   virtual Double_t  GetBinError(Int_t bin) const;
   virtual Double_t  GetBinError(Int_t bin,Int_t) const {return GetBinError(bin);}
   virtual Double_t  GetBinError(Int_t bin,Int_t,Int_t) const {return GetBinError(bin);}


   virtual void      Reset(Option_t *option="");
   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");

   void    SetKOrd(Int_t k){fKOrd=k;}

   ClassDef(TH1K,1)  //1-Dim Nearest Kth neighbour method
};

#endif
 TH1K.h:1
 TH1K.h:2
 TH1K.h:3
 TH1K.h:4
 TH1K.h:5
 TH1K.h:6
 TH1K.h:7
 TH1K.h:8
 TH1K.h:9
 TH1K.h:10
 TH1K.h:11
 TH1K.h:12
 TH1K.h:13
 TH1K.h:14
 TH1K.h:15
 TH1K.h:16
 TH1K.h:17
 TH1K.h:18
 TH1K.h:19
 TH1K.h:20
 TH1K.h:21
 TH1K.h:22
 TH1K.h:23
 TH1K.h:24
 TH1K.h:25
 TH1K.h:26
 TH1K.h:27
 TH1K.h:28
 TH1K.h:29
 TH1K.h:30
 TH1K.h:31
 TH1K.h:32
 TH1K.h:33
 TH1K.h:34
 TH1K.h:35
 TH1K.h:36
 TH1K.h:37
 TH1K.h:38
 TH1K.h:39
 TH1K.h:40
 TH1K.h:41
 TH1K.h:42
 TH1K.h:43
 TH1K.h:44
 TH1K.h:45
 TH1K.h:46
 TH1K.h:47
 TH1K.h:48
 TH1K.h:49
 TH1K.h:50
 TH1K.h:51
 TH1K.h:52
 TH1K.h:53
 TH1K.h:54
 TH1K.h:55
 TH1K.h:56
 TH1K.h:57
 TH1K.h:58
 TH1K.h:59
 TH1K.h:60
 TH1K.h:61
 TH1K.h:62