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
21
22/** \class TGraph2DAsymmErrors
23 \ingroup Graphs
24Graph 2D class with errors.
25
26A TGraph2DAsymmErrors is a TGraph2D with asymmetric errors. It behaves like a TGraph2D and has
27the same drawing options.
28
29The "ERR" drawing option allows to display the error bars. The
30following example shows how to use it:
31
32Begin_Macro(source)
33{
34 auto c = new TCanvas("c","TGraph2DAsymmErrors example",0,0,600,600);
35
36 Double_t P = 6.;
37 const Int_t np = 200;
38 std::vector<Double_t> rx(np), ry(np), rz(np), exl(np), exh(np), eyl(np), eyh(np), ezl(np), ezh(np);
39 TRandom r;
40
41 for (Int_t N=0; N<np;N++) {
42 rx[N] = 2*P*(r.Rndm(N))-P;
43 ry[N] = 2*P*(r.Rndm(N))-P;
44 rz[N] = rx[N]*rx[N]-ry[N]*ry[N];
45 rx[N] += 10.;
46 ry[N] += 10.;
47 rz[N] += 40.;
48 exl[N] = r.Rndm(N);
49 exh[N] = r.Rndm(N);
50 eyl[N] = r.Rndm(N);
51 eyh[N] = r.Rndm(N);
52 ezl[N] = 10*r.Rndm(N);
53 ezh[N] = 10*r.Rndm(N);
54 }
55
56 auto g = new TGraph2DAsymmErrors(np, rx.data(), ry.data(), rz.data(), exl.data(), exh.data(), eyl.data(), eyh.data(), ezl.data(), ezh.data());
57
58 g->SetTitle("TGraph2D with asymmetric error bars: option \"ERR\"");
59 g->SetFillColor(29);
60 g->SetMarkerSize(0.8);
61 g->SetMarkerStyle(20);
62 g->SetMarkerColor(kRed);
63 g->SetLineColor(kBlue-3);
64 g->SetLineWidth(2);
65 gPad->SetLogy(1);
66 g->Draw("err p0");
67}
68End_Macro
69*/
70
71
72////////////////////////////////////////////////////////////////////////////////
73/// TGraph2DAsymmErrors default constructor
74
76
77
78////////////////////////////////////////////////////////////////////////////////
79/// TGraph2DAsymmErrors normal constructor
80/// the arrays are preset to zero
81
83 : TGraph2D(n)
84{
85 if (n <= 0) {
86 Error("TGraph2DAsymmErrors", "Invalid number of points (%d)", n);
87 return;
88 }
89
90 fEXlow = new Double_t[n];
91 fEXhigh = new Double_t[n];
92 fEYlow = new Double_t[n];
93 fEYhigh = new Double_t[n];
94 fEZlow = new Double_t[n];
95 fEZhigh = new Double_t[n];
96
97 for (Int_t i=0;i<n;i++) {
98 fEXlow[i] = 0;
99 fEXhigh[i] = 0;
100 fEYlow[i] = 0;
101 fEYhigh[i] = 0;
102 fEZlow[i] = 0;
103 fEZhigh[i] = 0;
104 }
105}
106
107
108////////////////////////////////////////////////////////////////////////////////
109/// TGraph2DAsymmErrors constructor with doubles vectors as input.
110
112 :TGraph2D(n, x, y, z)
113{
114 if (n <= 0) {
115 Error("TGraph2DAsymmErrorsErrors", "Invalid number of points (%d)", n);
116 return;
117 }
118
119 fEXlow = new Double_t[n];
120 fEXhigh = new Double_t[n];
121 fEYlow = new Double_t[n];
122 fEYhigh = new Double_t[n];
123 fEZlow = new Double_t[n];
124 fEZhigh = new Double_t[n];
125
126 for (Int_t i=0;i<n;i++) {
127 if (exl) fEXlow[i] = exl[i];
128 else fEXlow[i] = 0;
129 if (exh) fEXhigh[i] = exh[i];
130 else fEXhigh[i] = 0;
131 if (eyl) fEYlow[i] = eyl[i];
132 else fEYlow[i] = 0;
133 if (eyh) fEYhigh[i] = eyh[i];
134 else fEYhigh[i] = 0;
135 if (ezl) fEZlow[i] = ezl[i];
136 else fEZlow[i] = 0;
137 if (ezh) fEZhigh[i] = ezh[i];
138 else fEZhigh[i] = 0;
139 }
140}
141
142
143////////////////////////////////////////////////////////////////////////////////
144/// TGraph2DAsymmErrors destructor.
145
147{
148 delete [] fEXlow;
149 delete [] fEXhigh;
150 delete [] fEYlow;
151 delete [] fEYhigh;
152 delete [] fEZlow;
153 delete [] fEZhigh;
154}
155
156////////////////////////////////////////////////////////////////////////////////
157/// Copy constructor.
158/// Copy everything except list of functions
159
161: TGraph2D(g), fEXlow(nullptr), fEXhigh(nullptr), fEYlow(nullptr), fEYhigh(nullptr), fEZlow(nullptr), fEZhigh(nullptr)
162{
163 if (fSize > 0) {
164 fEXlow = new Double_t[fSize];
165 fEXhigh = new Double_t[fSize];
166 fEYlow = new Double_t[fSize];
167 fEYhigh = new Double_t[fSize];
168 fEZlow = new Double_t[fSize];
169 fEZhigh = new Double_t[fSize];
170 for (Int_t n = 0; n < fSize; n++) {
171 fEXlow[n] = g.fEXlow[n];
172 fEXhigh[n] = g.fEXhigh[n];
173 fEYlow[n] = g.fEYlow[n];
174 fEYhigh[n] = g.fEYhigh[n];
175 fEZlow[n] = g.fEZlow[n];
176 fEZhigh[n] = g.fEZhigh[n];
177 }
178 }
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Assignment operator
183/// Copy everything except list of functions
184
186{
187 if (this == &g) return *this;
188
189 // call operator= on TGraph2D
190 this->TGraph2D::operator=(static_cast<const TGraph2D&>(g) );
191
192 // delete before existing contained objects
193 if (fEXlow) delete [] fEXlow;
194 if (fEXhigh) delete [] fEXhigh;
195 if (fEYlow) delete [] fEYlow;
196 if (fEYhigh) delete [] fEYhigh;
197 if (fEZlow) delete [] fEZlow;
198 if (fEZhigh) delete [] fEZhigh;
199
200 fEXlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
201 fEXhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
202 fEYlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
203 fEYhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
204 fEZlow = (fSize > 0) ? new Double_t[fSize] : nullptr;
205 fEZhigh = (fSize > 0) ? new Double_t[fSize] : nullptr;
206
207
208 // copy error arrays
209 for (Int_t n = 0; n < fSize; n++) {
210 fEXlow[n] = g.fEXlow[n];
211 fEXhigh[n] = g.fEXhigh[n];
212 fEYlow[n] = g.fEYlow[n];
213 fEYhigh[n] = g.fEYhigh[n];
214 fEZlow[n] = g.fEZlow[n];
215 fEZhigh[n] = g.fEZhigh[n];
216 }
217 return *this;
218}
219
220////////////////////////////////////////////////////////////////////////////////
221/// Add a 3D point with asymmetric errorbars to an existing graph
222
229
230////////////////////////////////////////////////////////////////////////////////
231/// Returns the combined error along X at point i by computing the average
232/// of the lower and upper variance.
233
235{
236 if (i < 0 || i >= fNpoints) return -1;
237 if (!fEXlow && !fEXhigh) return -1;
238 Double_t elow=0, ehigh=0;
239 if (fEXlow) elow = fEXlow[i];
240 if (fEXhigh) ehigh = fEXhigh[i];
241 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// Returns the low error along X at point i.
246
248{
249 if (i < 0 || i >= fNpoints) return -1;
250 if (fEXlow) return fEXlow[i];
251 return -1;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Returns the high error along X at point i.
256
258{
259 if (i < 0 || i >= fNpoints) return -1;
260 if (fEXhigh) return fEXhigh[i];
261 return -1;
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// Returns the combined error along Y at point i by computing the average
266/// of the lower and upper variance.
267
269{
270 if (i < 0 || i >= fNpoints) return -1;
271 if (!fEYlow && !fEYhigh) return -1;
272 Double_t elow=0, ehigh=0;
273 if (fEYlow) elow = fEYlow[i];
274 if (fEYhigh) ehigh = fEYhigh[i];
275 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
276}
277
278
279////////////////////////////////////////////////////////////////////////////////
280/// Returns the low error along Y at point i.
281
283{
284 if (i < 0 || i >= fNpoints) return -1;
285 if (fEYlow) return fEYlow[i];
286 return -1;
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// Returns the high error along Y at point i.
291
293{
294 if (i < 0 || i >= fNpoints) return -1;
295 if (fEYhigh) return fEYhigh[i];
296 return -1;
297}
298
299////////////////////////////////////////////////////////////////////////////////
300/// Returns the combined error along Z at point i by computing the average
301/// of the lower and upper variance.
302
304{
305 if (i < 0 || i >= fNpoints) return -1;
306 if (!fEZlow && !fEZhigh) return -1;
307 Double_t elow=0, ehigh=0;
308 if (fEZlow) elow = fEZlow[i];
309 if (fEZhigh) ehigh = fEZhigh[i];
310 return TMath::Sqrt(0.5*(elow*elow + ehigh*ehigh));
311}
312
313////////////////////////////////////////////////////////////////////////////////
314/// Returns the low error along Z at point i.
315
317{
318 if (i < 0 || i >= fNpoints) return -1;
319 if (fEZlow) return fEZlow[i];
320 return -1;
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Returns the high error along Z at point i.
325
327{
328 if (i < 0 || i >= fNpoints) return -1;
329 if (fEZhigh) return fEZhigh[i];
330 return -1;
331}
332
333
334////////////////////////////////////////////////////////////////////////////////
335/// Returns the X maximum with errors.
336
338{
339 Double_t v = fX[0]+fEXhigh[0];
340 for (Int_t i=1; i<fNpoints; i++) if (fX[i]+fEXhigh[i]>v) v=fX[i]+fEXhigh[i];
341 return v;
342}
343
344
345////////////////////////////////////////////////////////////////////////////////
346/// Returns the X minimum with errors.
347
349{
350 Double_t v = fX[0]-fEXlow[0];
351 for (Int_t i=1; i<fNpoints; i++) if (fX[i]-fEXlow[i]<v) v=fX[i]-fEXlow[i];
352 return v;
353}
354
355
356////////////////////////////////////////////////////////////////////////////////
357/// Returns the Y maximum with errors.
358
360{
361 Double_t v = fY[0]+fEYhigh[0];
362 for (Int_t i=1; i<fNpoints; i++) if (fY[i]+fEYhigh[i]>v) v=fY[i]+fEYhigh[i];
363 return v;
364}
365
366
367////////////////////////////////////////////////////////////////////////////////
368/// Returns the Y minimum with errors.
369
371{
372 Double_t v = fY[0]-fEYlow[0];
373 for (Int_t i=1; i<fNpoints; i++) if (fY[i]-fEYlow[i]<v) v=fY[i]-fEYlow[i];
374 return v;
375}
376
377
378////////////////////////////////////////////////////////////////////////////////
379/// Returns the Z maximum with errors.
380
382{
383 Double_t v = fZ[0]+fEZhigh[0];
384 for (Int_t i=1; i<fNpoints; i++) if (fZ[i]+fEZhigh[i]>v) v=fZ[i]+fEZhigh[i];
385 return v;
386}
387
388
389////////////////////////////////////////////////////////////////////////////////
390/// Returns the Z minimum with errors.
391
393{
394 Double_t v = fZ[0]-fEZlow[0];
395 for (Int_t i=1; i<fNpoints; i++) if (fZ[i]-fEZlow[i]<v) v=fZ[i]-fEZlow[i];
396 return v;
397}
398
399
400////////////////////////////////////////////////////////////////////////////////
401/// Print 2D graph and errors values.
402
404{
405 for (Int_t i = 0; i < fNpoints; i++) {
406 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",
407 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]);
408 }
409}
410
411////////////////////////////////////////////////////////////////////////////////
412/// Multiply the values and errors of a TGraph2DAsymmErrors by a constant c1.
413///
414/// If option contains "x" the x values and errors are scaled
415/// If option contains "y" the y values and errors are scaled
416/// If option contains "z" the z values and errors are scaled
417/// If option contains "xyz" all three x, y and z values and errors are scaled
418
420{
422 TString opt = option; opt.ToLower();
423 if (opt.Contains("x") && GetEXlow()) {
424 for (Int_t i=0; i<GetN(); i++)
425 GetEXlow()[i] *= c1;
426 }
427 if (opt.Contains("x") && GetEXhigh()) {
428 for (Int_t i=0; i<GetN(); i++)
429 GetEXhigh()[i] *= c1;
430 }
431 if (opt.Contains("y") && GetEYlow()) {
432 for (Int_t i=0; i<GetN(); i++)
433 GetEYlow()[i] *= c1;
434 }
435 if (opt.Contains("y") && GetEYhigh()) {
436 for (Int_t i=0; i<GetN(); i++)
437 GetEYhigh()[i] *= c1;
438 }
439 if (opt.Contains("z") && GetEZlow()) {
440 for (Int_t i=0; i<GetN(); i++)
441 GetEZlow()[i] *= c1;
442 }
443 if (opt.Contains("z") && GetEZhigh()) {
444 for (Int_t i=0; i<GetN(); i++)
445 GetEZhigh()[i] *= c1;
446 }
447}
448
449////////////////////////////////////////////////////////////////////////////////
450/// Set number of points in the 2D graph.
451/// Existing coordinates are preserved.
452/// New coordinates above fNpoints are preset to 0.
453
455{
456 if (n < 0) n = 0;
457 if (n == fNpoints) return;
458 if (n > fNpoints) SetPointError(n,0,0,0,0,0,0);
459 fNpoints = n;
460}
461
462////////////////////////////////////////////////////////////////////////////////
463/// Deletes point number ipoint
464
466{
467 if (ipoint < 0) return -1;
468 if (ipoint >= fNpoints) return -1;
469
470 fNpoints--;
480
481 Int_t j = -1;
482 for (Int_t i = 0; i < fNpoints + 1; i++) {
483 if (i == ipoint) continue;
484 j++;
485 newX[j] = fX[i];
486 newY[j] = fY[i];
487 newZ[j] = fZ[i];
488 newEXlow[j] = fEXlow[i];
489 newEXhigh[j] = fEXhigh[i];
490 newEYlow[j] = fEYlow[i];
491 newEYhigh[j] = fEYhigh[i];
492 newEZlow[j] = fEZlow[i];
493 newEZhigh[j] = fEZhigh[i];
494 }
495 delete [] fX;
496 delete [] fY;
497 delete [] fZ;
498 delete [] fEXlow;
499 delete [] fEXhigh;
500 delete [] fEYlow;
501 delete [] fEYhigh;
502 delete [] fEZlow;
503 delete [] fEZhigh;
504 fX = newX;
505 fY = newY;
506 fZ = newZ;
513 fSize = fNpoints;
514 if (fHistogram) {
515 delete fHistogram;
516 fHistogram = nullptr;
517 fDelaunay = nullptr;
518 }
519 return ipoint;
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// Set x, y and z values for point number i
524
526{
527 if (i < 0) return;
528 if (i >= fNpoints) {
529 // re-allocate the object
530 Double_t *savex = new Double_t[i+1];
531 Double_t *savey = new Double_t[i+1];
532 Double_t *savez = new Double_t[i+1];
533 Double_t *saveexl = new Double_t[i+1];
534 Double_t *saveexh = new Double_t[i+1];
535 Double_t *saveeyl = new Double_t[i+1];
536 Double_t *saveeyh = new Double_t[i+1];
537 Double_t *saveezl = new Double_t[i+1];
538 Double_t *saveezh = new Double_t[i+1];
539 if (fNpoints > 0) {
540 memcpy(savex, fX, fNpoints*sizeof(Double_t));
541 memcpy(savey, fY, fNpoints*sizeof(Double_t));
542 memcpy(savez, fZ, fNpoints*sizeof(Double_t));
549 }
550 if (fX) delete [] fX;
551 if (fY) delete [] fY;
552 if (fZ) delete [] fZ;
553 if (fEXlow) delete [] fEXlow;
554 if (fEXhigh) delete [] fEXhigh;
555 if (fEYlow) delete [] fEYlow;
556 if (fEYhigh) delete [] fEYhigh;
557 if (fEZlow) delete [] fEZlow;
558 if (fEZhigh) delete [] fEZhigh;
559 fX = savex;
560 fY = savey;
561 fZ = savez;
562 fEXlow = saveexl;
564 fEYlow = saveeyl;
566 fEZlow = saveezl;
568 fNpoints = i+1;
569 }
570 fX[i] = x;
571 fY[i] = y;
572 fZ[i] = z;
573}
574
575
576////////////////////////////////////////////////////////////////////////////////
577/// Saves primitive as a C++ statement(s) on output stream out
578
580{
581 TString arrx = SavePrimitiveVector(out, "gr2daerr_x", fNpoints, fX, kTRUE);
582 TString arry = SavePrimitiveVector(out, "gr2daerr_y", fNpoints, fY);
583 TString arrz = SavePrimitiveVector(out, "gr2daerr_z", fNpoints, fZ);
584 TString arrexl = SavePrimitiveVector(out, "gr2daerr_exl", fNpoints, fEXlow);
585 TString arrexh = SavePrimitiveVector(out, "gr2daerr_exh", fNpoints, fEXhigh);
586 TString arreyl = SavePrimitiveVector(out, "gr2daerr_eyl", fNpoints, fEYlow);
587 TString arreyh = SavePrimitiveVector(out, "gr2daerr_eyh", fNpoints, fEYhigh);
588 TString arrezl = SavePrimitiveVector(out, "gr2daerr_ezl", fNpoints, fEZlow);
589 TString arrezh = SavePrimitiveVector(out, "gr2daerr_ezh", fNpoints, fEZhigh);
590
592 out, Class(), "gr2daerr",
594 "%d, %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data()",
595 fNpoints, arrx.Data(), arry.Data(), arrz.Data(), arrexl.Data(), arrexh.Data(), arreyl.Data(), arreyh.Data(),
596 arrezl.Data(), arrezh.Data()),
597 kFALSE);
598
599 if (strcmp(GetName(), "Graph2D"))
600 out << " gr2daerr->SetName(\"" << TString(GetName()).ReplaceSpecialCppChars() << "\");\n";
601
602 TString title = GetTitle();
603 if (fHistogram)
604 title = TString(fHistogram->GetTitle()) + ";" + fHistogram->GetXaxis()->GetTitle() + ";" +
606
607 out << " gr2daerr->SetTitle(\"" << title.ReplaceSpecialCppChars() << "\");\n";
608
609 if (!fDirectory)
610 out << " gr2daerr->SetDirectory(nullptr);\n";
611
612 SaveFillAttributes(out, "gr2daerr", 0, 1001);
613 SaveLineAttributes(out, "gr2daerr", 1, 1, 1);
614 SaveMarkerAttributes(out, "gr2daerr", 1, 1, 1);
615
616 TH1::SavePrimitiveFunctions(out, "gr2daerr", fFunctions);
617
618 SavePrimitiveDraw(out, "gr2daerr", option);
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// Set ex, ey and ez values for point number i
623
625{
626 if (i < 0) return;
627 if (i >= fNpoints) {
628 // re-allocate the object
630 }
631 fEXlow[i] = exl;
632 fEXhigh[i] = exh;
633 fEYlow[i] = eyl;
634 fEYhigh[i] = eyh;
635 fEZlow[i] = ezl;
636 fEZhigh[i] = ezh;
637}
638
639
640////////////////////////////////////////////////////////////////////////////////
641/// Stream an object of class TGraph2DAsymmErrors.
642
644{
645 if (b.IsReading()) {
647 Version_t R__v = b.ReadVersion(&R__s, &R__c);
648 b.ReadClassBuffer(TGraph2DAsymmErrors::Class(), this, R__v, R__s, R__c);
649 } else {
650 b.WriteClassBuffer(TGraph2DAsymmErrors::Class(),this);
651 }
652}
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
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:238
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:274
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:556
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:574
TAxis * GetXaxis()
Definition TH1.h:572
TAxis * GetYaxis()
Definition TH1.h:573
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:7471
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:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1121
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:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
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:673