130 fSumw2 += weight * weight;
131 fSumwv2 += weight * value * value;
149 :
TH2Poly(
name, title, nX, xlow, xup, nY, ylow, yup)
175 return Fill(xcoord, ycoord, value, 1);
205 fTsumwx2 += weight * xcoord * xcoord;
207 fTsumwy2 += weight * ycoord * ycoord;
208 fTsumwxy += weight * xcoord * ycoord;
216 while ((obj = next())) {
218 if (bin->
IsInside(xcoord, ycoord)) {
220 bin->
Fill(value, weight);
236 std::vector<TProfile2Poly *> list;
239 for (
int i = 0; i < size; i++) {
242 return this->
Merge(list);
250 if (list.size() == 0) {
251 std::cout <<
"[FAIL] TProfile2Poly::Merge: No objects to be merged " << std::endl;
256 std::set<Int_t> numBinUnique;
257 for (
const auto &histo : list) {
258 if (histo->fBins) numBinUnique.insert(histo->fBins->GetSize());
260 if (numBinUnique.size() != 1) {
261 std::cout <<
"[FAIL] TProfile2Poly::Merge: Bin numbers of TProfile2Polys to be merged differ!" << std::endl;
264 Int_t nbins = *numBinUnique.begin();
267 for (
const auto &histo : list) {
269 this->
fTsumw += histo->fTsumw;
270 this->
fTsumw2 += histo->fTsumw2;
271 this->
fTsumwx += histo->fTsumwx;
273 this->
fTsumwy += histo->fTsumwy;
276 this->
fTsumwz += histo->fTsumwz;
288 for (
Int_t i = 0; i < nbins; i++) {
291 for (
const auto &
e : list) {
309 for (
Int_t i = 0; i < nbins; i++) {
327 for (
Int_t i = 0; i < nbins; i++) {
458 std::cout <<
"\t" << cont <<
"\t";
459 if ((i + 1) % 3 == 0) std::cout << std::endl;
462 std::cout <<
"Total: " <<
total << std::endl;
475 while ((obj = next())) {
static unsigned int total
Collection abstract base class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
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.
Double_t fEntries
Number of entries.
TAxis fXaxis
X axis descriptor.
TAxis fYaxis
Y axis descriptor.
Double_t fTsumwx
Total Sum of weight*X.
Helper class to represent a bin in the TH2Poly histogram.
Bool_t IsInside(Double_t x, Double_t y) const
Return "true" if the point (x,y) is inside the bin.
void SetContent(Double_t content)
Double_t GetContent() const
void SetChanged(Bool_t flag)
2D Histogram with Polygonal Bins
TList * fBins
List of bins. The list owns the contained objects.
Int_t GetNumberOfBins() const
Int_t fCellX
Number of partition cells in the x-direction of the histogram.
Double_t fStepY
Dimensions of a partition cell.
TList * fCells
[fNCells] The array of TLists that store the bins that intersect with each cell. List do not own the ...
Int_t fCellY
Number of partition cells in the y-direction of the histogram.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Mother of all ROOT objects.
Helper class to represent a bin in the TProfile2Poly histogram.
Double_t GetEntriesW2() const
Double_t GetEntries() const
void Fill(Double_t value, Double_t weight)
Fill.
Double_t GetError() const
Double_t GetEffectiveEntries() const
TProfile2PolyBin()
TProfile2PolyBin constructor.
void UpdateAverage()
Update average.
Double_t GetEntriesVW() const
void UpdateError()
Update error.
Double_t GetEntriesWV2() const
void Merge(const TProfile2PolyBin *toMerge)
Merge.
void ClearStats()
Clear statistics.
2D Profile Histogram with Polygonal Bins.
void PrintOverflowRegions()
Print overflow regions.
Double_t GetOverflowContent(Int_t idx)
virtual Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value) override
Fill.
Long64_t Merge(const std::vector< TProfile2Poly * > &list)
Merge.
Double_t GetBinEffectiveEntries(Int_t bin) const
Get bin effective entries.
virtual Double_t GetBinError(Int_t bin) const override
Get bin error.
Double_t GetBinEntriesVW(Int_t bin) const
Get bin entries VW.
Double_t GetBinEntriesW2(Int_t bin) const
Get bin entries W2.
friend class TProfile2PolyBin
void SetContentToError()
Set content to error.
virtual Double_t GetBinContent(Int_t bin) const override
Get bin content.
Int_t GetOverflowRegionFromCoordinates(Double_t x, Double_t y)
The overflow regions are calculated by considering x, y coordinates.
virtual void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this profile.
virtual void Reset(Option_t *option="") override
Reset.
void SetContentToAverage()
Set content to average.
Double_t GetBinEntriesWV2(Int_t bin) const
Get bin entries WV2.
Double_t GetBinEntries(Int_t bin) const
Get bin entries.
void SetErrorOption(EErrorType type)
Set error option.
Int_t OverflowIdxToArrayIdx(Int_t val)
TProfile2PolyBin fOverflowBins[kNOverflow]
virtual TProfile2PolyBin * CreateBin(TObject *poly) override
Create bin.