116 if (exl)
fEXlow[i] = exl[i];
120 if (eyl)
fEYlow[i] = eyl[i];
125 if (exld)
fEXlowd[i] = exld[i];
129 if (eyld)
fEYlowd[i] = eyld[i];
153 if (exl) memcpy(
fEXlow, exl,
n);
157 if (eyl) memcpy(
fEYlow, eyl,
n);
203 Double_t x,
y,exl,exh,eyl,eyh,eyl_new,eyh_new,fxy;
221 if (
f->Eval(
x,
y-eyl)<
f->Eval(
x,
y+eyh)) {
310 memmove(&arrays[0][obegin], &
fEXlow[ibegin],
n);
311 memmove(&arrays[1][obegin], &
fEXhigh[ibegin],
n);
312 memmove(&arrays[2][obegin], &
fEYlow[ibegin],
n);
313 memmove(&arrays[3][obegin], &
fEYhigh[ibegin],
n);
314 memmove(&arrays[4][obegin], &
fEXlowd[ibegin],
n);
315 memmove(&arrays[5][obegin], &
fEXhighd[ibegin],
n);
316 memmove(&arrays[6][obegin], &
fEYlowd[ibegin],
n);
317 memmove(&arrays[7][obegin], &
fEYhighd[ibegin],
n);
361 if (
g->GetN() == 0)
return kFALSE;
373 if (exl == 0 || exh == 0 || eyl == 0 || eyh == 0 ||
374 exld == 0 || exhd == 0 || eyld == 0 || eyhd == 0) {
375 if (
g->IsA() != TGraph::Class() )
376 Warning(
"DoMerge",
"Merging a %s is not compatible with a TGraphBentErrors - errors will be ignored",
g->IsA()->GetName());
379 for (
Int_t i = 0 ; i <
g->GetN(); i++) {
385 exld[i], exhd[i], eyld[i], eyhd[i] );
396 if (i < 0 || i >=
fNpoints)
return -1;
410 if (i < 0 || i >=
fNpoints)
return -1;
490 printf(
"x[%d]=%g, y[%d]=%g, exl[%d]=%g, exh[%d]=%g, eyl[%d]=%g, eyh[%d]=%g\n"
491 ,i,
fX[i],i,
fY[i],i,
fEXlow[i],i,
fEXhigh[i],i,
fEYlow[i],i,
fEYhigh[i]);
546 out <<
" " << std::endl;
547 static Int_t frameNumber = 2000;
561 out <<
" Double_t " << fXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
562 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fX[i] <<
"," << std::endl;
563 out <<
" " <<
fX[
fNpoints-1] <<
"};" << std::endl;
564 out <<
" Double_t " << fYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
565 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fY[i] <<
"," << std::endl;
566 out <<
" " <<
fY[
fNpoints-1] <<
"};" << std::endl;
567 out <<
" Double_t " << fElXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
568 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlow[i] <<
"," << std::endl;
570 out <<
" Double_t " << fElYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
571 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlow[i] <<
"," << std::endl;
573 out <<
" Double_t " << fEhXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
574 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhigh[i] <<
"," << std::endl;
576 out <<
" Double_t " << fEhYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
577 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhigh[i] <<
"," << std::endl;
579 out <<
" Double_t " << fEldXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
580 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlowd[i] <<
"," << std::endl;
582 out <<
" Double_t " << fEldYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
583 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlowd[i] <<
"," << std::endl;
585 out <<
" Double_t " << fEhdXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
586 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhighd[i] <<
"," << std::endl;
588 out <<
" Double_t " << fEhdYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
589 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhighd[i] <<
"," << std::endl;
592 if (
gROOT->ClassSaved(TGraphBentErrors::Class())) out <<
" ";
593 else out <<
" TGraphBentErrors *";
594 out <<
"grbe = new TGraphBentErrors("<<
fNpoints <<
","
595 << fXName <<
"," << fYName <<
","
596 << fElXName <<
"," << fEhXName <<
","
597 << fElYName <<
"," << fEhYName <<
","
598 << fEldXName <<
"," << fEhdXName <<
","
599 << fEldYName <<
"," << fEhdYName <<
");"
602 out <<
" grbe->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
603 out <<
" grbe->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
611 hname += frameNumber;
621 while ((obj = next())) {
624 out <<
" grbe->GetListOfFunctions()->Add(ptstats);" << std::endl;
625 out <<
" ptstats->SetParent(grbe->GetListOfFunctions());" << std::endl;
630 out <<
" " << objname <<
"->SetParent(grbe);\n";
632 out <<
" grbe->GetListOfFunctions()->Add("
633 << objname <<
");" << std::endl;
637 const char *
l = strstr(option,
"multigraph");
639 out<<
" multigraph->Add(grbe,"<<quote<<
l+10<<quote<<
");"<<std::endl;
641 out<<
" grbe->Draw("<<quote<<option<<quote<<
");"<<std::endl;
662 if (dpx*dpx+dpy*dpy < 25) {ipoint = i;
break;}
664 if (ipoint == -2)
return;
char * Form(const char *fmt,...)
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
A TGraphBentErrors is a TGraph with bent, asymmetric error bars.
Double_t * GetEYhigh() const
Double_t * GetEXlow() const
Double_t GetErrorXhigh(Int_t bin) const
Get high error on X[i].
TGraphBentErrors()
TGraphBentErrors default constructor.
Double_t * fEYhigh
[fNpoints] array of Y high errors
virtual ~TGraphBentErrors()
TGraphBentErrors default destructor.
Double_t * fEXlowd
[fNpoints] array of X low displacements
Double_t * GetEXlowd() const
Double_t * fEYlowd
[fNpoints] array of Y low displacements
Double_t GetErrorXlow(Int_t bin) const
Get low error on X[i].
virtual Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy errors from fE***to arrays[***] or to f*** Copy points.
Bool_t CtorAllocate()
Should be called from ctors after fNpoints has been set.
virtual void Apply(TF1 *f)
Apply a function to all data points .
Double_t * fEXhighd
[fNpoints] array of X high displacements
Double_t * GetEYlow() const
Double_t GetErrorYhigh(Int_t bin) const
Get high error on Y[i].
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy and release.
Double_t GetErrorX(Int_t bin) const
It returns the error along X at point i.
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
virtual void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh, Double_t exld=0, Double_t exhd=0, Double_t eyld=0, Double_t eyhd=0)
Set ex and ey values for point pointed by the mouse.
Double_t * GetEXhighd() const
Double_t * fEXlow
[fNpoints] array of X low errors
Double_t * fEXhigh
[fNpoints] array of X high errors
Double_t GetErrorY(Int_t bin) const
It returns the error along Y at point i.
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end]
virtual void Scale(Double_t c1=1., Option_t *option="y")
Multiply the values and errors of a TGraphBentErrors by a constant c1.
virtual Bool_t DoMerge(const TGraph *g)
Protected function to perform the merge operation of a graph with asymmetric errors.
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute range.
Double_t * GetEYlowd() const
Double_t * fEYlow
[fNpoints] array of Y low errors
Double_t GetErrorYlow(Int_t bin) const
Get low error on Y[i].
Double_t * GetEYhighd() const
Double_t * fEYhighd
[fNpoints] array of Y high displacements
Double_t * GetEXhigh() const
virtual void Print(Option_t *chopt="") const
Print graph and errors values.
A TGraph is an object made of two arrays X and Y with npoints each.
Int_t fNpoints
Number of points <= fMaxSize.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Int_t fMaxSize
!Current dimension of arrays fX and fY
TH1F * fHistogram
Pointer to histogram used for drawing axis.
Double_t * fY
[fNpoints] array of Y points
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
virtual void Scale(Double_t c1=1., Option_t *option="y")
Multiply the values of a TGraph by a constant c1.
TList * fFunctions
Pointer to list of functions (fits and user)
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end) Should be redefined in descendant classes.
Double_t * fX
[fNpoints] array of X points
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin !...
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetName(const char *name)
Change the name of this histogram.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void ToLower()
Change string to lower-case.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)