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] );
397 if (i < 0 || i >=
fNpoints)
return -1;
412 if (i < 0 || i >=
fNpoints)
return -1;
492 printf(
"x[%d]=%g, y[%d]=%g, exl[%d]=%g, exh[%d]=%g, eyl[%d]=%g, eyh[%d]=%g\n"
493 ,i,
fX[i],i,
fY[i],i,
fEXlow[i],i,
fEXhigh[i],i,
fEYlow[i],i,
fEYhigh[i]);
504 out <<
" " << std::endl;
505 static Int_t frameNumber = 2000;
519 out <<
" Double_t " << fXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
520 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fX[i] <<
"," << std::endl;
521 out <<
" " <<
fX[
fNpoints-1] <<
"};" << std::endl;
522 out <<
" Double_t " << fYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
523 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fY[i] <<
"," << std::endl;
524 out <<
" " <<
fY[
fNpoints-1] <<
"};" << std::endl;
525 out <<
" Double_t " << fElXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
526 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlow[i] <<
"," << std::endl;
528 out <<
" Double_t " << fElYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
529 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlow[i] <<
"," << std::endl;
531 out <<
" Double_t " << fEhXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
532 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhigh[i] <<
"," << std::endl;
534 out <<
" Double_t " << fEhYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
535 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhigh[i] <<
"," << std::endl;
537 out <<
" Double_t " << fEldXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
538 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXlowd[i] <<
"," << std::endl;
540 out <<
" Double_t " << fEldYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
541 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYlowd[i] <<
"," << std::endl;
543 out <<
" Double_t " << fEhdXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
544 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEXhighd[i] <<
"," << std::endl;
546 out <<
" Double_t " << fEhdYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
547 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fEYhighd[i] <<
"," << std::endl;
550 if (
gROOT->ClassSaved(TGraphBentErrors::Class())) out <<
" ";
551 else out <<
" TGraphBentErrors *";
552 out <<
"grbe = new TGraphBentErrors("<<
fNpoints <<
","
553 << fXName <<
"," << fYName <<
","
554 << fElXName <<
"," << fEhXName <<
","
555 << fElYName <<
"," << fEhYName <<
","
556 << fEldXName <<
"," << fEhdXName <<
","
557 << fEldYName <<
"," << fEhdYName <<
");"
560 out <<
" grbe->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
561 out <<
" grbe->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
569 hname += frameNumber;
579 while ((obj = next())) {
582 out <<
" grbe->GetListOfFunctions()->Add(ptstats);" << std::endl;
583 out <<
" ptstats->SetParent(grbe->GetListOfFunctions());" << std::endl;
588 out <<
" " << objname <<
"->SetParent(grbe);\n";
590 out <<
" grbe->GetListOfFunctions()->Add("
591 << objname <<
");" << std::endl;
595 const char *
l = strstr(option,
"multigraph");
597 out<<
" multigraph->Add(grbe,"<<quote<<
l+10<<quote<<
");"<<std::endl;
599 out<<
" grbe->Draw("<<quote<<option<<quote<<
");"<<std::endl;
620 if (dpx*dpx+dpy*dpy < 25) {ipoint = i;
break;}
622 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 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.
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)