119 ((
TH1K*)
this)->Sort();
120 ((
TH1K*)
this)->fReady=1;
122 if (!
fNIn)
return 0.;
125 int jl=left,jr=left+1,nk,nkmax =
fKOrd;
126 float fl,fr,ff=0.,ffmin=1.e-6;
129 for (nk = 1; nk <= nkmax || ff <= ffmin; nk++) {
132 if (jl<0 && jr>=
fNIn)
break;
133 if (fl < fr) { ff = fl; jl--;}
134 else { ff = fr; jr++;}
136 ((
TH1K*)
this)->fKCur = nk - 1;
179 out <<
");"<<std::endl;
182 out<<
" "<<
GetName()<<
"->SetDirectory(0);"<<std::endl;
185 out<<
" "<<
GetName()<<
"->SetStats(0);"<<std::endl;
192 out<<
" Float_t Arr[]={"<<std::endl;
193 for (
int i=0; i<
fNIn; i++) {
195 if (i !=
fNIn-1) {out<<
",";}
else { out<<
"};";}
196 if (i%10 == 9) {out<< std::endl;}
199 out<<
" for(int i=0;i<" <<
fNIn <<
";i++)"<<
GetName()<<
"->Fill(Arr[i]);";
212 <<quote<<
option<<quote<<
");"<<std::endl;
222 if (*((
float*)
f1) < *((
float*)f2))
return -1;
223 if (*((
float*)
f1) > *((
float*)f2))
return 1;
static int TH1K_fcompare(const void *f1, const void *f2)
Compare.
Array of floats (32 bits per element).
const Float_t * GetArray() const
void AddAt(Float_t c, Int_t i)
Add float c at position i. Check for out of bounds.
void Set(Int_t n) override
Set size of this array to n floats.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
void SaveAttributes(std::ostream &out, const char *name, const char *subname) override
Save axis attributes as C++ statement(s) on output stream out.
TH1K class supports the nearest K Neighbours method, widely used in cluster analysis.
~TH1K() override
Destructor.
Double_t GetBinError(Int_t bin) const override
Return content of global bin error.
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...
Int_t Fill(Double_t x) override
Increment bin with abscissa X by 1.
void Copy(TObject &obj) const override
Copy this histogram structure to newth1.
Double_t GetBinContent(Int_t bin) const override
Return content of global bin number bin.
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
void Copy(TObject &hnew) const override
Copy this histogram structure to newth1.
Double_t fTsumw
Total Sum of weights.
Double_t fTsumw2
Total Sum of squares of weights.
Double_t fTsumwx2
Total Sum of weight*X*X.
@ kNoStats
Don't draw stats box.
TDirectory * fDirectory
! Pointer to directory holding this histogram
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Int_t fDimension
! Histogram dimension (1, 2 or 3 dim)
Double_t fEntries
Number of entries.
TAxis fZaxis
Z axis descriptor.
TAxis fXaxis
X axis descriptor.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
Bool_t GetStatOverflowsBehaviour() const
TAxis fYaxis
Y axis descriptor.
Double_t fTsumwx
Total Sum of weight*X.
TString fOption
Histogram options.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Double_t Sqrt(Double_t x)
Returns the square root of x.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.