diff --git a/src/BTVNanoCommissioning/helpers/xsection.py b/src/BTVNanoCommissioning/helpers/xsection.py index 8612170d..f580886d 100644 --- a/src/BTVNanoCommissioning/helpers/xsection.py +++ b/src/BTVNanoCommissioning/helpers/xsection.py @@ -184,7 +184,7 @@ }, { "process_name": "WtoLNu-4Jets_TuneCP5_13p6TeV_madgraphMLM-pythia8", - "cross_section": "54860", + "cross_section": "63199.9", "DAS": "/WtoLNu-4Jets_TuneCP5_13p6TeV_madgraphMLM-pythia8/Run3Summer22NanoAODv11-126X_mcRun3_2022_realistic_v2-v2/NANOAODSIM", "energy": "13.6", "comment": "from TOP-22-012", diff --git a/src/BTVNanoCommissioning/utils/correction.py b/src/BTVNanoCommissioning/utils/correction.py index 09b800c6..495cc377 100644 --- a/src/BTVNanoCommissioning/utils/correction.py +++ b/src/BTVNanoCommissioning/utils/correction.py @@ -531,7 +531,7 @@ def JME_shifts( ak.values_astype(corrected_polar_met(*metinfo).pt, np.float32), ak.values_astype(corrected_polar_met(*metinfo).phi, np.float32), ) - met["orig_pt"], met["orig_phi"] = nocorrmet["pt"], nocorrmet["pt"] + met["orig_pt"], met["orig_phi"] = nocorrmet["pt"], nocorrmet["phi"] if systematic != False: if systematic != "JERC_split": @@ -691,6 +691,7 @@ def JME_shifts( if "jetveto" in correct_map.keys(): events.Jet = update(events.Jet, {"veto": jetveto(events, correct_map)}) shifts += [({"Jet": jets, "MET": met}, None)] + print("in shift", met.pt) return shifts diff --git a/src/BTVNanoCommissioning/utils/histogrammer.py b/src/BTVNanoCommissioning/utils/histogrammer.py index dfd3a35d..29d08b28 100644 --- a/src/BTVNanoCommissioning/utils/histogrammer.py +++ b/src/BTVNanoCommissioning/utils/histogrammer.py @@ -7,7 +7,7 @@ def histogrammer(events, workflow): ## Common variables flav_axis = Hist.axis.IntCategory([0, 1, 4, 5, 6], name="flav", label="Genflavour") syst_axis = Hist.axis.StrCategory([], name="syst", growth=True) - pt_axis = Hist.axis.Regular(300, 0, 3000, name="pt", label=" $p_{T}$ [GeV]") + pt_axis = Hist.axis.Regular(300, 0, 300, name="pt", label=" $p_{T}$ [GeV]") jpt_axis = Hist.axis.Regular(300, 0, 3000, name="pt", label=" $p_{T}$ [GeV]") softlpt_axis = Hist.axis.Regular(25, 0, 25, name="pt", label=" $p_{T}$ [GeV]") mass_axis = Hist.axis.Regular(50, 0, 300, name="mass", label=" $p_{T}$ [GeV]") diff --git a/src/BTVNanoCommissioning/workflows/QCD_validation.py b/src/BTVNanoCommissioning/workflows/QCD_validation.py index 6436f275..63d947d0 100644 --- a/src/BTVNanoCommissioning/workflows/QCD_validation.py +++ b/src/BTVNanoCommissioning/workflows/QCD_validation.py @@ -185,7 +185,6 @@ def process_shift(self, events, shift_name): pseval = correctionlib.CorrectionSet.from_file( f"src/BTVNanoCommissioning/data/Prescales/ps_weight_{triggers[0]}_run{run_num}.json" ) - print(triggers[0]) psweight = pseval["prescaleWeight"].evaluate( selev.run, f"HLT_{triggers[0]}", diff --git a/src/BTVNanoCommissioning/workflows/ctag_Wc_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_Wc_valid_sf.py index cbc9eade..4cb05e86 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_Wc_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_Wc_valid_sf.py @@ -240,26 +240,15 @@ def process_shift(self, events, shift_name): (dilep_mass.mass < 80) | (dilep_mass.mass > 100) ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) Wmass = MET + iso_muon # modified to transverse mass req_mtw = ( diff --git a/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py index 524e84fc..c3e17df6 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py @@ -209,26 +209,15 @@ def process_shift(self, events, shift_name): (dilep_mass.mass < 75) | (dilep_mass.mass > 105) ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) req_MET = MET.pt > 40 event_level = ( diff --git a/src/BTVNanoCommissioning/workflows/ctag_eWc_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_eWc_valid_sf.py index 02927686..482c3f8a 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_eWc_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_eWc_valid_sf.py @@ -229,26 +229,15 @@ def process_shift(self, events, shift_name): ak.count(dilep_mu.pt, axis=1) + ak.count(dilep_ele.pt, axis=1) != 2 ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) Wmass = MET + iso_ele req_Wmass = Wmass.mass > 55 diff --git a/src/BTVNanoCommissioning/workflows/ctag_edileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_edileptt_valid_sf.py index 7a804cea..8596f2fe 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_edileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_edileptt_valid_sf.py @@ -208,26 +208,15 @@ def process_shift(self, events, shift_name): (dilep_mass.mass < 75) | (dilep_mass.mass > 105) ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) req_MET = MET.pt > 40 event_level = ( diff --git a/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py index 9f82ccf4..b7d97b7a 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py @@ -254,26 +254,15 @@ def process_shift(self, events, shift_name): | ((iso_mu[:, 0] + iso_ele[:, 0]).mass > 105) ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) req_MET = MET.pt > 40 event_level = ( diff --git a/src/BTVNanoCommissioning/workflows/ctag_ettsemilep_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_ettsemilep_valid_sf.py index b6dbaf32..c869959b 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_ettsemilep_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_ettsemilep_valid_sf.py @@ -246,26 +246,15 @@ def process_shift(self, events, shift_name): ak.count(dilep_mu.pt, axis=1) + ak.count(dilep_ele.pt, axis=1) != 2 ) - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) Wmass = MET + iso_ele req_Wmass = Wmass.mass > 55 diff --git a/src/BTVNanoCommissioning/workflows/ctag_semileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_semileptt_valid_sf.py index 2a0a43f6..931d0153 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_semileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_semileptt_valid_sf.py @@ -258,27 +258,15 @@ def process_shift(self, events, shift_name): req_dilepmass = (dilep_mass.mass > 12.0) & ( (dilep_mass.mass < 80) | (dilep_mass.mass > 100) ) - - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) Wmass = MET + iso_muon req_Wmass = Wmass.mass > 55 diff --git a/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py b/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py index a1faa693..1c6a4348 100644 --- a/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py @@ -177,26 +177,17 @@ def process_shift(self, events, shift_name): jetindx = jetindx[:, :4] ## other cuts - if int(self._year) > 2020: - MET = ak.zip( - { - "pt": events.MET.pt, - "eta": ak.zeros_like(events.MET.pt), - "phi": events.MET.phi, - "mass": ak.zeros_like(events.MET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) - else: - MET = ak.zip( - { - "pt": events.PuppiMET.pt, - "eta": ak.zeros_like(events.PuppiMET.pt), - "phi": events.PuppiMET.phi, - "mass": ak.zeros_like(events.PuppiMET.pt), - }, - with_name="PtEtaPhiMLorentzVector", - ) + + MET = ak.zip( + { + "pt": events.MET.pt, + "eta": ak.zeros_like(events.MET.pt), + "phi": events.MET.phi, + "mass": ak.zeros_like(events.MET.pt), + }, + with_name="PtEtaPhiMLorentzVector", + ) + req_MET = MET.pt > 50 event_level = ak.fill_none(