298 Error(
"Add",
"Attempt to add histograms with different number of bins");
312 Error(
"Add",
"Attempt to add histograms with different bin limits");
340 for (bin = 0; bin <
fNcells; bin++) {
355 if (i == 1)
s1[i] +=
c1 *
c1 * s2[i];
356 else s1[i] +=
c1 * s2[i];
371 Int_t nl, nr, mb, mt;
372 Double_t xclipl, xclipr, yclipb, yclipt;
373 Double_t binXmax, binXmin, binYmax, binYmin;
395 for (
int i = nl; i <= nr; i++) {
398 for (
int j = mb; j <= mt; j++) {
404 if ((binXmin >= xclipl) && (binXmax <= xclipr) &&
405 (binYmax <= yclipt) && (binYmin >= yclipb)){
461 for (
int i = 0; i<
fNCells; i++) {
470 while((obj = next())){
498 while ((obj = next())) {
523 while ((obj = next())) {
556 if (overflow != -5)
return overflow;
576 while ((obj=next())) {
618 if (overflow != -5) {
646 while ((obj=next())) {
688 while ((obj = next())) {
714 for (
int i = 0; i < ntimes; i += stride) {
737 while ((obj=next())) {
821 if (bin < 0)
return "";
831 if (bin < 0)
return "";
851 while ((obj=next())) {
875 while ((obj=next())) {
878 if (
c>max &&
c<maxval) max=
c;
899 while ((obj=next())) {
923 while ((obj=next())) {
926 if (c<min && c>minval) min=
c;
941 xloop = xstart; yloop = ystart +
a/2.0;
942 for (
int sCounter = 0; sCounter <
s; sCounter++) {
947 if(sCounter%2 == 0){numberOfHexagonsInTheRow = k;}
948 else{numberOfHexagonsInTheRow = k - 1;}
1053 TList *gl =
mg->GetListOfGraphs();
1054 if (!gl)
return inter;
1057 while ((
g = (
TGraph*) next())) {
1063 if (inter)
return inter;
1078 Bool_t p0R, p0L, p0T, p0B, p0xM, p0yM, p1R, p1L, p1T;
1079 Bool_t p1B, p1xM, p1yM, p0In, p1In;
1081 for (
int counter = 0; counter < (bn-1); counter++) {
1083 p0L =
x[counter] <= xclipl;
1084 p1L =
x[counter + 1] <= xclipl;
1085 if (p0L && p1L)
continue;
1086 p0R =
x[counter] >= xclipr;
1087 p1R =
x[counter + 1] >= xclipr;
1088 if (p0R && p1R)
continue;
1089 p0T =
y[counter] >= yclipt;
1090 p1T =
y[counter + 1] >= yclipt;
1091 if (p0T && p1T)
continue;
1092 p0B =
y[counter] <= yclipb;
1093 p1B =
y[counter + 1] <= yclipb;
1094 if (p0B && p1B)
continue;
1097 p0xM = !p0R && !p0L;
1098 p0yM = !p0T && !p0B;
1099 p1xM = !p1R && !p1L;
1100 p1yM = !p1T && !p1B;
1101 p0In = p0xM && p0yM;
1102 p1In = p1xM && p1yM;
1107 if (p1In)
return kTRUE;
1114 if (p0xM && p1xM)
return kTRUE;
1115 if (p0yM && p1yM)
return kTRUE;
1120 xcoord[0] =
x[counter];
1121 xcoord[1] =
x[counter + 1];
1122 ycoord[0] =
y[counter];
1123 ycoord[1] =
y[counter + 1];
1190 for (
auto h2pAsObj : *coll) {
1191 if (!
Add((
TH1*)h2pAsObj, 1.)) {
1192 Warning(
"Merge",
"An issue was encountered during the merge operation.");
1204 out <<
" "<<std::endl;
1210 static Int_t hcounter = 0;
1215 histName += hcounter;
1217 const char *hname = histName.
Data();
1220 out << hname <<
" = new " <<
ClassName() <<
"(\"" << hname <<
"\", \""
1231 while((obj = next())){
1238 out<<
" "<<std::endl;
1243 out<<
" "<<hname<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
1252 out<<
" "<<hname<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
1303 if (!
fBins)
return false;
1305 if (!bin)
return false;
1376 fArea =
g->Integral(0,bn-1);
1381 TList *gl =
mg->GetListOfGraphs();
1382 if (!gl)
return fArea;
1385 while ((
g = (
TGraph*) next())) {
1410 for (i=1; i<bn; i++) {
if (
fXmax < bx[i])
fXmax = bx[i];}
1415 TList *gl =
mg->GetListOfGraphs();
1416 if (!gl)
return fXmax;
1420 while ((
g = (
TGraph*) next())) {
1424 for (i=0; i<bn; i++) {
if (
fXmax < bx[i])
fXmax = bx[i];}
1446 for (i=1; i<bn; i++) {
if (
fXmin > bx[i])
fXmin = bx[i];}
1451 TList *gl =
mg->GetListOfGraphs();
1452 if (!gl)
return fXmin;
1456 while ((
g = (
TGraph*) next())) {
1460 for (i=0; i<bn; i++) {
if (
fXmin > bx[i])
fXmin = bx[i];}
1482 for (i=1; i<bn; i++) {
if (
fYmax < by[i])
fYmax = by[i];}
1487 TList *gl =
mg->GetListOfGraphs();
1488 if (!gl)
return fYmax;
1492 while ((
g = (
TGraph*) next())) {
1496 for (i=0; i<bn; i++) {
if (
fYmax < by[i])
fYmax = by[i];}
1518 for (i=1; i<bn; i++) {
if (
fYmin > by[i])
fYmin = by[i];}
1523 TList *gl =
mg->GetListOfGraphs();
1524 if (!gl)
return fYmin;
1528 while ((
g = (
TGraph*) next())) {
1532 for (i=0; i<bn; i++) {
if (
fYmin > by[i])
fYmin = by[i];}
1548 in =
g->IsInside(
x,
y);
1553 in =
mg->IsInside(
x,
y);
1568 Error(
"Add",
"Not implement for TH2Poly");
1576 Error(
"Add",
"Not implement for TH2Poly");
1584 Error(
"Divide",
"Not implement for TH2Poly");
1592 Error(
"Multiply",
"Not implement for TH2Poly");
1599 Error(
"ComputeIntegral",
"Not implement for TH2Poly");
1606 Error(
"FFT",
"Not implement for TH2Poly");
1613 Error(
"GetAsymmetry",
"Not implement for TH2Poly");
1620 Error(
"Interpolate",
"Not implement for TH2Poly");
static const double x2[5]
static const double x1[5]
void Set(Int_t n)
Set size of this array to n doubles.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
Collection abstract base class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
A Graph is a graphics object made of two arrays X and Y with npoints each.
Double_t * fBuffer
[fBufferSize] entry buffer
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
virtual void GetStats(Double_t *stats) const
fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
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.
virtual Double_t GetNormFactor() const
@ kIsNotW
Histogram is forced to be not weighted even when the histogram is filled with weighted different than...
TDirectory * fDirectory
!Pointer to directory holding this histogram
Double_t fMaximum
Maximum value for plotting.
Int_t fDimension
!Histogram dimension (1, 2 or 3 dim)
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
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,...
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
Double_t fMinimum
Minimum value for plotting.
virtual Double_t GetEntries() const
Return the current number of entries.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculates from bin cont...
virtual void SetBinErrorOption(EBinErrorOpt type)
Double_t fEntries
Number of entries.
virtual void SetName(const char *name)
Change the name of this histogram.
@ kNormal
errors with Normal (Wald) approximation: errorUp=errorLow= sqrt(N)
TAxis fXaxis
X axis descriptor.
TArrayD fSumw2
Array of sum of squares of weights.
virtual Int_t GetSumw2N() const
TAxis fYaxis
Y axis descriptor.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual void SetEntries(Double_t n)
Double_t fTsumwx
Total Sum of weight*X.
Helper class to represent a bin in the TH2Poly histogram.
Double_t GetXMin()
Returns the minimum value for the x coordinates of the bin.
Double_t GetYMax()
Returns the maximum value for the y coordinates of the bin.
Double_t GetArea()
Returns the area of the bin.
Double_t GetYMin()
Returns the minimum value for the y coordinates of the bin.
Double_t fContent
Bin content.
Bool_t IsInside(Double_t x, Double_t y) const
Return "true" if the point (x,y) is inside the bin.
Double_t fXmax
X maximum value.
Int_t fNumber
Bin number of the bin in TH2Poly.
TH2PolyBin()
Default constructor.
Double_t fYmax
Y maximum value.
Double_t GetXMax()
Returns the maximum value for the x coordinates of the bin.
Double_t GetContent() const
Double_t fYmin
Y minimum value.
void SetChanged(Bool_t flag)
Int_t GetBinNumber() const
Double_t fXmin
X minimum value.
TObject * GetPolygon() const
virtual ~TH2PolyBin()
Destructor.
TObject * fPoly
Object holding the polygon definition.
2D Histogram with Polygonal Bins
Double_t Integral(Option_t *option="") const
Returns the integral of bin contents.
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...
TList * GetBins()
Returns the TList of all bins in the histogram.
void ClearBinContents()
Clears the contents of all bins in the histogram.
Double_t fOverflow[kNOverflow]
Overflow bins.
Bool_t fFloat
When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error.
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,...
void Honeycomb(Double_t xstart, Double_t ystart, Double_t a, Int_t k, Int_t s)
Bins the histogram using a honeycomb structure.
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 GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
virtual TH2PolyBin * CreateBin(TObject *poly)
Create appropriate histogram bin.
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...
Bool_t * fIsEmpty
[fNCells] The array that returns true if the cell at the given coordinate is empty
TList * fBins
List of bins. The list owns the contained objects.
void AddBinToPartition(TH2PolyBin *bin)
Adds the input bin into the partition cell matrix.
Int_t GetNumberOfBins() const
void SetBinContentChanged(Bool_t flag)
virtual ~TH2Poly()
Destructor.
virtual Int_t Fill(Double_t x, Double_t y)
Increment the bin containing (x,y) by 1.
Bool_t * fCompletelyInside
[fNCells] The array that returns true if the cell at the given coordinate is completely inside a bin
TH2Poly()
Default Constructor. No boundaries specified.
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.
void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
TObject * Clone(const char *newname="") const
Make a complete copy of the underlying object.
virtual void Reset(Option_t *option)
Reset this histogram: contents, errors, etc.
const char * GetBinTitle(Int_t bin) const
Returns the bin title.
void SetNewBinAdded(Bool_t flag)
void ChangePartition(Int_t n, Int_t m)
Changes the number of partition cells in the histogram.
virtual Double_t Interpolate(Double_t, Double_t)
NOT IMPLEMENTED for TH2Poly.
Double_t GetMinimum() const
Returns the minimum value of the histogram.
const char * GetBinName(Int_t bin) const
Returns the bin name.
virtual Bool_t Multiply(TF1 *, Double_t)
NOT IMPLEMENTED for TH2Poly.
Int_t fNCells
Number of partition cells: fCellX*fCellY.
virtual Double_t GetBinContent(Int_t bin) const
Returns the content of the input bin For the overflow/underflow/sea bins:
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.
Int_t fCellX
Number of partition cells in the x-direction of the histogram.
virtual Bool_t Add(const TH1 *h1, Double_t c1)
Performs the operation: this = this + c1*h1.
virtual Int_t AddBin(TObject *poly)
Adds a new bin to the histogram.
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...
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,...
virtual TH1 * FFT(TH1 *, Option_t *)
NOT IMPLEMENTED for TH2Poly.
virtual Double_t GetBinError(Int_t bin) const
Returns the value of error associated to bin number bin.
virtual TH1 * GetAsymmetry(TH1 *, Double_t, Double_t)
NOT IMPLEMENTED for TH2Poly.
virtual 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...
Double_t GetMaximum() const
Returns the maximum value of the histogram.
Int_t FindBin(Double_t x, Double_t y, Double_t z=0)
Returns the bin number of the bin at the given coordinate.
virtual Double_t ComputeIntegral(Bool_t)
NOT IMPLEMENTED for TH2Poly.
Double_t fStepY
Dimensions of a partition cell.
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.
TList * fCells
[fNCells] The array of TLists that store the bins that intersect with each cell. List do not own the ...
virtual Bool_t Divide(TF1 *, Double_t)
Performs the operation: this = this / c1*f1. NOT IMPLEMENTED for TH2Poly.
Int_t fCellY
Number of partition cells in the y-direction of the histogram.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void Add(TObject *obj)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
static constexpr double L
static constexpr double mg
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 QuietNaN()
Returns a quiet NaN as defined by IEEE 754
Double_t Sqrt(Double_t x)