Skip to content

Commit

Permalink
Merge branch 'master' into sync_updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Dec 16, 2024
2 parents 9f22df9 + 61585ac commit eb44057
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 45 deletions.
79 changes: 38 additions & 41 deletions hbt/config/configs_hbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,15 @@ def if_era(
},
}
cfg.x.default_custom_style_config = "small_legend"

cfg.x.default_blinding_threshold = 3e-4

################################################################################################
# luminosity and normalization
################################################################################################

# lumi values in inverse pb
# https://twiki.cern.ch/twiki/bin/view/CMS/LumiRecommendationsRun2?rev=2#Combination_and_correlations
# lumi values in 1/pb (= 1000/fb)
# https://twiki.cern.ch/twiki/bin/view/CMS/LumiRecommendationsRun2?rev=7
# https://twiki.cern.ch/twiki/bin/view/CMS/LumiRecommendationsRun3?rev=25
# https://twiki.cern.ch/twiki/bin/view/CMS/PdmVRun3Analysis
# difference pre-post VFP: https://cds.cern.ch/record/2854610/files/DP2023_006.pdf
if year == 2016 and campaign.has_tag("preVFP"):
Expand Down Expand Up @@ -520,21 +520,39 @@ def if_era(
cfg.x.luminosity = Number(26_671.7, {
"lumi_13p6TeV_correlated": 0.014j,
})
elif year == 2023:
cfg.x.luminosity = Number(27_208, {
"lumi_13p6TeV_correlated": 0.0j,
elif year == 2023 and campaign.has_tag("preBPix"):
cfg.x.luminosity = Number(17_794, {
"lumi_13p6TeV_correlated": 0.013j,
})
elif year == 2024:
cfg.x.luminosity = Number(0, {
"lumi_13p6TeV_correlated": 0.0j,
elif year == 2023 and campaign.has_tag("postBPix"):
cfg.x.luminosity = Number(9_451, {
"lumi_13p6TeV_correlated": 0.013j,
})
else:
assert False

# minimum bias cross section in mb (milli) for creating PU weights, values from
# https://twiki.cern.ch/twiki/bin/view/CMS/PileupJSONFileforData?rev=45#Recommended_cross_section
# https://twiki.cern.ch/twiki/bin/view/CMS/PileupJSONFileforData?rev=52#Recommended_cross_section
cfg.x.minbias_xs = Number(69.2, 0.046j)

################################################################################################
# met settings
################################################################################################

if run == 2:
cfg.x.met_name = "MET"
cfg.x.raw_met_name = "RawMET"
elif run == 3:
cfg.x.met_name = "PuppiMET"
cfg.x.raw_met_name = "RawPuppiMET"
else:
assert False

# name of the MET phi correction set
# (used in the met_phi calibrator)
if run == 2:
cfg.x.met_phi_correction_set = r"{variable}_metphicorr_pfmet_{data_source}"

################################################################################################
# jet settings
# TODO: keep a single table somewhere that configures all settings: btag correlation, year
Expand Down Expand Up @@ -638,19 +656,6 @@ def if_era(
},
})

################################################################################################
# MET settings
################################################################################################

if run == 2:
cfg.x.met_name = "MET"
cfg.x.raw_met_name = "RawMET"
elif run == 3:
cfg.x.met_name = "PuppiMET"
cfg.x.raw_met_name = "RawPuppiMET"
else:
assert False

################################################################################################
# tau settings
################################################################################################
Expand Down Expand Up @@ -743,15 +748,6 @@ def if_era(
else:
assert False

################################################################################################
# met settings
################################################################################################

# name of the MET phi correction set
# (used in the met_phi calibrator)
if run == 2:
cfg.x.met_phi_correction_set = r"{variable}_metphicorr_pfmet_{data_source}"

################################################################################################
# b tagging
################################################################################################
Expand Down Expand Up @@ -918,8 +914,8 @@ def if_era(
{
"Jet.pt": "Jet.pt_{name}",
"Jet.mass": "Jet.mass_{name}",
"MET.pt": "MET.pt_{name}",
"MET.phi": "MET.phi_{name}",
f"{cfg.x.met_name}.pt": f"{cfg.x.met_name}.pt_{{name}}",
f"{cfg.x.met_name}.phi": f"{cfg.x.met_name}.phi_{{name}}",
},
)
# TODO: check the JEC de/correlation across years and the interplay with btag weights
Expand All @@ -943,8 +939,8 @@ def if_era(
{
"Jet.pt": "Jet.pt_{name}",
"Jet.mass": "Jet.mass_{name}",
"MET.pt": "MET.pt_{name}",
"MET.phi": "MET.phi_{name}",
f"{cfg.x.met_name}.pt": f"{cfg.x.met_name}.pt_{{name}}",
f"{cfg.x.met_name}.phi": f"{cfg.x.met_name}.phi_{{name}}",
},
)

Expand All @@ -957,8 +953,8 @@ def if_era(
{
"Tau.pt": "Tau.pt_{name}",
"Tau.mass": "Tau.mass_{name}",
"MET.pt": "MET.pt_{name}",
"MET.phi": "MET.phi_{name}",
f"{cfg.x.met_name}.pt": f"{cfg.x.met_name}.pt_{{name}}",
f"{cfg.x.met_name}.phi": f"{cfg.x.met_name}.phi_{{name}}",
},
)

Expand Down Expand Up @@ -1061,7 +1057,7 @@ def add_external(name, value):
assert False

# common files
# lumi files
# (versions in the end are for hashing in cases where file contents changed but paths did not)
add_external("lumi", {
"golden": {
2016: ("/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/Legacy_2016/Cert_271036-284044_13TeV_Legacy2016_Collisions16_JSON.txt", "v1"), # noqa
Expand Down Expand Up @@ -1149,7 +1145,7 @@ def add_external(name, value):
"Electron.*",
"Muon.*",
"Tau.*",
"MET.{pt,phi,significance,covXX,covXY,covYY}",
f"{cfg.x.met_name}.{{pt,phi,significance,covXX,covXY,covYY}}",
"PV.npvs",
"FatJet.*",
# keep all columns added during selection, but skip cutflow feature
Expand Down Expand Up @@ -1177,6 +1173,7 @@ def add_external(name, value):
"pdf_weight": get_shifts("pdf"),
"murmuf_weight": get_shifts("murmuf"),
"normalized_pu_weight": get_shifts("minbias_xs"),
# TODO: enable again once we have btag cuts
# "normalized_njet_btag_deepjet_weight": get_shifts(*(f"btag_{unc}" for unc in cfg.x.btag_unc_names)),
"electron_weight": get_shifts("e"),
"muon_weight": get_shifts("mu"),
Expand Down Expand Up @@ -1268,7 +1265,7 @@ def get_dataset_lfns(

# loop though files and interpret paths as lfns
return [
lfn_base.child(basename, type="f").path
"/" + lfn_base.child(basename, type="f").path.lstrip("/")
for basename in lfn_base.listdir(pattern="*.root")
]

Expand Down
2 changes: 1 addition & 1 deletion hbt/selection/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def default(

# pdf weights
if self.has_dep(pdf_weights):
events = self[pdf_weights](events, **kwargs)
events = self[pdf_weights](events, outlier_log_mode="debug", **kwargs)

# renormalization/factorization scale weights
if self.has_dep(murmuf_weights):
Expand Down
22 changes: 20 additions & 2 deletions law.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ slurm_partition: $CF_SLURM_PARTITION
# ChunkedIOHandler defaults
chunked_io_chunk_size: 50000
chunked_io_pool_size: 2
chunked_io_debug: True
chunked_io_debug: False

# 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
Expand All @@ -86,7 +86,7 @@ log_array_function_runtime: False
[outputs]

# list of all used file systems
wlcg_file_systems: wlcg_fs, wlcg_fs_desy, wlcg_fs_cernbox, wlcg_fs_desy_store, wlcg_fs_infn_redirector, wlcg_fs_global_redirector, wlcg_fs_run2_2017_nano_uhh_v11
wlcg_file_systems: wlcg_fs, wlcg_fs_desy, wlcg_fs_cernbox, wlcg_fs_desy_store, wlcg_fs_infn_redirector, wlcg_fs_global_redirector

# list of file systems used by columnflow.tasks.external.GetDatasetLFNs.iter_nano_files to
# look for the correct fs per nano input file (in that order)
Expand Down Expand Up @@ -348,6 +348,23 @@ cache_max_size: 50GB
base: /pnfs/desy.de/cms/tier2/store/user/roward/hbt_store


[wlcg_fs_desy_pgadow]

webdav_base: davs://dcache-cms-webdav-wan.desy.de:2880/pnfs/desy.de/cms/tier2/store/user/pgadow/hbt_store
gsiftp_base: gsiftp://dcache-door-cms04.desy.de:2811/pnfs/desy.de/cms/tier2/store/user/pgadow/hbt_store
xrootd_base: root://dcache-cms-xrootd.desy.de:1094/pnfs/desy.de/cms/tier2/store/user/pgadow/hbt_store
base: &::xrootd_base
create_file_dir: True
use_cache: $CF_WLCG_USE_CACHE
cache_root: $CF_WLCG_CACHE_ROOT
cache_cleanup: $CF_WLCG_CACHE_CLEANUP
cache_max_size: 50GB

[local_fs_desy_pgadow]

base: /pnfs/desy.de/cms/tier2/store/user/pgadow/hbt_store


#
# file systems for custom LFNs
#
Expand Down Expand Up @@ -528,3 +545,4 @@ naf_prouvost: 5000
naf_haddadan: 5000
naf_nguyenth: 5000
naf_wardrobe: 5000
naf_pgadow: 5000

0 comments on commit eb44057

Please sign in to comment.