diff --git a/higgs_dna/tools/mass_decorrelator.py b/higgs_dna/tools/mass_decorrelator.py index 641f19b5fb09f0f0af1369ac53caa58e4dc70c6d..30817ca3229329836dea7a263f455303de047087 100644 --- a/higgs_dna/tools/mass_decorrelator.py +++ b/higgs_dna/tools/mass_decorrelator.py @@ -5,7 +5,7 @@ import numpy as np import higgs_dna.tools.decorrelator as decorr -def decorrelate_mass_resolution(events: awkward.Array, type: str, year): +def decorrelate_mass_resolution(events: awkward.Array, type: str, year, IsSAS_ET_Dependent=False): # type = "nominal","smeared","corr","corr_smeared" @@ -44,9 +44,15 @@ def decorrelate_mass_resolution(events: awkward.Array, type: str, year): elif (type == "corr_smeared"): if (year == "2022postEE"): - decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/postEE/sigma_m_smeared_corr_postEE_CDFs.pkl.gz') + if IsSAS_ET_Dependent: + decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/postEE/Paper_postEE_CDFS_v3.pkl.gz') + else: + decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/postEE/sigma_m_smeared_corr_postEE_CDFs.pkl.gz') else: - decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/preEE/sigma_m_smeared_corr_preEE_CDFs.pkl.gz') + if IsSAS_ET_Dependent: + decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/preEE/Paper_preEE_CDFS_v3.pkl.gz') + else: + decl.loadCdfs(os.path.dirname(__file__) + '/decorrelation_CDFs/preEE/sigma_m_smeared_corr_preEE_CDFs.pkl.gz') df["sigma_m_over_m"] = events.sigma_m_over_m_Smeared_corr.to_numpy() else: diff --git a/higgs_dna/workflows/base.py b/higgs_dna/workflows/base.py index 801cc31a54d7914245b4fbd530dc6c7471ff1013..91b2a41dea9b584b1d816a05d908c5b6efb1cc18 100644 --- a/higgs_dna/workflows/base.py +++ b/higgs_dna/workflows/base.py @@ -939,7 +939,12 @@ class HggBaseProcessor(processor.ProcessorABC): # type: ignore # decorrelate flow corrected smeared sigma_m_over_m if (self.doFlow_corrections and self.Smear_sigma_m): - diphotons["sigma_m_over_m_corr_smeared_decorr"] = decorrelate_mass_resolution(diphotons, type="corr_smeared", year=self.year[dataset_name][0]) + if self.data_kind == "data" and "Et_dependent_Scale" in correction_names: + diphotons["sigma_m_over_m_corr_smeared_decorr"] = decorrelate_mass_resolution(diphotons, type="corr_smeared", year=self.year[dataset_name][0], IsSAS_ET_Dependent=True) + elif self.data_kind == "mc" and "Et_dependent_Smearing" in correction_names: + diphotons["sigma_m_over_m_corr_smeared_decorr"] = decorrelate_mass_resolution(diphotons, type="corr_smeared", year=self.year[dataset_name][0], IsSAS_ET_Dependent=True) + else: + diphotons["sigma_m_over_m_corr_smeared_decorr"] = decorrelate_mass_resolution(diphotons, type="corr_smeared", year=self.year[dataset_name][0]) # Instead of the nominal sigma_m_over_m, we will use the smeared version of it -> (https://indico.cern.ch/event/1319585/#169-update-on-the-run-3-mass-r) # else: diff --git a/higgs_dna/workflows/dystudies.py b/higgs_dna/workflows/dystudies.py index de840d31d46add3b2562dfe5aace4f3458f16921..57ddc33ad931bd4bda36b6334835dacfae03b03b 100644 --- a/higgs_dna/workflows/dystudies.py +++ b/higgs_dna/workflows/dystudies.py @@ -160,9 +160,9 @@ class TagAndProbeProcessor(HggBaseProcessor): # Since now we are applying Smearing term to the sigma_m_over_m i added this portion of code # specially for the estimation of smearing terms for the data events [data pt/energy] are not smeared! if self.data_kind == "data" and self.Smear_sigma_m: - if "Smearing" in correction_names: + if "Scale" in correction_names: correction_name = "Smearing" - elif "Et_dependent_Smearing" in correction_names: + elif "Et_dependent_Scale" in correction_names: correction_name = "Et_dependent_Smearing" else: logger.info('Specify a scale correction for the data in the corrections field in .json in order to smear the mass!') diff --git a/higgs_dna/workflows/zee_processor.py b/higgs_dna/workflows/zee_processor.py index c30829fd92c1974e047f3c2aef7bd1155e27b3c1..67ca58baa395d5c734850674edea2e32cc1233bc 100644 --- a/higgs_dna/workflows/zee_processor.py +++ b/higgs_dna/workflows/zee_processor.py @@ -180,9 +180,9 @@ class ZeeProcessor(HggBaseProcessor): # Since now we are applying Smearing term to the sigma_m_over_m i added this portion of code # specially for the estimation of smearing terms for the data events [data pt/energy] are not smeared! if self.data_kind == "data" and self.Smear_sigma_m: - if "Smearing" in correction_names: + if "Scale" in correction_names: correction_name = "Smearing" - elif "Et_dependent_Smearing" in correction_names: + elif "Et_dependent_Scale" in correction_names: correction_name = "Et_dependent_Smearing" else: logger.info('Specify a scale correction for the data in the corrections field in .json in order to smear the mass!')