79 fTsumwt = fTsumwt2 = 0;
114 TProfile3D::TProfile3D(
const char *
name,
const char *title,
Int_t nx,
Double_t xlow,
Double_t xup,
Int_t ny,
Double_t ylow,
Double_t yup,
Int_t nz,
Double_t zlow,
Double_t zup,
Option_t *option)
115 :
TH3D(name,title,nx,xlow,xup,ny,ylow,yup,nz,zlow,zup)
125 :
TH3D(name,title,nx,xbins,ny,ybins,nz,zbins)
169 Error(
"Add",
"Function not implemented for TProfile3D");
180 Error(
"Add",
"Attempt to add a non-existing profile");
184 Error(
"Add",
"Attempt to add a non-profile2D object");
199 Error(
"Add",
"Attempt to add a non-existing profile");
203 Error(
"Add",
"Attempt to add a non-profile3D object");
207 Error(
"Add",
"Attempt to add a non-profile3D object");
243 if (!nbentries)
return 0;
246 if (action == 0)
return 0;
247 nbentries = -nbentries;
260 for (
Int_t i=1;i<nbentries;i++) {
262 if (x < xmin) xmin =
x;
263 if (x > xmax) xmax =
x;
265 if (y < ymin) ymin =
y;
266 if (y > ymax) ymax =
y;
268 if (z < zmin) zmin =
z;
269 if (z > zmax) zmax =
z;
288 for (
Int_t i=0;i<nbentries;i++) {
289 Fill(buffer[5*i+2],buffer[5*i+3],buffer[5*i+4],buffer[5*i+5],buffer[5*i+1]);
315 nbentries = -nbentries;
325 return Fill(x,y,z,t,w);
347 for (
int bin=0;bin<
fNcells;bin++) {
359 Fatal(
"Copy",
"Cannot copy a TProfile3D in a %s",obj.IsA()->
GetName());
369 Error(
"Divide",
"Function not implemented for TProfile3D");
383 Error(
"Divide",
"Attempt to divide a non-existing profile2D");
387 Error(
"Divide",
"Attempt to divide a non-profile3D object");
398 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
403 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
408 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
416 Int_t bin,binx,biny,binz;
421 for (binx =0;binx<=nx+1;binx++) {
422 for (biny =0;biny<=ny+1;biny++) {
423 for (binz =0;binz<=nz+1;binz++) {
424 bin =
GetBin(binx,biny,binz);
452 else fSumw2.
fArray[bin] = (e0*c1*c1 + e1*c0*c0)/(c12*c12);
461 Warning(
"Divide",
"Cannot preserve during the division of profiles the sum of bin weight square");
482 Error(
"Divide",
"Attempt to divide a non-existing profile2D");
486 Error(
"Divide",
"Attempt to divide a non-profile2D object");
491 Error(
"Divide",
"Attempt to divide a non-profile2D object");
499 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
504 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
509 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
513 Error(
"Divide",
"Coefficient of dividing profile cannot be zero");
521 Int_t bin,binx,biny,binz;
531 for (binx =0;binx<=nx+1;binx++) {
532 for (biny =0;biny<=ny+1;biny++) {
533 for (binz =0;binz<=nz+1;binz++) {
534 bin =
GetBin(binx,biny,binz);
537 if (b2) w = c1*b1/(c2*b2);
567 fSumw2.
fArray[bin] = ac1*ac2*(e1*b2*b2 + e2*b1*b1)/(b22*b22);
585 Int_t bin,binx,biny,binz;
595 if (binx <0 || biny <0 || binz<0)
return -1;
596 bin =
GetBin(binx,biny,binz);
634 Int_t bin,binx,biny,binz;
645 if (binx <0 || biny <0 || binz<0)
return -1;
646 bin =
GetBin(binx,biny,binz);
684 if (bin < 0 || bin >=
fNcells)
return 0;
697 if (bin < 0 || bin >=
fNcells)
return 0;
779 Int_t bin, binx, biny,binz;
782 for (bin=0;bin<
kNstat;bin++) stats[bin] = 0;
789 bin =
GetBin(binx,biny,binz);
1015 Error(
"Multiply",
"Function not implemented for TProfile3D");
1028 Error(
"Multiply",
"Multiplication of profile2D histograms not implemented");
1042 Error(
"Multiply",
"Multiplication of profile2D histograms not implemented");
1090 if (pname ==
"_px") {
1094 if (xbins->
fN == 0 && ybins->
fN == 0 && zbins->
fN == 0)
1095 h1 =
new TH3D(pname,
GetTitle(),nx,
fXaxis.
GetXmin(),
fXaxis.
GetXmax(),
ny,
fYaxis.
GetXmin(),
fYaxis.
GetXmax(),nz,
fZaxis.
GetXmin(),
fZaxis.
GetXmax());
1096 else if ( xbins->
fN != 0 && ybins->
fN != 0 && zbins->
fN != 0)
1099 Error(
"ProjectionXYZ",
"Histogram has an axis with variable bins and an axis with fixed bins. This case is not cupported - return a null pointer");
1113 if (computeErrors || binWeight || (binEntries &&
fBinSumw2.
fN) ) h1->
Sumw2();
1116 Int_t bin,binx,biny,binz;
1118 for (binx =0;binx<=nx+1;binx++) {
1119 for (biny =0;biny<=ny+1;biny++) {
1120 for (binz =0;binz<=nz+1;binz++) {
1121 bin =
GetBin(binx,biny,binz);
1183 bool originalRange,
bool useUF,
bool useOF)
const 1190 if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->
GetNbins(); }
1191 if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->
GetNbins(); }
1202 if ( originalRange ) {
1203 if (xbins->
fN == 0 && ybins->
fN == 0) {
1210 if (xbins->
fN == 0 && ybins->
fN == 0) {
1220 if (useWeights) p2->
Sumw2();
1238 TH2D * h2W =
TH3::DoProject2D(*h3dW,
"htemp-W",
"",projX_hW, projY_hW,
true, originalRange, useUF, useOF);
1239 TH2D * h2N =
TH3::DoProject2D(*h3dN,
"htemp-N",
"",projX_hN, projY_hN, useWeights, originalRange, useUF, useOF);
1247 for (
int i = 0; i < p2->
fN ; ++i) {
1324 out <<
" "<<std::endl;
1340 out <<
");" << std::endl;
1345 for (bin=0;bin<
fNcells;bin++) {
1348 out<<
" "<<
GetName()<<
"->SetBinEntries("<<bin<<
","<<bi<<
");"<<std::endl;
1352 for (bin=0;bin<
fNcells;bin++) {
1355 out<<
" "<<
GetName()<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
1360 for (bin=0;bin<
fNcells;bin++) {
1363 out<<
" "<<
GetName()<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
1396 TH1::SetBins(nx, xmin, xmax, ny, ymin, ymax, nz, zmin, zmax);
1431 if (buffersize <= 0) {
1435 if (buffersize < 100) buffersize = 100;
TArrayD()
Default TArrayD ctor.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual const char * GetTitle() const
Returns title of object.
static void SetBinEntries(T *p, Int_t bin, Double_t w)
virtual TH3D * ProjectionXYZ(const char *name="_pxyz", Option_t *option="e") const
*-*-*-*-*Project this profile3D into a 3-D histogram along X,Y,Z -* *-* =============================...
static void Scale(T *p, Double_t c1, Option_t *option)
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void SetBinEntries(Int_t bin, Double_t w)
Set the number of entries in bin.
virtual void SetBuffer(Int_t buffersize, Option_t *opt="")
set the buffer size in units of 8 bytes (double)
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Sumw2(Bool_t flag=kTRUE)
Create/Delete structure to store sum of squares of weights per bin This is needed to compute the corr...
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this profile2D by a constant c1.
static Double_t GetBinError(T *p, Int_t bin)
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual void Sumw2(Bool_t flag=kTRUE)
Create/Delete structure to store sum of squares of weights per bin This is needed to compute the corr...
TAxis fYaxis
Y axis descriptor.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
static void SetErrorOption(T *p, Option_t *opt)
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual ~TProfile3D()
Default destructor for Profile3D histograms.
static Bool_t fgStatOverflows
!flag to use under/overflows in statistics
virtual Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
void ToUpper()
Change string to upper case.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
void BuildOptions(Double_t tmin, Double_t tmax, Option_t *option)
Set Profile3D histogram structure and options.
void ToLower()
Change string to lower-case.
Profile3D histograms are used to display the mean value of T and its RMS for each cell in X...
Histogram is forced to be not weighted even when the histogram is filled with weighted different than...
TArrayD fSumw2
Array of sum of squares of weights.
virtual Double_t GetBinEntries(Int_t bin) const
Return bin entries of a Profile3D histogram.
virtual Int_t GetNbinsX() const
virtual void GetStats(Double_t *stats) const
fill the array stats from the contents of this profile The array stats must be correctly dimensionned...
virtual TProfile2D * Project3DProfile(Option_t *option="xy") const
Project a 3-d histogram into a 2-d profile histograms depending on the option parameter option may co...
void Copy(TArrayD &array) const
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
compute the best axis limits for the X axis.
TAxis fZaxis
Z axis descriptor.
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual Bool_t Multiply(TF1 *h1, Double_t c1=1)
Performs the operation: this = this*c1*f1.
static void BuildArray(T *p)
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
static Bool_t fgApproximate
virtual TProfile2D * Project3DProfile(Option_t *option="xy") const
*-*-*-*-*Project a 3-D profile into a 2D-profile histogram depending on the option parameter option m...
static double p2(double t, double a, double b, double c)
Double_t fTsumwt
True when TProfile3D::Scale is called.
TString & Append(const char *cs)
static T * ExtendAxis(T *p, Double_t x, TAxis *axis)
virtual TArrayD * GetSumw2()
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetBinError(Int_t bin, Double_t error)
See convention for numbering bins in TH1::GetBin.
Double_t fTsumwx
Total Sum of weight*X.
virtual Double_t GetEffectiveEntries() const
Number of effective entries of the histogram.
static void Approximate(Bool_t approx=kTRUE)
set the fgApproximate flag.
Class to manage histogram axis.
tomato 3-D histogram with a double per channel (see TH1 documentation)}
virtual Double_t GetBinError(Int_t bin) const
-*Return bin error of a Profile3D histogram
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Int_t Fill(const Double_t *v)
Collection abstract base class.
static Int_t fgBufferSize
!default buffer size for automatic histograms
Double_t fEntries
Number of entries.
Bool_t TestBit(UInt_t f) const
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual Int_t GetNbinsZ() const
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1.
virtual const char * GetName() const
Returns name of object.
static double p1(double t, double a, double b)
virtual Long64_t Merge(TCollection *list)
Merge all histograms in the collection in this histogram.
virtual void SetErrorOption(Option_t *option="")
Set option to compute profile3D errors.
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
const Double_t * GetArray() const
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
static Bool_t Add(T *p, const TH1 *h1, const TH1 *h2, Double_t c1, Double_t c2=1)
virtual Double_t GetBinEffectiveEntries(Int_t bin)
Return bin effective entries for a weighted filled Profile histogram.
Double_t fTsumw2
Total Sum of squares of weights.
TProfile3D()
Default constructor for Profile3D histograms.
virtual const char * GetName() const
Returns name of object.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
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.
virtual TH2D * DoProject2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool computeErrors, bool originalRange, bool useUF, bool useOF) const
internal method performing the projection to a 2D histogram called from TH3::Project3D ...
Double_t fTsumw
Total Sum of weights.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
static Double_t GetBinEffectiveEntries(T *p, Int_t bin)
void SetBins(const Int_t *nbins, const Double_t *range)
virtual void SetBinEntries(Int_t bin, Double_t w)
Set the number of entries in bin -.
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X...
Array of doubles (64 bits per element).
Int_t GetLast() const
Return last bin on the axis i.e.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void Copy(TObject &hnew) const
Copy a Profile3D histogram to a new profile2D histogram.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
virtual Int_t GetNbinsY() const
Int_t fBufferSize
fBuffer size
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.
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
virtual void SetEntries(Double_t n)
virtual void ExtendAxis(Double_t x, TAxis *axis)
Profile histogram is resized along axis such that x is in the axis range.
TAxis fXaxis
X axis descriptor.
static void Sumw2(T *p, Bool_t flag)
const TArrayD * GetXbins() const
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile3D histogram.
Double_t Sqrt(Double_t x)
Option_t * GetErrorOption() const
-*Return option to compute profile2D errors *-* ========================================= ...
Double_t * fBuffer
[fBufferSize] entry buffer
void Set(Int_t n)
Set size of this array to n doubles.
virtual TProfile2D * DoProjectProfile2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool originalRange, bool useUF, bool useOF) const
internal method to project to a 2D Profile called from TH3::Project3DProfile but re-implemented in ca...
static Long64_t Merge(T *p, TCollection *list)
virtual Bool_t Divide(TF1 *h1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) This function is not implemented.
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
tomato 2-D histogram with a double per channel (see TH1 documentation)}
virtual TArrayD * GetBinSumw2()
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.