Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f040a3e
added ci cstom model
valeriadamante Jan 21, 2026
2503a07
yaml formatting
valeriadamante Jan 21, 2026
1aed642
yaml formatting 2
valeriadamante Jan 21, 2026
b45c732
bug fix + comments applied
valeriadamante Jan 23, 2026
dab76d0
yaml formatting
valeriadamante Jan 23, 2026
ba7f3e9
added all eras for hmm testing
valeriadamante Jan 23, 2026
5988ca3
comments applied + updated FLAF/Corrections
valeriadamante Jan 26, 2026
0dbb0a4
added FLAF hopefully passing the checks
valeriadamante Jan 26, 2026
2a757f5
added also data for 2024 testing
valeriadamante Jan 26, 2026
f00de6d
fixed files for studies
valeriadamante Jan 26, 2026
79c5e6d
conflicts fixed
valeriadamante Jan 27, 2026
795678c
removed muon studies scripts
valeriadamante Jan 27, 2026
2fafd8b
added test model with data for 2024 testing
valeriadamante Jan 27, 2026
a3185a2
yaml formatting 5
valeriadamante Jan 27, 2026
81855c2
added CI custom for test model with data and bckg
valeriadamante Jan 27, 2026
280d3d3
fixed bckg path for 2024
valeriadamante Jan 27, 2026
79c0a6b
fixed folders for 2024 samples
valeriadamante Jan 27, 2026
aaafc04
yaml formatting
valeriadamante Jan 27, 2026
c59a58a
bugfix for dfbuilder config
valeriadamante Jan 27, 2026
99bbc5a
use of Muon_Run2022D for testing
valeriadamante Jan 28, 2026
09c9d0b
redefined m_mumu for all different cases
valeriadamante Jan 28, 2026
f8196fe
removed 2025
valeriadamante Jan 28, 2026
81f5a5c
moved nanoVersion to analysis related config
valeriadamante Jan 28, 2026
db3eecc
yaml formatting
valeriadamante Jan 28, 2026
e476caa
Merge branch 'main' of github.com:cms-flaf/H_mumu into 2024_fixes
valeriadamante Jan 28, 2026
0e10e62
fixed bugs
valeriadamante Jan 29, 2026
65ad1c7
python formatting
valeriadamante Jan 29, 2026
e1cb61f
yaml formatting
valeriadamante Jan 29, 2026
ded8af2
updated FLAF and Corrections
valeriadamante Jan 29, 2026
d1bdc3b
fixed datasets for 2024 data
valeriadamante Jan 29, 2026
c206325
Merge branch 'main' of github.com:cms-flaf/H_mumu into data_fixes
valeriadamante Jan 30, 2026
5022169
fixed all samples and processes
valeriadamante Feb 2, 2026
2b09019
python formatting
valeriadamante Feb 2, 2026
41694af
python formatting 1
valeriadamante Feb 2, 2026
b327d98
yaml formatting 2
valeriadamante Feb 2, 2026
0d80f71
fixed custom CI signal process
valeriadamante Feb 2, 2026
3c4df41
fixed some processes and correction issues
valeriadamante Feb 2, 2026
fb969c0
removed eras A,B and J from 2024 as recommended
valeriadamante Feb 3, 2026
e9ff0b6
yaml formatting 2
valeriadamante Feb 3, 2026
daf8778
fixed DY XS and samples and filePattern
valeriadamante Feb 3, 2026
799e787
fixed DY XS and samples and filePattern
valeriadamante Feb 3, 2026
a7e0f24
added updated FLAF
valeriadamante Feb 4, 2026
4a1b556
copilot comments implemented
valeriadamante Feb 4, 2026
d7e80c9
branch for producing input NN files
valeriadamante Feb 4, 2026
a3ab9aa
fixed the pT selection for muon trg SF
valeriadamante Feb 4, 2026
05665a9
disabled trigger corrections
valeriadamante Feb 4, 2026
ec76e9a
Merge branch 'main' of github.com:cms-flaf/H_mumu into fix_for_trigge…
valeriadamante Feb 4, 2026
2517210
included option to add trigger and ID weights to total weight
valeriadamante Feb 4, 2026
238297f
bugfix when bscPt already exists in format muX_pt_BSCPt
valeriadamante Feb 5, 2026
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
17 changes: 8 additions & 9 deletions Analysis/H_mumu.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,12 @@ def SaveVarsForNNInput(variables):
return variables


def GetWeight(channel, process_name, muID_WP_for_SF, muIso_WP_for_SF):
def GetWeight(
channel, process_name, muID_WP_for_SF, muIso_WP_for_SF, enable_ID, enable_trigger
):
weights_to_apply = [
"weight_base",
# "weight_XS",
# "newDYWeight_ptLL_nano"
# "newDYWeight_ptLL_bsConstrained"
# "weight_DYw_DYWeightCentral",
# "weight_EWKCorr_VptCentral",
] # ,"weight_EWKCorr_ewcorrCentral"] #
]
# quick fix for DY weights. In future should pass the full dataset and process info to DefineWeightForHistograms
if process_name.startswith("DY"):
weights_to_apply.extend(
Expand All @@ -186,8 +183,10 @@ def GetWeight(channel, process_name, muID_WP_for_SF, muIso_WP_for_SF):
}

