Skip to content
Snippets Groups Projects
Commit a4edf43a authored by Olivier Couet's avatar Olivier Couet
Browse files

Improve doc as requested here https://sft.its.cern.ch/jira/browse/ROOT-8925

parent 32bc0000
No related branches found
No related tags found
No related merge requests found
...@@ -1827,6 +1827,7 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons ...@@ -1827,6 +1827,7 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons
\end{bmatrix} \end{bmatrix}
\f] \f]
*/ */
///
/// #### References: /// #### References:
/// ///
/// 1. Jandel M., Morhac; M., Kliman J., Krupa L., Matouoek /// 1. Jandel M., Morhac; M., Kliman J., Krupa L., Matouoek
...@@ -1845,29 +1846,27 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons ...@@ -1845,29 +1846,27 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons
/// #### Script: /// #### Script:
/// ///
/// ~~~ {.cpp} /// ~~~ {.cpp}
/// // Example to illustrate unfolding function (class TSpectrum). /// // Example to illustrate unfolding function (class TSpectrum).
/// // To execute this example, do /// // To execute this example, do
/// // root > .x Unfolding.C /// // root > .x Unfolding.C
///
/// #include <TSpectrum>
/// ///
/// void Unfolding() { /// void Unfolding() {
/// Int_t i, j; /// Int_t i, j;
/// Int_t nbinsx = 2048; /// Int_t nbinsx = 2048;
/// Int_t nbinsy = 10; /// Int_t nbinsy = 10;
/// Double_t xmin = 0; /// double xmin = 0;
/// Double_t xmax = nbinsx; /// double xmax = nbinsx;
/// Double_t ymin = 0; /// double ymin = 0;
/// Double_t ymax = nbinsy; /// double ymax = nbinsy;
/// Double_t * source = new Double_t[nbinsx]; /// double *source = new double[nbinsx];
/// Double_t ** response = new Double_t *[nbinsy]; /// double **response = new double *[nbinsy];
/// for (i=0;i<nbinsy;i++) response[i]=new Double_t[nbinsx]; /// for (i=0;i<nbinsy;i++) response[i] = new double[nbinsx];
/// TH1F *h = new TH1F("h","",nbinsx,xmin,xmax); /// TH1F *h = new TH1F("h","",nbinsx,xmin,xmax);
/// TH1F *d = new TH1F("d","Decomposition - unfolding",nbinsx,xmin,xmax); /// TH1F *d = new TH1F("d","Decomposition - unfolding",nbinsx,xmin,xmax);
/// TH2F *decon_unf_resp = new TH2F("decon_unf_resp","Root File",nbinsy,ymin,ymax,nbinsx,xmin,xmax); /// TH2F *decon_unf_resp = new TH2F("decon_unf_resp","Root File",nbinsy,ymin,ymax,nbinsx,xmin,xmax);
/// TFile *f = new TFile("spectra/TSpectrum.root"); /// TFile *f = new TFile("TSpectrum.root");
/// h=(TH1F*) f->Get("decon_unf_in;1"); /// h = (TH1F*) f->Get("decon_unf_in;1");
/// TFile *fr = new TFile("spectra/TSpectrum.root"); /// TFile *fr = new TFile("TSpectrum.root");
/// decon_unf_resp = (TH2F*) fr->Get("decon_unf_resp;1"); /// decon_unf_resp = (TH2F*) fr->Get("decon_unf_resp;1");
/// for (i = 0; i < nbinsx; i++) source[i] = h->GetBinContent(i + 1); /// for (i = 0; i < nbinsx; i++) source[i] = h->GetBinContent(i + 1);
/// for (i = 0; i < nbinsy; i++){ /// for (i = 0; i < nbinsy; i++){
...@@ -1875,11 +1874,11 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons ...@@ -1875,11 +1874,11 @@ const char *TSpectrum::DeconvolutionRL(Double_t *source, const Double_t *respons
/// response[i][j] = decon_unf_resp->GetBinContent(i + 1, j + 1); /// response[i][j] = decon_unf_resp->GetBinContent(i + 1, j + 1);
/// } /// }
/// } /// }
/// TCanvas *Decon1 = gROOT->GetListOfCanvases()->FindObject("Decon1"); /// TCanvas *Decon1 = (TCanvas *)gROOT->GetListOfCanvases()->FindObject("Decon1");
/// if (!Decon1) Decon1 = new TCanvas("Decon1","Decon1",10,10,1000,700); /// if (!Decon1) Decon1 = new TCanvas("Decon1","Decon1",10,10,1000,700);
/// h->Draw("L"); /// h->Draw("L");
/// TSpectrum *s = new TSpectrum(); /// TSpectrum *s = new TSpectrum();
/// s->Unfolding(source,response,nbinsx,nbinsy,1000,1,1); /// s->Unfolding(source,(const double**)response,nbinsx,nbinsy,1000,1,1);
/// for (i = 0; i < nbinsy; i++) d->SetBinContent(i + 1,source[i]); /// for (i = 0; i < nbinsy; i++) d->SetBinContent(i + 1,source[i]);
/// d->SetLineColor(kRed); /// d->SetLineColor(kRed);
/// d->SetAxisRange(0,nbinsy); /// d->SetAxisRange(0,nbinsy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment