From 0e463f64766cb9b48a578c7d87cdc4e1eb7299d2 Mon Sep 17 00:00:00 2001 From: Braden Date: Wed, 8 Mar 2023 18:34:24 +0100 Subject: [PATCH 1/2] extended existing HLT tau-jet correlation module --- .../src/HLTPFDiJetCorrCheckerWithDiTau.cc | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc b/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc index aedc65b200937..8c1b682207ec1 100644 --- a/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc +++ b/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc @@ -1,11 +1,14 @@ /** Description: Check correlation between PFJet pairs and filtered PFTau pairs and store the PFJet pairs. For (j1, j2, t1, t2) where j1, j2 from the PFJet collection and t1, t2 from the filtered PFTau collection, -the module checks if there is no overlap (within dRmin) between j1, j2, t1, t2, i.e. they are 4 different objects. +the module checks if there is no overlap (within dRmin) between j1, j2, t1, t2, i.e. there are 4 different objects. In addition, the module imposes the following cuts: * mjjMin: the min invariant mass cut on (j1, j2) * extraTauPtCut: the leading tau pt cut on (t1, t2) (under the assumption t1, t2 are products of a subleading pt filter with minN = 2) The module stores j1, j2 of any (j1, j2, t1, t2) that satisfies the conditions above. */ +/* Extended for the case of j1, j2, t1 (no t2, i.e. there are only 3 different objects) + */ + // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" @@ -68,22 +71,28 @@ void HLTPFDiJetCorrCheckerWithDiTau::produce(edm::StreamID iSId, edm::Event& iEv std::set indices; - if (pfJets.size() > 1 && taus.size() > 1) { - for (unsigned int iJet1 = 0; iJet1 < pfJets.size(); iJet1++) { - for (unsigned int iJet2 = iJet1 + 1; iJet2 < pfJets.size(); iJet2++) { - bool correctComb = false; - const reco::PFJet& myPFJet1 = pfJets[iJet1]; - const reco::PFJet& myPFJet2 = pfJets[iJet2]; + for (unsigned int iJet1 = 0; iJet1 < pfJets.size(); iJet1++) { + for (unsigned int iJet2 = iJet1 + 1; iJet2 < pfJets.size(); iJet2++) { + bool correctComb = false; + const reco::PFJet& myPFJet1 = pfJets[iJet1]; + const reco::PFJet& myPFJet2 = pfJets[iJet2]; + + if ((myPFJet1.p4() + myPFJet2.p4()).M() < mjjMin_) + continue; - if ((myPFJet1.p4() + myPFJet2.p4()).M() < mjjMin_) + for (unsigned int iTau1 = 0; iTau1 < taus.size(); iTau1++) { + if (reco::deltaR2(taus[iTau1]->p4(), myPFJet1.p4()) < dRmin2_) + continue; + if (reco::deltaR2(taus[iTau1]->p4(), myPFJet2.p4()) < dRmin2_) continue; - for (unsigned int iTau1 = 0; iTau1 < taus.size(); iTau1++) { - if (reco::deltaR2(taus[iTau1]->p4(), myPFJet1.p4()) < dRmin2_) - continue; - if (reco::deltaR2(taus[iTau1]->p4(), myPFJet2.p4()) < dRmin2_) + if (taus.size() == 1) { + if (taus[iTau1]->pt() < extraTauPtCut_) continue; + correctComb = true; + break; + } else { for (unsigned int iTau2 = iTau1 + 1; iTau2 < taus.size(); iTau2++) { if (taus[iTau1]->pt() < extraTauPtCut_ && taus[iTau2]->pt() < extraTauPtCut_) continue; @@ -96,14 +105,14 @@ void HLTPFDiJetCorrCheckerWithDiTau::produce(edm::StreamID iSId, edm::Event& iEv correctComb = true; break; } - if (correctComb) - break; } + if (correctComb) + break; + } - if (correctComb) { - indices.insert(iJet1); - indices.insert(iJet2); - } + if (correctComb) { + indices.insert(iJet1); + indices.insert(iJet2); } } @@ -134,3 +143,5 @@ void HLTPFDiJetCorrCheckerWithDiTau::fillDescriptions(edm::ConfigurationDescript // #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(HLTPFDiJetCorrCheckerWithDiTau); +using HLTDiPFJetPlusTausFilter = HLTPFDiJetCorrCheckerWithDiTau; +DEFINE_FWK_MODULE(HLTDiPFJetPlusTausFilter); From 72744064da7474af1f55b6c6b97088dd9998fff7 Mon Sep 17 00:00:00 2001 From: Braden Date: Thu, 9 Mar 2023 12:45:23 +0100 Subject: [PATCH 2/2] extended existing HLT tau-jet correlation module --- .../HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc b/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc index 8c1b682207ec1..0d30f4a7f24b0 100644 --- a/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc +++ b/RecoTauTag/HLTProducers/src/HLTPFDiJetCorrCheckerWithDiTau.cc @@ -91,7 +91,6 @@ void HLTPFDiJetCorrCheckerWithDiTau::produce(edm::StreamID iSId, edm::Event& iEv continue; correctComb = true; - break; } else { for (unsigned int iTau2 = iTau1 + 1; iTau2 < taus.size(); iTau2++) { if (taus[iTau1]->pt() < extraTauPtCut_ && taus[iTau2]->pt() < extraTauPtCut_) @@ -143,5 +142,5 @@ void HLTPFDiJetCorrCheckerWithDiTau::fillDescriptions(edm::ConfigurationDescript // #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(HLTPFDiJetCorrCheckerWithDiTau); -using HLTDiPFJetPlusTausFilter = HLTPFDiJetCorrCheckerWithDiTau; -DEFINE_FWK_MODULE(HLTDiPFJetPlusTausFilter); +using HLTDiPFJetPlusTausCandidatePFJetProducer = HLTPFDiJetCorrCheckerWithDiTau; +DEFINE_FWK_MODULE(HLTDiPFJetPlusTausCandidatePFJetProducer);