33 TFile *outputFile=
new TFile(
"testUnfold5_results.root",
"recreate");
37 TFile *inputFile=
new TFile(
"testUnfold5_histograms.root");
43 inputFile->GetObject(
"detector",detectorBinning);
44 inputFile->GetObject(
"generator",generatorBinning);
46 if((!detectorBinning)||(!generatorBinning)) {
47 cout<<
"problem to read binning schemes\n";
51 detectorBinning->
Write();
52 generatorBinning->
Write();
55 TH1 *histDataReco,*histDataTruth;
58 inputFile->GetObject(
"histDataReco",histDataReco);
59 inputFile->GetObject(
"histDataTruth",histDataTruth);
60 inputFile->GetObject(
"histMCGenRec",histMCGenRec);
62 histDataReco->
Write();
63 histDataTruth->
Write();
64 histMCGenRec->
Write();
66 if((!histDataReco)||(!histDataTruth)||(!histMCGenRec)) {
67 cout<<
"problem to read input histograms\n";
85 const char *REGULARISATION_DISTRIBUTION=0;
86 const char *REGULARISATION_AXISSTEERING=
"*[B]";
90 regMode,constraintMode,densityFlags,
91 generatorBinning,detectorBinning,
92 REGULARISATION_DISTRIBUTION,
93 REGULARISATION_AXISSTEERING);
96 unfold.SetInput(histDataReco );
100 TH2 *histL= unfold.GetL(
"L");
102 cout<<
"L["<<unfold.GetLBinning()->GetBinName(j)<<
"]";
105 if(c!=0.0) cout<<
" ["<<i<<
"]="<<
c;
123 const char *SCAN_DISTRIBUTION=
"signal";
124 const char *SCAN_AXISSTEERING=0;
126 Int_t iBest=unfold.ScanTau(nScan,0.,0.,&rhoLogTau,
128 SCAN_DISTRIBUTION,SCAN_AXISSTEERING,
133 rhoLogTau->
GetKnot(iBest,t[0],rho[0]);
138 for(
Int_t i=0;i<nScan;i++) {
139 rhoLogTau->
GetKnot(i,tAll[i],rhoAll[i]);
143 cout<<
"chi**2="<<unfold.GetChi2A()<<
"+"<<unfold.GetChi2L()
144 <<
" / "<<unfold.GetNdf()<<
"\n";
151 TH1 *histDataUnfold=unfold.GetOutput(
"unfolded signal",0,0,0,
kFALSE);
154 TH1 *histMCTruth=histMCGenRec->
ProjectionX(
"histMCTruth",0,-1,
"e");
157 histMCReco->
Scale(scaleFactor);
158 histMCTruth->
Scale(scaleFactor);
160 TH2 *histProbability=unfold.GetProbabilityMatrix(
"histProbability");
162 TH1 *histGlobalCorr=unfold.GetRhoItotal(
"histGlobalCorr",0,0,0,
kFALSE);
163 TH1 *histGlobalCorrScan=unfold.GetRhoItotal
164 (
"histGlobalCorrScan",0,SCAN_DISTRIBUTION,SCAN_AXISSTEERING,
kFALSE);
165 TH2 *histCorrCoeff=unfold.GetRhoIJtotal(
"histCorrCoeff",0,0,0,
kFALSE);
168 canvas->
Print(
"testUnfold5.ps[");
180 histDataReco->
Draw(
"E");
182 histMCReco->
Draw(
"SAME HIST");
185 histProbability->
Draw(
"BOX");
189 histDataUnfold->
Draw(
"E");
191 histDataTruth->
Draw(
"SAME HIST");
193 histMCTruth->
Draw(
"SAME HIST");
199 bestRhoLogTau->
Draw(
"*");
204 histGlobalCorrScan->
Draw(
"HIST");
209 bestLCurve->
Draw(
"*");
212 canvas->
Print(
"testUnfold5.ps");
214 canvas->
Print(
"testUnfold5.ps]");
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along Y.
Base class for spline implementation containing the Draw/Paint methods //.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
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.
virtual void SetMinimum(Double_t minimum=-1111)
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
void Clear(Option_t *option="")
Remove all primitives from the canvas.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
Service class for 2-Dim histogram classes.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void Print(const char *filename="") const
Save Pad contents in a file in one of various formats.
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const =0
This class serves as a container of analysis bins analysis bins are specified by defining the axes of...
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Int_t GetNbinsX() const
virtual Int_t GetNbinsY() const