Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RDStar
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
Container registry
Model registry
Operate
Environments
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
Show more breadcrumbs
Felix Metzner
RDStar
Commits
6891fb83
Commit
6891fb83
authored
4 years ago
by
Patrick Ecker
Browse files
Options
Downloads
Patches
Plain Diff
fixed an issue with the plotting
parent
74e8fac3
Branches
Branches containing commit
No related tags found
1 merge request
!63
Low level cut study
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdstar/studies/low_level_cut_study/plotting.py
+11
-8
11 additions, 8 deletions
rdstar/studies/low_level_cut_study/plotting.py
with
11 additions
and
8 deletions
rdstar/studies/low_level_cut_study/plotting.py
+
11
−
8
View file @
6891fb83
...
...
@@ -44,7 +44,7 @@ class LowLevelCutPlotter:
return
output
def
plot_on
(
self
)
->
Dict
[
str
,
os
.
fspath
]:
def
plot_on
(
self
,
save
:
bool
=
True
)
->
Dict
[
str
,
os
.
fspath
]:
output
=
{}
relevant_keys
=
[
key
for
key
in
self
.
cut_dicts
if
key
.
startswith
(
self
.
n_tuple
)]
for
key
in
relevant_keys
:
...
...
@@ -66,7 +66,8 @@ class LowLevelCutPlotter:
plt
.
cla
()
plt
.
title
(
cut_info
.
cut_str
,
loc
=
"
center
"
)
plt
.
title
(
channel
,
loc
=
"
right
"
)
plt
.
savefig
(
save_path
)
if
save
:
plt
.
savefig
(
save_path
)
continue
fig
,
ax
=
plt
.
subplots
()
...
...
@@ -95,16 +96,18 @@ class LowLevelCutPlotter:
plt
.
legend
(
loc
=
"
best
"
)
save_path
=
os
.
path
.
join
(
self
.
target_path
,
f
"
{
key
}
_
{
new_cut_info
.
cut_name
}
_evaluation.pdf
"
)
output
.
update
({
f
"
{
key
}
_
{
new_cut_info
.
cut_name
}
_evaluation
"
:
save_path
})
plt
.
savefig
(
save_path
)
#plt.show()
if
save
:
plt
.
savefig
(
save_path
)
else
:
plt
.
show
()
return
output
if
__name__
==
'
__main__
'
:
df
=
pd
.
read_hdf
(
"
/ceph/pecker/rdstar/low_level_cut_study/prod_4thAug/CombinedNTuples/e_ntuple_total.h5
"
)
#
df = pd.read_hdf("/ceph/pecker/rdstar/low_level_cut_study/CombinedNTuples/dcharged_ntuple_total.h5")
llcp
=
LowLevelCutPlotter
(
n_tuple
=
"
e
_ntuple
"
,
target_path
=
""
)
#
df = pd.read_hdf("/ceph/pecker/rdstar/low_level_cut_study/prod_4thAug/CombinedNTuples/e_ntuple_total.h5")
df
=
pd
.
read_hdf
(
"
/ceph/pecker/rdstar/low_level_cut_study/CombinedNTuples/dcharged_ntuple_total.h5
"
)
llcp
=
LowLevelCutPlotter
(
n_tuple
=
"
dcharged
_ntuple
"
,
target_path
=
""
)
print
(
llcp
.
generate_output_dict
())
llcp
.
get_df
(
df
=
df
)
#llcp.apply_cuts(pivot=fsp_cut_dict["e_ntuple"]["cuts"][0], cut_infos=fsp_cut_dict["e_ntuple"]["cuts"])
llcp
.
plot_on
()
\ No newline at end of file
llcp
.
plot_on
(
save
=
False
)
\ No newline at end of file
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