Skip to content

Commit

Permalink
Merge branch 'master' into sanity_check_sync_calibration.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Dec 9, 2024
2 parents f30d63c + 82247f4 commit 88440a9
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 63 deletions.
130 changes: 67 additions & 63 deletions hbt/config/configs_hbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,72 +546,76 @@ def if_era(
assert False

cfg.x.jec = DotDict.wrap({
"campaign": jec_campaign,
"version": jec_version,
"jet_type": jet_type,
"levels": ["L1FastJet", "L2Relative", "L2L3Residual", "L3Absolute"],
"levels_for_type1_met": ["L1FastJet"],
"uncertainty_sources": [
# "AbsoluteStat",
# "AbsoluteScale",
# "AbsoluteSample",
# "AbsoluteFlavMap",
# "AbsoluteMPFBias",
# "Fragmentation",
# "SinglePionECAL",
# "SinglePionHCAL",
# "FlavorQCD",
# "TimePtEta",
# "RelativeJEREC1",
# "RelativeJEREC2",
# "RelativeJERHF",
# "RelativePtBB",
# "RelativePtEC1",
# "RelativePtEC2",
# "RelativePtHF",
# "RelativeBal",
# "RelativeSample",
# "RelativeFSR",
# "RelativeStatFSR",
# "RelativeStatEC",
# "RelativeStatHF",
# "PileUpDataMC",
# "PileUpPtRef",
# "PileUpPtBB",
# "PileUpPtEC1",
# "PileUpPtEC2",
# "PileUpPtHF",
# "PileUpMuZero",
# "PileUpEnvelope",
# "SubTotalPileUp",
# "SubTotalRelative",
# "SubTotalPt",
# "SubTotalScale",
# "SubTotalAbsolute",
# "SubTotalMC",
"Total",
# "TotalNoFlavor",
# "TotalNoTime",
# "TotalNoFlavorNoTime",
# "FlavorZJet",
# "FlavorPhotonJet",
# "FlavorPureGluon",
# "FlavorPureQuark",
# "FlavorPureCharm",
# "FlavorPureBottom",
"CorrelationGroupMPFInSitu",
"CorrelationGroupIntercalibration",
"CorrelationGroupbJES",
"CorrelationGroupFlavor",
"CorrelationGroupUncorrelated",
],
"Jet": {
"campaign": jec_campaign,
"version": jec_version,
"jet_type": jet_type,
"levels": ["L1FastJet", "L2Relative", "L2L3Residual", "L3Absolute"],
"levels_for_type1_met": ["L1FastJet"],
"uncertainty_sources": [
# "AbsoluteStat",
# "AbsoluteScale",
# "AbsoluteSample",
# "AbsoluteFlavMap",
# "AbsoluteMPFBias",
# "Fragmentation",
# "SinglePionECAL",
# "SinglePionHCAL",
# "FlavorQCD",
# "TimePtEta",
# "RelativeJEREC1",
# "RelativeJEREC2",
# "RelativeJERHF",
# "RelativePtBB",
# "RelativePtEC1",
# "RelativePtEC2",
# "RelativePtHF",
# "RelativeBal",
# "RelativeSample",
# "RelativeFSR",
# "RelativeStatFSR",
# "RelativeStatEC",
# "RelativeStatHF",
# "PileUpDataMC",
# "PileUpPtRef",
# "PileUpPtBB",
# "PileUpPtEC1",
# "PileUpPtEC2",
# "PileUpPtHF",
# "PileUpMuZero",
# "PileUpEnvelope",
# "SubTotalPileUp",
# "SubTotalRelative",
# "SubTotalPt",
# "SubTotalScale",
# "SubTotalAbsolute",
# "SubTotalMC",
"Total",
# "TotalNoFlavor",
# "TotalNoTime",
# "TotalNoFlavorNoTime",
# "FlavorZJet",
# "FlavorPhotonJet",
# "FlavorPureGluon",
# "FlavorPureQuark",
# "FlavorPureCharm",
# "FlavorPureBottom",
"CorrelationGroupMPFInSitu",
"CorrelationGroupIntercalibration",
"CorrelationGroupbJES",
"CorrelationGroupFlavor",
"CorrelationGroupUncorrelated",
],
},
})

# JER
cfg.x.jer = DotDict.wrap({
"campaign": jer_campaign,
"version": jer_version,
"jet_type": jet_type,
"Jet": {
"campaign": jer_campaign,
"version": jer_version,
"jet_type": jet_type,
},
})

################################################################################################
Expand Down Expand Up @@ -850,7 +854,7 @@ def if_era(
cfg.add_shift(name="top_pt_down", id=10, type="shape")
add_shift_aliases(cfg, "top_pt", {"top_pt_weight": "top_pt_weight_{direction}"})

for jec_source in cfg.x.jec.uncertainty_sources:
for jec_source in cfg.x.jec.Jet.uncertainty_sources:
idx = all_jec_sources.index(jec_source)
cfg.add_shift(
name=f"jec_{jec_source}_up",
Expand Down
7 changes: 7 additions & 0 deletions sandboxes/columnar_torch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# version 1

-r ../modules/columnflow/sandboxes/columnar.txt

torch~=2.5.1
lightning~=2.4.0
torchmetrics~=1.6.0
18 changes: 18 additions & 0 deletions sandboxes/venv_columnar_torch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Script that sets up a virtual env in $CF_VENV_PATH.
# For more info on functionality and parameters, see the generic setup script _setup_venv.sh.

action() {
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 )"

# set variables and source the generic venv setup
export CF_SANDBOX_FILE="${CF_SANDBOX_FILE:-${this_file}}"
export CF_VENV_NAME="$( basename "${this_file%.sh}" )"
export CF_VENV_REQUIREMENTS="${this_dir}/columnar_torch.txt"

source "${CF_BASE}/sandboxes/_setup_venv.sh" "$@"
}
action "$@"
18 changes: 18 additions & 0 deletions sandboxes/venv_columnar_torch_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Script that sets up a virtual env in $CF_VENV_PATH.
# For more info on functionality and parameters, see the generic setup script _setup_venv.sh.

action() {
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 )"

# set variables and source the generic venv setup
export CF_SANDBOX_FILE="${CF_SANDBOX_FILE:-${this_file}}"
export CF_VENV_NAME="$( basename "${this_file%.sh}" )"
export CF_VENV_REQUIREMENTS="${this_dir}/columnar_torch.txt,${CF_BASE}/sandboxes/dev.txt"

source "${CF_BASE}/sandboxes/_setup_venv.sh" "$@"
}
action "$@"

0 comments on commit 88440a9

Please sign in to comment.