Test program for the classes TUnfoldDensity and TUnfoldBinning.
A toy test of the TUnfold package
This example is documented in conference proceedings:
arXiv:1611.01927 12th Conference on Quark Confinement and the Hadron Spectrum (Confinement XII)
This is an example of unfolding a two-dimensional distribution also using an auxiliary measurement to constrain some background
The example comprises several macros
- testUnfold7a.C create root files with TTree objects for signal, background and data
- write files testUnfold7_signal.root testUnfold7_background.root testUnfold7_data.root
- testUnfold7b.C loop over trees and fill histograms based on the TUnfoldBinning objects
- read testUnfold7binning.xml testUnfold7_signal.root testUnfold7_background.root testUnfold7_data.root
- write testUnfold7_histograms.root
- testUnfold7c.C run the unfolding
- read testUnfold7_histograms.root
- write testUnfold7_result.root testUnfold7_result.ps
fill data tree
data event 0
fill signal tree
signal event 0
signal event 100000
signal event 200000
fill background tree
background event 0
#include <iostream>
#include <cmath>
#define MASS1 0.511E-3
using std::cout;
public:
if(IsSignal())
return fMGen[i];
else return -1.0;
}
if(IsSignal())
return fPtGen[i];
else return -1.0;
}
else return 999.0;
}
else return 999.0;
}
protected:
public:
};
{
cout<<"fill data tree\n";
event.GenerateDataEvent(
g_rnd);
for(int i=0;i<3;i++) {
ptRec[i]=
event.GetPtRec(i);
mRec[i]=
event.GetMRec(i);
ptGen[i]=
event.GetPtGen(i);
mGen[i]=
event.GetMGen(i);
}
discr=
event.GetDiscriminator();
}
cout<<"fill signal tree\n";
event.GenerateSignalEvent(
g_rnd);
for(int i=0;i<3;i++) {
ptRec[i]=
event.GetPtRec(i);
mRec[i]=
event.GetMRec(i);
ptGen[i]=
event.GetPtGen(i);
mGen[i]=
event.GetMGen(i);
}
discr=
event.GetDiscriminator();
}
bgrTree->Branch(
"weight",&weight,
"weight/F");
cout<<"fill background tree\n";
event.GenerateBgrEvent(
g_rnd);
for(int i=0;i<3;i++) {
ptRec[i]=
event.GetPtRec(i);
}
discr=
event.GetDiscriminator();
if(!(
ievent%100000)) cout<<
" background event "<<
ievent<<
"\n";
}
}
Double_t ToyEvent7::kDataSignalFraction=0.75;
Double_t ToyEvent7::kMCSignalFraction=0.75;
if(IsSignal()) {
} else {
}
}
void ToyEvent7::GenerateSignalEvent(
TRandom *
rnd) {
}
}
do {
}
do {
do {
double r=
rnd->Uniform(-1.,1.);
p[0].SetXYZT(px,py,pz,
e);
p[1].SetXYZT(-px,-py,-pz,
e);
for(int i=0;i<2;i++) {
}
for(int i=0;i<3;i++) {
}
}
for(int i=0;i<3;i++) {
}
for(int i=0;i<2;i++) {
p[i].SetPtEtaPhiM(
rnd->Exp(15.0),
rnd->Uniform(-3.,3.),
}
for(int i=0;i<3;i++) {
}
}
for(int i=0;i<2;i++) {
do {
}
for(int i=0;i<3;i++) {
}
}
do {
} else {
do {
}
for(int i=0;i<2;i++) {
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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
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.
RVec< PromoteTypes< T0, T1 > > remainder(const T0 &x, const RVec< T1 > &v)
LVector boost(const LVector &v, const BoostVector &b)
Boost a generic Lorentz Vector class using a generic 3D Vector class describing the boost The only re...
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
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.
static uint64_t sum(uint64_t i)
Version 17.6, in parallel to changes in TUnfold
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 testUnfold7a.C.