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
fill data tree
data event 0
data event 100000
fill signal tree
signal event 0
signal event 100000
signal event 200000
signal event 300000
signal event 400000
signal event 500000
signal event 600000
signal event 700000
signal event 800000
signal event 900000
signal event 1000000
signal event 1100000
signal event 1200000
signal event 1300000
signal event 1400000
signal event 1500000
signal event 1600000
signal event 1700000
signal event 1800000
signal event 1900000
fill background tree
background event 0
background event 100000
background event 200000
background event 300000
background event 400000
background event 500000
background event 600000
background event 700000
background event 800000
background event 900000
background event 1000000
background event 1100000
background event 1200000
background event 1300000
background event 1400000
background event 1500000
background event 1600000
background event 1700000
background event 1800000
background event 1900000
#include <iostream>
#include <cmath>
using std::cout;
public:
else return -1.0;
}
else return 999.0;
}
protected:
};
{
cout<<"fill data tree\n";
event.GenerateDataEvent(
g_rnd);
discr=
event.GetDiscriminator();
}
cout<<"fill signal tree\n";
event.GenerateSignalEvent(
g_rnd);
discr=
event.GetDiscriminator();
}
cout<<"fill background tree\n";
event.GenerateBgrEvent(
g_rnd);
discr=
event.GetDiscriminator();
if(!(
ievent%100000)) cout<<
" background event "<<
ievent<<
"\n";
}
}
Double_t ToyEvent::kDataSignalFraction=0.8;
if(IsSignal()) {
} else {
}
}
void ToyEvent::GenerateSignalEvent(
TRandom *
rnd) {
}
}
}
} else {
}
}
}
do {
do {
} else {
do {
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Random number generator class based on M.
This is the base class for the ROOT Random number generators.
A TTree represents a columnar dataset.
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho,...
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
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 Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
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 testUnfold5a.C.