From 83fb71b3e50e3c7f8add106979447b9f983d189b Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Wed, 29 Jan 2025 20:42:27 +0100 Subject: [PATCH 1/5] Add exception if P2GT eta regions not consistent with cuts --- L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h index d8703e95049a8..f81e3913bba93 100644 --- a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h +++ b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h @@ -90,7 +90,14 @@ namespace l1t { primVertex_(getOptionalParam("primVertex", config)), minPtMultiplicityN_(config.getParameter("minPtMultiplicityN")), minPtMultiplicityCut_(getOptionalParam( - "minPtMultiplicityCut", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })) {} + "minPtMultiplicityCut", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })) { + if (!regionsMinPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMinPt_.size()) { + throw cms::Exception("Configuration") << "\'regionsMinPt\' has " << regionsMinPt_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; + } + if (!regionsMaxRelIsolationPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMaxRelIsolationPt_.size()) { + throw cms::Exception("Configuration") << "\'regionsMinPt\' has " << regionsMaxRelIsolationPt_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; + } + } bool checkObject(const P2GTCandidate& obj) const { bool result = true; From 04c5f331f45ed4ea2eb3fdc7815b6bb7f791bb98 Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Wed, 29 Jan 2025 20:55:13 +0100 Subject: [PATCH 2/5] Fix pt cuts where less than regions in P2GT --- .../step1_2024/l1tGTMenu_hadr_crossLepSeeds_cff.py | 8 ++++---- .../l1tGTMenu_hadr_crossLepSeeds_cff.py | 10 +++++----- .../step1_2024_explicitSeeds/l1tGTMenu_lepSeeds_cff.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024/l1tGTMenu_hadr_crossLepSeeds_cff.py b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024/l1tGTMenu_hadr_crossLepSeeds_cff.py index 65774e94fed94..ffcd876688c67 100644 --- a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024/l1tGTMenu_hadr_crossLepSeeds_cff.py +++ b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024/l1tGTMenu_hadr_crossLepSeeds_cff.py @@ -39,13 +39,13 @@ primVertex = cms.uint32(0), # primary vertex index (choose 0) ), collection2 = l1tGTsc4Jet.clone( - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), collection3 = l1tGTsc4Jet.clone( - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), collection4 = l1tGTsc4Jet.clone( - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), correl12 = cms.PSet( maxDR = cms.double(0.4), @@ -169,7 +169,7 @@ primVertex = cms.uint32(0), # primary vertex index (choose 0) ), collection2 = l1tGTsc4Jet.clone( - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), minDR = cms.double(0.3) ) diff --git a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_hadr_crossLepSeeds_cff.py b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_hadr_crossLepSeeds_cff.py index 0d6280ea8e1f8..bd97e382c4c83 100644 --- a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_hadr_crossLepSeeds_cff.py +++ b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_hadr_crossLepSeeds_cff.py @@ -53,21 +53,21 @@ minEta = cms.double(-2.4), maxEta = cms.double(2.4), regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), collection3 = cms.PSet( tag = cms.InputTag("l1tGTProducer", "CL2JetsSC4"), minEta = cms.double(-2.4), maxEta = cms.double(2.4), regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), collection4 = cms.PSet( tag = cms.InputTag("l1tGTProducer", "CL2JetsSC4"), minEta = cms.double(-2.4), maxEta = cms.double(2.4), regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), correl12 = cms.PSet( maxDR = cms.double(0.4), @@ -247,7 +247,7 @@ minEta = cms.double(-2.4), maxEta = cms.double(2.4), regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), - regionsMinPt=cms.vdouble(25,25), #safety cut + minPt = cms.double(25) #safety cut ), minDR = cms.double(0.3) ) @@ -262,7 +262,7 @@ tag = cms.InputTag("l1tGTProducer", "CL2Taus"), minEta = cms.double(-2.172), maxEta = cms.double(2.172), - regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), + regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2Taus"), regionsMinPt = get_object_thrs(55, "CL2Taus","default"), minQualityScore = get_object_ids("CL2Taus","default") ), diff --git a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_lepSeeds_cff.py b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_lepSeeds_cff.py index 9663b573e040a..39143081342f1 100644 --- a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_lepSeeds_cff.py +++ b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/step1_2024_explicitSeeds/l1tGTMenu_lepSeeds_cff.py @@ -241,7 +241,7 @@ tag = cms.InputTag("l1tGTProducer", "CL2Taus"), minEta = cms.double(-2.172), maxEta = cms.double(2.172), - regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), + regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2Taus"), regionsMinPt = get_object_thrs(52, "CL2Taus","default"), minQualityScore = get_object_ids("CL2Taus","default") ), @@ -249,7 +249,7 @@ tag = cms.InputTag("l1tGTProducer", "CL2Taus"), minEta = cms.double(-2.172), maxEta = cms.double(2.172), - regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2JetsSC4"), + regionsAbsEtaLowerBounds = get_object_etalowbounds("CL2Taus"), regionsMinPt = get_object_thrs(52, "CL2Taus","default"), minQualityScore = get_object_ids("CL2Taus","default") ), From 7749d0a7fee6ef6e67505f76c8c54febfb71b700 Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Wed, 29 Jan 2025 21:03:52 +0100 Subject: [PATCH 3/5] Apply code format --- .../plugins/L1GTSingleCollectionCut.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h index f81e3913bba93..d2a5c765dafe5 100644 --- a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h +++ b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h @@ -91,13 +91,17 @@ namespace l1t { minPtMultiplicityN_(config.getParameter("minPtMultiplicityN")), minPtMultiplicityCut_(getOptionalParam( "minPtMultiplicityCut", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })) { - if (!regionsMinPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMinPt_.size()) { - throw cms::Exception("Configuration") << "\'regionsMinPt\' has " << regionsMinPt_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; - } - if (!regionsMaxRelIsolationPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMaxRelIsolationPt_.size()) { - throw cms::Exception("Configuration") << "\'regionsMinPt\' has " << regionsMaxRelIsolationPt_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; - } - } + if (!regionsMinPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMinPt_.size()) { + throw cms::Exception("Configuration") + << "\'regionsMinPt\' has " << regionsMinPt_.size() << " entries, but requires " + << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; + } + if (!regionsMaxRelIsolationPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMaxRelIsolationPt_.size()) { + throw cms::Exception("Configuration") + << "\'regionsMinPt\' has " << regionsMaxRelIsolationPt_.size() << " entries, but requires " + << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; + } + } bool checkObject(const P2GTCandidate& obj) const { bool result = true; From 91e35ada8dddcf8989df698f6554c2fd8de74e42 Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Thu, 30 Jan 2025 13:20:33 +0100 Subject: [PATCH 4/5] Add check for regionsQualityFlags in P2GT --- L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h index d2a5c765dafe5..72bf27e92d849 100644 --- a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h +++ b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h @@ -98,7 +98,12 @@ namespace l1t { } if (!regionsMaxRelIsolationPt_.empty() && regionsAbsEtaLowerBounds_.size() != regionsMaxRelIsolationPt_.size()) { throw cms::Exception("Configuration") - << "\'regionsMinPt\' has " << regionsMaxRelIsolationPt_.size() << " entries, but requires " + << "\'regionsMaxRelIsolationPt\' has " << regionsMaxRelIsolationPt_.size() << " entries, but requires " + << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; + } + if (!regionsQualityFlags_.empty() && regionsAbsEtaLowerBounds_.size() != regionsQualityFlags_.size()) { + throw cms::Exception("Configuration") + << "\'regionsMaxRelIsolationPt\' has " << regionsQualityFlags_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; } } From 7e19b534955c824f7647d22408761a0fb5816ef4 Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Mon, 3 Feb 2025 13:05:37 +0100 Subject: [PATCH 5/5] Fix print for checking regionsQualityFlags regions --- L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h index 72bf27e92d849..dd94fe0dbb909 100644 --- a/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h +++ b/L1Trigger/Phase2L1GT/plugins/L1GTSingleCollectionCut.h @@ -103,7 +103,7 @@ namespace l1t { } if (!regionsQualityFlags_.empty() && regionsAbsEtaLowerBounds_.size() != regionsQualityFlags_.size()) { throw cms::Exception("Configuration") - << "\'regionsMaxRelIsolationPt\' has " << regionsQualityFlags_.size() << " entries, but requires " + << "\'regionsQualityFlags\' has " << regionsQualityFlags_.size() << " entries, but requires " << regionsAbsEtaLowerBounds_.size() << " in " << tag_ << " ."; } }