Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGraph2DAsymmErrors.cxx
Go to the documentation of this file.
1// @(#)root/hist:$Id: TGraph2DAsymmErrors.cxx,v 1.00
2// Author: Olivier Couet
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#include <iostream>
13#include "TBuffer.h"
14#include "TGraph2DAsymmErrors.h"
15#include "TMath.h"
16#include "TH2.h"
17#include "TVirtualPad.h"
18#include "TVirtualFitter.h"
19#include "THLimitsFinder.h"
20
22
23/** \class TGraph2DAsymmErrors
24 \ingroup Graphs
25Graph 2D class with errors.
26
27A TGraph2DAsymmErrors is a TGraph2D with asymmetric errors. It behaves like a TGraph2D and has
28the same drawing options.
29
30The **"ERR"** drawing option allows to display the error bars. The
31following example shows how to use it:
32
33Begin_Macro(source)
34{
35 auto c = new TCanvas("c","TGraph2DAsymmErrors example",0,0,600,600);
36
37 Double_t P = 6.;
38 const Int_t np = 200;
39 std::vector<Double_t> rx(np), ry(np), rz(np), exl(np), exh(np), eyl(np), eyh(np), ezl(np), ezh(np);
40 TRandom r;
41
42 for (Int_t N=0; N<np;N++) {
43 rx[N] = 2*P*(r.Rndm(N))-P;
44 ry[N] = 2*P*(r.Rndm(N))-P;
45 rz[N] = rx[N]*rx[N]-ry[N]*ry[N];
46 rx[N] += 10.;
47 ry[N] += 10.;
48 rz[N] += 40.;
49 exl[N] = r.Rndm(N);
50 exh[N] = r.Rndm(N);
51 eyl[N] = r.Rndm(N);
52 eyh[N] = r.Rndm(N);
53 ezl[N] = 10*r.Rndm(N);
54 ezh[N] = 10*r.Rndm(N);
55 }
56
57 auto g = new TGraph2DAsymmErrors(np, rx.data(), ry.data(), rz.data(), exl.data(), exh.data(), eyl.data(), eyh.data(), ezl.data(), ezh.data());
58
59 g->SetTitle("TGraph2D with asymmetric error bars: option \"ERR\"");
60 g->SetFillColor(29);
61 g->SetMarkerSize(0.8);
62 g->SetMarkerStyle(20);
63 g->SetMarkerColor(kRed);
64 g->SetLineColor(kBlue-3);
65 g->SetLineWidth(2);
66 gPad->SetLogy(1);
67 g->Draw("err p0");
68}
69End_Macro
70*/
71
72
73////////////////////////////////////////////////////////////////////////////////
74/// TGraph2DAsymmErrors default constructor
75
77
78
79////////////////////////////////////////////////////////////////////////////////
80/// TGraph2DAsymmErrors normal constructor
81/// the arrays are preset to zero
82
84 : TGraph2D(n)
85{
86 if (n <= 0) {
87 Error("TGraph2DAsymmErrors", "Invalid number of points (%d)", n);
88 return;
89 }
90
91 fEXlow = new Double_t[n];
92 fEXhigh = new Double_t[n];
93 fEYlow = new Double_t[n];
94 fEYhigh = new Double_t[n];
95 fEZlow = new Double_t[n];
96 fEZhigh = new Double_t[n];
97
98 for (Int_t i=0;i<n;i++) {
99 fEXlow[i] = 0;
100 fEXhigh[i] = 0;
101 fEYlow[i] = 0;
102 fEYhigh[i] = 0;
103 fEZlow[i] = 0;
104 fEZhigh[i] = 0;
105 }
106}
107
108
109////////////////////////////////////////////////////////////////////////////////
110/// TGraph2DAsymmErrors constructor with doubles vectors as input.
111
113 :TGraph2D(n, x, y, z)
114{
115 if (n <= 0) {
116 Error("TGraph2DAsymmErrorsErrors", "Invalid number of points (%d)", n);
117 return;
118 }
119
120 fEXlow = new Double_t[n];
121 fEXhigh = new Double_t[n];
122 fEYlow = new Double_t[n];
123 fEYhigh = new Double_t[n];
124 fEZlow = new Double_t[n];
125 fEZhigh = new Double_t[n];
126
127 for (Int_t i=0;i<n;i++) {
128 if (exl) fEXlow[i] = exl[i];
129 else fEXlow[i] = 0;
130 if (exh) fEXhigh[i] = exh[i];
131 else fEXhigh[i] = 0;
132 if (eyl) fEYlow[i] = eyl[i];
133 else fEYlow[i] = 0;
134 if (eyh) fEYhigh[i] = eyh[i];
135 else fEYhigh[i] = 0;
136 if (ezl) fEZlow[i] = ezl[i];
137 else fEZlow[i] = 0;
138 if (ezh) fEZhigh[i] = ezh[i];
139 else fEZhigh[i] = 0;
140 }
141}
142
143
144////////////////////////////////////////////////////////////////////////////////
145/// TGraph2DAsymmErrors destructor.
146
148{
149 delete [] fEXlow;
150 delete [] fEXhigh;
151 delete [] fEYlow;
152 delete [] fEYhigh;
153 delete [] fEZlow;
154 delete [] fEZhigh;
155}
156
157////////////////////////////////////////////////////////////////////////////////
158/// Copy constructor.
159/// Copy everything except list of functions
160
162: TGraph2D(g), fEXlow(nullptr), fEXhigh(nullptr), fEYlow(nullptr), fEYhigh(nullptr), fEZlow(nullptr), fEZhigh(nullptr)
163{
164 if (fSize > 0) {
165 fEXlow = new Double_t[fSize];
166 fEXhigh = new Double_t[fSize];
167 fEYlow = new Double_t[fSize];
168 fEYhigh = new Double_t[fSize];
169 fEZlow = new Double_t[fSize];
170 fEZhigh = new Double_t[fSize];
171 for (Int_t n = 0; n < fSize; n++) {
172 fEXlow[n] = g.fEXlow[n];
173 fEXhigh[n] = g.fEXhigh[n];
174 fEYlow[n] = g.fEYlow[n];
175 fEYhigh[n] = g.fEYhigh[n];
176 fEZlow[n] = g.fEZlow[n];
177 fEZhigh[n] = g.fEZhigh[n];
178 }
179 }
180}
181
182////////////////////////////////////////////////////////////////////////////////
183/// Assignment operator
184/// Copy everything except list of functions
185
187{
188 if (this == &g) return *this;
189
190 // call operator= on TGraph2D
191 this->TGraph2D::operator=(static_cast<const TGraph2D&>(g) );
192
193 // delete before existing contained objects
194 if (fEXlow) delete [] fEXlow;
195 if (fEXhigh) delete [] fEXhigh;
196 if (fEYlow) delete [] fEYlow;
197 if (fEYhigh) delete [] fEYhigh;
198 if (fEZlow) delete [] fEZlow;
199 if (fEZhigh) delete [] fEZhigh;
200
201 fEXlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
202 fEXhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
203 fEYlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
204 fEYhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
205 fEZlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
206 fEZhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
207
208
209 // copy error arrays
210 for (Int_t n = 0; n < fSize; n++) {
211 fEXlow[n] = g.fEXlow[n];
212 fEXhigh[n] = g.fEXhigh[n];
213 fEYlow[n] = g.fEYlow[n];
214 fEYhigh[n] = g.fEYhigh[n];
215 fEZlow[n] = g.fEZlow[n];
216 fEZhigh[n] = g.fEZhigh[n];
217 }
218 return *this;
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Add a 3D point with asymmetric errorbars to an existing graph
223
230
231////////////////////////////////////////////////////////////////////////////////
232/// Returns the combined error along X at point i by computing the average
233/// of the lower and upper variance.
234
236{
237 if (i < 0 || i >= fNpoints) return -1;
238 if (!fEXlow && !fEXhigh) return -1;
239 Double_t elow=0, ehigh=0;
240 if (fEXlow) elow = fEXlow[i];
241 if (fEXhigh) ehigh = fEXhigh[i];
242 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
243}
244
245////////////////////////////////////////////////////////////////////////////////
246/// Returns the low error along X at point i.
247
249{
250 if (i < 0 || i >= fNpoints) return -1;
251 if (fEXlow) return fEXlow[i];
252 return -1;
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Returns the high error along X at point i.
257
259{
260 if (i < 0 || i >= fNpoints) return -1;
261 if (fEXhigh) return fEXhigh[i];
262 return -1;
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Returns the combined error along Y at point i by computing the average
267/// of the lower and upper variance.
268
270{
271 if (i < 0 || i >= fNpoints) return -1;
272 if (!fEYlow && !fEYhigh) return -1;
273 Double_t elow=0, ehigh=0;
274 if (fEYlow) elow = fEYlow[i];
275 if (fEYhigh) ehigh = fEYhigh[i];
276 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
277}
278
279
280////////////////////////////////////////////////////////////////////////////////
281/// Returns the low error along Y at point i.
282
284{
285 if (i < 0 || i >= fNpoints) return -1;
286 if (fEYlow) return fEYlow[i];
287 return -1;
288}
289
290////////////////////////////////////////////////////////////////////////////////
291/// Returns the high error along Y at point i.
292
294{
295 if (i < 0 || i >= fNpoints) return -1;
296 if (fEYhigh) return fEYhigh[i];
297 return -1;
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Returns the combined error along Z at point i by computing the average
302/// of the lower and upper variance.
303
305{
306 if (i < 0 || i >= fNpoints) return -1;
307 if (!fEZlow && !fEZhigh) return -1;
308 Double_t elow=0, ehigh=0;
309 if (fEZlow) elow = fEZlow[i];
310 if (fEZhigh) ehigh = fEZhigh[i];
311 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
312}
313
314////////////////////////////////////////////////////////////////////////////////
315/// Returns the low error along Z at point i.
316
318{
319 if (i < 0 || i >= fNpoints) return -1;
320 if (fEZlow) return fEZlow[i];
321 return -1;
322}
323
324////////////////////////////////////////////////////////////////////////////////
325/// Returns the high error along Z at point i.
326
328{
329 if (i < 0 || i >= fNpoints) return -1;
330 if (fEZhigh) return fEZhigh[i];
331 return -1;
332}
333
334
335////////////////////////////////////////////////////////////////////////////////
336/// Returns the X maximum with errors.
337
339{
340 Double_t v = fX[0]+fEXhigh[0];
341 for (Int_t i=1; i<fNpoints; i++) if (fX[i]+fEXhigh[i]>v) v=fX[i]+fEXhigh[i];
342 return v;
343}
344
345
346////////////////////////////////////////////////////////////////////////////////
347/// Returns the X minimum with errors.
348
350{
351 Double_t v = fX[0]-fEXlow[0];
352 for (Int_t i=1; i<fNpoints; i++) if (fX[i]-fEXlow[i]<v) v=fX[i]-fEXlow[i];
353 return v;
354}
355
356
357////////////////////////////////////////////////////////////////////////////////
358/// Returns the Y maximum with errors.
359
361{
362 Double_t v = fY[0]+fEYhigh[0];
363 for (Int_t i=1; i<fNpoints; i++) if (fY[i]+fEYhigh[i]>v) v=fY[i]+fEYhigh[i];
364 return v;
365}
366
367
368////////////////////////////////////////////////////////////////////////////////
369/// Returns the Y minimum with errors.
370
372{
373 Double_t v = fY[0]-fEYlow[0];
374 for (Int_t i=1; i<fNpoints; i++) if (fY[i]-fEYlow[i]<v) v=fY[i]-fEYlow[i];
375 return v;
376}
377
378
379////////////////////////////////////////////////////////////////////////////////
380/// Returns the Z maximum with errors.
381
383{
384 Double_t v = fZ[0]+fEZhigh[0];
385 for (Int_t i=1; i<fNpoints; i++) if (fZ[i]+fEZhigh[i]>v) v=fZ[i]+fEZhigh[i];
386 return v;
387}
388
389
390////////////////////////////////////////////////////////////////////////////////
391/// Returns the Z minimum with errors.
392
394{
395 Double_t v = fZ[0]-fEZlow[0];
396 for (Int_t i=1; i<fNpoints; i++) if (fZ[i]-fEZlow[i]<v) v=fZ[i]-fEZlow[i];
397 return v;
398}
399
400
401////////////////////////////////////////////////////////////////////////////////
402/// Print 2D graph and errors values.
403
405{
406 for (Int_t i = 0; i < fNpoints; i++) {
407 printf("x[%d]=%g, y[%d]=%g, z[%d]=%g, exl[%d]=%g, exh[%d]=%g, eyl[%d]=%g, eyh[%d]=%g, ezl[%d]=%g, ezh[%d]=%g\n",
408 i, fX[i], i, fY[i], i, fZ[i], i, fEXlow[i], i, fEXhigh[i], i, fEYlow[i], i, fEYhigh[i], i, fEZlow[i], i, fEZhigh[i]);
409 }
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Multiply the values and errors of a TGraph2DAsymmErrors by a constant c1.
414///
415/// If option contains "x" the x values and errors are scaled
416/// If option contains "y" the y values and errors are scaled
417/// If option contains "z" the z values and errors are scaled
418/// If option contains "xyz" all three x, y and z values and errors are scaled
419
421{
423 TString opt = option; opt.ToLower();
424 if (opt.Contains("x") && GetEXlow()) {
425 for (Int_t i=0; i<GetN(); i++)
426 GetEXlow()[i] *= c1;
427 }
428 if (opt.Contains("x") && GetEXhigh()) {
429 for (Int_t i=0; i<GetN(); i++)
430 GetEXhigh()[i] *= c1;
431 }
432 if (opt.Contains("y") && GetEYlow()) {
433 for (Int_t i=0; i<GetN(); i++)
434 GetEYlow()[i] *= c1;
435 }
436 if (opt.Contains("y") && GetEYhigh()) {
437 for (Int_t i=0; i<GetN(); i++)
438 GetEYhigh()[i] *= c1;
439 }
440 if (opt.Contains("z") && GetEZlow()) {
441 for (Int_t i=0; i<GetN(); i++)
442 GetEZlow()[i] *= c1;
443 }
444 if (opt.Contains("z") && GetEZhigh()) {
445 for (Int_t i=0; i<GetN(); i++)
446 GetEZhigh()[i] *= c1;
447 }
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// Set number of points in the 2D graph.
452/// Existing coordinates are preserved.
453/// New coordinates above fNpoints are preset to 0.
454
456{
457 if (n < 0) n = 0;
458 if (n == fNpoints) return;
459 if (n > fNpoints) SetPointError(n,0,0,0,0,0,0);
460 fNpoints = n;
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Deletes point number ipoint
465
467{
468 if (ipoint < 0) return -1;
469 if (ipoint >= fNpoints) return -1;
470
471 fNpoints--;
481
482 Int_t j = -1;
483 for (Int_t i = 0; i < fNpoints + 1; i++) {
484 if (i == ipoint) continue;
485 j++;
486 newX[j] = fX[i];
487 newY[j] = fY[i];
488 newZ[j] = fZ[i];
489 newEXlow[j] = fEXlow[i];
490 newEXhigh[j] = fEXhigh[i];
491 newEYlow[j] = fEYlow[i];
492 newEYhigh[j] = fEYhigh[i];
493 newEZlow[j] = fEZlow[i];
494 newEZhigh[j] = fEZhigh[i];
495 }
496 delete [] fX;
497 delete [] fY;
498 delete [] fZ;
499 delete [] fEXlow;
500 delete [] fEXhigh;
501 delete [] fEYlow;
502 delete [] fEYhigh;
503 delete [] fEZlow;
504 delete [] fEZhigh;
505 fX = newX;
506 fY = newY;
507 fZ = newZ;
514 fSize = fNpoints;
515 if (fHistogram) {
516 delete fHistogram;
517 fHistogram = nullptr;
518 fDelaunay = nullptr;
519 }
520 return ipoint;
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Set x, y and z values for point number i
525
527{
528 if (i < 0) return;
529 if (i >= fNpoints) {
530 // re-allocate the object
531 Double_t *savex = new Double_t[i+1];
532 Double_t *savey = new Double_t[i+1];
533 Double_t *savez = new Double_t[i+1];
534 Double_t *saveexl = new Double_t[i+1];
535 Double_t *saveexh = new Double_t[i+1];
536 Double_t *saveeyl = new Double_t[i+1];
537 Double_t *saveeyh = new Double_t[i+1];
538 Double_t *saveezl = new Double_t[i+1];
539 Double_t *saveezh = new Double_t[i+1];
540 if (fNpoints > 0) {
541 memcpy(savex, fX, fNpoints*sizeof(Double_t));
542 memcpy(savey, fY, fNpoints*sizeof(Double_t));
543 memcpy(savez, fZ, fNpoints*sizeof(Double_t));
550 }
551 if (fX) delete [] fX;
552 if (fY) delete [] fY;
553 if (fZ) delete [] fZ;
554 if (fEXlow) delete [] fEXlow;
555 if (fEXhigh) delete [] fEXhigh;
556 if (fEYlow) delete [] fEYlow;
557 if (fEYhigh) delete [] fEYhigh;
558 if (fEZlow) delete [] fEZlow;
559 if (fEZhigh) delete [] fEZhigh;
560 fX = savex;
561 fY = savey;
562 fZ = savez;
563 fEXlow = saveexl;
565 fEYlow = saveeyl;
567 fEZlow = saveezl;
569 fNpoints = i+1;
570 }
571 fX[i] = x;
572 fY[i] = y;
573 fZ[i] = z;
574}
575
576
577////////////////////////////////////////////////////////////////////////////////
578/// Saves primitive as a C++ statement(s) on output stream out
579
581{
582 TString arrx = SavePrimitiveVector(out, "gr2daerr_x", fNpoints, fX, kTRUE);
583 TString arry = SavePrimitiveVector(out, "gr2daerr_y", fNpoints, fY);
584 TString arrz = SavePrimitiveVector(out, "gr2daerr_z", fNpoints, fZ);
585 TString arrexl = SavePrimitiveVector(out, "gr2daerr_exl", fNpoints, fEXlow);
586 TString arrexh = SavePrimitiveVector(out, "gr2daerr_exh", fNpoints, fEXhigh);
587 TString arreyl = SavePrimitiveVector(out, "gr2daerr_eyl", fNpoints, fEYlow);
588 TString arreyh = SavePrimitiveVector(out, "gr2daerr_eyh", fNpoints, fEYhigh);
589 TString arrezl = SavePrimitiveVector(out, "gr2daerr_ezl", fNpoints, fEZlow);
590 TString arrezh = SavePrimitiveVector(out, "gr2daerr_ezh", fNpoints, fEZhigh);
591
593 out, Class(), "gr2daerr",
595 "%d, %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data()",
596 fNpoints, arrx.Data(), arry.Data(), arrz.Data(), arrexl.Data(), arrexh.Data(), arreyl.Data(), arreyh.Data(),
597 arrezl.Data(), arrezh.Data()),
598 kFALSE);
599
600 if (strcmp(GetName(), "Graph2D"))
601 out << " gr2daerr->SetName(\"" << TString(GetName()).ReplaceSpecialCppChars() << "\");\n";
602
603 TString title = GetTitle();
604 if (fHistogram)
605 title = TString(fHistogram->GetTitle()) + ";" + fHistogram->GetXaxis()->GetTitle() + ";" +
607
608 out << " gr2daerr->SetTitle(\"" << title.ReplaceSpecialCppChars() << "\");\n";
609
610 if (!fDirectory)
611 out << " gr2daerr->SetDirectory(nullptr);\n";
612
613 SaveFillAttributes(out, "gr2daerr", 0, 1001);
614 SaveLineAttributes(out, "gr2daerr", 1, 1, 1);
615 SaveMarkerAttributes(out, "gr2daerr", 1, 1, 1);
616
617 TH1::SavePrimitiveFunctions(out, "gr2daerr", fFunctions);
618
619 SavePrimitiveDraw(out, "gr2daerr", option);
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Set ex, ey and ez values for point number i
624
626{
627 if (i < 0) return;
628 if (i >= fNpoints) {
629 // re-allocate the object
631 }
632 fEXlow[i] = exl;
633 fEXhigh[i] = exh;
634 fEYlow[i] = eyl;
635 fEYhigh[i] = eyh;
636 fEZlow[i] = ezl;
637 fEZhigh[i] = ezh;
638}
639
640
641////////////////////////////////////////////////////////////////////////////////
642/// Stream an object of class TGraph2DAsymmErrors.
643
645{
646 if (b.IsReading()) {
648 Version_t R__v = b.ReadVersion(&R__s, &R__c);
649 b.ReadClassBuffer(TGraph2DAsymmErrors::Class(), this, R__v, R__s, R__c);
650 } else {
651 b.WriteClassBuffer(TGraph2DAsymmErrors::Class(),this);
652 }
653}
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
short Version_t
Definition RtypesCore.h:65
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:374
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
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.
Definition TAttFill.cxx:239
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.
Definition TAttLine.cxx:275
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.
const char * GetTitle() const override
Returns title of object.
Definition TAxis.h:137
Buffer base class used for serializing objects.
Definition TBuffer.h:43
Graph 2D class with errors.
Double_t GetErrorY(Int_t bin) const override
Returns the combined error along Y at point i by computing the average of the lower and upper varianc...
Double_t * GetEYlow() const override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Saves primitive as a C++ statement(s) on output stream out.
Double_t * fEYlow
[fNpoints] array of Y low errors
Double_t GetYminE() const override
Returns the Y minimum with errors.
Double_t GetErrorZlow(Int_t i) const
Returns the low error along Z at point i.
virtual void SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh, Double_t ezl, Double_t ezh)
Set ex, ey and ez values for point number i.
Double_t * GetEYhigh() const override
Double_t * fEZlow
[fNpoints] array of Z low errors
Double_t GetErrorZhigh(Int_t i) const
Returns the high error along Z at point i.
Double_t GetYmaxE() const override
Returns the Y maximum with errors.
Double_t * fEXlow
[fNpoints] array of X low errors
Double_t GetErrorZ(Int_t bin) const override
Returns the combined error along Z at point i by computing the average of the lower and upper varianc...
Double_t GetErrorYlow(Int_t i) const
Returns the low error along Y at point i.
Double_t GetZmaxE() const override
Returns the Z maximum with errors.
Double_t * GetEZhigh() const override
Double_t * fEXhigh
[fNpoints] array of X high errors
Int_t RemovePoint(Int_t ipoint)
Deletes point number ipoint.
Double_t * fEZhigh
[fNpoints] array of Z high errors
Double_t * GetEXhigh() const override
Double_t * GetEZlow() const override
Double_t * fEYhigh
[fNpoints] array of Y high errors
Double_t GetErrorX(Int_t bin) const override
Returns the combined error along X at point i by computing the average of the lower and upper varianc...
Double_t GetErrorXhigh(Int_t i) const
Returns the high error along X at point i.
void Streamer(TBuffer &) override
Stream an object of class TGraph2DAsymmErrors.
Double_t GetErrorYhigh(Int_t i) const
Returns the high error along Y at point i.
virtual void AddPointError(Double_t x, Double_t y, Double_t z, Double_t exl=0., Double_t exh=0., Double_t eyl=0., Double_t eyh=0., Double_t ezl=0., Double_t ezh=0.)
Add a 3D point with asymmetric errorbars to an existing graph.
Double_t GetErrorXlow(Int_t i) const
Returns the low error along X at point i.
void Set(Int_t n) override
Set number of points in the 2D graph.
void SetPoint(Int_t i, Double_t x, Double_t y, Double_t z) override
Set x, y and z values for point number i.
TGraph2DAsymmErrors()
TGraph2DAsymmErrors default constructor.
Double_t GetXminE() const override
Returns the X minimum with errors.
void Print(Option_t *chopt="") const override
Print 2D graph and errors values.
void Scale(Double_t c1=1., Option_t *option="z") override
Multiply the values and errors of a TGraph2DAsymmErrors by a constant c1.
Double_t GetXmaxE() const override
Returns the X maximum with errors.
TGraph2DAsymmErrors & operator=(const TGraph2DAsymmErrors &)
Assignment operator Copy everything except list of functions.
Double_t GetZminE() const override
Returns the Z minimum with errors.
Double_t * GetEXlow() const override
static TClass * Class()
~TGraph2DAsymmErrors() override
TGraph2DAsymmErrors destructor.
Graphics object made of three arrays X, Y and Z with the same number of points each.
Definition TGraph2D.h:41
Int_t fNpoints
Number of points in the data set.
Definition TGraph2D.h:45
Double_t * fZ
[fNpoints]
Definition TGraph2D.h:52
TH2D * fHistogram
!2D histogram of z values linearly interpolated on the triangles
Definition TGraph2D.h:58
TObject * fDelaunay
! Pointer to Delaunay interpolator object
Definition TGraph2D.h:59
Int_t GetN() const
Definition TGraph2D.h:121
TGraph2D & operator=(const TGraph2D &)
Graph2D operator "=".
Definition TGraph2D.cxx:557
Double_t * fX
[fNpoints]
Definition TGraph2D.h:50
Double_t * fY
[fNpoints] Data set to be plotted
Definition TGraph2D.h:51
TDirectory * fDirectory
!Pointer to directory holding this 2D graph
Definition TGraph2D.h:60
virtual void Scale(Double_t c1=1., Option_t *option="z")
Multiply the values of a TGraph2D by a constant c1.
virtual void AddPoint(Double_t x, Double_t y, Double_t z)
Append a new point to the graph.
Definition TGraph2D.h:91
TList * fFunctions
Pointer to list of functions (fits and user)
Definition TGraph2D.h:57
Int_t fSize
!Real size of fX, fY and fZ
Definition TGraph2D.h:49
TAxis * GetZaxis()
Definition TH1.h:573
TAxis * GetXaxis()
Definition TH1.h:571
TAxis * GetYaxis()
Definition TH1.h:572
static void SavePrimitiveFunctions(std::ostream &out, const char *varname, TList *lst)
Save list of functions Also can be used by TGraph classes.
Definition TH1.cxx:7426
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Bool_t empty_line=kFALSE)
Save array in the output stream "out" as vector.
Definition TObject.cxx:788
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:822
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:771
Basic string class.
Definition TString.h:139
void ToLower()
Change string to lower-case.
Definition TString.cxx:1182
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1114
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
Double_t y[n]
Definition legend1.C:17
return c1
Definition legend1.C:41
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:666