Skip to content
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

[RC] workspace jsons #27

Open
Moelf opened this issue Sep 5, 2023 · 0 comments
Open

[RC] workspace jsons #27

Moelf opened this issue Sep 5, 2023 · 0 comments

Comments

@Moelf
Copy link
Owner

Moelf commented Sep 5, 2023

all_hists = Dict(tag => LHC_AGC.get_histo(tag; n_files_max_per_sample=3) for tag in LHC_AGC.TAGS);

LHC_AGC.generate_workspace_file(all_hists, "workspace.json", [[0], [0]])

JSON3.write("raw.json", all_hists)

output:


and I have soft-linked data folder:

~/LHC_AGC.jl $ ln -s /data/alheld/AGC/datasets/nanoAOD/ ./data

and applied the following patch:

diff --git a/src/LHC_AGC.jl b/src/LHC_AGC.jl
index c072c34..f1b3cdd 100644
--- a/src/LHC_AGC.jl
+++ b/src/LHC_AGC.jl
@@ -18,7 +18,7 @@ end
     Convert xrd path from JSON to local path
 """
 function xrd_to_local(url)
-    joinpath(BASE_PATH[], last(split(url, '/')))
+    joinpath(BASE_PATH[], last(split(url, '/'), 2)...)
 end

 const TAG_PATH_DICT =
diff --git a/src/main_loop.jl b/src/main_loop.jl
index 931d658..986b970 100644
--- a/src/main_loop.jl
+++ b/src/main_loop.jl
@@ -10,7 +10,7 @@ function get_histo(process_tag::Symbol; do_file_variations::Bool=true, wgt = 0.0
     file_variation_tags = (do_file_variations ? keys(TAG_PATH_DICT[process_tag]) : [:nominal])

     all_hists = reduce(merge, [
-        mapreduce(mergewith(+), @view TAG_PATH_DICT[process_tag][variation_tag][begin:N]) do path
+        mapreduce(mergewith(+), @view first(TAG_PATH_DICT[process_tag][variation_tag], N)) do path
             get_histo(LazyTree(path, "Events"), wgt, file_variation=variation_tag)
         end for variation_tag in file_variation_tags
     ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant