Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
26class TH1K : public TH1, public TArrayF {
27
28private:
29 void Sort();
30protected:
35
36 Double_t RetrieveBinContent(Int_t bin) const override { return GetBinContent(bin); }
37
38public:
39 TH1K();
40 TH1K(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Int_t k=0);
41 ~TH1K() override;
42
43 void Copy(TObject &obj) const override;
44 Int_t Fill(Double_t x) override;
45 Int_t Fill(Double_t x,Double_t w) override{return TH1::Fill(x,w);}
46 Int_t Fill(const char *name,Double_t w) override{return TH1::Fill(name,w);}
47 Double_t GetBinContent(Int_t bin) const override;
48 Double_t GetBinContent(Int_t bin,Int_t) const override {return GetBinContent(bin);}
49 Double_t GetBinContent(Int_t bin,Int_t,Int_t) const override {return GetBinContent(bin);}
50
51 Double_t GetBinError(Int_t bin) const override;
52 Double_t GetBinError(Int_t bin,Int_t) const override {return GetBinError(bin);}
53 Double_t GetBinError(Int_t bin,Int_t,Int_t) const override {return GetBinError(bin);}
54
55
56 void Reset(Option_t *option="") override;
57 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
58
59 void SetKOrd(Int_t k){fKOrd=k;}
60
61 ClassDefOverride(TH1K,2) //1-Dim Nearest Kth neighbour method
62};
63
64#endif
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
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:26
~TH1K() override
Destructor.
Definition TH1K.cxx:67
Double_t GetBinContent(Int_t bin, Int_t, Int_t) const override
Definition TH1K.h:49
Double_t GetBinError(Int_t bin) const override
Return content of global bin error.
Definition TH1K.cxx:144
Int_t fReady
Definition TH1K.h:31
Int_t fKOrd
Definition TH1K.h:33
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out Note the following restrictions in the code...
Definition TH1K.cxx:168
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH1K.h:36
Int_t Fill(Double_t x, Double_t w) override
Increment bin with abscissa X with a weight w.
Definition TH1K.h:45
Int_t fKCur
Definition TH1K.h:34
Double_t GetBinError(Int_t bin, Int_t, Int_t) const override
Definition TH1K.h:53
Int_t fNIn
Definition TH1K.h:32
Int_t Fill(const char *name, Double_t w) override
Increment bin with namex with a weight w.
Definition TH1K.h:46
Int_t Fill(Double_t x) override
Increment bin with abscissa X by 1.
Definition TH1K.cxx:93
void Copy(TObject &obj) const override
Copy this histogram structure to newth1.
Definition TH1K.cxx:77
Double_t GetBinError(Int_t bin, Int_t) const override
Definition TH1K.h:52
TH1K()
Constructor.
Definition TH1K.cxx:39
void Sort()
Sort.
Definition TH1K.cxx:231
void SetKOrd(Int_t k)
Definition TH1K.h:59
Double_t GetBinContent(Int_t bin) const override
Return content of global bin number bin.
Definition TH1K.cxx:116
Double_t GetBinContent(Int_t bin, Int_t) const override
Definition TH1K.h:48
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3346
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17