00001 #include "TGraphAsymmErrorsFix.h" 00002 00003 using namespace std; 00004 00005 void TGraphAsymmErrorsFix::Set(Int_t n) throw() { 00006 if (n < 0) n = 0; 00007 if (n == fNpoints) return; 00008 00009 TGraph::Set(n); 00010 00011 Double_t *exh=0, *exl=0, *eyh=0, *eyl=0; 00012 if (n > 0) { 00013 exh = new Double_t[n]; 00014 exl = new Double_t[n]; 00015 eyh = new Double_t[n]; 00016 eyl = new Double_t[n]; 00017 } 00018 Int_t i; 00019 for (i=0; i<fNpoints && i<n;i++) { 00020 if (fEXlow) exl[i] = fEXlow[i]; 00021 if (fEXhigh) exh[i] = fEXhigh[i]; 00022 if (fEYlow) eyl[i] = fEYlow[i]; 00023 if (fEYhigh) eyh [i] = fEYhigh[i]; 00024 } 00025 for (i=fNpoints; i<n;i++) { 00026 exh[i] = 0; 00027 exl[i] = 0; 00028 eyh[i] = 0; 00029 eyl[i] = 0; 00030 } 00031 delete [] fEXlow; 00032 delete [] fEXhigh; 00033 delete [] fEYlow; 00034 delete [] fEYhigh; 00035 00036 fEXhigh = exh; 00037 fEXlow = exl; 00038 fEYhigh = eyh; 00039 fEYlow = eyl; 00040 }