From 45d3375004ad410015f617934a12d1f3a2985acb Mon Sep 17 00:00:00 2001 From: Billy Jackson Date: Fri, 1 Nov 2024 10:06:07 -0500 Subject: [PATCH 1/2] Updated .gitignore --- .gitignore | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitignore b/.gitignore index 56720fd..e5e27f8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,16 +6,10 @@ __pycache__ *.gz *.png *.pdf -plots/ -datasets/.sites_map.json .env/ .local/ .bashrc .condor_config -old/ *.png wr_env/ .sites_map.json -WR_Plotter/ -root_outputs/ -preprocess/jsons From b7abc4bad17a33f28f6992e0eef3d0ce9201d5c2 Mon Sep 17 00:00:00 2001 From: Billy Jackson Date: Mon, 4 Nov 2024 10:31:35 -0600 Subject: [PATCH 2/2] Added variables --- WR_Plotter | 2 +- src/analyzer.py | 50 +++++++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/WR_Plotter b/WR_Plotter index 0d76959..129c419 160000 --- a/WR_Plotter +++ b/WR_Plotter @@ -1 +1 @@ -Subproject commit 0d76959eea305d1f4350cfa06314115b9f4f79a8 +Subproject commit 129c41978c32fdcdf9e5294fe3ce2e7f44b3c4a8 diff --git a/src/analyzer.py b/src/analyzer.py index c6ae6a1..76f87b2 100644 --- a/src/analyzer.py +++ b/src/analyzer.py @@ -18,20 +18,26 @@ def __init__(self, mass_point=None): self._signal_sample = mass_point self.make_output = lambda: { - 'Jet_0_Pt': self.create_hist('pt_leadjet', 'process', 'region', (200, 0, 2000), r'p_{T} of the leading jet [GeV]'), - 'Jet_1_Pt': self.create_hist('pt_subleadjet', 'process', 'region', (200, 0, 2000), r'p_{T} of the subleading jet [GeV]'), - 'Lepton_0_Eta': self.create_hist('eta_leadlep', 'process', 'region', (60, -3, 3), r'#eta of the leading lepton'), - 'Lepton_0_Pt': self.create_hist('pt_leadlep', 'process', 'region', (200, 0, 2000), r'p_{T} of the leading lepton [GeV]'), - 'Lepton_1_Eta': self.create_hist('eta_subleadlep', 'process', 'region', (60, -3, 3), r'#eta of the subleading lepton'), - 'Lepton_1_Pt': self.create_hist('pt_subleadlep', 'process', 'region', (200, 0, 2000), r'p_{T} of the subleading lepton [GeV]'), + 'ZCand_Mass': self.create_hist('mass_dileptons', 'process', 'region', (500, 0, 5000), r'm_{ll} [GeV]'), + 'ZCand_Pt': self.create_hist('pt_dileptons', 'process', 'region', (200, 0, 2000), r'p^{T}_{ll} [GeV]'), + 'WRCand_Mass': self.create_hist('mass_fourobject', 'process', 'region', (800, 0, 8000), r'm_{lljj} [GeV]'), + 'WRCand_Pt': self.create_hist('pt_fourobject', 'process', 'region', (800, 0, 8000), r'p^{T}_{lljj} [GeV]'), 'NCand_Lepton_0_Mass': self.create_hist('mass_threeobject_leadlep', 'process', 'region', (800, 0, 8000), r'm_{ljj} [GeV]'), 'NCand_Lepton_0_Pt': self.create_hist('pt_threeobject_leadlep', 'process', 'region', (800, 0, 8000), r'p^{T}_{ljj} [GeV]'), 'NCand_Lepton_1_Mass': self.create_hist('mass_threeobject_subleadlep', 'process', 'region', (800, 0, 8000), r'm_{ljj} [GeV]'), 'NCand_Lepton_1_Pt': self.create_hist('pt_threeobject_subleadlep', 'process', 'region', (800, 0, 8000), r'p^{T}_{ljj} [GeV]'), - 'WRCand_Mass': self.create_hist('mass_fourobject', 'process', 'region', (800, 0, 8000), r'm_{lljj} [GeV]'), - 'WRCand_Pt': self.create_hist('pt_fourobject', 'process', 'region', (800, 0, 8000), r'p^{T}_{lljj} [GeV]'), - 'ZCand_Mass': self.create_hist('mass_dileptons', 'process', 'region', (5000, 0, 5000), r'm_{ll} [GeV]'), - 'ZCand_Pt': self.create_hist('pt_dileptons', 'process', 'region', (200, 0, 2000), r'p^{T}_{ll} [GeV]'), + 'Dijet_Mass': self.create_hist('mass_dijet', 'process', 'region', (500, 0, 5000), r'm_{jj} [GeV]'), + 'Dijet_Pt': self.create_hist('pt_dijet', 'process', 'region', (500, 0, 5000), r'p^{T}_{jj} [GeV]'), + 'Lepton_0_Pt': self.create_hist('pt_leadlep', 'process', 'region', (200, 0, 2000), r'p_{T} of the leading lepton [GeV]'), + 'Lepton_0_Eta': self.create_hist('eta_leadlep', 'process', 'region', (60, -3, 3), r'#eta of the leading lepton'), + 'Lepton_1_Pt': self.create_hist('pt_subleadlep', 'process', 'region', (200, 0, 2000), r'p_{T} of the subleading lepton [GeV]'), + 'Lepton_1_Eta': self.create_hist('eta_subleadlep', 'process', 'region', (60, -3, 3), r'#eta of the subleading lepton'), + 'Jet_0_Pt': self.create_hist('pt_leadjet', 'process', 'region', (200, 0, 2000), r'p_{T} of the leading jet [GeV]'), + 'Jet_0_Eta': self.create_hist('eta_leadjet', 'process', 'region', (60, -3, 3), r'#eta of the leading jet [GeV]'), + 'Jet_1_Pt': self.create_hist('pt_subleadjet', 'process', 'region', (200, 0, 2000), r'p_{T} of the subleading jet [GeV]'), + 'Jet_1_Eta': self.create_hist('eta_subleadjet', 'process', 'region', (60, -3, 3), r'#eta of the subleading jet [GeV]'), +# 'Dijet_Mass': self.create_hist('mass_dijet', 'process', 'region', (500, 0, 5000), r'm_{jj} [GeV]'), +# 'Dijet_Pt': self.create_hist('pt_dijet', 'process', 'region', (500, 0, 5000), r'p^{T}_{jj} [GeV]'), } def create_hist(self, name, process, region, bins, label): @@ -90,20 +96,24 @@ def fill_basic_histograms(self, output, region, cut, process, jets, leptons, we """Helper function to fill histograms dynamically.""" # Define a list of variables and their corresponding histograms variables = [ - ('Jet_0_Pt', jets[:, 0].pt, 'pt_leadjet'), - ('Jet_1_Pt', jets[:, 1].pt, 'pt_subleadjet'), - ('Lepton_0_Eta', leptons[:, 0].eta, 'eta_leadlep'), - ('Lepton_0_Pt', leptons[:, 0].pt, 'pt_leadlep'), - ('Lepton_1_Eta', leptons[:, 1].eta, 'eta_subleadlep'), - ('Lepton_1_Pt', leptons[:, 1].pt, 'pt_subleadlep'), + ('ZCand_Mass', (leptons[:, 0] + leptons[:, 1]).mass, 'mass_dileptons'), + ('ZCand_Pt', (leptons[:, 0] + leptons[:, 1]).pt, 'pt_dileptons'), + ('WRCand_Mass', (leptons[:, 0] + leptons[:, 1] + jets[:, 0] + jets[:, 1]).mass, 'mass_fourobject'), + ('WRCand_Pt', (leptons[:, 0] + leptons[:, 1] + jets[:, 0] + jets[:, 1]).pt, 'pt_fourobject'), ('NCand_Lepton_0_Mass', (leptons[:, 0] + jets[:, 0] + jets[:, 1]).mass, 'mass_threeobject_leadlep'), ('NCand_Lepton_0_Pt', (leptons[:, 0] + jets[:, 0] + jets[:, 1]).pt, 'pt_threeobject_leadlep'), ('NCand_Lepton_1_Mass', (leptons[:, 1] + jets[:, 0] + jets[:, 1]).mass, 'mass_threeobject_subleadlep'), ('NCand_Lepton_1_Pt', (leptons[:, 1] + jets[:, 0] + jets[:, 1]).pt, 'pt_threeobject_subleadlep'), - ('WRCand_Mass', (leptons[:, 0] + leptons[:, 1] + jets[:, 0] + jets[:, 1]).mass, 'mass_fourobject'), - ('WRCand_Pt', (leptons[:, 0] + leptons[:, 1] + jets[:, 0] + jets[:, 1]).pt, 'pt_fourobject'), - ('ZCand_Mass', (leptons[:, 0] + leptons[:, 1]).mass, 'mass_dileptons'), - ('ZCand_Pt', (leptons[:, 0] + leptons[:, 1]).pt, 'pt_dileptons'), + ('Lepton_0_Pt', leptons[:, 0].pt, 'pt_leadlep'), + ('Lepton_0_Eta', leptons[:, 0].eta, 'eta_leadlep'), + ('Lepton_1_Pt', leptons[:, 1].pt, 'pt_subleadlep'), + ('Lepton_1_Eta', leptons[:, 1].eta, 'eta_subleadlep'), + ('Jet_0_Pt', jets[:, 0].pt, 'pt_leadjet'), + ('Jet_0_Eta', jets[:, 0].eta, 'eta_leadjet'), + ('Jet_1_Pt', jets[:, 1].pt, 'pt_subleadjet'), + ('Jet_1_Eta', jets[:, 1].eta, 'eta_subleadjet'), +# ('Dijet_Mass', (jets[:, 0].pt + jets[:, 1]).mass, 'mass_dijet'), +# ('Dijet_Pt', (jets[:, 0].pt + jets[:, 1]).pt, 'pt_dijet'), ] # Loop over variables and fill corresponding histograms