diff --git a/configs/V44nano/object_performance/disp_ht.yaml b/configs/V44nano/object_performance/disp_ht.yaml index c48b8614..094a634f 100644 --- a/configs/V44nano/object_performance/disp_ht.yaml +++ b/configs/V44nano/object_performance/disp_ht.yaml @@ -8,9 +8,6 @@ HtoLLPto4b_M125_Phi60_ctau100_promptHT: L1TrackHT:HT: "ht" L1ExtTrackHT:HT: "ht" thresholds: [50, 100] - # scalings: - # method: "naive" - # threshold: 0.90 xlabel: "Gen. HT (GeV)" ylabel: "Trigger Efficiency ( GeV)" binning: diff --git a/configs/V44nano/object_performance/electron_iso.yaml b/configs/V44nano/object_performance/electron_iso.yaml index ce3116fe..33aedb8b 100644 --- a/configs/V44nano/object_performance/electron_iso.yaml +++ b/configs/V44nano/object_performance/electron_iso.yaml @@ -4,7 +4,7 @@ ElectronsIsolation_Barrel: match_test_to_ref: True iso_vs_efficiency: True reference_object: - GenPart:reference_electron_barrel: "pt" + GenPart:electron_iso:barrel_iso: "pt" test_objects: L1tkElectron:NoIsoForIso: "relIso" xlabel: "Isolation" @@ -20,7 +20,7 @@ ElectronsIsolation_Endcap: match_test_to_ref: True iso_vs_efficiency: True reference_object: - GenPart:reference_electron_endcap: "pt" + GenPart:electron:endcap_iso: "pt" test_objects: L1tkElectron:NoIsoForIso: "relIso" xlabel: "Isolation" diff --git a/configs/V44nano/object_performance/electron_matching.yaml b/configs/V44nano/object_performance/electron_matching.yaml index 4e575db9..5a40078f 100644 --- a/configs/V44nano/object_performance/electron_matching.yaml +++ b/configs/V44nano/object_performance/electron_matching.yaml @@ -1,9 +1,9 @@ ElectronsMatchingBarrel: - sample: DYLL_M50 + sample: DYLL_M50 # version: V44nano - match_test_to_ref: True + match_test_to_ref: True # Delta R matching reference_object: - GenPart:reference_electron:barrel: "pt" + GenPart:electron:barrel: "pt" test_objects: L1EG:default: "pt" L1tkElectron:NoIso: "pt" @@ -38,7 +38,7 @@ ElectronsMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_electron_endcap: "pt" + GenPart:electron:endcap: "pt" test_objects: L1EG:default: "pt" L1tkElectron:NoIso: "pt" diff --git a/configs/V44nano/object_performance/electron_matching_eta.yaml b/configs/V44nano/object_performance/electron_matching_eta.yaml index d9f86244..033e57f3 100644 --- a/configs/V44nano/object_performance/electron_matching_eta.yaml +++ b/configs/V44nano/object_performance/electron_matching_eta.yaml @@ -3,7 +3,7 @@ ElectronsMatching_Eta_Pt10to25: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_electron_pt10to25: "eta" + GenPart:electron_pt10to25: "eta" test_objects: L1EG:default: "eta" L1tkElectron:NoIso: "eta" @@ -21,7 +21,7 @@ ElectronsMatching_Eta_Pt25toInf: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_electron_pt25toInf: "eta" + GenPart:electron_pt25toInf: "eta" test_objects: L1EG:default: "eta" L1tkElectron:NoIso: "eta" diff --git a/configs/V44nano/object_performance/electron_trigger.yaml b/configs/V44nano/object_performance/electron_trigger.yaml index adb9cfbc..bef434d0 100644 --- a/configs/V44nano/object_performance/electron_trigger.yaml +++ b/configs/V44nano/object_performance/electron_trigger.yaml @@ -3,7 +3,7 @@ ElectronsTriggerBarrel: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_electron_trigger_barrel: "pt" + GenPart:electron_trigger:barrel: "pt" test_objects: L1EG:default:barrel: "pt" L1tkElectron:NoIso:barrel: "pt" @@ -25,7 +25,7 @@ ElectronsTriggerEndcap: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_electron_trigger_endcap: "pt" + GenPart:electron_trigger:endcap: "pt" test_objects: L1EG:default:endcap: "pt" L1tkElectron:NoIso:endcap: "pt" diff --git a/configs/V44nano/object_performance/jets_matching.yaml b/configs/V44nano/object_performance/jets_matching.yaml index 7fa2cea0..333d7c26 100644 --- a/configs/V44nano/object_performance/jets_matching.yaml +++ b/configs/V44nano/object_performance/jets_matching.yaml @@ -3,12 +3,7 @@ JetMatchingBarrel: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_barrel: "pt" - cuts: - event: - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenJet:jet:barrel: "pt" test_objects: L1puppiJetHisto:default: "pt" L1puppiJetSC4:default: "pt" @@ -26,7 +21,7 @@ JetMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_endcap: "pt" + GenJet:jet:endcap: "pt" test_objects: L1puppiJetHisto:default: "pt" L1puppiJetSC4:default: "pt" @@ -44,7 +39,7 @@ JetMatchingForward: sample: TT match_test_to_ref: True reference_object: - GenJet:reference_forward: "pt" + GenJet:default:forward: "pt" test_objects: L1puppiJetHisto:default: "pt" L1puppiJetSC4:default: "pt" @@ -62,7 +57,7 @@ JetMatchingBarrelSC8: version: V44nano match_test_to_ref: True reference_object: - GenJetAK8:reference_barrel: "pt" + GenJetAK8:jet:barrel: "pt" test_objects: L1puppiJetSC8:default:barrel: "pt" xlabel: "Gen. $p_T$ (GeV)" @@ -77,7 +72,7 @@ JetMatchingEndcapSC8: version: V44nano match_test_to_ref: True reference_object: - GenJetAK8:reference_endcap: "pt" + GenJetAK8:jet:endcap: "pt" test_objects: L1puppiJetSC8:default:endcap: "pt" xlabel: "Gen. $p_T$ (GeV)" diff --git a/configs/V44nano/object_performance/jets_matching_eta.yaml b/configs/V44nano/object_performance/jets_matching_eta.yaml index f9722256..9dff3851 100644 --- a/configs/V44nano/object_performance/jets_matching_eta.yaml +++ b/configs/V44nano/object_performance/jets_matching_eta.yaml @@ -1,9 +1,24 @@ +JetMatching_Eta_SC8_Pt100ToInf: + sample: TT + version: V44nano + match_test_to_ref: True + reference_object: + GenJetAK8:jet_matching_SC8_Pt100ToInf: "eta" + test_objects: + L1puppiJetSC8:default: "eta" + xlabel: "Gen. $\\eta$" + ylabel: "Matching Efficiency (>100 GeV)" + binning: + min: -5 + max: 5 + step: 0.25 + JetMatching_Eta_Pt40To100: sample: TT version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt40To100: "eta" + GenJet:jet_Pt40To100: "eta" # TODO test_objects: L1puppiJetHisto:default: "eta" L1puppiJetSC4:default: "eta" @@ -21,7 +36,7 @@ JetMatching_Eta_Pt100ToInf: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt100ToInf: "eta" + GenJet:jet_Pt100ToInf: "eta" test_objects: L1puppiJetHisto:default: "eta" L1puppiJetSC4:default: "eta" @@ -39,7 +54,7 @@ JetMatching_Eta_Pt100ToInf_extEta: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt100ToInf_extEta: "eta" + GenJet:jet_Pt100ToInf_extEta: "eta" test_objects: L1caloJet:default: "eta" xlabel: "Gen. $\\eta$" @@ -48,18 +63,3 @@ JetMatching_Eta_Pt100ToInf_extEta: min: -5.5 max: 5.5 step: 0.25 - -JetMatching_Eta_SC8_Pt100ToInf: - sample: TT - version: V44nano - match_test_to_ref: True - reference_object: - GenJetAK8:reference_matching_SC8_Pt100ToInf: "eta" - test_objects: - L1puppiJetSC8:default: "eta" - xlabel: "Gen. $\\eta$" - ylabel: "Matching Efficiency (>100 GeV)" - binning: - min: -5 - max: 5 - step: 0.25 diff --git a/configs/V44nano/object_performance/jets_matching_wBTag.yaml b/configs/V44nano/object_performance/jets_matching_wBTag.yaml index a475b42c..d0a388c2 100644 --- a/configs/V44nano/object_performance/jets_matching_wBTag.yaml +++ b/configs/V44nano/object_performance/jets_matching_wBTag.yaml @@ -3,7 +3,7 @@ JetMatching_Eta_Pt40To100_ExtendedVsRegular: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt40To100: "eta" + GenJet:jet_Pt40To100: "eta" test_objects: L1puppiJetSC4:default: "eta" L1puppiExtJetSC4:default: "eta" @@ -19,7 +19,7 @@ JetMatching_Eta_Pt100ToInf_ExtendedVsRegular: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt100ToInf: "eta" + GenJet:jet_Pt100ToInf: "eta" test_objects: L1puppiJetSC4:default: "eta" L1puppiExtJetSC4:default: "eta" @@ -35,7 +35,7 @@ JetMatching_Eta_Pt30ToInf_genBJets: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt30ToInf_genBJets: "eta" + GenJet:jet_Pt30ToInf_genBJets: "eta" test_objects: L1puppiExtJetSC4:bjetnn: "eta" xlabel: "Gen. $\\eta$" @@ -50,7 +50,7 @@ JetMatching_Eta_Pt30ToInf_genNotBJets: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt30ToInf_genNotBJets: "eta" + GenJet:jet_Pt30ToInf_genNotBJets: "eta" test_objects: L1puppiExtJetSC4:bjetnn: "eta" xlabel: "Gen. $\\eta$" @@ -65,7 +65,7 @@ JetMatching_Pt_Pt30ToInf_genBJets: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt30ToInf_genBJets: "pt" + GenJet:jet_Pt30ToInf_genBJets: "pt" test_objects: L1puppiExtJetSC4:bjetnn: "pt" xlabel: "Gen. $p_T$ (GeV)" @@ -80,7 +80,7 @@ JetMatching_Pt_Pt30ToInf_genNotBJets: version: V44nano match_test_to_ref: True reference_object: - GenJet:reference_Pt30ToInf_genNotBJets: "eta" + GenJet:jet_Pt30ToInf_genNotBJets: "pt" test_objects: L1puppiExtJetSC4:bjetnn: "pt" xlabel: "Gen. $p_T$ (GeV)" diff --git a/configs/V44nano/object_performance/jets_sc8_trigger.yaml b/configs/V44nano/object_performance/jets_sc8_trigger.yaml index 69491a4b..95c872a0 100644 --- a/configs/V44nano/object_performance/jets_sc8_trigger.yaml +++ b/configs/V44nano/object_performance/jets_sc8_trigger.yaml @@ -1,9 +1,10 @@ + JetTurnonBarrelSC8: version: V44nano sample: TT match_test_to_ref: True reference_object: - GenJetAK8:reference_barrel: "pt" + GenJetAK8:jet:barrel: "pt" test_objects: L1puppiJetSC8:default:barrel: "pt" thresholds: [150] @@ -22,7 +23,7 @@ JetTurnonEndcapSC8: sample: TT match_test_to_ref: True reference_object: - GenJetAK8:reference_endcap: "pt" + GenJetAK8:jet:endcap: "pt" test_objects: L1puppiJetSC8:default:endcap: "pt" thresholds: [150] @@ -41,7 +42,7 @@ JetTurnonForwardSC8: sample: TT match_test_to_ref: True reference_object: - GenJetAK8:reference_forward: "pt" + GenJetAK8:default:forward: "pt" test_objects: L1puppiJetSC8:default:forward: "pt" thresholds: [150] diff --git a/configs/V44nano/object_performance/jets_trigger.yaml b/configs/V44nano/object_performance/jets_trigger.yaml index 0a3c6e22..5774af70 100644 --- a/configs/V44nano/object_performance/jets_trigger.yaml +++ b/configs/V44nano/object_performance/jets_trigger.yaml @@ -3,7 +3,7 @@ JetTurnonBarrel: sample: TT match_test_to_ref: True reference_object: - GenJet:reference_barrel: "pt" + GenJet:jet:barrel: "pt" test_objects: # L1puppiJetHisto:default:barrel: "pt" L1puppiJetSC4:default:barrel: "pt" @@ -25,7 +25,7 @@ JetTurnonEndcap: sample: TT match_test_to_ref: True reference_object: - GenJet:reference_endcap: "pt" + GenJet:jet:endcap: "pt" test_objects: # L1puppiJetHisto:default:endcap: "pt" L1puppiJetSC4:default:endcap: "pt" @@ -47,7 +47,7 @@ JetTurnonForward: sample: TT match_test_to_ref: True reference_object: - GenJet:reference_forward: "pt" + GenJet:default:forward: "pt" test_objects: # L1puppiJetHisto:default:forward: "pt" L1puppiJetSC4:default:forward: "pt" diff --git a/configs/V44nano/object_performance/muonTF_matching.yaml b/configs/V44nano/object_performance/muonTF_matching.yaml index 3c0dde41..22808d98 100644 --- a/configs/V44nano/object_performance/muonTF_matching.yaml +++ b/configs/V44nano/object_performance/muonTF_matching.yaml @@ -3,15 +3,7 @@ MuonTFsMatchingBarrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) < 0.83" + GenPart:muon_barrel: "pt" test_objects: L1gmtMuon:default:barrel: "pt" L1MuonKMTF:default:barrel: "pt" @@ -30,16 +22,7 @@ MuonTFsMatchingOverlap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 0.83" - - "abs({eta}) < 1.24" + GenPart:muon_overlap: "pt" test_objects: L1gmtMuon:default:overlap: "pt" L1MuonKMTF:default:overlap: "pt" @@ -58,16 +41,7 @@ MuonTFsMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 1.24" - - "abs({eta}) < 2.4" + GenPart:muon_endcap: "pt" test_objects: L1gmtMuon:default:endcap: "pt" L1MuonKMTF:default:endcap: "pt" diff --git a/configs/V44nano/object_performance/muonTF_matching_eta.yaml b/configs/V44nano/object_performance/muonTF_matching_eta.yaml index a3c95760..765dc49a 100644 --- a/configs/V44nano/object_performance/muonTF_matching_eta.yaml +++ b/configs/V44nano/object_performance/muonTF_matching_eta.yaml @@ -3,23 +3,13 @@ MuonTFsMatching_Eta_Pt2to5: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - - "{pt} > 2" - - "{pt} < 5" - object: - - "abs({eta}) < 2.4" + GenPart:muon_Pt2to5: "eta" test_objects: L1gmtMuon:default: "eta" - L1MuonKMTF:default: "eta" - L1MuonOMTF:default: "eta" - L1MuonEMTF:default: "eta" - L1gmtTkMuon:default: "eta" + L1MuonKMTF:default: "eta" # Kalman filter (actually barrel) track finder + L1MuonOMTF:default: "eta" # overlap track finder + L1MuonEMTF:default: "eta" # endcap track finder + L1gmtTkMuon:default: "eta" # gmt global muon trigger xlabel: "Gen. $\\eta$" ylabel: "Matching Efficiency (2-5 GeV)" binning: @@ -32,16 +22,7 @@ MuonTFsMatching_Eta_Pt15toInf: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - - "{pt} > 15" - object: - - "abs({eta}) < 2.4" + GenPart:muon_Pt15toInf: "eta" test_objects: L1gmtMuon:default: "eta" L1MuonKMTF:default: "eta" diff --git a/configs/V44nano/object_performance/muonTF_trigger.yaml b/configs/V44nano/object_performance/muonTF_trigger.yaml index 1347a833..7d8c2001 100644 --- a/configs/V44nano/object_performance/muonTF_trigger.yaml +++ b/configs/V44nano/object_performance/muonTF_trigger.yaml @@ -3,15 +3,7 @@ MuonTFsTrigger_Barrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) < 0.83" + GenPart:muon_barrel: "eta" test_objects: L1gmtMuon:default:barrel: "pt" L1MuonKMTF:default:barrel: "pt" @@ -21,9 +13,6 @@ MuonTFsTrigger_Barrel: xlabel: "Gen. pT (GeV)" ylabel: "Trigger Efficiency (barrel, L1 $p_T > 20$ GeV)" thresholds: [20, 25] - # scalings: - # method: "naive" - # threshold: 0.95 binning: min: 0 max: 50 diff --git a/configs/V44nano/object_performance/muon_matching.yaml b/configs/V44nano/object_performance/muon_matching.yaml index 2d9ce9aa..a89d07d9 100644 --- a/configs/V44nano/object_performance/muon_matching.yaml +++ b/configs/V44nano/object_performance/muon_matching.yaml @@ -3,12 +3,16 @@ MuonsMatchingBarrel: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_muon:barrel_muon: "pt" + GenPart:muon_barrel: "pt" test_objects: L1gmtMuon:default:barrel: "pt" L1gmtTkMuon:default:barrel: "pt" xlabel: "Gen. $p_T$ (GeV)" ylabel: "Matching Efficiency (barrel)" + # thresholds: [-999] + # scalings: + # method: "naive" + # threshold: 0.95 binning: min: 0 max: 100 @@ -19,7 +23,7 @@ MuonsMatchingOverlap: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_muon:overlap: "pt" + GenPart:muon_overlap: "pt" test_objects: L1gmtMuon:default:overlap: "pt" L1gmtTkMuon:default:overlap: "pt" @@ -35,7 +39,7 @@ MuonsMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_muon:endcap_muon: "pt" + GenPart:muon_endcap: "pt" test_objects: L1gmtMuon:default:endcap: "pt" L1gmtTkMuon:default:endcap: "pt" diff --git a/configs/V44nano/object_performance/muon_matching_eta.yaml b/configs/V44nano/object_performance/muon_matching_eta.yaml index d9cbbf75..73de1313 100644 --- a/configs/V44nano/object_performance/muon_matching_eta.yaml +++ b/configs/V44nano/object_performance/muon_matching_eta.yaml @@ -3,7 +3,7 @@ MuonsMatching_Eta_Pt2to5: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_muon_Pt2to5: "eta" + GenPart:muon_Pt2to5: "eta" test_objects: L1gmtMuon:default: "eta" L1gmtMuon:dR0p6: "eta" @@ -20,7 +20,7 @@ MuonsMatching_Eta_Pt15toInf: version: V44nano match_test_to_ref: True reference_object: - GenPart:reference_muon_Pt15toInf: "eta" + GenPart:muon_Pt15toInf: "eta" test_objects: L1gmtMuon:default: "eta" L1gmtTkMuon:default: "eta" diff --git a/configs/V44nano/object_performance/muon_trigger.yaml b/configs/V44nano/object_performance/muon_trigger.yaml index bfa14d0b..38ecdb3a 100644 --- a/configs/V44nano/object_performance/muon_trigger.yaml +++ b/configs/V44nano/object_performance/muon_trigger.yaml @@ -3,15 +3,7 @@ MuonsTrigger_Barrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) < 0.83" + GenPart:muon_barrel: "eta" test_objects: L1gmtMuon:default:barrel: "pt" L1gmtTkMuon:default:barrel: "pt" @@ -31,16 +23,7 @@ MuonsTrigger_Overlap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 0.83" - - "abs({eta}) < 1.24" + GenPart:muon_overlap: "eta" test_objects: L1gmtMuon:default:overlap: "pt" L1gmtTkMuon:default:overlap: "pt" @@ -60,15 +43,7 @@ MuonsTrigger_Endcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 1.24" + GenPart:muon_trigger_endcap: "eta" test_objects: L1gmtMuon:default:endcap: "pt" L1gmtTkMuon:default:endcap: "pt" diff --git a/configs/V44nano/object_performance/muons_purity.yaml b/configs/V44nano/object_performance/muons_purity.yaml deleted file mode 100644 index 52cf1867..00000000 --- a/configs/V44nano/object_performance/muons_purity.yaml +++ /dev/null @@ -1,82 +0,0 @@ -Purity_Muons_Barrel: - sample: DYLL_M50 - version: V44nano - match_test_to_ref: True - reference_object: - object: "L1gmtTkMuon" - x_arg: "pt" - label: "L1gmtTkMuon" - cuts: - event: - - "({hwQual}>>0)&1 == 1" - - "abs({eta}) < 0.83" - object: - - "abs({eta}) < 2.4" - test_objects: - GenPart:muon: "pt" - L1gmtMuon:default: "pt" - # L1tkElectron:NoIso: "pt" - # L1tkElectron:NoIsoNoLowPtID: "pt" - # L1tkElectron:Iso: "pt" - xlabel: "L1 TkMuon. $p_T$ (GeV)" - ylabel: "Matching Efficiency (Barrel)" - binning: - min: 0 - max: 100 - step: 3 - -Purity_Muons_Overlap: - sample: DYLL_M50 - version: V44nano - match_test_to_ref: True - reference_object: - object: "L1gmtTkMuon" - x_arg: "pt" - label: "L1gmtTkMuon" - cuts: - event: - - "({hwQual}>>0)&1 == 1" - - "abs({eta}) > 0.83" - - "abs({eta}) < 1.24" - object: - - "abs({eta}) < 2.4" - test_objects: - GenPart:muon: "pt" - L1gmtMuon:default: "pt" - # L1tkElectron:NoIso: "pt" - # L1tkElectron:NoIsoNoLowPtID: "pt" - # L1tkElectron:Iso: "pt" - xlabel: "L1 TkMuon. $p_T$ (GeV)" - ylabel: "Matching Efficiency (Overlap)" - binning: - min: 0 - max: 100 - step: 3 - -Purity_Muons_Endcap: - sample: DYLL_M50 - version: V44nano - match_test_to_ref: True - reference_object: - object: "L1gmtTkMuon" - x_arg: "pt" - label: "L1gmtTkMuon" - cuts: - event: - - "({hwQual}>>0)&1 == 1" - - "abs({eta}) > 1.24" - - "abs({eta}) < 2.4" - object: - - "abs({eta}) < 2.4" - test_objects: - GenPart:muon: "pt" - L1gmtMuon:default: "pt" - # L1tkElectron:NoIso: "pt" - # L1tkElectron:NoIsoNoLowPtID: "pt" - # L1tkElectron:Iso: "pt" - xlabel: "L1 TkMuon. $p_T$ (GeV)" - ylabel: "Matching Efficiency (Endcap)" - binning: - min: 0 - max: 100 - step: 3 diff --git a/configs/V44nano/object_performance/photon_iso.yaml b/configs/V44nano/object_performance/photon_iso.yaml index f8b5773f..fb684521 100644 --- a/configs/V44nano/object_performance/photon_iso.yaml +++ b/configs/V44nano/object_performance/photon_iso.yaml @@ -4,16 +4,7 @@ PhotonIsolation_Barrel: iso_vs_efficiency: True match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) < 1.479" - object: - - "abs({eta}) < 1.479" + GenPart:photon_barrel:barrel_iso: "pt" test_objects: L1tkPhoton:NoIso:barrel: "relIso" xlabel: "Isolation" @@ -29,17 +20,7 @@ PhotonIsolation_Endcap: iso_vs_efficiency: True match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) > 1.479" - - "abs({eta}) < 2.4" - object: - - "abs({eta}) > 1.479" + GenPart:photon_endcap:endcap_iso: "pt" test_objects: L1tkPhoton:NoIso:endcap: "relIso" xlabel: "Isolation" diff --git a/configs/V44nano/object_performance/photons_matching.yaml b/configs/V44nano/object_performance/photons_matching.yaml index 70996d43..a515beb7 100644 --- a/configs/V44nano/object_performance/photons_matching.yaml +++ b/configs/V44nano/object_performance/photons_matching.yaml @@ -3,16 +3,7 @@ PhotonsMatching_Barrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenPart:photon:barrel: "pt" # TODO: Photon barrel region might be different from what is declared atm in GenPart test_objects: L1EG:default: "pt" L1tkPhoton:NoIso: "pt" @@ -29,16 +20,7 @@ PhotonsMatching_Endcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) > 1.5" - object: - - "abs({eta}) < 2.4" + GenPart:photon:endcap: "pt" test_objects: L1EG:default: "pt" L1tkPhoton:NoIso: "pt" diff --git a/configs/V44nano/object_performance/photons_matching_eta.yaml b/configs/V44nano/object_performance/photons_matching_eta.yaml index 3aa25155..2a1564d2 100644 --- a/configs/V44nano/object_performance/photons_matching_eta.yaml +++ b/configs/V44nano/object_performance/photons_matching_eta.yaml @@ -3,17 +3,7 @@ PhotonsMatching_Eta_Pt10to25: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "{pt} < 25" - - "{pt} > 10" - object: - - "abs({eta}) < 3.0" + GenPart:photon_Pt10to25: "eta" test_objects: L1EG:default: "eta" L1tkPhoton:NoIso: "eta" @@ -30,16 +20,7 @@ PhotonsMatching_Eta_Pt25toInf: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "{pt} >= 25" - object: - - "abs({eta}) < 3.0" + GenPart:photon_Pt25toInf: "eta" test_objects: L1EG:default: "eta" L1tkPhoton:NoIso: "eta" diff --git a/configs/V44nano/object_performance/photons_trigger.yaml b/configs/V44nano/object_performance/photons_trigger.yaml index 464a23a1..02653a0c 100644 --- a/configs/V44nano/object_performance/photons_trigger.yaml +++ b/configs/V44nano/object_performance/photons_trigger.yaml @@ -3,16 +3,7 @@ PhotonsTrigger_Barrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenPart:photon:barrel: "pt" test_objects: L1EG:default:barrel: "pt" L1tkPhoton:NoIso:barrel: "pt" @@ -33,16 +24,7 @@ PhotonsTrigger_Endcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Photons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 22" - - "abs({eta}) > 1.5" - object: - - "abs({eta}) < 2.4" + GenPart:photon:endcap: "pt" test_objects: L1EG:default:endcap: "pt" L1tkPhoton:NoIso:endcap: "pt" diff --git a/configs/V44nano/object_performance/electron_purity.yaml b/configs/V44nano/object_performance/purity_electron.yaml similarity index 50% rename from configs/V44nano/object_performance/electron_purity.yaml rename to configs/V44nano/object_performance/purity_electron.yaml index 3e957b39..4417b256 100644 --- a/configs/V44nano/object_performance/electron_purity.yaml +++ b/configs/V44nano/object_performance/purity_electron.yaml @@ -17,21 +17,21 @@ # max: 100 # step: 3 -Purity_ElectronsEndcap: - sample: DYLL_M50 - version: V44nano - match_test_to_ref: True - reference_object: - L1tkElectron:reference_endcap: "pt" - test_objects: - GenPart:electron: "pt" - L1EG:default: "pt" - # L1tkElectron:NoIso: "pt" - # L1tkElectron:NoIsoNoLowPtID: "pt" - # L1tkElectron:Iso: "pt" - xlabel: "L1 TkEle. $p_T$ (GeV)" - ylabel: "Matching Efficiency (Barrel)" - binning: - min: 0 - max: 100 - step: 3 +# Purity_ElectronsEndcap: +# sample: DYLL_M50 +# version: V44nano +# match_test_to_ref: True +# reference_object: +# L1tkElectron:reference_endcap: "pt" +# test_objects: +# GenPart:electron: "pt" +# L1EG:default: "pt" +# # L1tkElectron:NoIso: "pt" +# # L1tkElectron:NoIsoNoLowPtID: "pt" +# # L1tkElectron:Iso: "pt" +# xlabel: "L1 TkEle. $p_T$ (GeV)" +# ylabel: "Matching Efficiency (Barrel)" +# binning: +# min: 0 +# max: 100 +# step: 3 diff --git a/configs/V44nano/object_performance/purity_muon.yaml b/configs/V44nano/object_performance/purity_muon.yaml new file mode 100644 index 00000000..eef6d72f --- /dev/null +++ b/configs/V44nano/object_performance/purity_muon.yaml @@ -0,0 +1,77 @@ +# Purity_Muons_Barrel: +# sample: DYLL_M50 +# version: V44nano +# match_test_to_ref: True +# reference_object: +# L1gmtTkMuon:VLoose:barrel: "pt" +# test_objects: +# GenPart:muon: "pt" +# L1gmtTkMuon:VLoose:barrel: "pt" +# # L1gmtMuon:default:barrel: "pt" +# # L1tkElectron:NoIso: "pt" +# # L1tkElectron:NoIsoNoLowPtID: "pt" +# # L1tkElectron:Iso: "pt" +# xlabel: "L1 TkMuon. $p_T$ (GeV)" +# ylabel: "Matching Efficiency (Barrel)" +# binning: +# min: 0 +# max: 100 +# step: 3 + +# Purity_Muons_Overlap: +# sample: DYLL_M50 +# version: V44nano +# match_test_to_ref: True +# reference_object: +# L1gmtTkMuon:VLoose:overlap: "pt" +# # object: "L1gmtTkMuon" +# # x_arg: "pt" +# # label: "L1gmtTkMuon" +# # cuts: +# # event: +# # - "({hwQual}>>0)&1 == 1" +# # - "abs({eta}) > 0.83" +# # - "abs({eta}) < 1.24" +# # object: +# # - "abs({eta}) < 2.4" +# test_objects: +# GenPart:muon: "pt" +# L1gmtMuon:default: "pt" +# # L1tkElectron:NoIso: "pt" +# # L1tkElectron:NoIsoNoLowPtID: "pt" +# # L1tkElectron:Iso: "pt" +# xlabel: "L1 TkMuon. $p_T$ (GeV)" +# ylabel: "Matching Efficiency (Overlap)" +# binning: +# min: 0 +# max: 100 +# step: 3 + +# Purity_Muons_Endcap: +# sample: DYLL_M50 +# version: V44nano +# match_test_to_ref: True +# reference_object: +# L1gmtTkMuon:VLoose:endcap: "pt" +# # object: "L1gmtTkMuon" +# # x_arg: "pt" +# # label: "L1gmtTkMuon" +# # cuts: +# # event: +# # - "({hwQual}>>0)&1 == 1" +# # - "abs({eta}) > 1.24" +# # - "abs({eta}) < 2.4" +# # object: +# # - "abs({eta}) < 2.4" +# test_objects: +# GenPart:muon: "pt" +# L1gmtMuon:default: "pt" +# # L1tkElectron:NoIso: "pt" +# # L1tkElectron:NoIsoNoLowPtID: "pt" +# # L1tkElectron:Iso: "pt" +# xlabel: "L1 TkMuon. $p_T$ (GeV)" +# ylabel: "Matching Efficiency (Endcap)" +# binning: +# min: 0 +# max: 100 +# step: 3 diff --git a/configs/V44nano/object_performance/tau_matching.yaml b/configs/V44nano/object_performance/tau_matching.yaml index d4970ede..e1a6673c 100644 --- a/configs/V44nano/object_performance/tau_matching.yaml +++ b/configs/V44nano/object_performance/tau_matching.yaml @@ -3,21 +3,12 @@ TausMatchingBarrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:barrel: "pt" test_objects: L1nnPuppiTau:default: "pt" L1hpsTau:default: "pt" L1caloTau:default: "pt" L1nnCaloTau:default: "pt" -# L1caloTau:PtGe20: "Pt" xlabel: "Gen. $p_T$ (GeV)" ylabel: "Matching Efficiency (Barrel)" binning: @@ -30,24 +21,16 @@ TausMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) > 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:endcap: "pt" test_objects: L1nnPuppiTau:default: "pt" L1hpsTau:default: "pt" L1caloTau:default: "pt" L1nnCaloTau:default: "pt" -# L1caloTau:PtGe20: "Pt" xlabel: "Gen. $p_T$ (GeV)" ylabel: "Matching Efficiency (Endcap)" binning: min: 0 max: 150 step: 6 + diff --git a/configs/V44nano/object_performance/tau_matching_eta.yaml b/configs/V44nano/object_performance/tau_matching_eta.yaml index 871baa97..76290d8f 100644 --- a/configs/V44nano/object_performance/tau_matching_eta.yaml +++ b/configs/V44nano/object_performance/tau_matching_eta.yaml @@ -3,15 +3,7 @@ TauMatching_Eta_Pt40To100: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "eta" - label: "Gen Taus" - cuts: - event: - - "{pt} > 40" - - "{pt} < 100" - object: - - "abs({eta}) < 2.4" + GenVisTau:tau_Pt40To100: "eta" test_objects: L1nnPuppiTau:default: "eta" L1hpsTau:default: "eta" @@ -29,14 +21,7 @@ TauMatching_Eta_Pt100ToInf: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "eta" - label: "Gen Taus" - cuts: - event: - - "{pt} > 100" - object: - - "abs({eta}) < 5" + GenVisTau:tau_Pt100ToInf: "eta" test_objects: L1nnPuppiTau:default: "eta" L1hpsTau:default: "eta" diff --git a/configs/V44nano/object_performance/tau_matching_highPt.yaml b/configs/V44nano/object_performance/tau_matching_highPt.yaml index db936726..39f63d57 100644 --- a/configs/V44nano/object_performance/tau_matching_highPt.yaml +++ b/configs/V44nano/object_performance/tau_matching_highPt.yaml @@ -52,20 +52,14 @@ # max: 400 # step: 20 +# TODO: This config is almost an exact copy of tau_matching.yaml +# except thresholds and binning TauTriggerBarrel_90perc_highPt: sample: VBFHToTauTau version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:barrel: "pt" test_objects: L1nnPuppiTau:default:barrel: "pt" L1hpsTau:default:barrel: "pt" @@ -74,28 +68,20 @@ TauTriggerBarrel_90perc_highPt: xlabel: "Gen. pT (GeV)" ylabel: "Trigger Efficiency (barrel, L1 $p_T > $ GeV)" thresholds: [30, 50] - # scalings: - # method: "naive" - # threshold: 0.90 binning: min: 0 max: 400 step: 10 + +# TODO: This config is almost an exact copy of tau_matching.yaml +# except thresholds and binning TauTriggerEndcap_90perc_highPt: sample: VBFHToTauTau version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) > 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:endcap: "pt" test_objects: L1nnPuppiTau:default:endcap: "pt" L1hpsTau:default:endcap: "pt" @@ -104,9 +90,6 @@ TauTriggerEndcap_90perc_highPt: xlabel: "Gen. pT (GeV)" ylabel: "Trigger Efficiency (endcap, L1 $p_T > $ GeV)" thresholds: [30, 50] - # scalings: - # method: "naive" - # threshold: 0.90 binning: min: 0 max: 400 diff --git a/configs/V44nano/object_performance/tau_trigger.yaml b/configs/V44nano/object_performance/tau_trigger.yaml index cc9f1686..cc74ed1e 100644 --- a/configs/V44nano/object_performance/tau_trigger.yaml +++ b/configs/V44nano/object_performance/tau_trigger.yaml @@ -3,15 +3,7 @@ TauTriggerBarrel_90perc: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) < 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:barrel: "pt" test_objects: L1nnPuppiTau:default:barrel: "pt" L1hpsTau:default:barrel: "pt" @@ -33,15 +25,7 @@ TauTriggerEndcap_90perc: version: V44nano match_test_to_ref: True reference_object: - object: "GenVisTau" - x_arg: "pt" - label: "Gen Taus" - cuts: - event: - # - "{dr_0.3} < 0.15" - - "abs({eta}) > 1.5" - object: - - "abs({eta}) < 2.4" + GenVisTau:default:endcap: "pt" test_objects: L1nnPuppiTau:default:endcap: "pt" L1hpsTau:default:endcap: "pt" @@ -57,3 +41,5 @@ TauTriggerEndcap_90perc: min: 0 max: 150 step: 6 + + diff --git a/configs/V44nano/object_performance/tkmuon_matching.yaml b/configs/V44nano/object_performance/tkmuon_matching.yaml index 4cbe0281..52f353cc 100644 --- a/configs/V44nano/object_performance/tkmuon_matching.yaml +++ b/configs/V44nano/object_performance/tkmuon_matching.yaml @@ -3,15 +3,7 @@ TkMuonsMatchingBarrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) < 0.83" + GenPart:muon_barrel: "pt" test_objects: # L1gmtMuon:default:barrel: "pt" L1gmtTkMuon:default:barrel: "pt" @@ -31,16 +23,7 @@ TkMuonsMatchingOverlap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 0.83" - - "abs({eta}) < 1.24" + GenPart:muon_overlap: "pt" test_objects: # L1gmtMuon:default:overlap: "pt" L1gmtTkMuon:default:overlap: "pt" @@ -60,16 +43,7 @@ TkMuonsMatchingEndcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "pt" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 1.24" - - "abs({eta}) < 2.4" + GenPart:muon_endcap: "pt" test_objects: # L1gmtMuon:default:endcap: "pt" L1gmtTkMuon:default:endcap: "pt" diff --git a/configs/V44nano/object_performance/tkmuon_matching_eta.yaml b/configs/V44nano/object_performance/tkmuon_matching_eta.yaml index 563ed0b0..7b37879c 100644 --- a/configs/V44nano/object_performance/tkmuon_matching_eta.yaml +++ b/configs/V44nano/object_performance/tkmuon_matching_eta.yaml @@ -3,17 +3,7 @@ TkMuonsMatching_Eta_Pt2to5: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - - "{pt} > 2" - - "{pt} < 5" - object: - - "abs({eta}) < 2.4" + GenPart:muon_Pt2to5: "eta" test_objects: # L1gmtMuon:default: "eta" L1gmtTkMuon:default: "eta" @@ -33,16 +23,7 @@ TkMuonsMatching_Eta_Pt15toInf: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - - "{pt} > 15" - object: - - "abs({eta}) < 2.4" + GenPart:muon_Pt15toInf: "eta" test_objects: # L1gmtMuon:default: "eta" L1gmtTkMuon:default: "eta" diff --git a/configs/V44nano/object_performance/tkmuon_trigger.yaml b/configs/V44nano/object_performance/tkmuon_trigger.yaml index b125adae..f8b973d9 100644 --- a/configs/V44nano/object_performance/tkmuon_trigger.yaml +++ b/configs/V44nano/object_performance/tkmuon_trigger.yaml @@ -3,15 +3,7 @@ TkMuonsTrigger_Barrel: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) < 0.83" + GenPart:muon_barrel: "eta" test_objects: # L1gmtMuon:default:barrel: "pt" # L1gmtTkMuon:default:barrel: "pt" @@ -35,16 +27,7 @@ TkMuonsTrigger_Overlap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 0.83" - - "abs({eta}) < 1.24" + GenPart:muon_overlap: "eta" test_objects: # L1gmtMuon:default:overlap: "pt" # L1gmtTkMuon:default:overlap: "pt" @@ -68,15 +51,7 @@ TkMuonsTrigger_Endcap: version: V44nano match_test_to_ref: True reference_object: - object: "GenPart" - x_arg: "eta" - label: "Gen Muons" - cuts: - event: - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - object: - - "abs({eta}) > 1.24" + GenPart:muon_trigger_endcap: "eta" test_objects: # L1gmtMuon:default:endcap: "pt" # L1gmtTkMuon:default:endcap: "pt" diff --git a/configs/V44nano/objects/GenPart.yaml b/configs/V44nano/objects/GenPart.yaml index 43d363b4..33f6fa1d 100644 --- a/configs/V44nano/objects/GenPart.yaml +++ b/configs/V44nano/objects/GenPart.yaml @@ -1,126 +1,216 @@ + GenPart: match_dR: 0.15 eta_ranges: +# == Inclusive ================= inclusive: [0, 7] - barrel: [0, 1.479] +# == General definition ======== + barrel: [0, 1.5] + endcap: [1.5, 5] +# == Definition for isolation == + barrel_iso: [0, 1.479] + endcap_iso: [1.479, 2.4] +# == Definition for muon ======= barrel_muon: [0, 0.83] overlap: [0.83, 1.24] - endcap: [1.479, 5] endcap_muon: [1.24, 2.4] ids: +# ==ELECTRONS================================== electron: label: "Gen Electron" cuts: - inclusive: - - "abs({eta}) < 3" - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - muon: - label: "Gen Muon" - cuts: - inclusive: - - "abs({eta}) < 3" - - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 13" - reference_muon: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 11" + object: + inclusive: + - "abs({eta}) < 2.4" + electron_iso: + label: "Gen Electron" + cuts: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 11" + object: + inclusive: + - "abs({eta}) < 1.479" + electron_trigger: + label: "Gen Electron" + cuts: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 11" + object: + inclusive: + - "abs({eta}) < 2.8" + electron_pt10to25: + label: "Gen Electron $p_T=10-25$GeV" + cuts: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 11" + - "{pt} < 25" + - "{pt} > 10" + object: + inclusive: + - "abs({eta}) < 3.0" + electron_pt25toInf: + label: "Gen Electron $p_T>25$GeV" + cuts: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 11" + - "{pt} > 25" + object: + inclusive: + - "abs({eta}) < 3.0" +# ==MUONS======================================= + muon_barrel: label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - "abs({pdgId}) == 13" - reference_muon_Pt2to5: + object: + inclusive: + - "abs({eta}) < 0.83" + muon_overlap: label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - "abs({pdgId}) == 13" - - "{pt} > 2" - - "{pt} < 5" object: inclusive: - - "abs({eta}) < 2.4" - reference_muon_Pt15toInf: + - "abs({eta}) > 0.83" + - "abs({eta}) < 1.24" + muon_endcap: label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - "abs({pdgId}) == 13" - - "{pt} > 15" object: inclusive: - - "abs({eta}) < 2.4" - reference_electron_barrel: - label: "Gen Electron" + - "abs({eta}) > 1.24" + - "abs({eta}) < 2.4" + muon_trigger_endcap: + label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "abs({eta}) < 1.479" + - "abs({pdgId}) == 13" object: inclusive: - - "abs({eta}) < 2.4" - reference_electron: - label: "Gen Electron" + - "abs({eta}) > 1.24" + muon_Pt2to5: + label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - reference_electron_endcap: - label: "Gen Electron Endcap" + - "abs({pdgId}) == 13" + - "{pt} > 2" + - "{pt} < 5" + object: + inclusive: + - "abs({eta}) < 2.4" + muon_Pt15toInf: + label: "Gen Muons" cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "abs({eta}) > 1.479" + - "abs({pdgId}) == 13" + - "{pt} > 15" object: inclusive: - "abs({eta}) < 2.4" - reference_electron_pt10to25: - label: "Gen Electron $p_T=10-25$GeV" +# ==PHOTONS==================================== + photon: cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "{pt} < 25" - - "{pt} > 10" + - "abs({pdgId}) == 22" object: inclusive: - - "abs({eta}) < 3.0" - reference_electron_pt25toInf: - label: "Gen Electron $p_T>25$GeV" + - "abs({eta}) < 2.4" + photon_barrel: cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "{pt} > 25" + - "abs({pdgId}) == 22" object: inclusive: - - "abs({eta}) < 3.0" - reference_electron_trigger_barrel: + - "abs({eta}) < 1.479" + photon_endcap: cuts: event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "abs({eta}) < 1.5" + - "abs({pdgId}) == 22" object: inclusive: - - "abs({eta}) < 2.8" - reference_electron_trigger_endcap: + - "abs({eta}) > 1.479" + photon_Pt10to25: cuts: + event: + inclusive: + - "(({statusFlags}>>7)&1) == 1" + - "abs({pdgId}) == 22" + - "{pt} < 25" + - "{pt} > 10" + object: + inclusive: + - "abs({eta}) < 3.0" + photon_Pt25toInf: + cuts: + object: + inclusive: + - "abs({eta}) < 3.0" event: inclusive: - "(({statusFlags}>>7)&1) == 1" - - "abs({pdgId}) == 11" - - "abs({eta}) > 1.5" + - "abs({pdgId}) == 22" + - "{pt} >= 25" + +GenVisTau: + label: "Gen Taus" + eta_ranges: + inclusive: [0, 7] + barrel: [0, 1.5] + endcap: [1.5, 5] + ids: + default: + cuts: + object: + inclusive: + - "abs({eta}) < 2.4" + tau_Pt40To100: + cuts: + event: + inclusive: + - "{pt} > 40" + - "{pt} < 100" object: inclusive: - - "abs({eta}) < 2.8" + - "abs({eta}) < 2.4" + tau_Pt100ToInf: + cuts: + event: + inclusive: + - "{pt} > 100" + object: + inclusive: + - "abs({eta}) < 5" diff --git a/configs/V44nano/objects/electrons.yaml b/configs/V44nano/objects/electrons.yaml index 279edbed..ce0b449a 100644 --- a/configs/V44nano/objects/electrons.yaml +++ b/configs/V44nano/objects/electrons.yaml @@ -11,6 +11,7 @@ L1tkElectron: cuts: inclusive: - "abs({eta}) < 2.4" + # - "{pt} > 5" endcap: - "({eleId} == 1) | ({pt} < 25)" barrel: @@ -59,6 +60,7 @@ L1EG: cuts: inclusive: - "abs({eta}) < 3.0" + # - "{pt} > 5" barrel: - "{eleId} == 1" endcap: diff --git a/configs/V44nano/objects/jets.yaml b/configs/V44nano/objects/jets.yaml index aa955869..fd0b6317 100644 --- a/configs/V44nano/objects/jets.yaml +++ b/configs/V44nano/objects/jets.yaml @@ -1,3 +1,4 @@ + GenJetAK8: label: "Gen AK8 Jets" eta_ranges: @@ -6,31 +7,20 @@ GenJetAK8: endcap: [1.5, 2.4] forward: [2.4, 5] ids: - reference_matching_SC8_Pt100ToInf: + jet_matching_SC8_Pt100ToInf: cuts: event: inclusive: - "{pt} > 100" object: inclusive: - - "abs({eta}) < 5" - reference_barrel: + - "abs({eta}) < 5" + jet: cuts: - event: - inclusive: - - "abs({eta}) < 1.5" object: inclusive: - "abs({eta}) < 2.4" - reference_endcap: - cuts: - event: - inclusive: - - "abs({eta}) > 1.5" - object: - inclusive: - - "abs({eta}) < 2.4" - reference_forward: + default: cuts: event: inclusive: @@ -39,12 +29,11 @@ GenJetAK8: inclusive: - "abs({eta}) < 5" - GenJet: eta_ranges: inclusive: [0, 7] barrel: [0, 1.5] - endcap: [1.5, 2.4] + endcap: [1.5, 5] forward: [2.4, 5] ids: mht_default: @@ -63,7 +52,7 @@ GenJet: inclusive: - "abs({eta}) < 2.4" - "{pt} > 30" - reference_Pt40To100: + jet_Pt40To100: label: "Gen Jets" cuts: event: @@ -73,7 +62,7 @@ GenJet: object: inclusive: - "abs({eta}) < 5" - reference_Pt100ToInf: + jet_Pt100ToInf: label: "Gen Jets" cuts: event: @@ -81,8 +70,8 @@ GenJet: - "{pt} > 100" object: inclusive: - - "abs({eta}) < 5" - reference_Pt100ToInf_extEta: + - "abs({eta}) < 5" + jet_Pt100ToInf_extEta: label: "Gen Jets" cuts: event: @@ -91,9 +80,9 @@ GenJet: object: inclusive: - "abs({eta}) < 7" - reference_Pt30ToInf_genBJets: + jet_Pt30ToInf_genBJets: label: "Gen Jets" - cuts: + cuts: event: inclusive: - "{pt} > 30" @@ -101,7 +90,7 @@ GenJet: object: inclusive: - "abs({eta}) < 2.4" - reference_Pt30ToInf_genNotBJets: + jet_Pt30ToInf_genNotBJets: label: "Gen Jets" cuts: event: @@ -111,30 +100,15 @@ GenJet: object: inclusive: - "abs({eta}) < 2.4" - reference_barrel: - label: "Gen Jets" - cuts: - event: - inclusive: - - "abs({eta}) < 1.5" - object: - inclusive: - - "abs({eta}) < 2.4" - reference_endcap: + jet: label: "Gen Jets" cuts: - event: - inclusive: - - "abs({eta}) > 1.5" object: inclusive: - "abs({eta}) < 2.4" - reference_forward: + default: label: "Gen Jets" cuts: - event: - inclusive: - - "abs({eta}) > 2.4" object: inclusive: - "abs({eta}) < 5" diff --git a/configs/V44nano/objects/muons.yaml b/configs/V44nano/objects/muons.yaml index 266fc1c5..9b01101d 100644 --- a/configs/V44nano/objects/muons.yaml +++ b/configs/V44nano/objects/muons.yaml @@ -11,6 +11,7 @@ L1gmtTkMuon: label: "GMT TkMuon" cuts: inclusive: + # - "({hwQual}>>1)&1 == 1" # NOTE: In comparison this is often used as default in matching üplots for muons - "(({hwQual}>>1)&1 == 1) | (({pt} > 8) & (({hwQual}>>0)&1 == 1))" # Loose (bit 2) for pt < 8 VLoose (bit 1) for pt > 8 VLoose: # x.numberOfMatches() > 0 label: "GMT TkMuon, VLoose ID" diff --git a/configs/V44nano/objects/taus.yaml b/configs/V44nano/objects/taus.yaml index 11e49a74..cd652ea2 100644 --- a/configs/V44nano/objects/taus.yaml +++ b/configs/V44nano/objects/taus.yaml @@ -59,3 +59,5 @@ L1nnCaloTau: inclusive: - "abs({eta}) < 2.4" - "{hwQual}==3" + + diff --git a/menu_tools/object_performance/turnon_collection.py b/menu_tools/object_performance/turnon_collection.py index e85b7747..93dbfec4 100644 --- a/menu_tools/object_performance/turnon_collection.py +++ b/menu_tools/object_performance/turnon_collection.py @@ -3,13 +3,14 @@ import awkward as ak import numpy as np import vector +import re from menu_tools.object_performance.config import PerformancePlotConfig from menu_tools.utils import utils from menu_tools.utils.objects import ( Object, - compute_selection_mask_for_event_cuts, - compute_selection_mask_for_object_cuts, + # compute_selection_mask_for_event_cuts, + # compute_selection_mask_for_object_cuts, ) @@ -231,6 +232,16 @@ def _select_highest_pt_ref_object(self): sel_pt = ak.argmax(self.ak_arrays["ref"]["pt"], axis=-1, keepdims=True) self.ak_arrays["ref"] = self.ak_arrays["ref"][sel_pt] + def _apply_list_of_reference_cuts(self, cut_list): + for cut in cut_list: + cut = re.sub(r"{([^&|]*)}", r"self.ak_arrays['ref']['\1']", cut) + sel = eval(cut) + self.ak_arrays["ref"] = self.ak_arrays["ref"][sel] + if not isinstance( + self.ak_arrays["ref"], vector.backends.awkward.MomentumArray4D + ): + self.ak_arrays["ref"] = ak.with_name(self.ak_arrays["ref"], "Momentum4D") + def _apply_reference_cuts(self) -> None: """Applies configured cuts on reference objects. @@ -240,26 +251,45 @@ def _apply_reference_cuts(self) -> None: if "met" in self.cfg_plot.reference_object.nano_obj_name.lower(): # TODO: Maybe we want to modify it and allow possible cuts on MET return + ref_object_cuts = self.cfg_plot.reference_object.cuts + self._apply_list_of_reference_cuts(ref_object_cuts["inclusive"]) - # Apply object level cuts, i.e. removing objects from event, while - # retaining the events. - if self.cfg_plot.reference_object.cuts: - sel = compute_selection_mask_for_object_cuts( - self.cfg_plot.reference_object, self.ak_arrays["ref"] - ) - self.ak_arrays["ref"] = self.ak_arrays["ref"][sel] - - # If specified, apply transformation if self.cfg_plot.reference_object.trafo: # In this case each event is reduced to a single value already return None - # Select highest pt object from each event and apply event level cuts. self._select_highest_pt_ref_object() - sel = compute_selection_mask_for_event_cuts( - self.cfg_plot.reference_object, self.ak_arrays["ref"] - ) - self.ak_arrays["ref"] = self.ak_arrays["ref"][sel] + ref_event_cuts = self.cfg_plot.reference_object.event_cuts + self._apply_list_of_reference_cuts(ref_event_cuts["inclusive"]) + + # """Applies configured cuts on reference objects. + + # Should be applied before any matching and before the + # selection of the highest pT object. + # """ + # if "met" in self.cfg_plot.reference_object.nano_obj_name.lower(): + # # TODO: Maybe we want to modify it and allow possible cuts on MET + # return + + # # Apply object level cuts, i.e. removing objects from event, while + # # retaining the events. + # if self.cfg_plot.reference_object.cuts: + # sel = compute_selection_mask_for_object_cuts( + # self.cfg_plot.reference_object, self.ak_arrays["ref"] + # ) + # self.ak_arrays["ref"] = self.ak_arrays["ref"][sel] + + # # If specified, apply transformation + # if self.cfg_plot.reference_object.trafo: + # # In this case each event is reduced to a single value already + # return None + + # # Select highest pt object from each event and apply event level cuts. + # self._select_highest_pt_ref_object() + # sel = compute_selection_mask_for_event_cuts( + # self.cfg_plot.reference_object, self.ak_arrays["ref"] + # ) + # self.ak_arrays["ref"] = self.ak_arrays["ref"][sel] def _apply_test_obj_cuts(self): """Applies configured cuts on all configured test objects. @@ -269,10 +299,32 @@ def _apply_test_obj_cuts(self): for test_obj, _ in self.test_objects: if not test_obj.cuts: continue - sel = compute_selection_mask_for_object_cuts( - test_obj, self.ak_arrays[str(test_obj)] - ) - self.ak_arrays[str(test_obj)] = self.ak_arrays[str(test_obj)][sel] + if "eta" not in self.ak_arrays[str(test_obj)].fields: + self.ak_arrays[str(test_obj)]["eta"] = 0 + for ( + range_i, + range_cuts, + ) in test_obj.cuts.items(): # TODO: use the version from utils + for cut in range_cuts: + cut = re.sub( + r"{([^&|]*)}", r"self.ak_arrays[str(test_obj)]['\1']", cut + ) + eta_sel = ( + abs(self.ak_arrays[str(test_obj)]["eta"]) + >= test_obj.eta_ranges[range_i][0] + ) & ( + abs(self.ak_arrays[str(test_obj)]["eta"]) + < test_obj.eta_ranges[range_i][1] + ) + sel = eval(cut) + ~eta_sel + self.ak_arrays[str(test_obj)] = self.ak_arrays[str(test_obj)][sel] + + # NOTE: This is the previous implementation + # --> See NOTE in defintion of function + # sel = compute_selection_mask_for_object_cuts( + # test_obj, self.ak_arrays[str(test_obj)] + # ) + # self.ak_arrays[str(test_obj)] = self.ak_arrays[str(test_obj)][sel] def _skim_to_hists(self) -> None: """ diff --git a/menu_tools/rate_plots/plotter.py b/menu_tools/rate_plots/plotter.py index 9ccfd30d..17cc53e3 100644 --- a/menu_tools/rate_plots/plotter.py +++ b/menu_tools/rate_plots/plotter.py @@ -45,7 +45,10 @@ def __init__(self, cfg, data, offline_pt: bool): ## Overwrite outdir self._outdir = os.path.join( - "outputs", self.cfg.version, "object_performance", "rates" + "outputs", + self.cfg.version, + "rate_plots" + # "outputs", self.cfg.version, "object_performance", "rates" ) @property diff --git a/menu_tools/rate_plots/tests/test_rate_plots_v29.py b/menu_tools/rate_plots/tests/test_rate_plots_v29.py index bc6d920d..57a5f3eb 100644 --- a/menu_tools/rate_plots/tests/test_rate_plots_v29.py +++ b/menu_tools/rate_plots/tests/test_rate_plots_v29.py @@ -5,6 +5,8 @@ from unittest.mock import patch import re import sys +from datetime import datetime, timedelta +from pathlib import Path import numpy as np import pytest @@ -25,6 +27,9 @@ def test_matching_plots_reproduced(test_name): f"menu_tools/rate_plots/tests/reference_data/{test_name}.yaml", ] + # Record time before creating output + time_stamp = datetime.now() + # Run Plotting with patch.object(sys, "argv", testargs): plotter.main() @@ -32,8 +37,26 @@ def test_matching_plots_reproduced(test_name): # Load result and assert correct outcome (Offline) for online_offline in ["Online", "Offline"]: + output_path = Path( + f"outputs/V29/rate_plots/V29_{online_offline}_{test_name}.json" + ) + output_dir = "outputs/V29/rate_plots" + # Assert: Check whether output files were created + assert output_path.exists(), f"Expected output {output_path} does not exist." + + # Assert: Check if file was put in correct directory + assert output_path.parent == Path( + output_dir + ), f"Output file was not created in specified directory {output_dir}." + + # Assert: Check whether new file was created or rather just existed before + file_creation_time = datetime.fromtimestamp(output_path.stat().st_mtime) + assert ( + file_creation_time >= time_stamp + ), f"{output_path} already existed before plotter was called." + with open( - f"outputs/rate_plots/V29_{online_offline}_{test_name}.json", + f"outputs/V29/rate_plots/V29_{online_offline}_{test_name}.json", "r", ) as f: test_result = json.load(f) diff --git a/menu_tools/utils/objects.py b/menu_tools/utils/objects.py index 086f1a2b..93a69274 100644 --- a/menu_tools/utils/objects.py +++ b/menu_tools/utils/objects.py @@ -178,6 +178,13 @@ def __init__(self, object_key: str, version: str) -> None: super().__init__(object_key, version) @property + def obj_type(self) -> str: + return "test" + + @property + # TODO: I want to change the cuts dict to a list, without any key arguments, + # because it is called for specific ids, eta ranges, etc. anyways + # and now it is all dumped in inclusive which is somewhat misleading def cuts(self) -> dict[str, list[str]]: _cuts = {} if "cuts" in self._object_params.keys(): @@ -204,6 +211,10 @@ class ReferenceObject(BaseObject): def __init__(self, object_key: str, version: str) -> None: super().__init__(object_key, version) + @property + def obj_type(self) -> str: + return "ref" + @property def trafo(self) -> Optional[str]: """Returns the trafo key of the (reference) object @@ -216,6 +227,9 @@ def trafo(self) -> Optional[str]: # No transformation defined in reference object `self.object_key` return None + # NOTE: ATM every cut is in inclusive + # -> probably being a requirement from previous config structure. + # I find this misleading and also unnecessary. def _get_cuts(self, event_or_object: str) -> dict[str, list[str]]: assert event_or_object in [ "event", @@ -225,19 +239,6 @@ def _get_cuts(self, event_or_object: str) -> dict[str, list[str]]: if "cuts" in self._object_params.keys(): if event_or_object in self._object_params["cuts"].keys(): _cuts = self._object_params["cuts"][event_or_object] - elif self.eta_range == "inclusive": - return {} - if self.eta_range != "inclusive": - # if a region other than inclusive is specified, add an eta cut - eta_min = self.eta_ranges[self.eta_range][0] - eta_max = self.eta_ranges[self.eta_range][1] - global_eta_cut = ( - f"((abs({{eta}}) > {eta_min}) & (abs({{eta}}) < {eta_max}))" - ) - try: - _cuts["inclusive"].append(global_eta_cut) - except KeyError: - _cuts["inclusive"] = [global_eta_cut] return _cuts @property @@ -252,7 +253,12 @@ def cuts(self) -> dict[str, list[str]]: object_cut_dict: For info on the structure of the returned object see docstring of base class. """ - return self._get_cuts("object") + cuts = self._get_cuts("object") + # TODO: Drop this in future, but then style in config has to change, + # maybe do a handling here, if nothing -> inclusive, else else + if not cuts: + cuts["inclusive"] = {} + return cuts @property def event_cuts(self) -> dict[str, list[str]]: @@ -265,11 +271,39 @@ def event_cuts(self) -> dict[str, list[str]]: event_cut_dict: For info on the structure of the returned object see docstring of base class. """ - return self._get_cuts("event") + event_cuts = self._get_cuts("event") + if self.eta_range != "inclusive": + # if a region other than inclusive is specified, add an eta cut + eta_min = self.eta_ranges[self.eta_range][0] + eta_max = self.eta_ranges[self.eta_range][1] + global_eta_cut = ( + f"((abs({{eta}}) > {eta_min}) & (abs({{eta}}) < {eta_max}))" + ) + if "inclusive" not in event_cuts: + event_cuts["inclusive"] = [global_eta_cut] + else: + event_cuts["inclusive"].append(global_eta_cut) + + if not event_cuts: + event_cuts["inclusive"] = {} + return event_cuts + + +""" NOTE: I am not sure if this function is still called +Problem with this function is, it should outsource common code, +but the options between +test/ref object and event/object level cut in ref object make the code less readable +and prone to errors, because the sel mask is created in a suspicious for loop. +Also the code runs slower +--> It is now handled in turn on collection _apply_list_of_reference_cuts() +/ _apply_list_of_testobject_cuts()""" def compute_selection_mask_for_cuts( - obj: BaseObject, ak_array: ak.Array, cuts: dict + obj: BaseObject, + ak_array: ak.Array, + cuts: dict, + obj_type: str, ) -> ak.Array: """Compute selection mask for object/event cuts on array @@ -281,7 +315,6 @@ def compute_selection_mask_for_cuts( """ # Initialize mask with True everywhere sel = ak.ones_like(ak_array[ak_array.fields[0]]) > 0 - # If no cut are specified in object, return True everywhere. # That case will be `cuts = {}`. if not cuts: @@ -296,25 +329,28 @@ def compute_selection_mask_for_cuts( _sel = ak.ones_like(ak_array[ak_array.fields[0]]) > 0 for cut in range_cuts: cut = re.sub(r"{([^&|]*)}", r"ak_array['\1']", cut) - eta_sel = (abs(ak_array["eta"]) >= obj.eta_ranges[range_i][0]) & ( - abs(ak_array["eta"]) < obj.eta_ranges[range_i][1] - ) - _sel = _sel & (eval(cut) + ~eta_sel) + if obj_type == "ref": + _sel = _sel & eval(cut) + elif obj_type == "test": + eta_sel = (abs(ak_array["eta"]) >= obj.eta_ranges[range_i][0]) & ( + abs(ak_array["eta"]) < obj.eta_ranges[range_i][1] + ) + _sel = _sel & (eval(cut) + ~eta_sel) # apply OR logic sel = sel & _sel - return sel + return _sel def compute_selection_mask_for_event_cuts( obj: BaseObject, ak_array: ak.Array ) -> ak.Array: - return compute_selection_mask_for_cuts(obj, ak_array, obj.event_cuts) + return compute_selection_mask_for_cuts(obj, ak_array, obj.event_cuts, obj.obj_type) def compute_selection_mask_for_object_cuts( obj: BaseObject, ak_array: ak.Array ) -> ak.Array: - return compute_selection_mask_for_cuts(obj, ak_array, obj.cuts) + return compute_selection_mask_for_cuts(obj, ak_array, obj.cuts, obj.obj_type) if __name__ == "__main__":