120 if (exl)
fEXlow[i] = exl[i];
124 if (eyl)
fEYlow[i] = eyl[i];
129 if (exld)
fEXlowd[i] = exld[i];
133 if (eyld)
fEYlowd[i] = eyld[i];
157 if (exl) memcpy(
fEXlow, exl,
n);
161 if (eyl) memcpy(
fEYlow, eyl,
n);
207 Double_t x,
y,exl,exh,eyl,eyh,eyl_new,eyh_new,fxy;
225 if (
f->Eval(
x,
y-eyl)<
f->Eval(
x,
y+eyh)) {
314 memmove(&arrays[0][obegin], &
fEXlow[ibegin],
n);
315 memmove(&arrays[1][obegin], &
fEXhigh[ibegin],
n);
316 memmove(&arrays[2][obegin], &
fEYlow[ibegin],
n);
317 memmove(&arrays[3][obegin], &
fEYhigh[ibegin],
n);
318 memmove(&arrays[4][obegin], &
fEXlowd[ibegin],
n);
319 memmove(&arrays[5][obegin], &
fEXhighd[ibegin],
n);
320 memmove(&arrays[6][obegin], &
fEYlowd[ibegin],
n);
321 memmove(&arrays[7][obegin], &
fEYhighd[ibegin],
n);
365 if (
g->GetN() == 0)
return kFALSE;
377 if (exl == 0 || exh == 0 || eyl == 0 || eyh == 0 ||
378 exld == 0 || exhd == 0 || eyld == 0 || eyhd == 0) {
380 Warning(
"DoMerge",
"Merging a %s is not compatible with a TGraphBentErrors - errors will be ignored",
g->IsA()->GetName());
383 for (
Int_t i = 0 ; i <
g->GetN(); i++) {
389 exld[i], exhd[i], eyld[i], eyhd[i] );
401 if (i < 0 || i >=
fNpoints)
return -1;
416 if (i < 0 || i >=
fNpoints)
return -1;
496 printf(
"x[%d]=%g, y[%d]=%g, exl[%d]=%g, exh[%d]=%g, eyl[%d]=%g, eyh[%d]=%g\n"
497 ,i,
fX[i],i,
fY[i],i,
fEXlow[i],i,
fEXhigh[i],i,
fEYlow[i],i,
fEYhigh[i]);
508 out <<
" " << std::endl;
509 static Int_t frameNumber = 2000;
523 out <<
" Double_t " << fXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
524 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fX[i] <<
"," << std::endl;
525 out <<
" " <<
fX[
fNpoints-1] <<
"};" << std::endl;
526 out <<
" Double_t " << fYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
527 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fY[i] <<
"," << std::endl;
528 out <<
" " <<
fY[
fNpoints-1] <<
"};" << std::endl;
529 out <<
" Double_t " << fElXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
530 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlow[i] <<
"," << std::endl;
532 out <<
" Double_t " << fElYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
533 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlow[i] <<
"," << std::endl;
535 out <<
" Double_t " << fEhXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
536 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhigh[i] <<
"," << std::endl;
538 out <<
" Double_t " << fEhYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
539 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhigh[i] <<
"," << std::endl;
541 out <<
" Double_t " << fEldXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
542 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlowd[i] <<
"," << std::endl;
544 out <<
" Double_t " << fEldYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
545 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlowd[i] <<
"," << std::endl;
547 out <<
" Double_t " << fEhdXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
548 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhighd[i] <<
"," << std::endl;
550 out <<
" Double_t " << fEhdYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
551 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhighd[i] <<
"," << std::endl;
555 else out <<
" TGraphBentErrors *";
556 out <<
"grbe = new TGraphBentErrors("<<
fNpoints <<
","
557 << fXName <<
"," << fYName <<
","
558 << fElXName <<
"," << fEhXName <<
","
559 << fElYName <<
"," << fEhYName <<
","
560 << fEldXName <<
"," << fEhdXName <<
","
561 << fEldYName <<
"," << fEhdYName <<
");"
564 out <<
" grbe->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
565 out <<
" grbe->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
573 hname += frameNumber;
583 while ((obj = next())) {
586 out <<
" grbe->GetListOfFunctions()->Add(ptstats);" << std::endl;
587 out <<
" ptstats->SetParent(grbe->GetListOfFunctions());" << std::endl;
592 out <<
" " << objname <<
"->SetParent(grbe);\n";
594 out <<
" grbe->GetListOfFunctions()->Add("
595 << objname <<
");" << std::endl;
599 const char *
l = strstr(option,
"multigraph");
601 out<<
" multigraph->Add(grbe,"<<quote<<
l+10<<quote<<
");"<<std::endl;
603 out<<
" grbe->Draw("<<quote<<option<<quote<<
");"<<std::endl;
624 if (dpx*dpx+dpy*dpy < 25) {ipoint = i;
break;}
626 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 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 * 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 y = f(x,y)
Double_t * fEXhighd
[fNpoints] array of X high displacements
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
This function is called by GraphFitChisquare.
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 * fEXlow
[fNpoints] array of X low errors
Double_t * fEXhigh
[fNpoints] array of X high errors
Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
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 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 * fEYlow
[fNpoints] array of Y low errors
Double_t GetErrorYlow(Int_t bin) const
Get low error on Y[i].
Double_t * fEYhighd
[fNpoints] array of Y high displacements
virtual void Print(Option_t *chopt="") const
Print graph and errors values.
A Graph is a graphics 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.
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".
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)