284 Error(
"Add",
"Attempt to add histograms with different number of bins");
291 for (bin=1;bin<=
fNcells;bin++) {
298 Error(
"Add",
"Attempt to add histograms with different bin limits");
310 for (bin=1;bin<=
fNcells;bin++) {
327 Warning(
"Add",
"Not implement for TH2Poly");
336 Warning(
"Add",
"Not implement for TH2Poly");
347 Int_t nl, nr, mb, mt;
348 Double_t xclipl, xclipr, yclipb, yclipt;
349 Double_t binXmax, binXmin, binYmax, binYmin;
371 for (
int i = nl; i <= nr; i++) {
374 for (
int j = mb; j <= mt; j++) {
380 if ((binXmin >= xclipl) && (binXmax <= xclipr) &&
381 (binYmax <= yclipt) && (binYmin >= yclipb)){
437 for (
int i = 0; i<
fNCells; i++) {
446 while((obj =
next())){
474 while ((obj =
next())) {
498 while ((obj =
next())) {
531 if (overflow != -5)
return overflow;
551 while ((obj=
next())) {
566 return Fill(x, y, 1.0);
582 if (overflow != -5) {
608 while ((obj=
next())) {
644 while ((obj =
next())) {
670 for (
int i = 0; i < ntimes; i += stride) {
671 Fill(x[i], y[i], w[i]);
693 while ((obj=
next())) {
719 if (bin >
fNcells || bin == 0 || bin < -9)
return 0;
732 if (bin < 0) bin = 0;
748 if (bin > (
fNcells))
return "";
749 if (bin < 0)
return "";
758 if (bin > (
fNcells))
return "";
759 if (bin < 0)
return "";
779 while ((obj=
next())) {
803 while ((obj=
next())) {
806 if (c>max && c<maxval) max=
c;
827 while ((obj=
next())) {
851 while ((obj=
next())) {
854 if (c<min && c>minval) min=
c;
869 xloop = xstart; yloop = ystart + a/2.0;
870 for (
int sCounter = 0; sCounter < s; sCounter++) {
875 if(sCounter%2 == 0){numberOfHexagonsInTheRow = k;}
876 else{numberOfHexagonsInTheRow = k - 1;}
901 if (sCounter%2 == 0) xloop += a*
TMath::Sqrt(3)/2.0;
981 if (!gl)
return inter;
990 if (inter)
return inter;
1005 Bool_t p0R, p0L, p0T, p0B, p0xM, p0yM, p1R, p1L, p1T;
1006 Bool_t p1B, p1xM, p1yM, p0In, p1In;
1008 for (
int counter = 0; counter < (bn-1); counter++) {
1010 p0L = x[counter] <= xclipl;
1011 p1L = x[counter + 1] <= xclipl;
1012 if (p0L && p1L)
continue;
1013 p0R = x[counter] >= xclipr;
1014 p1R = x[counter + 1] >= xclipr;
1015 if (p0R && p1R)
continue;
1016 p0T = y[counter] >= yclipt;
1017 p1T = y[counter + 1] >= yclipt;
1018 if (p0T && p1T)
continue;
1019 p0B = y[counter] <= yclipb;
1020 p1B = y[counter + 1] <= yclipb;
1021 if (p0B && p1B)
continue;
1024 p0xM = !p0R && !p0L;
1025 p0yM = !p0T && !p0B;
1026 p1xM = !p1R && !p1L;
1027 p1yM = !p1T && !p1B;
1028 p0In = p0xM && p0yM;
1029 p1In = p1xM && p1yM;
1034 if (p1In)
return kTRUE;
1041 if (p0xM && p1xM)
return kTRUE;
1042 if (p0yM && p1yM)
return kTRUE;
1047 xcoord[0] = x[counter];
1048 xcoord[1] = x[counter + 1];
1049 ycoord[0] = y[counter];
1050 ycoord[1] = y[counter + 1];
1116 Error(
"Merge",
"Cannot merge TH2Poly");
1125 out <<
" "<<std::endl;
1131 static Int_t hcounter = 0;
1136 histName += hcounter;
1138 const char *hname = histName.
Data();
1141 out << hname <<
" = new " <<
ClassName() <<
"(\"" << hname <<
"\", \""
1152 while((obj =
next())){
1155 Form(
"th2poly%s",histName.
Data()));
1159 out<<
" "<<std::endl;
1161 for (bin=1;bin<=
fNcells;bin++) {
1164 out<<
" "<<hname<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
1170 for (bin=1;bin<=
fNcells;bin++) {
1173 out<<
" "<<hname<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
1196 if (bin > (
fNcells) || bin == 0 || bin < -9 )
return;
1276 if (!gl)
return fArea;
1304 for (i=1; i<bn; i++) {
if (
fXmax < bx[i])
fXmax = bx[i];}
1310 if (!gl)
return fXmax;
1318 for (i=0; i<bn; i++) {
if (
fXmax < bx[i])
fXmax = bx[i];}
1340 for (i=1; i<bn; i++) {
if (
fXmin > bx[i])
fXmin = bx[i];}
1346 if (!gl)
return fXmin;
1354 for (i=0; i<bn; i++) {
if (
fXmin > bx[i])
fXmin = bx[i];}
1376 for (i=1; i<bn; i++) {
if (
fYmax < by[i])
fYmax = by[i];}
1382 if (!gl)
return fYmax;
1390 for (i=0; i<bn; i++) {
if (
fYmax < by[i])
fYmax = by[i];}
1412 for (i=1; i<bn; i++) {
if (
fYmin > by[i])
fYmin = by[i];}
1418 if (!gl)
return fYmin;
1426 for (i=0; i<bn; i++) {
if (
fYmin > by[i])
fYmin = by[i];}
virtual const char * GetTitle() const
Returns title 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.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Double_t GetBinContent(Int_t bin) const
Returns the content of the input bin For the overflow/underflow/sea bins: -1 | -2 | -3 ---+----+---- ...
Bool_t * fCompletelyInside
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TList * GetListOfGraphs() const
Double_t GetBinError(Int_t bin) const
Returns the value of error associated to bin number bin.
void ChangePartition(Int_t n, Int_t m)
Changes the number of partition cells in the histogram.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
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...
Long64_t Merge(TCollection *)
TH2Poly cannot be merged.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void SetChanged(Bool_t flag)
Int_t GetNumberOfBins() const
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.
virtual Double_t GetNormFactor() const
void ToLower()
Change string to lower-case.
virtual Bool_t Add(const TH1 *h1, Double_t c1)
Performs the operation: this = this + c1*h1.
const char * GetBinName(Int_t bin) const
Returns the bin name.
void SetBinContentChanged(Bool_t flag)
TObject * Clone(const char *newname="") const
Make a complete copy of the underlying object.
Helper class to represent a bin in the TH2Poly histogram.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
void AddBinToPartition(TH2PolyBin *bin)
For the 3D Painter.
const char * Data() const
Double_t GetMaximum() const
Returns the maximum value of the histogram.
static const double x2[5]
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.
Double_t GetXMax()
Returns the maximum value for the x coordinates of the bin.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
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)
Double_t GetYMax()
Returns the maximum value for the y coordinates of the bin.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
void SetContent(Double_t content)
void Initialize(Bool_t useTMVAStyle=kTRUE)
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.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Collection abstract base class.
char * Form(const char *fmt,...)
const char * GetBinTitle(Int_t bin) const
Returns the bin title.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSumw2N() const
void SetFloat(Bool_t flag=true)
When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
TObject * GetPolygon() const
Double_t GetContent() const
virtual void SetName(const char *name)
Change the name of this histogram.
static const double x1[5]
virtual const char * GetName() const
Returns name of object.
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 Integral(Option_t *option="") const
Returns the integral of bin contents.
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 SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
void ClearBinContents()
Clears the contents of all bins in the histogram.
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
Mother of all ROOT objects.
void Reset(Option_t *option)
Reset this histogram: contents, errors, etc.
virtual void Add(TObject *obj)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) 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.
Int_t fDimension
Pointer to directory holding this histogram.
Int_t GetBinNumber() const
virtual void SetTitle(const char *title)
Change (i.e.
Double_t Sqrt(Double_t x)
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Bool_t IsInside(Double_t x, Double_t y) const
Return "true" if the point (x,y) is inside the bin.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
Double_t GetMinimum() const
Returns the minimum value of the histogram.
Double_t GetXMin()
Returns the minimum value for the x coordinates of the bin.
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 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.
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.
Int_t Fill(Double_t x, Double_t y)
Increment the bin containing (x,y) by 1.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
2D Histogram with Polygonal Bins
void SetNewBinAdded(Bool_t flag)
TH2PolyBin()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.