Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
1ebac8c
Fix to jer application on jec variations (#665)
JulesVandenbroeck Apr 28, 2025
ab1372b
Refactoring for 0.3 release (#628)
riga May 27, 2025
578d8b7
Add tmp dir checks, add cf_setup_post_install hook.
riga May 28, 2025
67f98da
don't consider empty axis as "missing"
maadcoen May 28, 2025
db5f46b
correct json file extension
maadcoen May 28, 2025
54191a5
Hotfix category flattening.
riga May 28, 2025
c21f2c2
Merge pull request #691 from GhentAnalysis/upstream/fix_stats_file_ext
mafrahm May 28, 2025
5ab1fdc
Improve tmp file check.
riga May 30, 2025
ca64e45
Merge pull request #690 from GhentAnalysis/upstream/fix_empty_hist_axis
mafrahm Jun 4, 2025
e0d1357
Update law.
riga Jun 12, 2025
05416b8
Make jet collection used in DY weights more flexible
Lara813 Jun 12, 2025
3089292
Merge pull request #696 from columnflow/feature/dy_weight
mafrahm Jun 12, 2025
b9044c4
Hotfix missing xsecs for stitched weight producer.
riga Jun 13, 2025
796b5db
Add dfs lookup pattern negation.
riga Jun 13, 2025
9ad7489
Allow skipping parts of post setup.
riga Jun 16, 2025
59dd574
allow evaluating multiple working points with single electron_weights…
mafrahm Jun 16, 2025
d9df517
Fix task key lookup. (#697)
riga Jun 16, 2025
79c1bad
Fix scope issue in seed producer.
riga Jun 18, 2025
00d595d
typo.
mafrahm Jun 18, 2025
97770d4
add run to inputs and remove double underscore
mafrahm Jun 19, 2025
35bf540
improve readability of make_jme_keys
mafrahm Jun 19, 2025
96d3919
implement data_per_era tag to jec config
mafrahm Jun 19, 2025
c2e35fa
docs: add LuSchaller as a contributor for code (#701)
allcontributors[bot] Jun 20, 2025
86765d1
added sourcing of cms setup to ensure scram is available (#699)
LuSchaller Jun 20, 2025
c86e46e
Fix typo in cf_inspect.
riga Jun 23, 2025
e1ebc81
Hotfix validation check in stitched normalization weight production.
riga Jun 25, 2025
14a3444
Improve categorizer calls. (#702)
riga Jun 25, 2025
2599015
Add ml model task pinning. (#703)
riga Jun 25, 2025
150e910
add exception when era aux is missing
mafrahm Jun 25, 2025
2f232af
Merge pull request #700 from columnflow/fix/jec_2023
mafrahm Jun 25, 2025
e9575f9
apply blinding threshold before process scaling
mafrahm Jun 26, 2025
1700472
merge workflow reqs of different variables in CreateDatacards (#689)
mafrahm Jun 26, 2025
21c55a5
Revert process id check in normalization producer.
riga Jun 26, 2025
3fe0f0c
[cms] Add note on TEC-to-MET propagation.
riga Jun 26, 2025
7a7359c
Control row group merging in MergeReducedEvents.
riga Jun 26, 2025
054edd9
Update law.
riga Jun 26, 2025
32a041c
Improve reduced events merging.
riga Jun 27, 2025
7240932
Updata law.
riga Jun 27, 2025
189d4d5
Store dataset_info_inst in params, cap files for reduction stats.
riga Jun 30, 2025
7903bb9
Make merging chunk size configurable. (#707)
riga Jul 3, 2025
f6113d3
Bump version in __version__ file.
riga Jul 3, 2025
80d7c38
add confirm message to cf_remove_tmp
mafrahm Jul 4, 2025
0100f25
Use return code in tmp removal.
riga Jul 4, 2025
9510f20
hotfix: constistent branches reqs between MergeReducedEvents and Merg…
mafrahm Jul 11, 2025
bfa2180
lint
mafrahm Jul 11, 2025
b45c2d8
fix handling of non_zero_mask in murf_envelope (#704)
mafrahm Jul 11, 2025
7e33b31
Fix reduction chunk size control.
riga Jul 14, 2025
35361c5
Fix/asymmetric syst unc (#710)
mafrahm Jul 15, 2025
02af6b7
Update law.
riga Jul 16, 2025
ce87e4f
check and remove overlaping processes (#712)
aalvesan Jul 16, 2025
9d4ce32
sort configs by ids for the multi config representation
haddadanas Jul 18, 2025
4dcd0b1
Merge pull request #713 from haddadanas/sort_configs
mafrahm Jul 18, 2025
0960301
Optionally bypass branch-level plot requirements. (#716)
riga Jul 21, 2025
5f5411e
inference model caching (#714)
mafrahm Jul 21, 2025
4396f81
pad with nominal if shift source missing in config (#715)
mafrahm Jul 21, 2025
32df6b7
Add option for hook to update dataset_selection_stats in norm weight …
riga Jul 24, 2025
0bdff9f
fix missing datasets in MultiConfig
Jul 29, 2025
f3af6f2
Update law.
riga Jul 30, 2025
b9cfaac
Add local directory check to cf_remove_tmp.
riga Jul 30, 2025
6600f0e
Hotfix typo.
riga Jul 30, 2025
611dd85
update met_phi Calibrator to new format (#719)
mafrahm Jul 31, 2025
d3689a3
Update law.
riga Jul 31, 2025
03efd80
Generalize normalization weight producer. (#718)
riga Aug 6, 2025
0619ee3
Hotfix inclusive dataset lookup in norm producer.
riga Aug 8, 2025
13d6523
Update boost-histogram version.
riga Aug 8, 2025
c586eb9
Hotfix norm weight logging.
riga Aug 11, 2025
2c77fb1
Revert boost-histogram update.
riga Aug 12, 2025
650b4f6
Hotfix combined jets calibrator.
riga Aug 13, 2025
433803d
Hotfix inclusive dataset attribute in norm weight producer.
riga Aug 14, 2025
9be2072
make plotting faster using non-interactive backend
Aug 15, 2025
433ba76
[cms] Make datacard writer class configurable in task.
riga Sep 1, 2025
36eb11a
Hotfix typo in norm weight producer.
riga Sep 1, 2025
e170f92
Adapt norm weight producer to more generic cases.
riga Sep 1, 2025
23e992d
Hotfix cf_inspect for root files.
riga Sep 2, 2025
4407e52
Optimize UniteColumns compression for root files.
riga Sep 2, 2025
17b3968
Improve treepath detection in cf_insepct.
riga Sep 4, 2025
1c04755
Hotfix fowarding of known_shifts for instance caching.
riga Sep 9, 2025
87db487
Minor consistency change.
riga Sep 9, 2025
9bbdbbe
Fix brace expansion in ProduceColumnsWrapper.
riga Sep 9, 2025
d83e07b
adapting dy weight producer for custom weights (#724)
aalvesan Sep 10, 2025
fc9553d
Consistent handling of kwargs in teardown functions.
riga Sep 15, 2025
d354824
Hotfix TAF instance method defaults.
riga Sep 15, 2025
17d2faf
Refactor and fix met phi calibration.
riga Sep 15, 2025
49c8a38
add plot function for efficeincy plots (#723)
mafrahm Sep 16, 2025
5fbf5d0
Merge branch 'master' into fix/met_phi_calib
riga Sep 16, 2025
f0cc020
Hotfix parameter group cleaning in inference model.
riga Sep 16, 2025
066a870
Merge branch 'master' into fix/met_phi_calib
riga Sep 16, 2025
bbd86c1
Hotfix: allow brace patterns in TAF shifts.
riga Sep 17, 2025
cce90f3
Merge branch 'master' into fix/met_phi_calib
riga Sep 17, 2025
e0953a9
Remove year from intrinsic btag weight names. (#726)
riga Sep 17, 2025
28332ad
Merge branch 'master' into fix/met_phi_calib
riga Sep 17, 2025
3168df5
Merge pull request #725 from columnflow/fix/met_phi_calib
mafrahm Sep 17, 2025
fccc853
Forward remote claw sandbox.
riga Sep 23, 2025
9ea6c72
Add pilot option to MergeShiftedHistograms.
riga Sep 24, 2025
b1028a3
Forward known values to hist hooks.
riga Sep 24, 2025
5c58bf0
Merge pull request #727 from columnflow/feature/hist_hook_args
mafrahm Sep 24, 2025
1de8924
Hook column union, update law.
riga Sep 26, 2025
7caa0fc
Hotfix default version injection into tasks with same family.
riga Sep 26, 2025
72fde04
add ParameterTransformation for ratifying + envelope if one-sided
Sep 29, 2025
b034246
allow removing negative contributions per process (#730)
mafrahm Sep 29, 2025
b0b1aa7
Apply suggestion from @riga
riga Sep 29, 2025
b66573e
Apply suggestion from @riga
riga Sep 29, 2025
acacf3e
Merge pull request #731 from columnflow/feature/datacard_param_trafos
mafrahm Sep 29, 2025
b4a3a6c
Sequentialize and optimize datacard writing. (#728)
riga Sep 29, 2025
7216e56
Refactor datacard parameter transformations.
riga Sep 30, 2025
4c18d30
Update tests.
riga Sep 30, 2025
a23bbd9
Merge pull request #732 from columnflow/feat/streamline_datacard_trafos
mafrahm Oct 1, 2025
b02ee6b
Add flip_(smaller|larger)_if_one_sided transormations.
riga Oct 1, 2025
7edba46
Typos.
riga Oct 1, 2025
4c4590a
Merge pull request #734 from columnflow/feat/add_datacard_rate_flips
mafrahm Oct 1, 2025
14c0a10
allow multiple processes per dataset in datacard writer (#733)
mafrahm Oct 1, 2025
af56133
Hotfix process object selection for multi-config datacards.
riga Oct 2, 2025
76c3f62
Hotfix variable shape? type in combine datacard writer.
riga Oct 2, 2025
77c36da
Hotfix abs eta in cms muon weight producer.
riga Oct 2, 2025
80bff98
Make default_remote_claw_sandbox configurable via law.cfg.
riga Oct 4, 2025
f247eeb
Hotfix version lookup.
riga Oct 4, 2025
781cb8f
Raise explicit error in reduction on option type masks.
riga Oct 5, 2025
0757a60
Add req helpers to mixins. (#738)
riga Oct 6, 2025
b5081ad
Accelerate loading time and imports (#737)
riga Oct 6, 2025
ade427b
Add parent_mode flag to create_category_combinations, add change trac…
riga Oct 7, 2025
b06111b
Update sandboxes, avoid dask_awkward in IO (#735)
riga Oct 7, 2025
fe2d28a
Hotfix ChunkedParquetReader.
riga Oct 8, 2025
8004828
Hotfix bad import in plot utils.
riga Oct 8, 2025
4e2c25a
Merge branch 'master' into GhentAnalysis/merge-upstream
maadcoen Oct 14, 2025
81c2621
fix deprecated use of masked_sorted_indices
maadcoen Oct 14, 2025
30cef66
fix missing make_plot_2d
maadcoen Oct 14, 2025
5a4761c
fix missing make_plot_2d
maadcoen Oct 14, 2025
3fb4b87
refactor import of matplotlib, hist, coffea, correctionlib
maadcoen Oct 14, 2025
f0198c9
linting fixes
Oct 27, 2025
0ab442a
addition of met_uncertainty_sources parameter for jer calibrator that…
Oct 29, 2025
34a1f33
cleaning of jets.py
Oct 29, 2025
d958c40
add jer return
maadcoen Oct 30, 2025
5b363ee
fix linting
maadcoen Oct 30, 2025
e764265
Upstream changing to upstream merge request (#113)
JulesVandenbroeck Oct 31, 2025
7ab29f3
Get upstream changes (#114)
JulesVandenbroeck Nov 13, 2025
db65c2c
updated law module
Nov 13, 2025
8cfa9a5
missing import of hist
Nov 20, 2025
776f441
fix pt overflow slowing down b-tagging scale factors
Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"profile": "https://github.com/Bogdan-Wiederspan",
"contributions": [
"code",
"test"
"test",
"review"
]
},
{
Expand Down Expand Up @@ -153,16 +154,27 @@
"avatar_url": "https://avatars.githubusercontent.com/u/99343616?v=4",
"profile": "https://github.com/aalvesan",
"contributions": [
"code"
"code",
"review"
]
}, {
},
{
"login": "philippgadow",
"name": "philippgadow",
"avatar_url": "https://avatars.githubusercontent.com/u/6804366?v=4",
"profile": "https://github.com/philippgadow",
"contributions": [
"code"
]
},
{
"login": "LuSchaller",
"name": "Lukas Schaller",
"avatar_url": "https://avatars.githubusercontent.com/u/30951523?v=4",
"profile": "https://github.com/LuSchaller",
"contributions": [
"code"
]
}
],
"commitType": "docs"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ For a better overview of the tasks that are triggered by the commands below, che
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dsavoiu"><img src="https://avatars.githubusercontent.com/u/17005255?v=4?s=100" width="100px;" alt="Daniel Savoiu"/><br /><sub><b>Daniel Savoiu</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=dsavoiu" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/pulls?q=is%3Apr+reviewed-by%3Adsavoiu" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pkausw"><img src="https://avatars.githubusercontent.com/u/26219567?v=4?s=100" width="100px;" alt="pkausw"/><br /><sub><b>pkausw</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=pkausw" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/pulls?q=is%3Apr+reviewed-by%3Apkausw" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nprouvost"><img src="https://avatars.githubusercontent.com/u/49162277?v=4?s=100" width="100px;" alt="nprouvost"/><br /><sub><b>nprouvost</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=nprouvost" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/commits?author=nprouvost" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Bogdan-Wiederspan"><img src="https://avatars.githubusercontent.com/u/79155113?v=4?s=100" width="100px;" alt="Bogdan-Wiederspan"/><br /><sub><b>Bogdan-Wiederspan</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=Bogdan-Wiederspan" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/commits?author=Bogdan-Wiederspan" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Bogdan-Wiederspan"><img src="https://avatars.githubusercontent.com/u/79155113?v=4?s=100" width="100px;" alt="Bogdan-Wiederspan"/><br /><sub><b>Bogdan-Wiederspan</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=Bogdan-Wiederspan" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/commits?author=Bogdan-Wiederspan" title="Tests">⚠️</a> <a href="https://github.com/columnflow/columnflow/pulls?q=is%3Apr+reviewed-by%3ABogdan-Wiederspan" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kramerto"><img src="https://avatars.githubusercontent.com/u/18616159?v=4?s=100" width="100px;" alt="Tobias Kramer"/><br /><sub><b>Tobias Kramer</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=kramerto" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/pulls?q=is%3Apr+reviewed-by%3Akramerto" title="Reviewed Pull Requests">👀</a></td>
</tr>
<tr>
Expand All @@ -151,8 +151,9 @@ For a better overview of the tasks that are triggered by the commands below, che
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JulesVandenbroeck"><img src="https://avatars.githubusercontent.com/u/93740577?v=4?s=100" width="100px;" alt="JulesVandenbroeck"/><br /><sub><b>JulesVandenbroeck</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=JulesVandenbroeck" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aalvesan"><img src="https://avatars.githubusercontent.com/u/99343616?v=4?s=100" width="100px;" alt="Ana Andrade"/><br /><sub><b>Ana Andrade</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=aalvesan" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aalvesan"><img src="https://avatars.githubusercontent.com/u/99343616?v=4?s=100" width="100px;" alt="Ana Andrade"/><br /><sub><b>Ana Andrade</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=aalvesan" title="Code">💻</a> <a href="https://github.com/columnflow/columnflow/pulls?q=is%3Apr+reviewed-by%3Aaalvesan" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/philippgadow"><img src="https://avatars.githubusercontent.com/u/6804366?v=4?s=100" width="100px;" alt="philippgadow"/><br /><sub><b>philippgadow</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=philippgadow" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/LuSchaller"><img src="https://avatars.githubusercontent.com/u/30951523?v=4?s=100" width="100px;" alt="Lukas Schaller"/><br /><sub><b>Lukas Schaller</b></sub></a><br /><a href="https://github.com/columnflow/columnflow/commits?author=LuSchaller" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
apply_variable_settings,
apply_process_settings,
)
from columnflow.types import TYPE_CHECKING

hist = maybe_import("hist")
np = maybe_import("numpy")
mpl = maybe_import("matplotlib")
plt = maybe_import("matplotlib.pyplot")
mplhep = maybe_import("mplhep")
od = maybe_import("order")

# import hist, matplotlib... for type checking only like this! import them then also locallu.
if TYPE_CHECKING:
hist = maybe_import("hist")
plt = maybe_import("matplotlib.pyplot")


def my_plot1d_func(
hists: OrderedDict[od.Process, hist.Hist],
Expand All @@ -45,6 +47,9 @@ def my_plot1d_func(
--plot-function __cf_module_name__.plotting.example.my_plot1d_func \
--general-settings example_param=some_text
"""
import mplhep
import matplotlib.pyplot as plt

# we can add arbitrary parameters via the `general_settings` parameter to access them in the
# plotting function. They are automatically parsed either to a bool, float, or string
print(f"the example_param has been set to '{example_param}' (type: {type(example_param)})")
Expand Down
37 changes: 25 additions & 12 deletions analysis_templates/cms_minimal/law.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ default_analysis: __cf_module_name__.config.analysis___cf_short_name_lc__.analys
default_config: run2_2017_nano_v9
default_dataset: st_tchannel_t_4f_powheg

calibration_modules: columnflow.calibration.cms.{jets,met,tau}, __cf_module_name__.calibration.example
calibration_modules: columnflow.calibration.cms.{jets,met,tau,egamma,muon}, __cf_module_name__.calibration.example
selection_modules: columnflow.selection.empty, columnflow.selection.cms.{json_filter,met_filters}, __cf_module_name__.selection.example
reduction_modules: columnflow.reduction.default, __cf_module_name__.reduction.example
production_modules: columnflow.production.{categories,matching,normalization,processes}, columnflow.production.cms.{btag,electron,jet,matching,mc_weight,muon,pdf,pileup,scale,parton_shower,seeds}, __cf_module_name__.production.example
production_modules: columnflow.production.{categories,matching,normalization,processes}, columnflow.production.cms.{btag,electron,jet,matching,mc_weight,muon,pdf,pileup,scale,parton_shower,seeds,gen_particles}, __cf_module_name__.production.example
categorization_modules: __cf_module_name__.categorization.example
hist_production_modules: columnflow.histogramming.default, __cf_module_name__.histogramming.example
ml_modules: columnflow.ml, __cf_module_name__.ml.example
Expand All @@ -56,12 +56,16 @@ default_create_selection_hists: False
# wether or not the ensure_proxy decorator should be skipped, even if used by task's run methods
skip_ensure_proxy: False

# the name of a sandbox to use for tasks in remote jobs initially (invoked with claw when set)
default_remote_claw_sandbox: None

# some remote workflow parameter defaults
# (resources like memory and disk can also be set in [resources] with more granularity)
htcondor_flavor: $CF_HTCONDOR_FLAVOR
htcondor_share_software: False
htcondor_memory: -1
htcondor_disk: -1
htcondor_runtime: 3h
slurm_flavor: $CF_SLURM_FLAVOR
slurm_partition: $CF_SLURM_PARTITION

Expand All @@ -70,6 +74,9 @@ chunked_io_chunk_size: 100000
chunked_io_pool_size: 2
chunked_io_debug: False

# settings for merging parquet files in several locations
merging_row_group_size: 50000

# csv list of task families that inherit from ChunkedReaderMixin and whose output arrays should be
# checked (raising an exception) for non-finite values before saving them to disk
check_finite_output: cf.CalibrateEvents, cf.SelectEvents, cf.ReduceEvents, cf.ProduceColumns
Expand Down Expand Up @@ -98,8 +105,8 @@ lfn_sources: wlcg_fs_t2b_redirector, wlcg_fs_infn_redirector, wlcg_fs_global_red
# output locations per task family
# the key can consist of multple underscore-separated parts, that can each be patterns or regexes
# these parts are used for the lookup from within tasks and can contain (e.g.) the analysis name,
# the config name, the task family, the dataset name, or the shift name
# (see AnalysisTask.get_config_lookup_keys() - and subclasses - for the exact order)
# the config name, the task family, the dataset name, or the shift name, for more info, see
# https://columnflow.readthedocs.io/en/latest/user_guide/best_practices.html#selecting-output-locations
# values can have the following format:
# for local targets : "local[, LOCAL_FS_NAME or STORE_PATH][, store_parts_modifier]"
# for remote targets : "wlcg[, WLCG_FS_NAME][, store_parts_modifier]"
Expand All @@ -108,22 +115,22 @@ lfn_sources: wlcg_fs_t2b_redirector, wlcg_fs_infn_redirector, wlcg_fs_global_red
# the "store_parts_modifiers" can be the name of a function in the "store_parts_modifiers" aux dict
# of the analysis instance, which is called with an output's store parts of an output to modify them
# example:
; run3_2023__cf.CalibrateEvents__nomin*: local
; cf.CalibrateEvents: wlcg
; cfg_run3_2023__task_cf.CalibrateEvents__shift_nomin*: local
; task_cf.CalibrateEvents: wlcg


[versions]

# default versions of specific tasks to pin
# the key can consist of multple underscore-separated parts, that can each be patterns or regexes
# these parts are used for the lookup from within tasks and can contain (e.g.) the analysis name,
# the config name, the task family, the dataset name, or the shift name
# (see AnalysisTask.get_config_lookup_keys() - and subclasses - for the exact order)
# the config name, the task family, the dataset name, or the shift name, for more info, see
# https://columnflow.readthedocs.io/en/latest/user_guide/best_practices.html#pinned-versions-in-the-analysis-config-or-law-cfg-file
# note:
# this lookup is skipped if the lookup based on the config instance's auxiliary data succeeded
# example:
; run3_2023__cf.CalibrateEvents__nomin*: prod1
; cf.CalibrateEvents: prod2
; cfg_run3_2023__task_cf.CalibrateEvents__shift_nomin*: prod1
; task_cf.CalibrateEvents: prod2


[resources]
Expand All @@ -135,8 +142,8 @@ lfn_sources: wlcg_fs_t2b_redirector, wlcg_fs_infn_redirector, wlcg_fs_global_red
# by the respective parameter instance at runtime
# same as for [versions], the order of options is important as it defines the resolution order
# example:
; run3_2023__cf.CalibrateEvents__nomin*: htcondor_memory=5GB
; run3_2023__cf.CalibrateEvents: htcondor_memory=2GB
; cfg_run3_2023__task_cf.CalibrateEvents__shift_nomin*: htcondor_memory=5GB
; cfg_run3_2023__task_cf.CalibrateEvents: htcondor_memory=2GB


[job]
Expand All @@ -159,6 +166,12 @@ remote_lcg_setup_el9: /cvmfs/grid.cern.ch/alma9-ui-test/etc/profile.d/setup-alma
remote_lcg_setup_force: False


[target]

# when removing target collections, use multi-threading
collection_remove_threads: 2


[local_fs]

base: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
apply_variable_settings,
apply_process_settings,
)
from columnflow.types import TYPE_CHECKING

hist = maybe_import("hist")
np = maybe_import("numpy")
mpl = maybe_import("matplotlib")
plt = maybe_import("matplotlib.pyplot")
mplhep = maybe_import("mplhep")
od = maybe_import("order")

# import hist, matplotlib... for type checking only like this! import them then also locallu.
if TYPE_CHECKING:
hist = maybe_import("hist")
plt = maybe_import("matplotlib.pyplot")


def my_plot1d_func(
hists: OrderedDict[od.Process, hist.Hist],
Expand All @@ -45,6 +47,9 @@ def my_plot1d_func(
--plot-function __cf_module_name__.plotting.example.my_plot1d_func \
--general-settings example_param=some_text
"""
import mplhep
import matplotlib.pyplot as plt

# we can add arbitrary parameters via the `general_settings` parameter to access them in the
# plotting function. They are automatically parsed either to a bool, float, or string
print(f"The example_param has been set to '{example_param}' (type: {type(example_param)})")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

np = maybe_import("numpy")
ak = maybe_import("awkward")
coffea = maybe_import("coffea")
maybe_import("coffea.nanoevents.methods.nanoaod")

# do not import coffea globally! Do this inside the function
# coffea = maybe_import("coffea")
# maybe_import("coffea.nanoevents.methods.nanoaod")


@producer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,21 @@
from __cf_short_name_lc__.selection.stats import __cf_short_name_lc___increment_stats
from __cf_short_name_lc__.selection.trigger import trigger_selection

# only numpy and awkward are okay to import globally
np = maybe_import("numpy")
ak = maybe_import("awkward")
coffea = maybe_import("coffea")
maybe_import("coffea.nanoevents.methods.nanoaod")

# do not import coffea globally! Do this inside the function
# coffea = maybe_import("coffea")
# maybe_import("coffea.nanoevents.methods.nanoaod")

logger = law.logger.get_logger(__name__)


def TetraVec(arr: ak.Array) -> ak.Array:
import coffea
import coffea.nanoevents.methods.nanoaod

TetraVec = ak.zip({"pt": arr.pt, "eta": arr.eta, "phi": arr.phi, "mass": arr.mass},
with_name="PtEtaPhiMLorentzVector",
behavior=coffea.nanoevents.methods.vector.behavior)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from columnflow.util import maybe_import, four_vec
from columnflow.columnar_util import set_ak_column
from columnflow.selection import Selector, SelectionResult, selector
from columnflow.reduction.util import masked_sorted_indices
from columnflow.columnar_util import sorted_indices_from_mask

ak = maybe_import("awkward")

Expand Down Expand Up @@ -53,7 +53,7 @@ def muon_object(
steps={},
objects={
"Muon": {
"Muon": masked_sorted_indices(mu_mask, muon.pt)
"Muon": sorted_indices_from_mask(mu_mask, muon.pt)
}
},
)
Expand Down Expand Up @@ -108,7 +108,7 @@ def electron_object(
steps={},
objects={
"Electron": {
"Electron": masked_sorted_indices(e_mask, electron.pt)
"Electron": sorted_indices_from_mask(e_mask, electron.pt)
}
},
)
Expand Down Expand Up @@ -142,7 +142,7 @@ def jet_object(
(dR_mask)
)

jet_indices = masked_sorted_indices(jet_mask, events.Jet.pt)
jet_indices = sorted_indices_from_mask(jet_mask, events.Jet.pt)
n_jets = ak.sum(jet_mask, axis=-1)

return events, SelectionResult(
Expand Down
12 changes: 11 additions & 1 deletion bin/cf_inspect
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#!/bin/sh
action () {
# local variables
local shell_is_zsh="$( [ -z "${ZSH_VERSION}" ] && echo "false" || echo "true" )"
local this_file="$( ${shell_is_zsh} && echo "${(%):-%x}" || echo "${BASH_SOURCE[0]}" )"
local this_dir="$( cd "$( dirname "${this_file}" )" && pwd )"

# check arguments
# [ "$#" -eq 0 ] && {
# echo "ERROR: at least one file must be provided"
# return 1
# }

cf_sandbox venv_columnar_dev python "${this_dir}/cf_inspect.py" "$@"
# determine the sandbox to use
local cf_inspect_sandbox="${CF_INSPECT_SANDBOX:-venv_columnar_dev}"

# run the inspection script, potentially switching to the sandbox if not already in it
if [ "${CF_VENV_NAME}" = "${cf_inspect_sandbox}" ]; then
python "${this_dir}/cf_inspect.py" "$@"
else
cf_sandbox "${cf_inspect_sandbox}" python "${this_dir}/cf_inspect.py" "$@"
fi
}

action "$@"
Loading