291 Error(
"Add",
"Attempt to add histograms with different number of bins");
305 Error(
"Add",
"Attempt to add histograms with different bin limits");
316 Bool_t resetStats = (c1 < 0);
330 for (bin = 0; bin <
fNcells; bin++) {
354 if (i == 1) s1[i] += c1 * c1 * s2[i];
355 else s1[i] += c1 * s2[i];
368 Warning(
"Add",
"Not implement for TH2Poly");
377 Warning(
"Add",
"Not implement for TH2Poly");
388 Int_t nl, nr, mb, mt;
389 Double_t xclipl, xclipr, yclipb, yclipt;
390 Double_t binXmax, binXmin, binYmax, binYmin;
412 for (
int i = nl; i <= nr; i++) {
415 for (
int j = mb; j <= mt; j++) {
421 if ((binXmin >= xclipl) && (binXmax <= xclipr) &&
422 (binYmax <= yclipt) && (binYmin >= yclipb)){
478 for (
int i = 0; i<
fNCells; i++) {
487 while((obj = next())){
515 while ((obj = next())) {
539 while ((obj = next())) {
572 if (overflow != -5)
return overflow;
592 while ((obj=next())) {
607 return Fill(x, y, 1.0);
623 if (overflow != -5) {
651 while ((obj=next())) {
689 while ((obj = next())) {
715 for (
int i = 0; i < ntimes; i += stride) {
716 Fill(x[i], y[i], w[i]);
738 while ((obj=next())) {
794 if (bin < 0)
return "";
804 if (bin < 0)
return "";
824 while ((obj=next())) {
848 while ((obj=next())) {
851 if (c>max && c<maxval) max=
c;
872 while ((obj=next())) {
896 while ((obj=next())) {
899 if (c<min && c>minval) min=
c;
914 xloop = xstart; yloop = ystart + a/2.0;
915 for (
int sCounter = 0; sCounter <
s; sCounter++) {
920 if(sCounter%2 == 0){numberOfHexagonsInTheRow = k;}
921 else{numberOfHexagonsInTheRow = k - 1;}
946 if (sCounter%2 == 0) xloop += a*
TMath::Sqrt(3)/2.0;
1026 if (!gl)
return inter;
1029 while ((g = (
TGraph*) next())) {
1035 if (inter)
return inter;
1050 Bool_t p0R, p0L, p0T, p0B, p0xM, p0yM, p1R, p1L, p1T;
1051 Bool_t p1B, p1xM, p1yM, p0In, p1In;
1053 for (
int counter = 0; counter < (bn-1); counter++) {
1055 p0L = x[counter] <= xclipl;
1056 p1L = x[counter + 1] <= xclipl;
1057 if (p0L && p1L)
continue;
1058 p0R = x[counter] >= xclipr;
1059 p1R = x[counter + 1] >= xclipr;
1060 if (p0R && p1R)
continue;
1061 p0T = y[counter] >= yclipt;
1062 p1T = y[counter + 1] >= yclipt;
1063 if (p0T && p1T)
continue;
1064 p0B = y[counter] <= yclipb;
1065 p1B = y[counter + 1] <= yclipb;
1066 if (p0B && p1B)
continue;
1069 p0xM = !p0R && !p0L;
1070 p0yM = !p0T && !p0B;
1071 p1xM = !p1R && !p1L;
1072 p1yM = !p1T && !p1B;
1073 p0In = p0xM && p0yM;
1074 p1In = p1xM && p1yM;
1079 if (p1In)
return kTRUE;
1086 if (p0xM && p1xM)
return kTRUE;
1087 if (p0yM && p1yM)
return kTRUE;
1092 xcoord[0] = x[counter];
1093 xcoord[1] = x[counter + 1];
1094 ycoord[0] = y[counter];
1095 ycoord[1] = y[counter + 1];
1162 for (
auto h2pAsObj : *coll) {
1163 if (!
Add((
TH1*)h2pAsObj, 1.)) {
1164 Warning(
"Merge",
"An issue was encountered during the merge operation.");
1176 out <<
" "<<std::endl;
1182 static Int_t hcounter = 0;
1187 histName += hcounter;
1189 const char *hname = histName.
Data();
1192 out << hname <<
" = new " <<
ClassName() <<
"(\"" << hname <<
"\", \"" 1203 while((obj = next())){
1210 out<<
" "<<std::endl;
1215 out<<
" "<<hname<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
1224 out<<
" "<<hname<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
1273 if (!
fBins)
return false;
1275 if (!bin)
return false;
1317 fNumber = bin_number;
1332 if (fPoly)
delete fPoly;
1352 if (!gl)
return fArea;
1355 while ((g = (
TGraph*) next())) {
1357 fArea = fArea + g->
Integral(0,bn-1);
1370 if (fXmax != -1111)
return fXmax;
1380 for (i=1; i<bn; i++) {
if (fXmax < bx[i]) fXmax = bx[i];}
1386 if (!gl)
return fXmax;
1390 while ((g = (
TGraph*) next())) {
1393 if (first) {fXmax = bx[0]; first =
kFALSE;}
1394 for (i=0; i<bn; i++) {
if (fXmax < bx[i]) fXmax = bx[i];}
1406 if (fXmin != -1111)
return fXmin;
1416 for (i=1; i<bn; i++) {
if (fXmin > bx[i]) fXmin = bx[i];}
1422 if (!gl)
return fXmin;
1426 while ((g = (
TGraph*) next())) {
1429 if (first) {fXmin = bx[0]; first =
kFALSE;}
1430 for (i=0; i<bn; i++) {
if (fXmin > bx[i]) fXmin = bx[i];}
1442 if (fYmax != -1111)
return fYmax;
1452 for (i=1; i<bn; i++) {
if (fYmax < by[i]) fYmax = by[i];}
1458 if (!gl)
return fYmax;
1462 while ((g = (
TGraph*) next())) {
1465 if (first) {fYmax = by[0]; first =
kFALSE;}
1466 for (i=0; i<bn; i++) {
if (fYmax < by[i]) fYmax = by[i];}
1478 if (fYmin != -1111)
return fYmin;
1488 for (i=1; i<bn; i++) {
if (fYmin > by[i]) fYmin = by[i];}
1494 if (!gl)
return fYmin;
1498 while ((g = (
TGraph*) next())) {
1501 if (first) {fYmin = by[0]; first =
kFALSE;}
1502 for (i=0; i<bn; i++) {
if (fYmin > by[i]) fYmin = by[i];}
Double_t Integral(Option_t *option="") const
Returns the integral of bin contents.
virtual const char * GetName() const
Returns name of object.
Int_t FindBin(Double_t x, Double_t y, Double_t z=0)
Returns the bin number of the bin at the given coordinate.
Bool_t * fCompletelyInside
virtual Double_t GetBinError(Int_t bin) const
Returns the value of error associated to bin number bin.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Bool_t IsInsideBin(Int_t binnr, Double_t x, Double_t y)
Return "true" if the point (x,y) is inside the bin of binnr.
Int_t GetBinNumber() const
void ChangePartition(Int_t n, Int_t m)
Changes the number of partition cells in the histogram.
virtual Double_t GetNormFactor() const
TAxis fYaxis
Y axis descriptor.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Long64_t Merge(TCollection *)
Merge TH2Polys Given the special nature of the TH2Poly, the merge is implemented in terms of subseque...
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
A TMultiGraph is a collection of TGraph (or derived) objects.
void Initialize(Double_t xlow, Double_t xup, Double_t ylow, Double_t yup, Int_t n, Int_t m)
Initializes the TH2Poly object. This method is called by the constructor.
void ToLower()
Change string to lower-case.
virtual Bool_t Add(const TH1 *h1, Double_t c1)
Performs the operation: this = this + c1*h1.
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside one of the graphs 0 otherwise.
Bool_t IsInside(Double_t x, Double_t y) const
Return "true" if the point (x,y) is inside the bin.
TArrayD fSumw2
Array of sum of squares of weights.
void SetBinContentChanged(Bool_t flag)
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
Helper class to represent a bin in the TH2Poly histogram.
void AddBinToPartition(TH2PolyBin *bin)
For the 3D Painter.
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual void GetStats(Double_t *stats) const
fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
static constexpr double mg
TDirectory * fDirectory
!Pointer to directory holding this histogram
static const double x2[5]
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
const char * GetBinTitle(Int_t bin) const
Returns the bin title.
const char * GetBinName(Int_t bin) const
Returns the bin name.
virtual Int_t AddBin(TObject *poly)
Adds a new bin to the histogram.
Bool_t IsIntersecting(TH2PolyBin *bin, Double_t xclipl, Double_t xclipr, Double_t yclipb, Double_t yclipt)
Returns kTRUE if the input bin is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt)
virtual ~TH2Poly()
Destructor.
static constexpr double L
Double_t GetXMax()
Returns the maximum value for the x coordinates of the bin.
Double_t GetYMin()
Returns the minimum value for the y coordinates of the bin.
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Double_t GetYMax()
Returns the maximum value for the y coordinates of the bin.
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculates from bin cont...
Double_t fTsumwx
Total Sum of weight*X.
virtual Double_t GetBinContent(Int_t bin) const
Returns the content of the input bin For the overflow/underflow/sea bins: -1 | -2 | -3 ---+----+---- ...
Double_t fMinimum
Minimum value for plotting.
TObject * GetPolygon() const
virtual TH2PolyBin * CreateBin(TObject *poly)
Create appropriate histogram bin.
TObject * Clone(const char *newname="") const
Make a complete copy of the underlying object.
void SetBinContent(Int_t bin, Double_t content)
Sets the contents of the input bin to the input content Negative values between -1 and -9 are for the...
virtual ~TH2PolyBin()
Destructor.
Double_t GetContent() const
Collection abstract base class.
Double_t fEntries
Number of entries.
Int_t GetNumberOfBins() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
void SetFloat(Bool_t flag=true)
When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
virtual void SetName(const char *name)
Change the name of this histogram.
virtual Int_t GetSumw2N() const
Double_t fTsumw2
Total Sum of squares of weights.
virtual void GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
static const double x1[5]
virtual void SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option="")
Helper function for the SavePrimitive functions from TH1 or classes derived from TH1, eg TProfile, TProfile2D.
Double_t fTsumw
Total Sum of weights.
Double_t GetMinimum() const
Returns the minimum value of the histogram.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
virtual Double_t GetEntries() const
Return the current number of entries.
void Honeycomb(Double_t xstart, Double_t ystart, Double_t a, Int_t k, Int_t s)
Bins the histogram using a honeycomb structure.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
void ClearBinContents()
Clears the contents of all bins in the histogram.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Mother of all ROOT objects.
Double_t fMaximum
Maximum value for plotting.
TList * GetListOfGraphs() const
Double_t fOverflow[kNOverflow]
virtual void Reset(Option_t *option)
Reset this histogram: contents, errors, etc.
virtual void Add(TObject *obj)
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
A Graph is a graphics object made of two arrays X and Y with npoints each.
Double_t GetArea()
Returns the area of the bin.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t fDimension
!Histogram dimension (1, 2 or 3 dim)
virtual void SetEntries(Double_t n)
TAxis fXaxis
X axis descriptor.
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise...
Double_t Sqrt(Double_t x)
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual const char * GetName() const
Returns name of object.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
Double_t GetXMin()
Returns the minimum value for the x coordinates of the bin.
Double_t * fBuffer
[fBufferSize] entry buffer
Bool_t IsIntersectingPolygon(Int_t bn, Double_t *x, Double_t *y, Double_t xclipl, Double_t xclipr, Double_t yclipb, Double_t yclipt)
Returns kTRUE if the input polygon (bn, x, y) is intersecting with the input rectangle (xclipl...
Double_t GetMaximum() const
Returns the maximum value of the histogram.
void FillN(Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1)
Fills a 2-D histogram with an array of values and weights.
virtual Int_t Fill(Double_t x, Double_t y)
Increment the bin containing (x,y) by 1.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
TH2Poly()
Default Constructor. No boundaries specified.
2D Histogram with Polygonal Bins
virtual const char * GetTitle() const
Returns title of object.
void SetNewBinAdded(Bool_t flag)
TH2PolyBin()
Default constructor.
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
const char * Data() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".