Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
a4edf43a
Commit
a4edf43a
authored
7 years ago
by
Olivier Couet
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hist/spectrum/src/TSpectrum.cxx
+16
-17
16 additions, 17 deletions
hist/spectrum/src/TSpectrum.cxx
with
16 additions
and
17 deletions
hist/spectrum/src/TSpectrum.cxx
+
16
−
17
View file @
a4edf43a
...
@@ -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;
///
D
ouble
_t
xmin = 0;
///
d
ouble xmin = 0;
///
D
ouble
_t
xmax = nbinsx;
///
d
ouble xmax = nbinsx;
///
D
ouble
_t
ymin = 0;
///
d
ouble ymin = 0;
///
D
ouble
_t
ymax = nbinsy;
///
d
ouble ymax = nbinsy;
///
D
ouble
_t
*
source = new
D
ouble
_t
[nbinsx];
///
d
ouble *source
= new
d
ouble[nbinsx];
///
D
ouble
_t
**
response = new
D
ouble
_t
*[nbinsy];
///
d
ouble **response = new
d
ouble *[nbinsy];
/// for (i=0;i<nbinsy;i++) response[i]
=
new
D
ouble
_t
[nbinsx];
/// for (i=0;i<nbinsy;i++) response[i]
=
new
d
ouble[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);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment