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//________________________________________________________________________
26
27class TH1K : public TH1, public TArrayF {
28
29private:
30 void Sort();
31protected:
36public:
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
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
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:27
Int_t fReady
Definition: TH1K.h:32
Int_t fKOrd
Definition: TH1K.h:34
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1K.cxx:93
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 GetBinContent(Int_t bin, Int_t, Int_t) const
Definition: TH1K.h:47
virtual void Copy(TObject &obj) const
Copy this histogram structure to newth1.
Definition: TH1K.cxx:77
Int_t fNIn
Definition: TH1K.h:33
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
virtual Int_t Fill(const char *name, Double_t w)
Increment bin with namex with a weight w.
Definition: TH1K.h:44
virtual Double_t GetBinError(Int_t bin) const
Return content of global bin error.
Definition: TH1K.cxx:144
virtual Double_t GetBinContent(Int_t bin) const
Return content of global bin number bin.
Definition: TH1K.cxx:116
TH1K()
Constructor.
Definition: TH1K.cxx:39
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH1K.h:46
void Sort()
Sort.
Definition: TH1K.cxx:231
virtual ~TH1K()
Destructor.
Definition: TH1K.cxx:67
void SetKOrd(Int_t k)
Definition: TH1K.h:57
virtual Double_t GetBinError(Int_t bin, Int_t) const
Definition: TH1K.h:50
virtual Int_t Fill(Double_t x, Double_t w)
Increment bin with abscissa X with a weight w.
Definition: TH1K.h:43
The TH1 histogram class.
Definition: TH1.h:56
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3275
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17