127 fSumw2 += weight * weight;
128 fSumwv2 += weight * value * value;
146 :
TH2Poly(
name, title, nX, xlow, xup, nY, ylow, yup)
155 if (!poly)
return nullptr;
157 if (
fBins ==
nullptr) {
172 return Fill(xcoord, ycoord, value, 1);
202 fTsumwx2 += weight * xcoord * xcoord;
204 fTsumwy2 += weight * ycoord * ycoord;
205 fTsumwxy += weight * xcoord * ycoord;
213 while ((obj = next())) {
215 if (bin->
IsInside(xcoord, ycoord)) {
217 bin->
Fill(value, weight);
233 std::vector<TProfile2Poly *> list;
236 for (
int i = 0; i <
size; i++) {
239 return this->
Merge(list);
248 std::cout <<
"[FAIL] TProfile2Poly::Merge: No objects to be merged " << std::endl;
253 std::set<Int_t> numBinUnique;
254 for (
const auto &histo : list) {
255 if (histo->fBins) numBinUnique.insert(histo->fBins->GetSize());
257 if (numBinUnique.size() != 1) {
258 std::cout <<
"[FAIL] TProfile2Poly::Merge: Bin numbers of TProfile2Polys to be merged differ!" << std::endl;
261 Int_t nbins = *numBinUnique.begin();
264 for (
const auto &histo : list) {
266 this->
fTsumw += histo->fTsumw;
267 this->
fTsumw2 += histo->fTsumw2;
268 this->
fTsumwx += histo->fTsumwx;
270 this->
fTsumwy += histo->fTsumwy;
273 this->
fTsumwz += histo->fTsumwz;
285 for (
Int_t i = 0; i < nbins; i++) {
288 for (
const auto &
e : list) {
306 for (
Int_t i = 0; i < nbins; i++) {
324 for (
Int_t i = 0; i < nbins; i++) {
353 if (bin < 0)
return fOverflowBins[-bin - 1].GetEffectiveEntries();
455 std::cout <<
"\t" << cont <<
"\t";
456 if ((i + 1) % 3 == 0) std::cout << std::endl;
459 std::cout <<
"Total: " <<
total << std::endl;
472 while ((obj = next())) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
static unsigned int total
Collection abstract base class.
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.
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)
TH2PolyBin()
Default constructor.
void SetChanged(Bool_t flag)
TList * fBins
List of bins. The list owns the contained objects.
Int_t GetNumberOfBins() const
Return the number of bins : it should be the size of the bin list.
TH2Poly()
Default Constructor. No boundaries specified.
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.
Double_t fTsumwxy
Total Sum of weight*X*Y.
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Double_t fTsumwy2
Total Sum of weight*Y*Y.
Double_t fTsumwy
Total Sum of weight*Y.
Mother of all ROOT objects.
TObject()
TObject constructor.
void Fill(Double_t value, Double_t weight)
Fill.
TProfile2PolyBin()
TProfile2PolyBin constructor.
void UpdateAverage()
Update average.
void UpdateError()
Update error.
void Merge(const TProfile2PolyBin *toMerge)
Merge.
void ClearStats()
Clear statistics.
void PrintOverflowRegions()
Print overflow regions.
Double_t GetOverflowContent(Int_t idx)
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.
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.
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.
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this profile.
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]
TProfile2PolyBin * CreateBin(TObject *poly) override
Create bin.