# should be moved to config
weights_to_apply.extend(ID_weights_dict[channel])
weights_to_apply.extend(trg_weights_dict[channel])
if enable_ID:
weights_to_apply.extend(ID_weights_dict[channel])
if enable_trigger:
weights_to_apply.extend(trg_weights_dict[channel])

total_weight = "*".join(weights_to_apply)
# print(total_weight)
Expand Down
6 changes: 4 additions & 2 deletions Analysis/MuonRelatedFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@ def GetMuMuMassResolution(df, pt_to_use):
def GetMuMuP4Observables(df):
for mu_idx in [1, 2]: # tmp patch for back compatibility with old AnaTuples
if f"mu{mu_idx}_bsConstrainedPt" in df.GetColumnNames():
if f"mu{mu_idx}_pt_bsConstrained" not in df.GetColumnNames():
if f"mu{mu_idx}_pt_bsConstrainedPt" not in df.GetColumnNames():
# print(f"defining mu{mu_idx}_pt_bsConstrainedPt" )
df = df.Define(
f"mu{mu_idx}_pt_bsConstrained", f"mu{mu_idx}_bsConstrainedPt"
f"mu{mu_idx}_pt_bsConstrainedPt", f"mu{mu_idx}_bsConstrainedPt"
)
pt_def = [col for col in df.GetColumnNames() if f"mu1_pt_" in col]
# print(f"pt defined are: {pt_def}")
muon_p4_to_define = list(set(["_".join(pt.split("_")[2:]) for pt in pt_def]))
# print(f"suffixes are : {muon_p4_to_define}")
for pt_suffix in muon_p4_to_define:
for idx in [0, 1]:
# print(f"defining mu{idx+1}_p4_{pt_suffix}")
df = df.Define(
f"mu{idx+1}_p4_{pt_suffix}",
f"ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>(mu{idx+1}_pt_{pt_suffix},mu{idx+1}_eta,mu{idx+1}_phi,mu{idx+1}_mass)",
Expand Down
20 changes: 14 additions & 6 deletions Analysis/histTupleDef.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ def DefineWeightForHistograms(
return_variations=is_central and global_params["compute_unc_histograms"],
use_genWeight_sign_only=True,
)

defineTriggerWeights(
dfw, global_params.get("mu_pt_for_triggerMatchingAndSF", "pt_nano")
)
if "trigger" in corrections.to_apply.keys():
defineTriggerWeights(
dfw, global_params.get("mu_pt_for_triggerMatchingAndSF", "pt_nano")
)
if (
df_is_central
and global_params["compute_unc_histograms"]
Expand All @@ -126,9 +126,17 @@ def DefineWeightForHistograms(
isCentral = uncName == "Central"
muID_WP_for_SF = global_params.get("muIDWP", "Loose")
muIso_WP_for_SF = global_params.get("muIsoWP", "Medium")

enable_trigger = "trigger" in corrections.to_apply.keys()
enable_ID = "mu" in corrections.to_apply.keys()
total_weight_expression = (
analysis.GetWeight("muMu", process_name, muID_WP_for_SF, muIso_WP_for_SF)
analysis.GetWeight(
"muMu",
process_name,
muID_WP_for_SF,
muIso_WP_for_SF,
enable_trigger=enable_trigger,
enable_ID=enable_ID,
)
if process_group != "data"
else "1"
) # are we sure?
Expand Down
2 changes: 1 addition & 1 deletion config/global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ corrections:
extraFormat:
pt: "bsConstrainedPt"
muScaRe:
stage: AnaTuple # later it will become anaTuple.
stage: AnaTuple
# stage: HistTuple # later it will become anaTuple.
mu_pt_for_ScaReApplication: "bsConstrainedPt"
lumi: { stage: AnaTuple }
Expand Down
8 changes: 3 additions & 5 deletions config/processes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
module: FLAF.Processors.MCStitching
class: MCStitcher
config: FLAF/config/Processors/stitching_DY_amcatnlo_Vpt_NpNLO_allFlavors.yaml
stages: [ AnaCache, AnaTuple ]
stages: [ AnaTuple, AnaTupleMerge ]
dependency_level:
AnaCache: dataset
AnaTuple: process

.DY_processors_singleFlavor: &DY_processors_singleFlavor
- name: Stitcher
module: FLAF.Processors.MCStitching
class: MCStitcher
config: FLAF/config/Processors/stitching_DY_amcatnlo_Vpt_NpNLO_singleFlavor.yaml
stages: [ AnaCache, AnaTuple ]
config: FLAF/config/Processors/stitching_DY_amcatnlo_Vpt_NpNLO.yaml
stages: [ AnaTuple, AnaTupleMerge ]
dependency_level:
AnaCache: dataset
AnaTuple: process