Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TProfile2Poly.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Filip Ilic
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TProfile2Poly
13#define ROOT_TProfile2Poly
14
15#include "TH2Poly.h"
16#include "TProfile.h"
17#include <vector>
18
20public:
21 friend class TProfile2Poly;
22
24 TProfile2PolyBin(TObject *poly, Int_t bin_number);
25 ~TProfile2PolyBin() override {}
26
27 void Merge(const TProfile2PolyBin *toMerge);
28
29 void Update();
30 void ClearStats();
31
32 Double_t GetEffectiveEntries() const { return (fSumw * fSumw) / fSumw2; }
33 Double_t GetEntries() const { return fSumw; }
34 Double_t GetEntriesW2() const { return fSumw2; }
35 Double_t GetEntriesVW() const { return fSumvw; }
36 Double_t GetEntriesWV2() const { return fSumwv2; }
37 Double_t GetError() const { return fError; }
38
39
40private:
48
49protected:
50 void Fill(Double_t value, Double_t weight);
51 void UpdateAverage();
52 void UpdateError();
54
56};
57
58class TProfile2Poly : public TH2Poly {
59 friend class TProfile2PolyBin;
60
61public:
62 friend class TProfileHelper;
63
65 TProfile2Poly(const char *name, const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup);
66 TProfile2Poly(const char *name, const char *title, Int_t nX, Double_t xlow, Double_t xup, Int_t nY, Double_t ylow,
67 Double_t yup);
68 ~TProfile2Poly() override {}
69
70 using TH2Poly::Fill;
71 Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value) override;
72 virtual Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value, Double_t weight);
73
74 Long64_t Merge(const std::vector<TProfile2Poly *> &list);
75 Long64_t Merge(TCollection *in) override;
76 void Reset(Option_t *option = "") override;
77
78 // option to display different measures on bins
79 void SetContentToAverage(); // this one is used by default
80 void SetContentToError();
81
83
85 Double_t GetBinEntries(Int_t bin) const;
89
91 Double_t GetBinContent(Int_t bin) const override;
92
94 Double_t GetBinError(Int_t bin) const override;
95
96 void GetStats(Double_t *stats) const override;
97
98
101
102private:
107
108protected:
109 TProfile2PolyBin *CreateBin(TObject *poly) override;
110
112 Int_t OverflowIdxToArrayIdx(Int_t val) { return -val - 1; }
113
114
116};
117#endif
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
EErrorType
Definition TProfile.h:28
@ kERRORMEAN
Definition TProfile.h:28
Collection abstract base class.
Definition TCollection.h:65
Helper class to represent a bin in the TH2Poly histogram.
Definition TH2Poly.h:25
2D Histogram with Polygonal Bins
Definition TH2Poly.h:66
@ kNOverflow
Definition TH2Poly.h:157
Double_t GetBinContent(Int_t bin) const override
Returns the content of the input bin Bin numbers are from [1,nbins] and for the overflow/underflow/se...
Definition TH2Poly.cxx:829
Int_t Fill(Double_t x, Double_t y) override
Increment the bin containing (x,y) by 1.
Definition TH2Poly.cxx:652
Double_t GetBinError(Int_t bin) const override
Returns the value of error associated to bin number bin.
Definition TH2Poly.cxx:844
Mother of all ROOT objects.
Definition TObject.h:41
Helper class to represent a bin in the TProfile2Poly histogram.
Double_t GetEntriesW2() const
void Update()
Update.
Double_t GetEntries() const
void Fill(Double_t value, Double_t weight)
Fill.
Double_t GetError() const
~TProfile2PolyBin() override
void SetErrorOption(EErrorType type)
Double_t GetEffectiveEntries() const
TProfile2PolyBin()
TProfile2PolyBin constructor.
void UpdateAverage()
Update average.
Double_t GetEntriesVW() const
void UpdateError()
Update error.
EErrorType fErrorMode
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)
EErrorType fErrorMode
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 fTsumwz2
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.
void SetContentToError()
Set content to error.
~TProfile2Poly() override
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.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17