108 for (
Int_t i=0;i<nPoints;i++) {
115 for (
Int_t i=0;i<nPoints;i++) {
116 for (
Int_t j=0;j<nPoints;j++) {
126 return par[0]/(dm*dm+par[2]*par[2]);
140 if(rnd->
Rndm()>bgr) {
182 if(rnd->
Rndm()>frac) {
183 return rnd->
Gaus(mTrue+smallBias,smallSigma);
185 return rnd->
Gaus(mTrue+wideBias,wideSigma);
201 Double_t const luminosityData=100000;
202 Double_t const luminosityMC=1000000;
205 Int_t const nDet=250;
206 Int_t const nGen=100;
215 TH1D *histMgenMC=
new TH1D(
"MgenMC",
";mass(gen)",nGen,xminGen,xmaxGen);
216 TH1D *histMdetMC=
new TH1D(
"MdetMC",
";mass(det)",nDet,xminDet,xmaxDet);
217 TH2D *histMdetGenMC=
new TH2D(
"MdetgenMC",
";mass(det);mass(gen)",
218 nDet,xminDet,xmaxDet,nGen,xminGen,xmaxGen);
220 for(
Int_t i=0;i<neventMC;i++) {
233 histMgenMC->
Fill(mGen,luminosityData/luminosityMC);
235 histMdetMC->
Fill(mDet,luminosityData/luminosityMC);
250 histMdetGenMC->
Fill(mDet,mGen,luminosityData/luminosityMC);
257 TH2D *histMdetGenSysMC=
new TH2D(
"MdetgenSysMC",
";mass(det);mass(gen)",
258 nDet,xminDet,xmaxDet,nGen,xminGen,xmaxGen);
259 neventMC=rnd->
Poisson(luminosityMC*crossSection);
260 for(
Int_t i=0;i<neventMC;i++) {
266 histMdetGenSysMC->
Fill(mDet,mGen,luminosityData/luminosityMC);
272 TH1D *histMgenData=
new TH1D(
"MgenData",
";mass(gen)",nGen,xminGen,xmaxGen);
273 TH1D *histMdetData=
new TH1D(
"MdetData",
";mass(det)",nDet,xminDet,xmaxDet);
274 Int_t neventData=rnd->
Poisson(luminosityData*crossSection);
275 for(
Int_t i=0;i<neventData;i++) {
282 histMgenData->
Fill(mGen);
285 histMdetData->
Fill(mDet);
290 TH1D *histDensityGenData=
new TH1D(
"DensityGenData",
";mass(gen)",
291 nGen,xminGen,xmaxGen);
292 TH1D *histDensityGenMC=
new TH1D(
"DensityGenMC",
";mass(gen)",
293 nGen,xminGen,xmaxGen);
294 for(
Int_t i=1;i<=nGen;i++) {
312 if(unfold.SetInput(histMdetData)>=10000) {
313 std::cout<<
"Unfolding result may be wrong\n";
329 #ifdef VERBOSE_LCURVE_SCAN 335 iBest=unfold.ScanLcurve(nScan,tauMin,tauMax,&lCurve,&logTauX,&logTauY);
338 #ifdef VERBOSE_LCURVE_SCAN 348 TH2D *histMdetGenSys1=
new TH2D(
"Mdetgensys1",
";mass(det);mass(gen)",
349 nDet,xminDet,xmaxDet,nGen,xminGen,xmaxGen);
350 for(
Int_t i=0;i<=nDet+1;i++) {
352 for(
Int_t j=0;j<=nGen+1;j++) {
365 std::cout<<
"tau="<<unfold.GetTau()<<
"\n";
366 std::cout<<
"chi**2="<<unfold.GetChi2A()<<
"+"<<unfold.GetChi2L()
367 <<
" / "<<unfold.GetNdf()<<
"\n";
368 std::cout<<
"chi**2(sys)="<<unfold.GetChi2Sys()<<
"\n";
375 logTauX->
GetKnot(iBest,t[0],x[0]);
376 logTauY->
GetKnot(iBest,t[0],y[0]);
384 TH1 *histMunfold=unfold.GetOutput(
"Unfolded");
387 TH1 *histMdetFold=unfold.GetFoldedOutput(
"FoldedBack");
395 TH2 *histEmatTotal=unfold.GetEmatrixTotal(
"EmatTotal");
398 TH1D *histTotalError=
399 new TH1D(
"TotalError",
";mass(gen)",nGen,xminGen,xmaxGen);
400 for(
Int_t bin=1;bin<=nGen;bin++) {
411 TH1 *histRhoi=unfold.GetRhoItotal(
"rho_I",
425 gFitter->
SetFCN(chisquare_corr);
427 TF1 *bw=
new TF1(
"bw",bw_func,xminGen,xmaxGen,3);
434 histMunfold->
Fit(bw,
"UE");
448 histMdetGenMC->
Draw(
"BOX");
456 histTotalError->
Draw(
"E");
458 histMunfold->
Draw(
"SAME E1");
460 histDensityGenData->
Draw(
"SAME");
461 histDensityGenMC->
Draw(
"SAME HIST");
469 histMdetFold->
Draw();
470 histMdetMC->
Draw(
"SAME HIST");
472 TH1 *histInput=unfold.GetInput(
"Minput",
";mass(det)");
475 histInput->
Draw(
"SAME");
485 bestLogTauLogChi2->
Draw(
"*");
491 bestLcurve->
Draw(
"*");
493 output.
SaveAs(
"testUnfold1.ps");
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Random number generator class based on M.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
R__EXTERN Int_t gErrorIgnoreLevel
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
R__EXTERN TStyle * gStyle
Base class for spline implementation containing the Draw/Paint methods //.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void SetNumberFitPoints(Int_t npfits)
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
This is the base class for the ROOT Random number generators.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetFCN(void *fcn) R__DEPRECATED(6
To set the address of the minimization objective function.
virtual void SetBinError(Int_t bin, Double_t error)
See convention for numbering bins in TH1::GetBin.
virtual Double_t Rndm()
Machine independent random number generator.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Service class for 2-Dim histogram classes.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
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...
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
static void RejectPoint(Bool_t reject=kTRUE)
Static function to set the global flag to reject points the fgRejectPoint global flag is tested by al...
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const =0
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
Abstract Base Class for Fitting.
virtual Int_t GetNpar() const
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
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.
static Bool_t RejectedPoint()
See TF1::RejectPoint above.
A Graph is a graphics object made of two arrays X and Y with npoints each.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetParameter(Int_t param, Double_t value)
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual Int_t GetNbinsX() const
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
Double_t Sqrt(Double_t x)
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
Int_t Fill(Double_t)
Invalid Fill method.
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual TObject * GetUserFunc() const
virtual TObject * GetObjectFit() const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
tomato 2-D histogram with a double per channel (see TH1 documentation)}