Test program for the classes TUnfoldDensity and TUnfoldBinning.
A toy test of the TUnfold package
This is an example of unfolding a two-dimensional distribution also using an auxiliary measurement to constrain some background
The example comprises several macros testUnfold5a.C create root files with TTree objects for signal, background and data -> write files testUnfold5_signal.root testUnfold5_background.root testUnfold5_data.root
testUnfold5b.C create a root file with the TUnfoldBinning objects -> write file testUnfold5_binning.root
testUnfold5c.C loop over trees and fill histograms based on the TUnfoldBinning objects -> read testUnfold5_binning.root testUnfold5_signal.root testUnfold5_background.root testUnfold5_data.root
-> write testUnfold5_histograms.root
testUnfold5d.C run the unfolding -> read testUnfold5_histograms.root -> write testUnfold5_result.root testUnfold5_result.ps
chi**2=289.624+47.9755 / 213
#include <iostream>
#include <cmath>
using std::cout;
#define TEST_INPUT_COVARIANCE
{
cout<<"problem to read binning schemes\n";
}
#ifdef TEST_ZERO_UNCORR_ERROR
}
}
#endif
cout<<"problem to read input histograms\n";
}
#ifdef TEST_INPUT_COVARIANCE
}
#else
#endif
#ifdef PRINT_MATRIX_L
cout<<
"L["<<
unfold.GetLBinning()->GetBinName(
j)<<
"]";
if(
c!=0.0) cout<<
" ["<<i<<
"]="<<
c;
}
cout<<"\n";
}
#endif
}
<<
" / "<<
unfold.GetNdf()<<
"\n";
unfold.GetRhoItotal(
"histGlobalCorr",
nullptr,
nullptr,
nullptr,
kFALSE);
unfold.GetRhoIJtotal(
"histCorrCoeff",
nullptr,
nullptr,
nullptr,
kFALSE);
canvas.
Print(
"testUnfold5.ps[");
canvas.
Print(
"testUnfold5.ps");
canvas.
Print(
"testUnfold5.ps]");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Clear(Option_t *option="") override
Remove all primitives from the canvas.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
A TGraph is an object made of two arrays X and Y with npoints each.
TH1 is the base class of all histogram classes in ROOT.
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
2-D histogram with a double per channel (see TH1 documentation)
Service class for 2-D histogram classes.
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 Print(const char *filename="") const override
This method is equivalent to SaveAs("filename"). See TPad::SaveAs for details.
Base class for spline implementation containing the Draw/Paint methods.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
An algorithm to unfold distributions from detector to truth level.
@ kEScanTauRhoMax
maximum global correlation coefficient (from TUnfold::GetRhoI())
EDensityMode
choice of regularisation scale factors to cinstruct the matrix L
@ kDensityModeBinWidth
scale factors from multidimensional bin width
EConstraint
type of extra constraint
@ kEConstraintArea
enforce preservation of the area
ERegMode
choice of regularisation scheme
@ kRegModeCurvature
regularize the 2nd derivative of the output distribution
@ kHistMapOutputHoriz
truth level on x-axis of the response matrix
virtual void SetLogy(Int_t value=1)=0
Version 17.6, in parallel to changes in TUnfold
History:
- Version 17.5, in parallel to changes in TUnfold
- Version 17.4, in parallel to changes in TUnfold
- Version 17.3, in parallel to changes in TUnfold
- Version 17.2, in parallel to changes in TUnfold
- Version 17.1, in parallel to changes in TUnfold
- Version 17.0 example for multi-dimensional unfolding
This file is part of TUnfold.
TUnfold is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
TUnfold is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with TUnfold. If not, see http://www.gnu.org/licenses/.
- Author
- Stefan Schmitt DESY, 14.10.2008
Definition in file testUnfold5d.C.