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;
virtual const char * GetTitle() const
Returns title of object.
virtual void SaveAttributes(std::ostream &out, const char *name, const char *subname)
Save axis attributes as C++ statement(s) on output stream out.
void AddAt(Float_t c, Int_t i)
Add float c at position i. Check for out of bounds.
static Bool_t fgStatOverflows
flag to add histograms to the directory
Array of floats (32 bits per element).
virtual ~TH1K()
Destructor.
void ToLower()
Change string to lower-case.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual Double_t GetBinWidth(Int_t bin) const
return bin width for 1D historam Better to use h1.GetXaxis().GetBinWidth(bin)
const char * Data() const
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 Double_t GetBinCenter(Int_t bin) const
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin)
ClassImp(TH1K) TH1K
Constructor.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
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.
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
virtual Double_t GetBinError(Int_t bin) const
Return content of global bin error.
virtual void Copy(TObject &obj) const
Copy this histogram structure to newth1.
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...
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
TH1K class supports the nearest K Neighbours method, widely used in cluster analysis.
static int TH1K_fcompare(const void *f1, const void *f2)
Compare.
virtual Double_t GetBinContent(Int_t bin) const
Return content of global bin number bin.
Mother of all ROOT objects.
double f2(const double *x)
virtual void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Int_t fDimension
Pointer to directory holding this histogram.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
const Float_t * GetArray() const
void Set(Int_t n)
Set size of this array to n floats.
Double_t Sqrt(Double_t x)
Long64_t BinarySearch(Long64_t n, const T *array, T value)