-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert boost hists to ROOT TGraphs #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @apaasch. It looks OK to me so far, I only have a few comments related to code style and variable naming, but this should be easy to fix. One should also maybe clarify if the convert_to_root.py
script is meant to run while columnflow is sourced or completely outside (it would also be good to add this information to the file).
dijet/tasks/base.py
Outdated
@@ -57,8 +60,8 @@ def get_datasets(self) -> tuple[list[str], bool]: | |||
# check that at least one config dataset matched | |||
if not dataset_insts_from_process: | |||
raise RuntimeError( | |||
"no single dataset found in config matching " | |||
f"process `{self.branch_data.process}`" | |||
"no single dataset found in config matching ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comma needed here since the string continues on the next line.
"no single dataset found in config matching ", | |
"no single dataset found in config matching " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
dijet/tasks/base.py
Outdated
@@ -68,8 +71,8 @@ def get_datasets(self) -> tuple[list[str], bool]: | |||
# check that at least one user-supplied dataset matched | |||
if not datasets_filtered: | |||
raise RuntimeError( | |||
"no single user-supplied dataset matched " | |||
f"process `{self.branch_data.process}`" | |||
"no single user-supplied dataset matched ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"no single user-supplied dataset matched ", | |
"no single user-supplied dataset matched " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
dijet/scripts/convert_to_root.py
Outdated
print(f"{arg}: {getattr(args, arg)}") | ||
|
||
# Construct the file path | ||
base_path = "/nfs/dust/cms/user/paaschal/WorkingArea/Analysis/JERC/DiJet/data/dijet_store/analysis_dijet/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this script be run inside a columnflow environment (i.e. after sourcing setup.sh
)? If so, it would be good to avoid hardcoding the path here and use the environment variables insteda (e.g. os.getenv("CF_STORE_LOCAL")
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can be run within the CF environment. You suggestion will be added to the next commit.
Redo flake8 changes Change naming scheme and structur in root task to be more efficient and readable. Co-authored-by: Daniel Savoiu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, all your suggestion have been added.
dijet/scripts/convert_to_root.py
Outdated
print(f"{arg}: {getattr(args, arg)}") | ||
|
||
# Construct the file path | ||
base_path = "/nfs/dust/cms/user/paaschal/WorkingArea/Analysis/JERC/DiJet/data/dijet_store/analysis_dijet/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can be run within the CF environment. You suggestion will be added to the next commit.
dijet/tasks/base.py
Outdated
@@ -57,8 +60,8 @@ def get_datasets(self) -> tuple[list[str], bool]: | |||
# check that at least one config dataset matched | |||
if not dataset_insts_from_process: | |||
raise RuntimeError( | |||
"no single dataset found in config matching " | |||
f"process `{self.branch_data.process}`" | |||
"no single dataset found in config matching ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
dijet/tasks/base.py
Outdated
@@ -68,8 +71,8 @@ def get_datasets(self) -> tuple[list[str], bool]: | |||
# check that at least one user-supplied dataset matched | |||
if not datasets_filtered: | |||
raise RuntimeError( | |||
"no single user-supplied dataset matched " | |||
f"process `{self.branch_data.process}`" | |||
"no single user-supplied dataset matched ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Looks good to me, but there is one small change I would make to the convert_to_root.py
script (see below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me now. Let's merge!
Task structure to store boost histogram objects as TGraphAsymmErrors in rootfiles.
Main goal is to do this indepently from Root using uproot.
This is not yet possible but there is ongoing work from the uproot team addressing this issue.
Updates can be followed in this PR from uproot5.
As long as this feature is not yet implement the conversion is done in two steps:
In the long term, the second step is included in the first one and remove the dependency from Root.
Additional