arXiv:1611.01927 12th Conference on Quark Confinement and the Hadron Spectrum (Confinement XII)
This is an example of unfolding a one-dimensional distribution. It compares various unfolding methods:
XII Quark Confinement and the Hadron Spectrum 29.8. - 3.9.2016 Thessaloniki, Greece statictics session (+proceedings)
#include <iostream>
#include <cmath>
#include <map>
using std::vector, std::pair, std::cout;
#define TEST_INPUT_COVARIANCE
TH2 *AddOverflowXY(
TH2 *
h,
double widthX,
double widthY);
void DrawOverflowX(
TH1 *
h,
double posy);
void DrawOverflowY(
TH1 *
h,
double posx);
double const kLegendFontSize=0.05;
int kNbinC=0;
void DrawPadProbability(
TH2 *
h);
void DrawPadEfficiency(
TH1 *
h);
void DrawPadReco(
TH1 *histMcRec,
TH1 *histMcbgrRec,
TH1 *histDataRec,
TH1 *histDataUnfold,
TH2 *histProbability,
TH2 *histRhoij);
void DrawPadTruth(
TH1 *histMcsigGen,
TH1 *histDataGen,
TH1 *histDataUnfold,
char const *
text=
nullptr,
double tau=0.0,vector<double>
const *
r=
nullptr,
void DrawPadCorrelations(
TH2 *
h,
vector<pair<
TF1*,vector<double> > >
const *table);
vector<pair<
TF1*,vector<double> > > &table,
int niter=0);
void GetNiterGraphs(
int iFirst,
int iLast,vector<pair<
TF1*,
vector<double> > > const &table,int color,
void GetNiterHist(
int ifit,vector<pair<
TF1*,vector<double> > >
const &table,
TH1 *hist[4],
int color,
int style,
int fillStyle);
#ifdef WITH_IDS
#endif
void testUnfold7c()
{
TFile *outputFile=
new TFile(
"testUnfold7_results.root",
"recreate");
TFile *inputFile=
new TFile(
"testUnfold7_histograms.root");
inputFile->
GetObject(
"coarse",coarseBinning);
if((!fineBinning)||(!coarseBinning)) {
cout<<"problem to read binning schemes\n";
}
#define READ(TYPE,binning,name) \
TYPE *name[3]; inputFile->GetObject(#name,name[0]); \
name[0]->Write(); \
if(!name[0]) cout<<"Error reading " #name "\n"; \
CreateHistogramCopies(name,binning);
READ(
TH1,fineBinning,histDataRecF);
READ(
TH1,coarseBinning,histDataRecC);
READ(
TH1,fineBinning,histDataBgrF);
READ(
TH1,coarseBinning,histDataBgrC);
READ(
TH1,coarseBinning,histDataGen);
READ(
TH2,fineBinning,histMcsigGenRecF);
READ(
TH2,coarseBinning,histMcsigGenRecC);
READ(
TH1,fineBinning,histMcsigRecF);
READ(
TH1,coarseBinning,histMcsigRecC);
READ(
TH1,coarseBinning,histMcsigGen);
READ(
TH1,fineBinning,histMcbgrRecF);
READ(
TH1,coarseBinning,histMcbgrRecC);
TH1 *histOutputCLCurve[3];
double tauMin=1.e-4;
double tauMax=1.e-1;
double fBgr=1.0;
double biasScale=1.0;
{
coarseBinning,
coarseBinning);
tunfoldC->
SetInput(histDataRecC[0],biasScale);
histOutputCtau0[0]=tunfoldC->
GetOutput(
"histOutputCtau0");
CreateHistogramCopies(histOutputCtau0,coarseBinning);
histOutputCLCurve[0]=tunfoldC->
GetOutput(
"histOutputCLCurve");
CreateHistogramCopies(histOutputCLCurve,coarseBinning);
}
TH1 *histOutputFLCurve[3];
tauMin=3.E-4;
tauMax=3.E-2;
{
coarseBinning,
fineBinning);
tunfoldF->
SetInput(histDataRecF[0],biasScale);
histOutputFtau0[0]=tunfoldF->
GetOutput(
"histOutputFtau0");
CreateHistogramCopies(histOutputFtau0,coarseBinning);
histOutputFLCurve[0]=tunfoldF->
GetOutput(
"histOutputFLCurve");
CreateHistogramCopies(histOutputFLCurve,coarseBinning);
}
TH1 *histOutputFAtau0[3];
TH1 *histOutputFALCurve[3];
double tauFA,tauFArho;
{
coarseBinning,
fineBinning);
tunfoldFA->
SetInput(histDataRecF[0],biasScale);
histOutputFAtau0[0]=tunfoldFA->
GetOutput(
"histOutputFAtau0");
CreateHistogramCopies(histOutputFAtau0,coarseBinning);
histOutputFArho[0]=tunfoldFA->
GetOutput(
"histOutputFArho");
CreateHistogramCopies(histOutputFArho,coarseBinning);
tunfoldFA->
ScanLcurve(50,tauMin,tauMax,&lCurve,&logTauX,&logTauY,&logTauCurvature);
histOutputFALCurve[0]=tunfoldFA->
GetOutput(
"histOutputFALCurve");
CreateHistogramCopies(histOutputFALCurve,coarseBinning);
}
TH2 *histProbCO=AddOverflowXY(histProbC,widthC,widthC);
TH2 *histProbFO=AddOverflowXY(histProbF,widthC,widthF);
TH1 *histMcsigRecCO=AddOverflowX(histMcsigRecC[2],widthC);
TH1 *histMcbgrRecCO=AddOverflowX(histMcbgrRecC[2],widthC);
histMcbgrRecCO->
Scale(fBgr);
TH1 *histMcRecCO=(
TH1 *)histMcsigRecCO->
Clone(
"histMcRecC0");
histMcRecCO->
Add(histMcsigRecCO,histMcbgrRecCO);
TH1 *histDataRecCO=AddOverflowX(histDataRecC[2],widthC);
TH1 *histMcsigRecFO=AddOverflowX(histMcsigRecF[2],widthF);
TH1 *histMcbgrRecFO=AddOverflowX(histMcbgrRecF[2],widthF);
histMcbgrRecFO->
Scale(fBgr);
TH1 *histMcRecFO=(
TH1 *)histMcsigRecFO->
Clone(
"histMcRecF0");
histMcRecFO->
Add(histMcsigRecFO,histMcbgrRecFO);
TH1 *histDataRecFO=AddOverflowX(histDataRecF[2],widthF);
TH1 *histMcsigGenO=AddOverflowX(histMcsigGen[2],widthC);
TH1 *histDataGenO=AddOverflowX(histDataGen[2],widthC);
TH1 *histOutputCtau0O=AddOverflowX(histOutputCtau0[2],widthC);
TH2 *histRhoCtau0O=AddOverflowXY(histRhoCtau0,widthC,widthC);
TH1 *histOutputFtau0O=AddOverflowX(histOutputFtau0[2],widthC);
TH2 *histRhoFtau0O=AddOverflowXY(histRhoFtau0,widthC,widthC);
TH1 *histOutputFAtau0O=AddOverflowX(histOutputFAtau0[2],widthC);
TH2 *histRhoFAtau0O=AddOverflowXY(histRhoFAtau0,widthC,widthC);
TH1 *histOutputFALCurveO=AddOverflowX(histOutputFALCurve[2],widthC);
TH2 *histRhoFALCurveO=AddOverflowXY(histRhoFALCurve,widthC,widthC);
TH1 *histOutputFArhoO=AddOverflowX(histOutputFArho[2],widthC);
TH2 *histRhoFArhoO=AddOverflowXY(histRhoFArho,widthC,widthC);
TH2 *histRhoBBBO=(
TH2 *)histRhoCtau0O->
Clone(
"histRhoBBBO");
for(
int i=1;i<=histRhoBBBO->
GetNbinsX();i++) {
for(
int j=1;j<=histRhoBBBO->
GetNbinsX();j++) {
}
}
TH1 *histDataBgrsub=(
TH1 *)histDataRecCO->
Clone(
"histDataBgrsub");
histDataBgrsub->
Add(histMcbgrRecCO,-fBgr);
TH1 *histOutputBBBO=(
TH1 *)histDataBgrsub->
Clone(
"histOutputBBBO");
histOutputBBBO->
Divide(histMcsigRecCO);
histOutputBBBO->
Multiply(histMcsigGenO);
int niter=1000;
cout<<"maximum number of iterations: "<<niter<<"\n";
vector <TH1 *>histOutputAgo,histOutputAgorep;
vector <TH2 *>histRhoAgo,histRhoAgorep;
vector<int> nIter;
histOutputAgo.push_back((
TH1*)histMcsigGenO->
Clone(
"histOutputAgo-1"));
histOutputAgorep.push_back((
TH1*)histMcsigGenO->
Clone(
"histOutputAgorep-1"));
histRhoAgo.push_back((
TH2*)histRhoBBBO->
Clone(
"histRhoAgo-1"));
histRhoAgorep.push_back((
TH2*)histRhoBBBO->
Clone(
"histRhoAgorep-1"));
nIter.push_back(-1);
for(int i=0;i<nx;i++) {
double epsilonI=0.;
for(int j=0;j<ny;j++) {
}
for(int j=0;j<ny;j++) {
A(j,i)=aji;
AToverEps(i,j)=aji/epsilonI;
}
}
for(int i=0;i<nx;i++) {
(histOutputAgo[0]->GetBinError(i+1)
*histOutputAgo[0]->GetXaxis()->GetBinWidth(i+1),2.);
}
for(int i=0;i<ny;i++) {
}
#define NREPLICA 300
vector<TVectorD *>
y(NREPLICA);
vector<TVectorD *> yMb(NREPLICA);
vector<TVectorD *> yErr(NREPLICA);
vector<TVectorD *>
x(NREPLICA);
for(int nr=0;nr<NREPLICA;nr++) {
}
for(int i=0;i<nx;i++) {
(*
x[0])(i)=histOutputAgo[0]->GetBinContent(i+1)
*histOutputAgo[0]->GetXaxis()->GetBinWidth(i+1);
for(int nr=1;nr<NREPLICA;nr++) {
}
}
for(int i=0;i<ny;i++) {
for(int nr=1;nr<NREPLICA;nr++) {
}
for(int nr=0;nr<NREPLICA;nr++) {
(*yMb[nr])(i)=(*
y[nr])(i)-
b(i);
}
}
for(int iter=0;iter<=niter;iter++) {
if(!(iter %100)) cout<<iter<<"\n";
for(int nr=0;nr<NREPLICA;nr++) {
for(int j=0;j<ny;j++) {
yOverYrec(j)=(*
y[nr])(j)/yrec(j);
}
for(int i=0;i<nx;i++) {
xx(i) = (*
x[nr])(i) *
f(i);
}
if(nr==0) {
for(int i=0;i<nx;i++) {
for(int j=0;j<ny;j++) {
xdf_dr(i,j) *= (*
x[nr])(i);
}
}
for(int j=0;j<ny;j++) {
dr_dxdy(j,nx+j)=1.0/yrec(j);
for(int i=0;i<nx;i++) {
dr_dxdy(j,i)= -yOverYrec(j)/yrec(j)*A(j,i);
}
}
dxy_dxy.SetSub(0,0,xdf_dr*dr_dxdy);
for(int i=0;i<nx;i++) {
}
for(int i=0;i<ny;i++) {
dxy_dxy(nx+i,nx+i) +=1.0;
}
covAgo= dxy_dxy*VDT;
}
}
if((iter<=25)||
((iter<=100)&&(iter %5==0))||
((iter<=1000)&&(iter %50==0))||
(iter %1000==0)) {
nIter.push_back(iter);
TH1 *
h=(
TH1*)histOutputAgo[0]->Clone
histOutputAgo.push_back(
h);
for(int i=0;i<nx;i++) {
h->SetBinContent(i+1,(*
x[0])(i)/bw);
}
histRhoAgo.push_back(h2);
for(int i=0;i<nx;i++) {
for(int j=0;j<nx;j++) {
double rho= covAgo(i,j)/
TMath::Sqrt(covAgo(i,i)*covAgo(j,j));
cout<<"bad error matrix: iter="<<iter<<"\n";
exit(0);
}
h2->SetBinContent(i+1,j+1,rho);
}
}
h=(
TH1*)histOutputAgo[0]->Clone
h2=(
TH2*)histRhoAgo[0]->Clone
histOutputAgorep.push_back(
h);
histRhoAgorep.push_back(h2);
double w=1./(NREPLICA-1.);
for(int nr=1;nr<NREPLICA;nr++) {
}
for(int nr=1;nr<NREPLICA;nr++) {
for(int i=0;i<nx;i++) {
dx(i,0)= (*
x[nr])(i)-(*
x[0])(i);
}
}
for(int i=0;i<nx;i++) {
double bw=
h->GetXaxis()->GetBinWidth(i+1);
h->SetBinContent(i+1,(*
x[0])(i)/bw);
}
for(int i=0;i<nx;i++) {
for(int j=0;j<nx;j++) {
double rho= covAgorep(i,j)/
cout<<"bad error matrix: iter="<<iter<<"\n";
exit(0);
}
h2->SetBinContent(i+1,j+1,rho);
}
}
}
}
#ifdef WITH_IDS
int niterIDS=100;
vector<TVectorD*> unfresIDS(NREPLICA),soustr(NREPLICA);
cout<<"IDS number of iterations: "<<niterIDS<<"\n";
for(int nr=0;nr<NREPLICA;nr++) {
}
for(int iy=0;iy<ny;iy++) {
for(int ix=0;ix<nx;ix++) {
A_IDS(iy,ix)=histMcsigGenRecC[0]->GetBinContent(ix+1,iy+1);
}
}
double lambdaL=0.;
double lambdaU=lambdaUmin;
double lambdaM=lambdaMmin;
vector<TH1 *> histOutputIDS;
vector<TH2 *> histRhoIDS;
histOutputIDS.push_back((
TH1*)histOutputAgo[0]->Clone(
"histOutputIDS-1"));
histRhoIDS.push_back((
TH2*)histRhoAgo[0]->Clone(
"histRhoIDS-1"));
histOutputIDS.push_back((
TH1*)histOutputAgo[0]->Clone(
"histOutputIDS0"));
histRhoIDS.push_back((
TH2*)histRhoAgo[0]->Clone(
"histRhoIDS0"));
for(int iter=1;iter<=niterIDS;iter++) {
if(!(iter %10)) cout<<iter<<"\n";
for(int nr=0;nr<NREPLICA;nr++) {
if(iter==1) {
IDSfirst(yMb[nr],yErr[nr],&A_IDS,lambdaL,unfresIDS[nr],soustr[nr]);
} else {
IDSiterate(yMb[nr],yErr[nr],&A_IDS,Am_IDS[nr],
lambdaU,lambdaM,lambdaS,
unfresIDS[nr],soustr[nr]);
}
}
unsigned ix;
for(ix=0;ix<nIter.size();ix++) {
if(nIter[ix]==iter) break;
}
if(ix<nIter.size()) {
TH1 *
h=(
TH1*)histOutputIDS[0]->Clone
histOutputIDS.push_back(
h);
histRhoIDS.push_back(h2);
double w=1./(NREPLICA-1.);
for(int nr=1;nr<NREPLICA;nr++) {
mean +=
w* (*unfresIDS[nr]);
}
for(int nr=1;nr<NREPLICA;nr++) {
for(int i=0;i<nx;i++) {
dx(i,0)= (*unfresIDS[nr])(i)-(*unfresIDS[0])(i);
}
}
for(int i=0;i<nx;i++) {
double bw=
h->GetXaxis()->GetBinWidth(i+1);
h->SetBinContent(i+1,(*unfresIDS[0])(i)/bw/
}
for(int i=0;i<nx;i++) {
for(int j=0;j<nx;j++) {
double rho= covIDSrep(i,j)/
cout<<"bad error matrix: iter="<<iter<<"\n";
exit(0);
}
h2->SetBinContent(i+1,j+1,rho);
}
}
}
}
#endif
vector<pair<TF1 *,vector<double> > > table;
subn[0]=
new TPad(
"subn0",
"",0.,0.5,1.,1.);
subn[1]=
new TPad(
"subn1",
"",0.,0.,0.5,0.5);
subn[2]=
new TPad(
"subn2",
"",0.5,0.0,1.,0.5);
for(int i=0;i<3;i++) {
}
subc[0]=
new TPad(
"sub0",
"",0.,0.5,1.,1.);
subc[1]=
new TPad(
"sub1",
"",0.,0.,0.5,0.5);
subc[2]=
new TPad(
"sub2",
"",0.5,0.0,1.,0.5);
for(int i=0;i<3;i++) {
}
DrawPadTruth(histMcsigGenO,histDataGenO,nullptr);
DrawPadReco(histMcRecCO,histMcbgrRecCO,histDataRecCO,nullptr,nullptr,nullptr);
DrawPadProbability(histProbCO);
DrawPadEfficiency(histEfficiencyC);
int iFitInversion=table.size();
DoFit(histOutputCtau0O,histRhoCtau0O,histDataGenO,"inversion",table);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputCtau0O,"inversion",0.,
&table[table.size()-1].second);
DrawPadCorrelations(histRhoCtau0O,&table);
DrawPadReco(histMcRecCO,histMcbgrRecCO,histDataRecCO,
histOutputCtau0O,histProbCO,histRhoCtau0O);
DoFit(histOutputFtau0O,histRhoFtau0O,histDataGenO,"template",table);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFtau0O,"fit",0.,
&table[table.size()-1].second);
DrawPadCorrelations(histRhoFtau0O,&table);
DrawPadReco(histMcRecFO,histMcbgrRecFO,histDataRecFO,
histOutputFtau0O,histProbFO,histRhoFtau0O);
DoFit(histOutputFAtau0O,histRhoFAtau0O,histDataGenO,"template+area",table);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFAtau0O,"fit",0.,
&table[table.size()-1].second);
DrawPadCorrelations(histRhoFAtau0O,&table);
DrawPadReco(histMcRecFO,histMcbgrRecFO,histDataRecFO,
histOutputFAtau0O,histProbFO,histRhoFAtau0O);
int iFitFALCurve=table.size();
DoFit(histOutputFALCurveO,histRhoFALCurveO,histDataGenO,"Tikhonov+area",table);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFALCurveO,"Tikhonov",tauFA,
&table[table.size()-1].second);
DrawPadCorrelations(histRhoFALCurveO,&table);
DrawPadReco(histMcRecFO,histMcbgrRecFO,histDataRecFO,
histOutputFALCurveO,histProbFO,histRhoFALCurveO);
int iFitFArho=table.size();
DoFit(histOutputFArhoO,histRhoFArhoO,histDataGenO,"min(rhomax)",table);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFArhoO,"Tikhonov",tauFArho,
&table[table.size()-1].second);
DrawPadCorrelations(histRhoFArho,&table);
DrawPadReco(histMcRecFO,histMcbgrRecFO,histDataRecFO,
histOutputFArhoO,histProbFO,histRhoFArhoO);
int iFitBinByBin=table.size();
DoFit(histOutputBBBO,histRhoBBBO,histDataGenO,"bin-by-bin",table);
DrawPadReco(histMcRecCO,histMcbgrRecCO,histDataRecCO,
histOutputBBBO,histProbCO,histRhoBBBO);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputBBBO,"bin-by-bin",0.,
&table[table.size()-1].second);
int iAgoFirstFit=table.size();
for(size_t i=1;i<histRhoAgorep.size();i++) {
bool isFitted=false;
DoFit(histOutputAgorep[i],histRhoAgorep[i],histDataGenO,
isFitted=true;
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputAgorep[i],
isFitted ? &table[table.size()-1].second : nullptr);
DrawPadCorrelations(histRhoAgorep[i],&table);
DrawPadReco(histMcRecCO,histMcbgrRecCO,histDataRecCO,
histOutputAgorep[i],histProbCO,histRhoAgorep[i]);
}
int iAgoLastFit=table.size();
#ifdef WITH_IDS
int iIDSFirstFit=table.size();
for(size_t i=2;i<histRhoIDS.size();i++) {
bool isFitted=false;
DoFit(histOutputIDS[i],histRhoIDS[i],histDataGenO,
isFitted=true;
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputIDS[i],
isFitted ? &table[table.size()-1].second : 0);
DrawPadCorrelations(histRhoIDS[i],&table);
DrawPadReco(histMcRecCO,histMcbgrRecCO,histDataRecCO,
histOutputIDS[i],histProbCO,histRhoIDS[i]);
}
int iIDSLastFit=table.size();
#endif
int nfit=table.size();
TH1D *fitChindf=
new TH1D(
"fitChindf",
";algorithm;#chi^{2}/NDF",nfit,0,nfit);
TH1D *fitNorm=
new TH1D(
"fitNorm",
";algorithm;Landau amplitude [1/GeV]",nfit,0,nfit);
TH1D *fitMu=
new TH1D(
"fitMu",
";algorithm;Landau #mu [GeV]",nfit,0,nfit);
TH1D *fitSigma=
new TH1D(
"fitSigma",
";algorithm;Landau #sigma [GeV]",nfit,0,nfit);
for(
int fit=0;
fit<nfit;
fit++) {
vector<double>
const &
r=table[
fit].second;
cout<<
"\""<<
f->GetName()<<
"\","<<
r[2]/
r[3]<<
","<<
r[3]
<<","<<chi2/ndf
<<","<<ndf
for(int i=1;i<3;i++) {
cout<<
","<<
f->GetParameter(i)<<
",\"\302\261\","<<
f->GetParError(i);
}
cout<<"\n";
}
lCurve->
SetTitle(
"L curve;log_{10} L_{x};log_{10} L_{y}");
logTauX->
SetTitle(
";log_{10} #tau;log_{10} L_{x}");
logTauY->
SetTitle(
";log_{10} #tau;log_{10} L_{y}");
logTauCurvature->
SetTitle(
";log_{10}(#tau);L curve curvature");
rhoScan->
SetTitle(
";log_{10}(#tau);average(#rho_{i})");
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFALCurveO,"Tikhonov",tauFA,
&table[iFitFALCurve].second);
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFArhoO,"Tikhonov",tauFArho,
&table[iFitFArho].second);
GetNiterGraphs(iAgoFirstFit,iAgoFirstFit+1,table,
kRed-2,graphNiterAgoBay,20);
GetNiterGraphs(iAgoFirstFit,iAgoLastFit,table,
kRed,graphNiterAgo,24);
#ifdef WITH_IDS
GetNiterGraphs(iIDSFirstFit,iIDSLastFit,table,
kMagenta,graphNiterIDS,21);
#endif
TH1 *histNiterInversion[4];
GetNiterHist(iFitInversion,table,histNiterInversion,
kCyan,1,1001);
TH1 *histNiterFALCurve[4];
GetNiterHist(iFitFALCurve,table,histNiterFALCurve,
kBlue,2,3353);
GetNiterHist(iFitFArho,table,histNiterFArho,
kAzure-4,3,3353);
TH1 *histNiterBinByBin[4];
GetNiterHist(iFitBinByBin,table,histNiterBinByBin,
kOrange+1,3,3335);
for(int i=0;i<2;i++) {
if(! histNiterInversion[i]) continue;
histNiterInversion[i]->
Draw(
"][");
histNiterFALCurve[i]->
Draw(
"SAME ][");
histNiterFArho[i]->
Draw(
"SAME ][");
histNiterBinByBin[i]->
Draw(
"SAME ][");
graphNiterAgo[i]->
Draw(
"LP");
graphNiterAgoBay[i]->
Draw(
"P");
#ifdef WITH_IDS
graphNiterIDS[i]->
Draw(
"LP");
#endif
if(i==1) {
legend=
new TLegend(0.48,0.28,0.87,0.63);
} else {
legend=
new TLegend(0.45,0.5,0.88,0.88);
}
legend->
AddEntry( histNiterInversion[0],
"inversion",
"l");
legend->
AddEntry( histNiterFALCurve[0],
"Tikhonov L-curve",
"l");
legend->
AddEntry( histNiterFArho[0],
"Tikhonov global cor.",
"l");
legend->
AddEntry( histNiterBinByBin[0],
"bin-by-bin",
"l");
legend->
AddEntry( graphNiterAgoBay[0],
"\"Bayesian\"",
"p");
legend->
AddEntry( graphNiterAgo[0],
"iterative",
"p");
#ifdef WITH_IDS
legend->
AddEntry( graphNiterIDS[0],
"IDS",
"p");
#endif
}
DrawPadTruth(histMcsigGenO,histDataGenO,histOutputFALCurveO,"Tikhonov",tauFA,
&table[iFitFALCurve].second,table[iFitFALCurve].first);
histNiterInversion[3]->
Draw(
"SAME HIST ][");
histNiterFALCurve[3]->
Draw(
"SAME HIST ][");
histNiterFArho[3]->
Draw(
"SAME HIST ][");
histNiterBinByBin[3]->
Draw(
"SAME HIST ][");
double yTrue=1.8;
line=
new TLine(histNiterInversion[3]->GetXaxis()->GetXmin(),
yTrue,
histNiterInversion[3]->GetXaxis()->GetXmax(),
yTrue);
graphNiterAgo[3]->
Draw(
"LP");
graphNiterAgoBay[3]->
Draw(
"P");
#ifdef WITH_IDS
graphNiterIDS[3]->
Draw(
"LP");
#endif
legend=
new TLegend(0.55,0.53,0.95,0.97);
legend->
AddEntry( histNiterInversion[3],
"inversion",
"l");
legend->
AddEntry( histNiterFALCurve[3],
"Tikhonov L-curve",
"l");
legend->
AddEntry( histNiterFArho[3],
"Tikhonov global cor.",
"l");
legend->
AddEntry( histNiterBinByBin[3],
"bin-by-bin",
"l");
legend->
AddEntry( graphNiterAgoBay[3],
"\"Bayesian\"",
"p");
legend->
AddEntry( graphNiterAgo[3],
"iterative",
"p");
#ifdef WITH_IDS
legend->
AddEntry( graphNiterIDS[3],
"IDS",
"p");
#endif
delete outputFile;
}
void GetNiterGraphs(
int iFirst,
int iLast,vector<pair<
TF1*,
vector<double> > > const &table,int color,
for(int ifit=iFirst;ifit<iLast;ifit++) {
vector<double>
const &
r=table[ifit].second;
chi2(ifit-iFirst)=
r[2]/
r[3];
TF1 const *
f=table[ifit].first;
emean(ifit-iFirst)=
f->GetParError(1);
sigma(ifit-iFirst)=
f->GetParameter(2);
esigma(ifit-iFirst)=
f->GetParError(2);
}
graph[
g]->SetLineColor(color);
graph[
g]->SetMarkerColor(color);
}
}
}
void GetNiterHist(
int ifit,vector<pair<
TF1*,vector<double> > >
const &table,
TH1 *hist[4],
int color,
int style,
int fillStyle) {
vector<double>
const &
r=table[ifit].second;
TF1 const *
f=table[ifit].first;
hist[0]=
new TH1D(table[ifit].first->GetName()+
TString(
"_chi2"),
";iteration;unfold-truth #chi^{2}/N_{D.F.}",1,0.2,1500.);
hist[1]=
new TH1D(table[ifit].first->GetName()+
TString(
"_gcor"),
";iteration;avg(#rho_{i})",1,0.2,1500.);
hist[2]=
new TH1D(table[ifit].first->GetName()+
TString(
"_mu"),
";iteration;parameter #mu",1,0.2,1500.);
hist[3]=
new TH1D(table[ifit].first->GetName()+
TString(
"_sigma"),
";iteration;parameter #sigma",1,0.2,1500.);
if( hist[
h]->GetBinError(1)>0.0) {
}
}
}
}
h[2]=(
TH1 *)
h[1]->Clone(baseName+
"_binw");
for(
Int_t iSrc=0;iSrc<nMax;iSrc++) {
Int_t iDest=binMap[iSrc];
double c=
h[0]->GetBinContent(iSrc)+
h[1]->GetBinContent(iDest);
h[1]->SetBinContent(iDest,
c);
h[1]->SetBinError(iDest,
e);
h[2]->SetBinContent(iDest,
c);
h[2]->SetBinError(iDest,
e);
}
for(
int iDest=0;iDest<=
h[2]->GetNbinsX()+1;iDest++) {
double c=
h[2]->GetBinContent(iDest);
double e=
h[2]->GetBinError(iDest);
if(bw>0.0) {
h[2]->SetBinContent(iDest,
c/bw);
h[2]->SetBinError(iDest,
e/bw);
} else {
}
}
}
}
TH2 *AddOverflowXY(
TH2 *
h,
double widthX,
double widthY) {
double *xBins=new double[nx+2];
double *yBins=new double[ny+2];
for(int i=1;i<=nx;i++) {
xBins[i-1]=
h->GetXaxis()->GetBinLowEdge(i);
}
xBins[nx]=
h->GetXaxis()->GetBinUpEdge(nx);
xBins[nx+1]=xBins[nx]+widthX;
for(int i=1;i<=ny;i++) {
yBins[i-1]=
h->GetYaxis()->GetBinLowEdge(i);
}
yBins[ny]=
h->GetYaxis()->GetBinUpEdge(ny);
yBins[ny+1]=yBins[ny]+widthY;
for(int ix=0;ix<=nx+1;ix++) {
for(int iy=0;iy<=ny+1;iy++) {
r->SetBinContent(ix,iy,
h->GetBinContent(ix,iy));
r->SetBinError(ix,iy,
h->GetBinError(ix,iy));
}
}
delete [] yBins;
delete [] xBins;
}
TH1 *AddOverflowX(
TH1 *
h,
double widthX) {
double *xBins=new double[nx+2];
for(int i=1;i<=nx;i++) {
xBins[i-1]=
h->GetXaxis()->GetBinLowEdge(i);
}
xBins[nx]=
h->GetXaxis()->GetBinUpEdge(nx);
xBins[nx+1]=xBins[nx]+widthX;
for(int ix=0;ix<=nx+1;ix++) {
r->SetBinContent(ix,
h->GetBinContent(ix));
r->SetBinError(ix,
h->GetBinError(ix));
}
delete [] xBins;
}
void DrawOverflowX(
TH1 *
h,
double posy) {
double x1=
h->GetXaxis()->GetBinLowEdge(
h->GetNbinsX());
double x2=
h->GetXaxis()->GetBinUpEdge(
h->GetNbinsX());
double y0=
h->GetYaxis()->GetBinLowEdge(1);
double y2=
h->GetYaxis()->GetBinUpEdge(
h->GetNbinsY());;
if(
h->GetDimension()==1) {
}
double w1=-0.3;
}
void DrawOverflowY(
TH1 *
h,
double posx) {
double x0=
h->GetXaxis()->GetBinLowEdge(1);
double x2=
h->GetXaxis()->GetBinUpEdge(
h->GetNbinsX());
double y1=
h->GetYaxis()->GetBinLowEdge(
h->GetNbinsY());;
double y2=
h->GetYaxis()->GetBinUpEdge(
h->GetNbinsY());;
double w1=-0.3;
}
void DrawPadProbability(
TH2 *
h) {
h->SetTitle(
"migration probabilities;P_{T}(gen) [GeV];P_{T}(rec) [GeV]");
}
void DrawPadEfficiency(
TH1 *
h) {
h->SetTitle(
"efficiency;P_{T}(gen) [GeV];#epsilon");
legEfficiency->
AddEntry(
h,
"reconstruction",
"l");
}
void DrawPadReco(
TH1 *histMcRec,
TH1 *histMcbgrRec,
TH1 *histDataRec,
TH1 *histDataUnfold,
TH2 *histProbability,
TH2 *histRhoij) {
double amax=0.0;
}
histMcRec->
SetTitle(
"Reconstructed;P_{T}(rec);Nevent / GeV");
histMcbgrRec->
Draw(
"SAME HIST");
TH1 * histFoldBack=
nullptr;
if(histDataUnfold && histProbability && histRhoij) {
) {
for(int ix=1;ix<=nrec;ix++) {
double sume2=0.0;
for(
int iy=0;iy<=histProbability->
GetNbinsX()+1;iy++) {
for(
int iy2=0;iy2<=histProbability->
GetNbinsX()+1;iy2++) {
}
}
}
} else {
cout<<"can not fold back: "<<nrec
<<"\n";
exit(0);
}
histFoldBack->
Draw(
"SAME HIST");
}
histDataRec->
Draw(
"SAME");
DrawOverflowX(histMcRec,0.5);
legRec->
AddEntry(histMcRec,
"MC total",
"l");
legRec->
AddEntry(histMcbgrRec,
"background",
"f");
if(histFoldBack) {
int ndf=-kNbinC;
double sumD=0.,sumF=0.,chi2=0.;
for(
int i=1;i<=histDataRec->
GetNbinsX();i++) {
chi2+= pull*pull;
ndf+=1;
}
} else {
legRec->
AddEntry(histDataRec,
"data",
"lp");
}
}
void DrawPadTruth(
TH1 *histMcsigGen,
TH1 *histDataGen,
TH1 *histDataUnfold,
char const *
text,
double tau,vector<double>
const *
r,
double amin=0.;
double amax=0.;
for(
int i=1;i<=histMcsigGen->
GetNbinsX();i++) {
if(histDataUnfold) {
}
}
histMcsigGen->
SetTitle(
"Truth;P_{T};Nevent / GeV");
histMcsigGen->
Draw(
"HIST");
histDataGen->
Draw(
"SAME HIST");
if(histDataUnfold) {
histDataUnfold->
Draw(
"SAME");
}
DrawOverflowX(histMcsigGen,0.5);
}
legTruth->
AddEntry(histMcsigGen,
"MC",
"l");
if(!histDataUnfold) legTruth->
AddEntry((
TObject *)
nullptr,
" Landau(5,2)",
"");
legTruth->
AddEntry(histDataGen,
"data",
"l");
if(!histDataUnfold) legTruth->
AddEntry((
TObject *)
nullptr,
" Landau(6,1.8)",
"");
if(histDataUnfold) {
if(tau>0) {
}
legTruth->
AddEntry(histDataUnfold,t,
"lp");
("#chi^{2}/%d=%.1f prob=%.3f",
(
int)(*
r)[3],(*
r)[2]/(*
r)[3],
}
}
}
if(histDataUnfold ) {
TPad *subpad =
new TPad(
"subpad",
"",0.35,0.29,0.88,0.68);
amin=0.;
amax=0.;
int istart=11;
for(
int i=istart;i<=histMcsigGen->
GetNbinsX();i++) {
}
copyMcsigGen->
Draw(
"HIST");
copyDataGen->
Draw(
"SAME HIST");
copyDataUnfold->
Draw(
"SAME");
}
}
}
void DrawPadCorrelations(
TH2 *
h,
vector<pair<
TF1*,vector<double> > >
const *table) {
h->SetTitle(
"correlation coefficients;P_{T}(gen) [GeV];P_{T}(gen) [GeV]");
if(table) {
vector<double>
const &
r=(*table)[table->size()-1].second;
}
}
if(flag==0) {
cout<<"fcn flag=0: npar="<<npar<<" gin="<<gin<<" par=[";
for(int i=0;i<npar;i++) {
cout<<" "<<u[i];
}
cout<<"]\n";
}
double x0=0,y0=0.;
if(i>0) {
double iy=u[0]*u[2]*(
y1-y0)/(
x1-x0);
}
}
}
vector<pair<
TF1 *,vector<double> > > &table,
int niter) {
cout<<
h->GetName()<<
"\n";
double gcorAvg=0.;
double rhoMin=0.;
double rhoMax=0.;
if(rho) {
(
h->GetBinError(i+1)*
h->GetBinError(j+1));
}
}
if(di(i)>0.0) {
} else {
cout<<"bad eigenvalue i="<<i<<" di="<<di(i)<<"\n";
exit(0);
}
}
int error=0;
error++;
}
if(i==j) continue;
}
}
rhoMin=1.;
rhoMax=-1.;
(
h->GetBinError(i+1)*
h->GetBinError(j+1));
if(i!=j) {
if(rho_ij<rhoMin) rhoMin=rho_ij;
if(rho_ij>rhoMax) rhoMax=rho_ij;
}
}
}
if(di1(i)>0.0) {
d1(i,i)=1./di1(i);
} else {
cout<<"bad eigenvalue i="<<i<<" di1="<<di1(i)<<"\n";
exit(0);
}
}
double gcor2=1.-1./(vinv1(i,i)*
v1(i,i));
if(gcor2>=0.0) {
gcorAvg += gcor;
} else {
cout<<"bad global correlation "<<i<<" "<<gcor2<<"\n";
}
}
}
double xmax=
h->GetXaxis()->GetBinUpEdge(
h->GetNbinsX()-1);
landau->SetParameter(0,6000.);
fcn(
np,
nullptr,
r[0],
landau->GetParameters(),0);
r[1]=
h->GetNbinsX()-1-
landau->GetNpar();
for(
int i=0;i<
h->GetNbinsX()-1;i++) {
if(g_fcnMatrix) {
for(
int j=0;j<
h->GetNbinsX()-1;j++) {
r[2]+=di*dj*(*g_fcnMatrix)(i,j);
}
} else {
double pull=di/
h->GetBinError(i+1);
}
}
if(rho) {
g_fcnHist=nullptr;
delete g_fcnMatrix;
g_fcnMatrix=nullptr;
}
table.push_back(make_pair(landau,
r));
return s;
}
#ifdef WITH_IDS
#include "ids_code.cc"
for(
Int_t i=0; i<N_; i++ ){ (*soustr)[i] = 0.; }
unfres1IDS_ = Unfold(
data, dataErr, A_, N_, lambdaL_, soustr );
}
ModifyMatrix( Am_, A_, unfres2IDS_, dataErr, N_, lambdaM_, soustr, lambdaS_ );
delete unfres2IDS_;
unfres2IDS_ = Unfold(
data, dataErr, Am_, N_, lambdaU_, soustr );
}
#endif
Int_t gErrorIgnoreLevel
Error handling routines.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
TMatrixT< Double_t > TMatrixD
R__EXTERN TStyle * gStyle
TVectorT< Double_t > TVectorD
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Bool_t cd() override
Change current directory to "this" directory.
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
virtual Double_t GetParameter(Int_t ipar) const
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
A TGraphErrors is a TGraph with error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
void SetTitle(const char *title="") override
Change (i.e.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual Bool_t Multiply(TF1 *f1, Double_t c1=1)
Performs the operation:
void SetTitle(const char *title) override
Change/set the title.
virtual Int_t GetNbinsY() const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetNbinsX() const
virtual void SetMaximum(Double_t maximum=-1111)
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2),...
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetMinimum(Double_t minimum=-1111)
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2),...
2-D histogram with a double per channel (see TH1 documentation)
Service class for 2-D histogram classes.
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along X.
Double_t GetBinContent(Int_t binx, Int_t biny) const override
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
Use the TLine constructor to create a simple line.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual void Clear(Option_t *="")
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The most important graphics class in the ROOT system.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
void SetFillStyle(Style_t fstyle) override
Override TAttFill::FillStyle for TPad because we want to handle style=0 as style 4000.
void SaveAs(const char *filename="", Option_t *option="") const override
Save the pad content in a file.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Random number generator class based on M.
virtual ULong64_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
Base class for spline implementation containing the Draw/Paint methods.
void Draw(Option_t *option="") override
Draw this function with its current attributes.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Base class for several text objects.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
TH1 * CreateHistogram(const char *histogramName, Bool_t originalAxisBinning=kFALSE, Int_t **binMap=nullptr, const char *histogramTitle=nullptr, const char *axisSteering=nullptr) const
Create a THxx histogram capable to hold the bins of this binning node and its children.
Double_t GetBinSize(Int_t iBin) const
Get N-dimensional bin size.
Int_t GetEndBin(void) const
last+1 bin of this node (includes children)
An algorithm to unfold distributions from detector to truth level.
@ kEScanTauRhoAvg
average global correlation coefficient (from TUnfold::GetRhoI())
TH2 * GetRhoIJtotal(const char *histogramName, const char *histogramTitle=nullptr, const char *distributionName=nullptr, const char *projectionMode=nullptr, Bool_t useAxisBinning=kTRUE)
Retrieve correlation coefficients, including all uncertainties.
TH2 * GetProbabilityMatrix(const char *histogramName, const char *histogramTitle=nullptr, Bool_t useAxisBinning=kTRUE) const
Get matrix of probabilities in a new histogram.
TH1 * GetOutput(const char *histogramName, const char *histogramTitle=nullptr, const char *distributionName=nullptr, const char *projectionMode=nullptr, Bool_t useAxisBinning=kTRUE) const
retrieve unfolding result as a new histogram
virtual Int_t ScanTau(Int_t nPoint, Double_t tauMin, Double_t tauMax, TSpline **scanResult, Int_t mode=kEScanTauRhoAvg, const char *distribution=nullptr, const char *projectionMode=nullptr, TGraph **lCurvePlot=nullptr, TSpline **logTauXPlot=nullptr, TSpline **logTauYPlot=nullptr)
Scan a function wrt tau and determine the minimum.
@ kDensityModeNone
no scale factors, matrix L is similar to unity matrix
void SubtractBackground(const TH1 *hist_bgr, const char *name, Double_t scale=1.0, Double_t scale_error=0.0)
Specify a source of background.
Int_t SetInput(const TH1 *hist_y, Double_t scaleBias=0.0, Double_t oneOverZeroError=0.0, const TH2 *hist_vyy=nullptr, const TH2 *hist_vyy_inv=nullptr) override
Define the input data for subsequent calls to DoUnfold(Double_t).
virtual Double_t DoUnfold(void)
Core unfolding algorithm.
virtual Int_t ScanLcurve(Int_t nPoint, Double_t tauMin, Double_t tauMax, TGraph **lCurve, TSpline **logTauX=nullptr, TSpline **logTauY=nullptr, TSpline **logTauCurvature=nullptr)
Scan the L curve, determine tau and unfold at the final value of tau.
@ kEConstraintArea
enforce preservation of the area
@ kEConstraintNone
use no extra constraint
ERegMode
choice of regularisation scheme
@ kRegModeSize
regularise the amplitude of the output distribution
@ kHistMapOutputHoriz
truth level on x-axis of the response matrix
Double_t GetTau(void) const
Return regularisation parameter.
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
To set the address of the minimization objective function called by the native compiler (see function...
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
virtual void SetLogx(Int_t value=1)=0
void Clear(Option_t *option="") override=0
fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
double landau(double x, double mu, double sigma)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Hypot(Double_t x, Double_t y)
Returns sqrt(x*x + y*y)
Double_t LandauI(Double_t x)
Returns the cumulative (lower tail integral) of the Landau distribution function at point x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)