From d7ba308038312a58c1b792f67d2e2fc15cac52d4 Mon Sep 17 00:00:00 2001 From: Seb Date: Tue, 22 Jun 2021 10:33:38 +0200 Subject: [PATCH 1/7] Fix in the MPA stub building code --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index 170f6bb5c42fa..14e255b1b19c6 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -210,7 +210,7 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed /// Here tempOutput stores all the stubs from this lower cluster /// Check if there is need to store only one (if only one already, skip this step) - if (ForbidMultipleStubs && tempOutput.size() > 1) { + if (ForbidMultipleStubs && tempOutput.size() > 1+static_cast(isPS)) { /// If so, sort the stubs by bend and keep only the first one (smallest bend) std::sort(tempOutput.begin(), tempOutput.end(), TTStubBuilder::SortStubsBend); From 6438d09d124957e4ebaed527653e9782ba98fef7 Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Tue, 22 Jun 2021 11:06:03 +0200 Subject: [PATCH 2/7] Update TTStubBuilder.cc --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index 14e255b1b19c6..6dea8822489c5 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -210,7 +210,7 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed /// Here tempOutput stores all the stubs from this lower cluster /// Check if there is need to store only one (if only one already, skip this step) - if (ForbidMultipleStubs && tempOutput.size() > 1+static_cast(isPS)) { + if (ForbidMultipleStubs && tempOutput.size() > 1 + static_cast(isPS)) { /// If so, sort the stubs by bend and keep only the first one (smallest bend) std::sort(tempOutput.begin(), tempOutput.end(), TTStubBuilder::SortStubsBend); From f4ff047290e393e5d23b23c9cc538082b66af11a Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Wed, 23 Jun 2021 13:13:49 +0200 Subject: [PATCH 3/7] Update TTStubBuilder.cc Added some comments and correct a minor bug (impact on total stub PS rates negligible (test made)) --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index 6dea8822489c5..0a25071f1aa69 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -209,16 +209,16 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed } /// End of loop over upper clusters /// Here tempOutput stores all the stubs from this lower cluster - /// Check if there is need to store only one (if only one already, skip this step) + /// Check if there is need to store only one or two (2S/PS modules cases) (if only one already, skip this step) if (ForbidMultipleStubs && tempOutput.size() > 1 + static_cast(isPS)) { - /// If so, sort the stubs by bend and keep only the first one (smallest bend) + /// If so, sort the stubs by bend and keep only the first one (2S case) or the first pair (PS case) (smallest |bend|) std::sort(tempOutput.begin(), tempOutput.end(), TTStubBuilder::SortStubsBend); /// Get to the second element (the switch above ensures there are min 2) typename std::vector>::iterator tempIter = tempOutput.begin(); ++tempIter; - - /// tempIter points now to the second element + if (isPS) ++tempIter; // PS module case + /// tempIter points now to the second or third element (2S/PS) /// Delete all-but-the first one from tempOutput tempOutput.erase(tempIter, tempOutput.end()); From 76e763bf4ab8cc3cfbe83076df26245dd46caf8a Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Wed, 23 Jun 2021 13:46:10 +0200 Subject: [PATCH 4/7] Update TTStubBuilder.cc --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index 0a25071f1aa69..468d45ac2ff05 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -217,7 +217,8 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed /// Get to the second element (the switch above ensures there are min 2) typename std::vector>::iterator tempIter = tempOutput.begin(); ++tempIter; - if (isPS) ++tempIter; // PS module case + if (isPS) + ++tempIter; // PS module case /// tempIter points now to the second or third element (2S/PS) /// Delete all-but-the first one from tempOutput From bcba42cbd35ac9e0a68b428d314735df429e5d63 Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Wed, 23 Jun 2021 14:00:20 +0200 Subject: [PATCH 5/7] Update TTStubBuilder.cc --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index 468d45ac2ff05..aef6985e31fcb 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -218,7 +218,7 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed typename std::vector>::iterator tempIter = tempOutput.begin(); ++tempIter; if (isPS) - ++tempIter; // PS module case + ++tempIter; // PS module case /// tempIter points now to the second or third element (2S/PS) /// Delete all-but-the first one from tempOutput From 0bd0c869a48b110414c0dd7c72b7b8df151550df Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Wed, 23 Jun 2021 14:15:30 +0200 Subject: [PATCH 6/7] Update TTStubBuilder.cc --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index aef6985e31fcb..be055d637b822 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -218,7 +218,7 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed typename std::vector>::iterator tempIter = tempOutput.begin(); ++tempIter; if (isPS) - ++tempIter; // PS module case + ++tempIter; // PS module case /// tempIter points now to the second or third element (2S/PS) /// Delete all-but-the first one from tempOutput From 5d05e8c193dc5492d1591414b533122c0ee00b76 Mon Sep 17 00:00:00 2001 From: Seb Viret Date: Wed, 23 Jun 2021 14:22:10 +0200 Subject: [PATCH 7/7] Update TTStubBuilder.cc --- L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc index be055d637b822..a44619a15b5f1 100644 --- a/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc +++ b/L1Trigger/TrackTrigger/plugins/TTStubBuilder.cc @@ -217,7 +217,7 @@ void TTStubBuilder::produce(edm::Event& iEvent, const ed /// Get to the second element (the switch above ensures there are min 2) typename std::vector>::iterator tempIter = tempOutput.begin(); ++tempIter; - if (isPS) + if (isPS) ++tempIter; // PS module case /// tempIter points now to the second or third element (2S/PS)