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
3abc96de
Commit
3abc96de
authored
6 years ago
by
Stefan Wunsch
Browse files
Options
Downloads
Patches
Plain Diff
[RDF,Tutorial] Restructure code of NanoAOD tutorial for nicer notebook representation
parent
43f5d4df
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tutorials/dataframe/df102_NanoAODDimuonAnalysis.C
+9
-16
9 additions, 16 deletions
tutorials/dataframe/df102_NanoAODDimuonAnalysis.C
with
9 additions
and
16 deletions
tutorials/dataframe/df102_NanoAODDimuonAnalysis.C
+
9
−
16
View file @
3abc96de
...
...
@@ -23,11 +23,9 @@
using
namespace
ROOT
::
VecOps
;
void
DrawSpectrum
(
TH1D
&
h
);
void
df102_NanoAODDimuonAnalysis
()
{
// Enable
implicit
multi-threading
// Enable multi-threading
ROOT
::
EnableImplicitMT
();
// Create dataframe from NanoAOD file
...
...
@@ -74,21 +72,11 @@ void df102_NanoAODDimuonAnalysis()
auto
df_mass
=
df_pair
.
Define
(
"Dimuon_mass"
,
compute_mass
,
{
"Muon_pt"
,
"Muon_eta"
,
"Muon_phi"
,
"Muon_mass"
,
"Muon_pair"
});
// P
lot
histogram of di-muon mass spectrum
// P
roduce
histogram of di-muon mass spectrum
auto
h
=
df_mass
.
Histo1D
({
"Dimuon_mass"
,
"Dimuon_mass"
,
20000
,
0
.
25
,
300
},
"Dimuon_mass"
)
.
GetValue
();
// Draw histogram
DrawSpectrum
(
h
);
}
int
main
()
{
df102_NanoAODDimuonAnalysis
();
}
void
DrawSpectrum
(
TH1D
&
h
)
{
// Make plot
gStyle
->
SetOptStat
(
0
);
gStyle
->
SetTextFont
(
42
);
TCanvas
c
(
"c"
,
"c"
,
800
,
600
);
...
...
@@ -111,7 +99,6 @@ void DrawSpectrum(TH1D& h)
label
.
DrawLatex
(
0
.
415
,
0
.
680
,
"#psi'"
);
label
.
DrawLatex
(
0
.
485
,
0
.
760
,
"Y(1,2,3S)"
);
label
.
DrawLatex
(
0
.
755
,
0
.
620
,
"Z"
);
label
.
DrawLatex
(
0
.
170
,
0
.
350
,
"#bf{CMS Open Data}"
);
label
.
DrawLatex
(
0
.
170
,
0
.
275
,
"#bf{#sqrt{s} = 7 TeV}"
);
label
.
DrawLatex
(
0
.
170
,
0
.
200
,
"#bf{L_{int} = 2.4 fb^{-1}}"
);
...
...
@@ -119,4 +106,10 @@ void DrawSpectrum(TH1D& h)
label
.
DrawLatex
(
0
.
10
,
0
.
920
,
"Run2011A Double Muon Dataset (DOI: 10.7483/OPENDATA.CMS.RZ34.QR6N)"
);
c
.
SaveAs
(
"nanoaod_dimuon_spectrum.pdf"
);
c
.
Draw
();
}
int
main
()
{
df102_NanoAODDimuonAnalysis
();
}
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