183 for (Int_t i=0; i<s.
fMaxdim; i++)
206 if (s.
fX)
fX=
new TArrayD(
fN);
207 if (s.
fY)
fY=
new TArrayD(
fN);
208 if (s.
fZ)
fZ=
new TArrayD(
fN);
209 if (s.
fT)
fT=
new TArrayD(
fN);
212 for (Int_t i=0; i<
fDim; i++)
220 for (Int_t j=0; j<
fDim; j++)
230 for (Int_t i=0; i<
fN; i++)
268 for (Int_t i=0; i<
fDim; i++)
276 for (Int_t j=0; j<
fDim; j++)
356 cout <<
" *NcSample::SetNames* Names not modified, since data were already present." << endl;
379 cout <<
" *NcSample::Enter* Error : Not a 1-dim sample." << endl;
405 if (
fX->GetSize() <
fN)
fX->Set(2*
fN);
425 cout <<
" *NcSample::Remove* Error : Not a 1-dim sample." << endl;
438 for (Int_t i=0; i<=
fN; i++)
441 if (fabs(x-val)>1.e-10)
continue;
443 for (Int_t j=i+1; j<=
fN; j++)
473 cout <<
" *NcSample::Enter* Error : Not a 2-dim sample." << endl;
507 if (
fX->GetSize() <
fN)
fX->Set(2*
fN);
510 if (
fY->GetSize() <
fN)
fY->Set(2*
fN);
530 cout <<
" *NcSample::Remove* Error : Not a 2-dim sample." << endl;
547 for (Int_t i=0; i<=
fN; i++)
550 if (fabs(x-val)>1.e-10)
continue;
552 if (fabs(y-val)>1.e-10)
continue;
554 for (Int_t j=i+1; j<=
fN; j++)
585 cout <<
" *NcSample::Enter* Error : Not a 3-dim sample." << endl;
629 if (
fX->GetSize() <
fN)
fX->Set(2*
fN);
632 if (
fY->GetSize() <
fN)
fY->Set(2*
fN);
635 if (
fZ->GetSize() <
fN)
fZ->Set(2*
fN);
655 cout <<
" *NcSample::Remove* Error : Not a 3-dim sample." << endl;
678 for (Int_t i=0; i<=
fN; i++)
681 if (fabs(x-val)>1.e-10)
continue;
683 if (fabs(y-val)>1.e-10)
continue;
685 if (fabs(z-val)>1.e-10)
continue;
687 for (Int_t j=i+1; j<=
fN; j++)
716 cout <<
" *NcSample::Enter* Error : Not a 4-dim sample." << endl;
772 if (
fX->GetSize() <
fN)
fX->Set(2*
fN);
775 if (
fY->GetSize() <
fN)
fY->Set(2*
fN);
778 if (
fZ->GetSize() <
fN)
fZ->Set(2*
fN);
781 if (
fT->GetSize() <
fN)
fT->Set(2*
fN);
801 cout <<
" *NcSample::Remove* Error : Not a 4-dim sample." << endl;
832 for (Int_t i=0; i<=
fN; i++)
835 if (fabs(x-val)>1.e-10)
continue;
837 if (fabs(y-val)>1.e-10)
continue;
839 if (fabs(z-val)>1.e-10)
continue;
841 if (fabs(t-val)>1.e-10)
continue;
843 for (Int_t j=i+1; j<=
fN; j++)
885 if (
fDim<1 ||
fN<=0 || i<1 || i>
fN)
return;
887 if (mode && (j<1 || j>
fDim))
889 cout <<
" *NcSample::RemoveEntry* Error : Invalide argument j=" << j << endl;
895 cout <<
" *NcSample::RemoveEntry* Error : Storage of data entries was not activated." << endl;
965 for (Int_t m=i; m<=j; m++)
988 for (Int_t m=i; m<=j; m++)
1011 if (mode && (i<1 || i>
fDim))
1013 cout <<
" *NcSample::Order* Error : Invalide argument i=" << i << endl;
1019 cout <<
" *NcSample::Order* Error : Dimension less than 1." << endl;
1025 cout <<
" *NcSample::Order* Error : Storage of data entries was not activated." << endl;
1039 Int_t iword=10*abs(mode)+i;
1040 if (mode<0) iword*=-1;
1073 for (Int_t j=0; j<
fN; j++)
1075 if (i==1) val=
fX->At(j);
1076 if (i==2) val=
fY->At(j);
1077 if (i==3) val=
fZ->At(j);
1078 if (i==4) val=
fT->At(j);
1087 for (Int_t j=0; j<
fN; j++)
1089 if (i==1) val=
fX->At(j);
1090 if (i==2) val=
fY->At(j);
1091 if (i==3) val=
fZ->At(j);
1092 if (i==4) val=
fT->At(j);
1103 for (Int_t k=0; k<j; k++)
1105 if (mode>0 && val>=
fArr->At(k))
continue;
1106 if (mode<0 && val<=fArr->At(k))
continue;
1108 for (Int_t m=j-1; m>=k; m--)
1139 for (Int_t i=0; i<
fMaxdim; i++)
1141 if (
fNames[i]==name) idx=i+1;
1165 for (Int_t k=0; k<
fDim; k++)
1179 for (Int_t i=0; i<
fDim; i++)
1181 for (Int_t j=0; j<
fDim; j++)
1186 if (rmsij != 0)
fCor[i][j]=
fCov[i][j]/rmsij;
1225 cout <<
" *NcSample::GetVariableName* Error : Invalid index " << i << endl;
1245 cout <<
" *NcSample::GetSum* Error : Invalid index " << i << endl;
1276 cout <<
" *NcSample::GetMean* Error : Invalid index " << i << endl;
1310 cout <<
" *NcSample::GetRMS* Error : Invalid index " << i << endl;
1315 Double_t val=
fSum2[i-1][i-1]/float(
fN);
1316 if (val>=0) rms=sqrt(val);
1351 cout <<
" *NcSample::GetVar* Error : Invalid index " << i << endl;
1390 cout <<
" *NcSample::GetSigma* Error : Invalid index " << i << endl;
1395 if (model) val=
fSigma[i-1];
1424 if (i<1 || i>
fDim || j<1 || j>
fDim)
1426 cout <<
" *NcSample::GetCov* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
1430 return fCov[i-1][j-1];
1455 if (i<1 || i>
fDim || j<1 || j>
fDim)
1457 cout <<
" *NcSample::GetCor* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
1461 return fCor[i-1][j-1];
1495 const char* name=GetName();
1496 const char* title=GetTitle();
1498 cout <<
" *" << ClassName() <<
"::Data*";
1499 if (strlen(name)) cout <<
" Info for sample Name : " << name;
1500 if (strlen(title)) cout <<
" Title : " << title;
1502 cout <<
" Access to the individual data entries is";
1503 if (!
fStore) cout <<
" not";
1504 cout <<
" possible (StoreMode=" <<
fStore <<
")" << endl;
1510 cout <<
" *** At entering data the dynamic FIFO storage was limited to " <<
fNmax <<
" entries";
1514 cout <<
" *** At entering new data the dynamic FIFO storage will be limited to " <<
fNmax <<
" entries";
1516 if (!
fMoveVariable) cout <<
" using the order of original entering.";
1523 if (i<0 || i>
fDim || j<0 || j>
fDim)
1525 cout <<
" Inconsistent input i=" << i <<
" and j=" << j <<
" for dimension " <<
fDim << endl;
1528 if (!i && !j) cout <<
" Statistics and correlations of all variables";
1529 if (i && !j) cout <<
" Statistics of variable " << i;
1530 if (!i && j) cout <<
" Statistics of variable " << j;
1531 if (i && j) cout <<
" Correlation statistics of the variables " << i <<
" and " << j;
1536 cout <<
" No data has been entered." << endl;
1544 for (Int_t iv=1; iv<=
fDim; iv++)
1552 for (Int_t iv=1; iv<=
fDim; iv++)
1554 for (Int_t jv=iv+1;jv<=
fDim; jv++)
1562 if (i && !j)
List(i);
1565 if (!i && j)
List(j);
1568 if (i && j)
List(i,j);
1623 cout <<
" *NcSample::ListOrdered* Error : Storage of data entries was not activated." << endl;
1629 cout <<
" *NcSample::ListOrdered* No entries were stored." << endl;
1635 cout <<
" *NcSample::ListOrdered* Error : Dimension less than 1." << endl;
1639 if (mode && (i<1 || i>
fDim))
1641 cout <<
" *NcSample::ListOrdered* Error : Invalid argument i=" << i << endl;
1647 const char* name=GetName();
1648 const char* title=GetTitle();
1650 cout <<
" *NcSample::ListOrdered* Ordered listing for the sample";
1651 if (strlen(name)) cout <<
" Name : " << name;
1652 if (strlen(title)) cout <<
" Title : " << title;
1656 cout <<
" *** At entering data the dynamic FIFO storage was limited to " <<
fNmax <<
" entries";
1657 if (!
fMoveVariable) cout <<
" using the order of original entering.";
1663 cout <<
" Listing of the stored entries in";
1664 if (!mode) cout <<
" order of original entering." << endl;
1665 if (mode<0) cout <<
" decreasing order of variable : " << i <<
" (" <<
fNames[i-1] <<
")" << endl;
1666 if (mode>0) cout <<
" increasing order of variable : " << i <<
" (" <<
fNames[i-1] <<
")" << endl;
1667 if (mode) cout <<
" The number between brackets indicates the original data entry number." << endl;
1670 for (Int_t j=0; j<
fN; j++)
1674 if (index<0 || index>=
fN)
continue;
1676 cout <<
" Index : " << (j+1);
1677 if (mode) cout <<
" (" << (index+1) <<
") ";
1678 cout <<
" " <<
fNames[0] <<
"=" <<
fX->At(index);
1679 if (
fDim>1) cout <<
" " <<
fNames[1] <<
"=" <<
fY->At(index);
1680 if (
fDim>2) cout <<
" " <<
fNames[2] <<
"=" <<
fZ->At(index);
1681 if (
fDim>3) cout <<
" " <<
fNames[3] <<
"=" <<
fT->At(index);
1718 cout <<
" *NcSample::List(i)* Error : Invalid index " << i << endl;
1722 cout <<
" Variable " <<
fNames[i-1] <<
" : N=" <<
fN;
1723 cout <<
" Sum=" <<
fSum[i-1] <<
" Mean=" <<
fMean[i-1];
1724 cout <<
" Deviation(rms)=" <<
fRMSdev[i-1] <<
" Sigma=" <<
fSigma[i-1];
1733 cout <<
" Spread(w.r.t. median)=" <<
GetSpread(i,0) <<
" Spread(w.r.t. mean)=" <<
GetSpread(i,1);
1748 if (i<1 || i>
fDim || j<1 || j>
fDim)
1750 cout <<
" *NcSample::List(i,j)* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
1755 cout <<
" Correlation(coefficient)=" <<
fCor[i-1][j-1] <<
" Covariance=" <<
fCov[i-1][j-1] << endl;
1802 cout <<
" Storage mode can only be set before first data." << endl;
1804 else if ((!mode && nmax) || mode<0 || nmax<0 || abs(i)>
fDim)
1806 cout <<
" Inconsistent input : mode=" << mode <<
" nmax=" << nmax <<
" i=" << i << endl;
1812 if (mode==1) mode=100;
1893 cout <<
" *NcSample::GetQuantile* Error : Invalid index " << i << endl;
1899 cout <<
" *NcSample::GetQuantile* Error : Storage of data entries was not activated." << endl;
1903 if (
fN<=0)
return 0;
1905 if (f<0 || f>1)
return 0;
1907 Double_t quantile=0;
1911 if (i==1) quantile=
fX->At(0);
1912 if (i==2) quantile=
fY->At(0);
1913 if (i==3) quantile=
fZ->At(0);
1914 if (i==4) quantile=
fT->At(0);
1925 Double_t rindex=double(
fN)*f;
1926 Int_t index=int(rindex);
1929 quantile=
fArr->At(index);
1933 quantile=(
fArr->At(index-1)+
fArr->At(index))/2.;
2029 if (model<0 || model>2)
2031 cout <<
" *NcSample::GetSpread* Error : Unsupported parameter model=" << model << endl;
2037 cout <<
" *NcSample::GetSpread* Error : Invalid index " << i << endl;
2043 cout <<
" *NcSample::GetSpread* Error : Storage of data entries was not activated." << endl;
2047 if (
fN<=1)
return -1;
2050 if (model==1) central=
GetMean(i);
2051 if (model==2) central=vref;
2054 for (Int_t j=0; j<
fN; j++)
2056 spread+=fabs(central-(
fArr->At(j)));
2059 spread=spread/float(
fN);
2102 cout <<
" *NcSample::GetMinimum* Error : Invalid index " << i << endl;
2110 cout <<
" *NcSample::GetMinimum* Error : Storage of data entries was not activated." << endl;
2114 if (
fN<=0)
return 0;
2118 if (i==1) min=
fX->At(0);
2119 if (i==2) min=
fY->At(0);
2120 if (i==3) min=
fZ->At(0);
2122 for (Int_t k=1; k<
fN; k++)
2124 if (i==1 &&
fX->At(k)<min) min=
fX->At(k);
2125 if (i==2 &&
fY->At(k)<min) min=
fY->At(k);
2126 if (i==3 &&
fZ->At(k)<min) min=
fZ->At(k);
2158 cout <<
" *NcSample::GetMaximum* Error : Invalid index " << i << endl;
2166 cout <<
" *NcSample::GetMaximum* Error : Storage of data entries was not activated." << endl;
2170 if (
fN<=0)
return 0;
2174 if (i==1) max=
fX->At(0);
2175 if (i==2) max=
fY->At(0);
2176 if (i==3) max=
fZ->At(0);
2178 for (Int_t k=1; k<
fN; k++)
2180 if (i==1 &&
fX->At(k)>max) max=
fX->At(k);
2181 if (i==2 &&
fY->At(k)>max) max=
fY->At(k);
2182 if (i==3 &&
fZ->At(k)>max) max=
fZ->At(k);
2227 if (!histo)
return 0;
2229 if (f<0 || f>1)
return 0;
2233 Double_t quantile=0;
2240 for (Int_t i=1; i<=histo->GetNbinsX(); i++)
2242 val=histo->GetBinContent(i);
2257 histo->ComputeIntegral();
2258 Int_t nq=histo->GetQuantiles(2,q,p);
2266 Int_t mbin=histo->FindBin(q[0]);
2267 xlow=histo->GetBinCenter(mbin);
2268 mbin=histo->FindBin(q[1]);
2269 xup=histo->GetBinCenter(mbin);
2273 quantile=(xlow+xup)/2.;
2326 if (model<0 || model>2)
2328 cout <<
" *NcSample::GetSpread* Error : Unsupported parameter model=" << model << endl;
2332 if (!histo)
return -1;
2334 Int_t nbins=histo->GetNbinsX();
2336 if (nbins<1)
return -1;
2345 for (Int_t i=1; i<=nbins; i++)
2347 val=histo->GetBinContent(i);
2355 if (model==1) central=histo->GetMean();
2356 if (model==2) central=vref;
2360 for (Int_t jbin=1; jbin<=nbins; jbin++)
2362 x=histo->GetBinCenter(jbin);
2363 y=histo->GetBinContent(jbin);
2366 spread+=fabs(x-central)*y;
2370 if (ysum>0) spread=spread/ysum;
2396 TString name=GetName();
2400 cout <<
" *NcSample::GetEntry* Error : Storage mode not activated." << endl;
2406 cout <<
" *NcSample::GetEntry* Error : Invalid index number i=" << i;
2407 if (name!=
"") printf(
" for NcSample %-s",name.Data());
2414 cout <<
" *NcSample::GetEntry* Error : Invalid variable number j=" << j;
2415 if (name!=
"") printf(
" for NcSample %-s",name.Data());
2420 if (mode && (k<1 || k>
fDim))
2422 cout <<
" *NcSample::GetEntry* Error : Invalid argument k=" << k;
2423 if (name!=
"") printf(
" for NcSample %-s",name.Data());
2439 if (j==1) value=
fX->At(index);
2440 if (j==2) value=
fY->At(index);
2441 if (j==3) value=
fZ->At(index);
2442 if (j==4) value=
fT->At(index);
2495 cout <<
" *NcSample::GetSubset* Error : Pointer for output NcSample object is zero." << endl;
2503 cout <<
" *NcSample::GetSubset* Error : Storage mode not activated." << endl;
2507 if (ifirst<1 || ifirst>
fN || ilast>
fN || ilast<ifirst)
2509 cout <<
" *NcSample::GetSubset* Error : Invalid input ifirst=" << ifirst <<
" ilast=" << ilast << endl;
2513 if (mode && (k<1 || k>
fDim))
2515 cout <<
" *NcSample::GetSubset* Error : Invalid argument k=" << k << endl;
2522 Double_t* values=
new Double_t[
fDim];
2523 for (Int_t i=ifirst; i<=ilast; i++)
2525 for (Int_t j=1; j<=
fDim; j++)
2530 if (
fDim==2) s->
Enter(values[0],values[1]);
2531 if (
fDim==3) s->
Enter(values[0],values[1],values[2]);
2532 if (
fDim==4) s->
Enter(values[0],values[1],values[2],values[3]);
2590 if (order>0) order=1;
2591 if (order<0) order=-1;
2595 sdt.SetName(
"DtSample");
2600 if (nc<1)
return sdt;
2603 if (nen<=nc)
return sdt;
2607 str.Form(
"Interval sampling for variable %-s between %-i consecutive entries (nc=%-i)",varname.Data(),nc+1,nc);
2608 sdt.SetNameTitle(
"DtSample",str);
2614 for (Int_t ien=1; ien<=nen; ien++)
2616 if (ien+nc>nen)
break;
2700 TString s=
"Sampling Histogram for NcSample ";
2702 s+=
";Sampling number;";
2705 TString sf=f->GetExpFormula(
"p");
2706 sf.ReplaceAll(
"x",
fNames[i-1]);
2714 TH1D hist(
"",s,
fN,0,
fN);
2718 cout <<
" *NcSample::GetSamplingHistogram* Error : Storage mode has not been activated." << endl;
2724 cout <<
" *NcSample::GetSamplingHistogram* Error : Invalid index encountered i=" << i << endl;
2729 for (Int_t ip=1; ip<=
fN; ip++)
2732 if (f) y=f->Eval(y);
2733 hist.SetBinContent(ip,y);
2809 TString s=
"1D Histogram for NcSample ";
2816 s+=
" weighted by : ";
2819 TString sf=f->GetExpFormula(
"p");
2820 sf.ReplaceAll(
"x",
fNames[j-1]);
2833 if (nbx) dx=(xup-xlow)/
double(nbx);
2838 TH1D hist(
"",s.Data(),nbx,xlow,xup);
2843 cout <<
" *NcSample::Get1DHistogram* Error : Storage mode has not been activated." << endl;
2849 cout <<
" *NcSample::Get1DHistogram* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
2855 for (Int_t ip=1; ip<=
fN; ip++)
2861 if (f) y=f->Eval(y);
2914 TString s=
"2D Histogram for NcSample ";
2923 s+=
" weighted by : ";
2926 TString sf=f->GetExpFormula(
"p");
2927 sf.ReplaceAll(
"x",
fNames[k-1]);
2942 if (nbx) dx=(xup-xlow)/
double(nbx);
2944 if (nby) dy=(yup-ylow)/
double(nby);
2950 TH2D hist(
"",s.Data(),nbx,xlow,xup,nby,ylow,yup);
2952 hist.SetMarkerStyle(20);
2953 hist.SetMarkerSize(1);
2957 cout <<
" *NcSample::Get2DHistogram* Error : Storage mode has not been activated." << endl;
2963 cout <<
" *NcSample::Get2DHistogram* Error : Invalid index encountered i=" << i <<
" j=" << j <<
" k=" << k << endl;
2970 for (Int_t ip=1; ip<=
fN; ip++)
2977 if (f) z=f->Eval(z);
3032 TString s=
"3D Histogram for NcSample ";
3039 TString sf=f->GetExpFormula(
"p");
3040 sf.ReplaceAll(
"x",
fNames[m-1]);
3064 if (nbx) dx=(xup-xlow)/
double(nbx);
3066 if (nby) dy=(yup-ylow)/
double(nby);
3068 if (nbz) dz=(zup-zlow)/
double(nbz);
3075 TH3D hist(
"",s.Data(),nbx,xlow,xup,nby,ylow,yup,nbz,zlow,zup);
3077 hist.SetMarkerStyle(20);
3078 hist.SetMarkerSize(1);
3082 cout <<
" *NcSample::Get3DHistogram* Error : Storage mode has not been activated." << endl;
3088 cout <<
" *NcSample::Get2DHistogram* Error : Invalid index encountered i=" << i <<
" j=" << j <<
" k=" << k <<
" m=" << m << endl;
3096 for (Int_t ip=1; ip<=
fN; ip++)
3104 if (f) t=f->Eval(t);
3116TH3D
NcSample::Get3DHistogram(TString nameA,TString nameB,TString nameC,TString nameD,Bool_t sumw2,Int_t nbx,Int_t nby,Int_t nbz,TF1* f)
3157 gr.SetName(
"NcSample");
3161 cout <<
" *NcSample::GetGraph* Error : Storage mode has not been activated." << endl;
3167 cout <<
" *NcSample::GetGraph* Error : Invalid index encountered i=" << i << endl;
3173 for (Int_t ip=0; ip<
fN; ip++)
3177 if (f) y=f->Eval(y);
3178 gr.SetPoint(ip,x,y);
3181 TString s=
"TGraph for NcSample ";
3183 s+=
" : X-axis=Sampling number ";
3188 sf=f->GetExpFormula(
"p");
3189 sf.ReplaceAll(
"x",
fNames[i-1]);
3192 s+=
";Sampling number;";
3195 gr.SetTitle(s.Data());
3197 gr.SetMarkerStyle(20);
3198 gr.SetMarkerSize(1);
3199 gr.SetDrawOption(
"AP");
3255 gr.SetName(
"NcSample");
3259 cout <<
" *NcSample::GetGraph* Error : Storage mode has not been activated." << endl;
3263 if (i<1 || i>
fDim || j<1 || j>
fDim)
3265 cout <<
" *NcSample::GetGraph* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
3271 for (Int_t ip=0; ip<
fN; ip++)
3275 if (f) y=f->Eval(y);
3276 gr.SetPoint(ip,x,y);
3279 TString s=
"TGraph for NcSample ";
3287 sf=f->GetExpFormula(
"p");
3288 sf.ReplaceAll(
"x",
fNames[j-1]);
3296 gr.SetTitle(s.Data());
3298 gr.SetMarkerStyle(20);
3299 gr.SetMarkerSize(1);
3300 gr.SetDrawOption(
"AP");
3389 cout <<
" *NcSample::GetGraphErrors* Error : No input Graph is specified." << endl;
3393 TString name=gr->GetName();
3398 if ((ix || iy) && !
fStore)
3400 cout <<
" *NcSample::GetGraphErrors* Error : Storage mode has not been activated." << endl;
3404 if (ix<0 || ix>
fDim || iy<0 || iy>
fDim)
3406 cout <<
" *NcSample::GetGraphErros* Error : Invalid index encountered ix=" << ix <<
" iy=" << iy << endl;
3411 Int_t np=gr->GetN();
3415 cout <<
" *NcSample::GetGraphErrors* Error : Input Graph does not contain any data points." << endl;
3419 if ((ix || iy) && np!=
fN)
3421 cout <<
" *NcSample::GetGraphErrors* Error : Entries don't match Nsample=" <<
fN <<
" Ngraph=" << np << endl;
3429 for (Int_t ip=0; ip<np; ip++)
3431 gr->GetPoint(ip,x,y);
3458 gre.SetPoint(ip,x,y);
3459 gre.SetPointError(ip,ex,ey);
3472 sfx+=fx->GetExpFormula(
"p");
3473 if (ix) sfx.ReplaceAll(
"x",
fNames[ix-1]);
3488 sfy+=fy->GetExpFormula(
"p");
3491 sfy.ReplaceAll(
"x",
fNames[iy-1]);
3495 sfy.ReplaceAll(
"x",
"y");
3501 TString s=
"TGraphErrors for Graph : ";
3510 axis=gr->GetXaxis();
3514 s+=axis->GetTitle();
3516 axis=gr->GetYaxis();
3520 s+=axis->GetTitle();
3523 gre.SetTitle(s.Data());
3525 gre.SetMarkerStyle(20);
3526 gre.SetMarkerSize(0.5);
3527 gre.SetDrawOption(
"AP");
3626 cout <<
" *NcSample::GetGraph* Error : Storage mode has not been activated." << endl;
3632 cout <<
" *NcSample::GetGraph* Error : No data entries are stored." << endl;
3636 if (i<1 || i>
fDim || j<1 || j>
fDim || (mode && (k<1 || k>
fDim)))
3638 cout <<
" *NcSample::GetGraph* Error : Invalid index encountered i=" << i <<
" j=" << j <<
" k=" << k << endl;
3648 xlow-=0.1*fabs(xlow);
3650 ylow-=0.1*fabs(ylow);
3659 fGraphT=
new TGraphTime(
fN,xlow,ylow,xup,yup);
3666 for (Int_t istep=0; istep<
fN; istep++)
3668 if (!smp) jpstart=istep;
3669 for (Int_t jp=jpstart; jp<=istep; jp++)
3673 m=
new TMarker(x,y,20);
3674 m->SetMarkerSize(1);
3679 TString s=
"TGraphTime for NcSample ";
3685 fGraphT->SetNameTitle(
"",s.Data());
3753 gr.SetName(
"NcSample");
3757 cout <<
" *NcSample::GetGraph* Error : Storage mode has not been activated." << endl;
3763 cout <<
" *NcSample::GetGraph* Error : No data entries are stored." << endl;
3769 cout <<
" *NcSample::GetGraph* Error : Invalid index encountered i=" << i <<
" j=" << j <<
" k=" << k << endl;
3776 for (Int_t ip=0; ip<
fN; ip++)
3781 if (f) z=f->Eval(z);
3782 gr.SetPoint(ip,x,y,z);
3785 TString s=
"TGraph2D for NcSample ";
3795 sf=f->GetExpFormula(
"p");
3796 sf.ReplaceAll(
"x",
fNames[k-1]);
3806 gr.SetTitle(s.Data());
3808 gr.SetMarkerStyle(20);
3809 gr.SetMarkerSize(1);
3810 gr.SetDrawOption(
"P");
3865 return GetGraph(nameA,nameB,nameC,&func);
3921 cout <<
" *NcSample::GetGraph2DErrors* Error : No input Graph is specified." << endl;
3925 TString name=gr->GetName();
3930 if ((ix || iy || iz) && !
fStore)
3932 cout <<
" *NcSample::GetGraph2DErrors* Error : Storage mode has not been activated." << endl;
3936 if (ix<0 || ix>
fDim || iy<0 || iy>
fDim || iz<0 || iz>
fDim)
3938 cout <<
" *NcSample::GetGraph2DErrors* Error : Invalid index encountered ix=" << ix <<
" iy=" << iy <<
" iz=" << iz << endl;
3943 Int_t np=gr->GetN();
3947 cout <<
" *NcSample::GetGraph2DErrors* Error : Input Graph does not contain any data points." << endl;
3951 if ((ix || iy || iz) && np!=
fN)
3953 cout <<
" *NcSample::GetGraph2DErrors* Error : Entries don't match Nsample=" <<
fN <<
" Ngraph=" << np << endl;
3957 Double_t* xarr=gr->GetX();
3958 Double_t* yarr=gr->GetY();
3959 Double_t* zarr=gr->GetZ();
3966 for (Int_t ip=0; ip<np; ip++)
4010 gre.SetPoint(ip,x,y,z);
4011 gre.SetPointError(ip,ex,ey,ez);
4024 sfx+=fx->GetExpFormula(
"p");
4025 if (ix) sfx.ReplaceAll(
"x",
fNames[ix-1]);
4040 sfy+=fy->GetExpFormula(
"p");
4043 sfy.ReplaceAll(
"x",
fNames[iy-1]);
4047 sfy.ReplaceAll(
"x",
"y");
4063 sfz+=fz->GetExpFormula(
"p");
4066 sfz.ReplaceAll(
"x",
fNames[iz-1]);
4070 sfz.ReplaceAll(
"x",
"z");
4076 TString s=
"TGraphErrors for Graph : ";
4087 axis=gr->GetXaxis();
4091 s+=axis->GetTitle();
4093 axis=gr->GetYaxis();
4097 s+=axis->GetTitle();
4099 axis=gr->GetZaxis();
4103 s+=axis->GetTitle();
4106 gre.SetTitle(s.Data());
4108 gre.SetMarkerStyle(20);
4109 gre.SetMarkerSize(0.5);
4110 gre.SetDrawOption(
"err P");
4187 gr.SetName(
"NcSample");
4189 if (!f && (j<1 || j>
fDim))
return gr;
4193 cout <<
" *NcSample::GetQQplot* Error : Storage mode has not been activated." << endl;
4199 cout <<
" *NcSample::GetQQplot* Error : No data entries are stored." << endl;
4203 if (i<1 || i>
fDim || (!f && (j<1 || j>
fDim)))
4205 cout <<
" *NcSample::GetQQplot* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
4210 if (i==1) arri=
fX->GetArray();
4211 if (i==2) arri=
fY->GetArray();
4212 if (i==3) arri=
fZ->GetArray();
4213 if (i==4) arri=
fT->GetArray();
4218 if (j==1) arrj=
fX->GetArray();
4219 if (j==2) arrj=
fY->GetArray();
4220 if (j==3) arrj=
fZ->GetArray();
4221 if (j==4) arrj=
fT->GetArray();
4223 if (arri && arrj) gr=TGraphQQ(
fN,arri,
fN,arrj);
4227 if (arri) gr=TGraphQQ(
fN,arri,f);
4230 TString s=
"QQ-plot (TGraphQQ) for NcSample ";
4237 TString sf=f->GetExpFormula(
"p");
4238 sf.ReplaceAll(
"x",
"a");
4249 gr.SetTitle(s.Data());
4251 gr.SetMarkerStyle(20);
4252 gr.SetMarkerSize(1);
4293 printf(
" *%-s::Load* Error : No TGraph specified ==> No action taken. \n",ClassName());
4297 if (!clr &&
fDim!=2)
4299 printf(
" *%-s::Load* Error : Dimension %-i does not match a TGraph. \n",ClassName(),
fDim);
4305 Int_t npoints=g->GetN();
4306 Double_t* x=g->GetX();
4307 Double_t* y=g->GetY();
4309 if (!x || !y || npoints<1)
return;
4311 for (Int_t i=0; i<npoints; i++)
4334 printf(
" *%-s::Load* Error : No TGraph2D specified ==> No action taken. \n",ClassName());
4338 if (!clr &&
fDim!=3)
4340 printf(
" *%-s::Load* Error : Dimension %-i does not match a TGraph2D. \n",ClassName(),
fDim);
4346 Int_t npoints=g->GetN();
4347 Double_t* x=g->GetX();
4348 Double_t* y=g->GetY();
4349 Double_t* z=g->GetZ();
4351 if (!x || !y || !z || npoints<1)
return;
4353 for (Int_t i=0; i<npoints; i++)
4355 Enter(x[i],y[i],z[i]);
4376 printf(
" *%-s::Load* Error : No histogram specified ==> No action taken. \n",ClassName());
4380 Int_t hdim=h->GetDimension();
4384 printf(
" *%-s::Load* Error : Histograms of dimension %-i are not supported. \n",ClassName(),hdim);
4388 if (!clr &&
fDim!=1)
4390 printf(
" *%-s::Load* Error : Dimension %-i does not match a 1-dimensional histogram. \n",ClassName(),
fDim);
4396 Int_t nbins=h->GetNbinsX();
4399 for (Int_t i=1; i<=nbins; i++)
4401 val=h->GetBinContent(i);
4423 printf(
" *%-s::Load* Error : No data array specified ==> No action taken. \n",ClassName());
4427 if (!clr &&
fDim!=1)
4429 printf(
" *%-s::Load* Error : Dimension %-i does not match a 1-dimensional data array. \n",ClassName(),
fDim);
4435 Int_t n=arr->GetSize();
4438 for (Int_t i=0; i<n; i++)
4525 if (i<1 || i>
fDim || !mode || abs(mode)>4)
return -9999;
4532 Double_t rmsdev=sqrt(var);
4534 Double_t stdev=rmsdev;
4535 if (mode<0) stdev=sigma;
4537 if (stdev<=0)
return -9999;
4547 snr=(ymax-ymin)/stdev;
4551 snr=(ymax-ymin)/(2.*stdev);
4554 if (dB && snr>0) snr=10.*log10(snr);
4564 Double_t psignal=mean*mean;
4565 Double_t pnoise=stdev*stdev;
4567 if (psignal>0 && pnoise>0)
4569 snr=10.*(log10(psignal)-log10(pnoise));
4570 if (abs(mode)==1) snr=snr/2.;
4661 return GetSNR(i,mode,dB);
4691 if (i<1 || i>
fDim || abs(mode)<1 || abs(mode)>2)
return -1;
4696 if (abs(mode)==2) value=(vmax-vmin)/2.;
4702 if (value) cv=fabs(stdev/value);
4734 return GetCV(i,mode);
4767 cout <<
" *NcSample::Animation* Inconsistent input data." << endl;
4783 fCanvas=
new TCanvas(
"fCanvas",
"Sampling animation");
4785 TGraph* gr=
new TGraph();
4788 TString s=
"Sampling animation for NcSample ";
4790 gr->SetTitle(s.Data());
4791 gr->SetMarkerStyle(20);
4792 gr->SetMarkerSize(1);
4796 for (Int_t ip=0; ip<
fN; ip++)
4800 gr->SetPoint(ip,x,y);
4802 if (!ip) gr->Draw(opt.Data());
4806 gr->GetXaxis()->SetTitle(s.Data());
4809 gr->GetYaxis()->SetTitle(s.Data());
4814 gSystem->Sleep(delay);
4881 cout <<
" *NcSample::Animation* Inconsistent input data." << endl;
4897 fCanvas=
new TCanvas(
"fCanvas",
"Sampling animation");
4899 TGraph2D* gr=
new TGraph2D(
fN);
4902 TString s=
"Sampling animation for NcSample ";
4904 gr->SetTitle(s.Data());
4905 gr->SetMarkerStyle(20);
4906 gr->SetMarkerSize(1);
4911 for (Int_t ip=0; ip<
fN; ip++)
4916 gr->SetPoint(ip,x,y,z);
4918 if (!ip) gr->Draw(opt.Data());
4922 gr->GetXaxis()->SetTitle(s.Data());
4925 gr->GetYaxis()->SetTitle(s.Data());
4928 gr->GetZaxis()->SetTitle(s.Data());
4933 gSystem->Sleep(delay);
4937void NcSample::Animation(TString nameA,TString nameB,TString nameC,Int_t mode,TString nameD,Int_t delay,TString opt)
5036 if (mode<0 || mode>3)
5038 cout <<
" *NcSample::Digitize* Inconsistent input mode=" << mode << endl;
5042 if (!nbits || nbits>60 || nbits<-60 || fabs(vcal)<=0)
5044 cout <<
" *NcSample::Digitize* Inconsistent input nbits=" << nbits <<
" vcal=" << vcal << endl;
5048 if ((mode==1 || mode==3) && nbits==1)
5050 cout <<
" *NcSample::Digitize* Inconsistent input nbits=" << nbits <<
" mode=" << mode << endl;
5054 Bool_t logmode=kFALSE;
5055 if (nbits<0) logmode=kTRUE;
5059 Long_t nlevels=pow(2,nbits);
5060 Double_t range=fabs(vcal);
5061 if (mode==1 || mode==3) range*=2.;
5062 Double_t step=fabs(vcal);
5063 if (mode==0) step=range/double(nlevels-1);
5064 if (mode==1) step=range/double(nlevels-2);
5066 if (step<=0)
return 0;
5069 Long_t nstepsmax=nlevels-1;
5070 if ((mode==0 || mode==2) && vcal<0)
5072 nstepsmin=-nlevels+1;
5075 if (mode==1 || mode==3)
5077 nstepsmin=-nlevels/2;
5078 nstepsmax=nlevels/2-1;
5081 Double_t digvalmin=double(nstepsmin)*step;
5082 Double_t digvalmax=double(nstepsmax)*step;
5084 cout <<
" *NcSample::Digitize* Parameters of the " << nbits <<
"-bits";
5085 if (logmode) cout <<
" Log10";
5086 cout <<
" ADC digitization";
5087 if (i>0 && i<=
fDim) cout <<
" of variable : " << i <<
" (" <<
fNames[i-1] <<
")";
5090 if (logmode) s=
"Log10";
5091 if (mode==0 || mode==2)
5093 cout <<
" Digitized " << s <<
" full scale range : [" << digvalmin <<
"," << digvalmax <<
"] Step size : " << step << endl;
5095 if (mode==1 || mode==3)
5097 cout <<
" Digitized " << s <<
" full scale range : [" << (digvalmin+step) <<
"," << digvalmax <<
"] Step size : " << step;
5098 cout <<
" Actual range : [" << digvalmin <<
"," << digvalmax <<
"]" << endl;
5103 Double_t linvalmin=pow(10,digvalmin);
5104 Double_t linvalmax=pow(10,digvalmax);
5105 if (mode==0 || mode==2)
5107 cout <<
" Digitized linear full scale range : [" << linvalmin <<
"," << linvalmax <<
"]" << endl;
5109 if (mode==1 || mode==3)
5111 cout <<
" Digitized linear full scale range : [" << (linvalmin*pow(10,step)) <<
"," << linvalmax <<
"]";
5112 cout <<
" Actual range : [" << linvalmin <<
"," << linvalmax <<
"]" << endl;
5116 Double_t retval=step;
5119 if (vcal<0) retval=digvalmin;
5120 if (vcal>0) retval=digvalmax;
5122 if (mode==3) retval=digvalmax;
5127 cout <<
" *NcSample::Digitize* Error : Storage mode has not been activated." << endl;
5134 if (logmode && minval<=0)
5137 cout <<
" *NcSample::Digitize* Non-positive input value(s) for Log10 ADC i=" << i <<
" minimum=" << minval << endl;
5144 cout <<
" *NcSample::Digitize* Value i=" << i <<
" is outside range. Only listing of ADC specs." << endl;
5151 for (Int_t j=1; j<=
fN; j++)
5155 if (logmode) val=log10(val);
5159 if (nsteps<nstepsmin) nsteps=nstepsmin;
5160 if (nsteps>nstepsmax) nsteps=nstepsmax;
5162 digval=double(nsteps)*step;
5164 if (logmode) digval=pow(10,digval);
5166 if (i==1)
fX->AddAt(digval,j-1);
5167 if (i==2)
fY->AddAt(digval,j-1);
5168 if (i==3)
fZ->AddAt(digval,j-1);
5169 if (i==4)
fT->AddAt(digval,j-1);
5242 return Digitize(i,nbits,vcal,mode);
5245TArrayL64
NcSample::ADC(Int_t nbits,Double_t range,Double_t Vbias,TArray* Vsig,TH1* hist,Int_t B,Int_t C)
const
5330 TArrayL64 arradc(0);
5331 if (hist) hist->Reset();
5334 if (Vsig) nVsig=Vsig->GetSize();
5336 if (nbits<=0 || nbits>60 || !range || fabs(Vbias)>fabs(range) || B<0 || (B && C<1))
5338 printf(
"\n *%-s::ADC* Inconsistent input nbits=%-i range=%-g Vbias=%-g B=%-i C=%-i \n",ClassName(),nbits,range,Vbias,B,C);
5344 Long64_t N=pow(2,nbits);
5346 Long64_t adcmax=N-1;
5354 if (B==1) rB=exp(1);
5356 Double_t radcmax=adcmax;
5375 if (range<0) Vfs=pow(rB,-rC)*pow(rB,radcmax*rC/rN)*Vref;
5376 if (range>0) Vref=pow(rB,rC)*pow(rB,-radcmax*rC/rN)*Vfs;
5377 LSB=Vref*pow(rB,-rC)*(pow(rB,rC/rN)-1.);
5380 if (frac>0) ped=Long64_t(rN*(math.
Log(rB,frac)+rC)/rC);
5383 if (LSB<=0 || Vfs<=0)
5385 printf(
"\n *%-s::ADC* Inconsistent parameters : LSB=%-g Vfs=%-g \n",ClassName(),LSB,Vfs);
5389 if (!B) ped=Vbias/LSB;
5391 Double_t DR=20.*log10(Vfs/LSB);
5393 TString mode=
"linear";
5394 if (B==1) mode=
"Log_e";
5403 printf(
" *%-s::ADC* No input data have been provided --> Only the value of adc(Vbias) is returned. \n",ClassName());
5406 printf(
" Parameters for a %-i-bits %-s ADC with adc=[%-lli,%-lli] : \n",nbits,mode.Data(),adcmin,adcmax);
5407 printf(
" Vref=%-g Vfs=%-g LSB=%-g DR=%-g (dB) Vbias=%-g adc(Vbias)=%-lli \n",Vref,Vfs,LSB,DR,Vbias,ped);
5411 printf(
" Parameters for a %-i-bits %-s ADC with adc=[%-lli,%-lli] and a code efficiency factor of %-i: \n",nbits,mode.Data(),adcmin,adcmax,C);
5412 printf(
" Vref=%-g Vfs=%-g LSB=%-g DR=%-g (dB) Vbias=%-g adc(Vbias)=%-lli \n",Vref,Vfs,LSB,DR,Vbias,ped);
5424 title.Form(
"%-s %-i-bits %-s ADC with Vfs=%-g LSB=%-g;Sample number;ADC counts",ClassName(),nbits,mode.Data(),Vfs,LSB);
5425 hist->SetBins(nVsig,0,nVsig);
5426 hist->SetMarkerStyle(20);
5427 hist->SetTitle(title);
5433 for (Int_t j=0; j<nVsig; j++)
5435 val=Vbias+Vsig->GetAt(j);
5441 if (frac>0) radcval=(rN/rC)*(math.
Log(rB,frac)+rC);
5448 adcval=Long64_t(radcval);
5451 if (adcval<adcmin) adcval=adcmin;
5452 if (adcval>adcmax) adcval=adcmax;
5456 if (hist) hist->SetBinContent(j+1,adcval);
5462TArrayD
NcSample::DAC(Int_t nbits,Double_t range,Double_t Vbias,TArray* adcs,TArray* peds,TH1* hist,Int_t B,Int_t C)
const
5552 if (hist) hist->Reset();
5555 if (adcs) nadcs=adcs->GetSize();
5558 if (peds) npeds=peds->GetSize();
5560 if (nbits<=0 || nbits>60 || !range || fabs(Vbias)>fabs(range) || (peds && npeds<nadcs) || B<0 || (B && C<1))
5562 printf(
"\n *%-s::DAC* Inconsistent input nbits=%-i range=%-g Vbias=%-g nadcs=%-i npeds=%-i B=%-i C=%-i \n",ClassName(),nbits,range,Vbias,nadcs,npeds,B,C);
5568 Long64_t N=pow(2,nbits);
5570 Long64_t adcmax=N-1;
5578 if (B==1) rB=exp(1);
5580 Double_t radcmax=adcmax;
5599 if (range<0) Vfs=pow(rB,-rC)*pow(rB,radcmax*rC/rN)*Vref;
5600 if (range>0) Vref=pow(rB,rC)*pow(rB,-radcmax*rC/rN)*Vfs;
5601 LSB=Vref*pow(rB,-rC)*(pow(rB,rC/rN)-1.);
5604 if (frac>0) ped=Long64_t(rN*(math.
Log(rB,frac)+rC)/rC);
5607 if (LSB<=0 || Vfs<=0)
5609 printf(
"\n *%-s::DAC* Inconsistent parameters : LSB=%-g Vfs=%-g \n",ClassName(),LSB,Vfs);
5613 if (!B) ped=Vbias/LSB;
5615 Double_t DR=20.*log10(Vfs/LSB);
5617 TString mode=
"linear";
5618 if (B==1) mode=
"Log_e";
5627 printf(
" *%-s::DAC* No input data have been provided --> Only the value of adc(Vbias) is returned. \n",ClassName());
5630 printf(
" Parameters for a %-i-bits %-s DAC with adc=[%-lli,%-lli] : \n",nbits,mode.Data(),adcmin,adcmax);
5631 printf(
" Vref=%-g Vfs=%-g LSB=%-g DR=%-g (dB) Vbias=%-g adc(Vbias)=%-lli \n",Vref,Vfs,LSB,DR,Vbias,ped);
5635 printf(
" Parameters for a %-i-bits %-s DAC with adc=[%-lli,%-lli] and a code efficiency factor of %-i: \n",nbits,mode.Data(),adcmin,adcmax,C);
5636 printf(
" Vref=%-g Vfs=%-g LSB=%-g DR=%-g (dB) Vbias=%-g adc(Vbias)=%-lli \n",Vref,Vfs,LSB,DR,Vbias,ped);
5648 title.Form(
"%-s %-i-bits %-s DAC with Vfs=%-g LSB=%-g;Sample number;Amplitude",ClassName(),nbits,mode.Data(),Vfs,LSB);
5649 hist->SetBins(nadcs,0,nadcs);
5650 hist->SetMarkerStyle(20);
5651 hist->SetTitle(title);
5657 for (Int_t j=0; j<nadcs; j++)
5664 dacval=Vref*pow(rB,-rC)*pow(rB,radc*rC/rN);
5678 if (B || (!B && !peds))
5680 dacval=dacval-Vbias;
5685 if (hist) hist->SetBinContent(j+1,dacval);
5691Long64_t
NcSample::Transmit(Int_t i,Int_t nbits,Double_t range,Double_t Vbias,TArray* peds,TH1* hist,Int_t B,Int_t C)
5768 if (hist) hist->Reset();
5772 printf(
"\n *%-s::Transmit* Error : Storage mode has not been activated. \n",ClassName());
5773 printf(
" No digitization is performed. \n");
5779 printf(
"\n *%-s::Transmit* Invalid variable name or index (i=%-i) --> Only listing of ADC specs. \n",ClassName(),i);
5780 adcarr=
ADC(nbits,range,Vbias,0,0,B,C);
5786 printf(
"\n *%-s::Transmit* No data available for variable %-s (index=%-i) --> Only listing of ADC specs. \n",ClassName(),
fNames[i-1].
Data(),i);
5787 adcarr=
ADC(nbits,range,Vbias,0,0,B,C);
5792 Double_t Vin=minval+Vbias;
5796 TString mode=
"Log_e";
5802 printf(
"\n *%-s::Transmit* Non-positive input value(s) for %-s ADC --> No digitization is performed. \n",ClassName(),mode.Data());
5803 printf(
" Minimum+Vbias=%-g+%-g=%-g for variable with name %-s (index i=%-i). \n",minval,Vbias,Vin,
fNames[i-1].
Data(),i);
5815 adcarr=
ADC(nbits,range,Vbias,arrin,0,B,C);
5818 dacarr=
DAC(nbits,range,Vbias,&adcarr,peds,hist,B,C);
5822 TString title=hist->GetTitle();
5823 title.ReplaceAll(
"DAC",
"ADC-DAC (Transmit)");
5824 hist->SetTitle(title);
5827 Int_t ndac=dacarr.GetSize();
5830 printf(
"\n *%-s::Transmit* Inconsistent number of entries : Nsamplings=%-i Ndac=%-i --> No digitization is performed. \n",ClassName(),
fN,ndac);
5836 for (Int_t j=0; j<
fN; j++)
5839 arrin->AddAt(val,j);
5845Long64_t
NcSample::Transmit(TString name,Int_t nbits,Double_t range,Double_t Vbias,TArray* peds,TH1* hist,Int_t B,Int_t C)
5923 return Transmit(i,nbits,range,Vbias,peds,hist,B,C);
5947 NcSample s(
"SampleAndHold",
"Error occurred in SampleAndHold");
5950 if (step<=0 || vmax<=vmin)
5952 cout <<
" *NcSample::SampleAndHold* Error : Invalid input step=" << step <<
" vmin=" << vmin <<
" vmax=" << vmax << endl;
5956 TString str=
"For Function ";
5957 str+=f.GetExpFormula(
"p");
5958 str+=
" with step=%-10.3g";
5959 TString str2=str.Format(str.Data(),step);
5960 s.SetTitle(str2.Data());
5969 if (loc<0) xval=xlow;
5970 if (!loc) xval=xlow+step/2.;
5971 if (loc>0) xval=xlow+step;
5972 if (xval>vmax) xval=vmax;
6010 NcSample s(
"SampleAndSum",
"Error occurred in SampleAndSum");
6015 cout <<
" *NcSample::SampleAndSum* Error : Storage mode has not been activated." << endl;
6021 cout <<
" *NcSample::SampleAndSum* Error : Invalid index encountered i=" << i <<
" j=" << j << endl;
6027 cout <<
" *NcSample::SampleAndSum* Error : Invalid step size step=" << step << endl;
6031 TString xname=
fNames[i-1];
6032 TString yname=
"Counts";
6033 if (j>0) yname=
fNames[j-1];
6037 TString str=
"For Variable ";
6039 str+=
" with step=%-10.3g";
6040 TString str2=str.Format(str.Data(),step);
6041 s.SetTitle(str2.Data());
6053 Int_t nbx=(xmax-xmin)/step;
6056 Double_t* bins=
new Double_t[nbx+1];
6058 for (Int_t idx=0; idx<=nbx; idx++)
6064 TH1D hist(
"",
"",nbx,bins);
6069 for (Int_t ient=1; ient<=
fN; ient++)
6073 hist.Fill(xval,yval);
6077 Int_t nbins=hist.GetNbinsX();
6078 Double_t binwidth=hist.GetBinWidth(1);
6079 for (Int_t k=1; k<=nbins; k++)
6081 if (loc) xval=hist.GetBinLowEdge(k);
6082 if (!loc) xval=hist.GetBinCenter(k);
6083 if (loc>0) xval+=binwidth;
6084 yval=hist.GetBinContent(k);
6141 if (strlen(name)) q->SetName(name);
Various mathematical tools for scientific analysis.
Double_t Log(Double_t B, Double_t x) const
Sampling and statistics tools for various multi-dimensional data samples.
Long64_t Transmit(Int_t i, Int_t nbits, Double_t range, Double_t Vbias=0, TArray *peds=0, TH1 *hist=0, Int_t B=0, Int_t C=3)
TGraphQQ GetQQplot(Int_t i, Int_t j, TF1 *f=0)
void Order(Int_t mode, Int_t i)
Double_t GetSNR(Int_t i, Int_t mode=2, Bool_t db=kTRUE) const
TCanvas * fCanvas
! Multi-purpose canvas for e.g. animation displays
Int_t GetStoreMode() const
Double_t fRMSdev[fMaxdim]
TH3D Get3DHistogram(Int_t i, Int_t j, Int_t k, Int_t m=0, Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, Int_t nbz=100, TF1 *f=0)
void Data(Int_t i=0, Int_t j=0)
Double_t GetCov(Int_t i, Int_t j) const
virtual TObject * Clone(const char *name="") const
TObject * fAnimObject
! Multi-purpose pointer for animation objects
void GetSubset(NcSample *s, Int_t ifirst, Int_t ilast, Int_t mode=0, Int_t k=0)
Double_t GetMinimum(Int_t i) const
TArrayL64 ADC(Int_t nbits, Double_t range, Double_t Vbias=0, TArray *Vsig=0, TH1 *hist=0, Int_t B=0, Int_t C=3) const
Int_t GetIndex(TString name) const
TH1D Get1DHistogram(Int_t i, Int_t j=0, Bool_t sumw2=kFALSE, Int_t nbx=100, TF1 *f=0)
Double_t GetCor(Int_t i, Int_t j) const
TArrayD * fArr
! Temp. storage array for ordered values
Double_t fCor[fMaxdim][fMaxdim]
Double_t fSum2[fMaxdim][fMaxdim]
Double_t GetSigma(Int_t i, Int_t model=0) const
TGraphTime * fGraphT
! Temp. pointer to return a TGraphTime object
Double_t GetMedian(Int_t i)
void Animation(Int_t i, Int_t j, Int_t mode, Int_t k, Int_t delay, TString opt="AP")
TGraphErrors GetGraphErrors(TGraph *g, Int_t ix=0, Int_t iy=0, TF1 *fx=0, TF1 *fy=0)
TH1D GetSamplingHistogram(Int_t i, TF1 *f=0)
Int_t GetStoreNmax() const
NcSample SampleAndHold(TF1 f, Double_t step, Double_t vmin, Double_t vmax, Int_t loc=-1) const
Int_t fOrdered
! Indicator of the status of the current ordering
Double_t GetRMS(Int_t i) const
void SetNames(TString name1="X", TString name2="Y", TString name3="Z", TString name4="T")
Double_t Digitize(Int_t i, Int_t nbits, Double_t vcal, Int_t mode)
NcSample GetDtSample(Int_t i, Int_t nc, Int_t store=1, Int_t nmax=0, Int_t order=0)
Double_t fCov[fMaxdim][fMaxdim]
Double_t GetMean(Int_t i) const
TArrayD DAC(Int_t nbits, Double_t range, Double_t Vbias=0, TArray *adcs=0, TArray *peds=0, TH1 *hist=0, Int_t B=0, Int_t C=3) const
void RemoveEntry(Int_t i, Int_t mode, Int_t j)
void ListOrdered(Int_t mode, Int_t i)
void SetStoreMode(Int_t mode=100, Int_t nmax=0, Int_t i=0)
TString GetVariableName(Int_t i) const
TArrayI * fIndices
! Temp. storage array for the indices of the ordered entries
Int_t GetDimension() const
TGraph GetGraph(Int_t i, TF1 *f=0)
Double_t GetVar(Int_t i, Int_t model=0) const
Double_t GetMaximum(Int_t i) const
void Load(TGraph *g, Int_t clr=1)
Double_t GetCV(Int_t i, Int_t mode=1) const
Double_t GetSpread(Int_t i, Int_t model=0, Double_t vref=0)
Double_t GetQuantile(Double_t f, Int_t i)
Double_t GetEntry(Int_t i, Int_t j, Int_t mode=0, Int_t k=0)
TGraph2DErrors GetGraph2DErrors(TGraph2D *g, Int_t ix=0, Int_t iy=0, Int_t iz=0, TF1 *fx=0, TF1 *fy=0, TF1 *fz=0)
NcSample(const char *name="", const char *title="")
TH2D Get2DHistogram(Int_t i, Int_t j, Int_t k=0, Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, TF1 *f=0)
Double_t GetSum(Int_t i) const
NcSample SampleAndSum(Int_t i, Double_t step, Int_t loc=0, Int_t j=0, Double_t vmin=0, Double_t vmax=-1)