diff --git a/RecoTauTag/HLTProducers/python/applyL2TauTag.py b/RecoTauTag/HLTProducers/python/applyL2TauTag.py index 4ebe47f5bc22c..4a1291ffe8466 100644 --- a/RecoTauTag/HLTProducers/python/applyL2TauTag.py +++ b/RecoTauTag/HLTProducers/python/applyL2TauTag.py @@ -52,7 +52,8 @@ def update(process): nExpected = 2, L1TauSrc = 'hltL1sDoubleTauBigOR', L2Outcomes = 'hltL2TauTagNNProducer:DoubleTau', - DiscrWP = thWp[working_point] + DiscrWP = thWp[working_point], + l1TauPtThreshold = 250, ) # L2 updated Sequence process.hltL2TauTagNNSequence = cms.Sequence(process.HLTDoCaloSequence + process.hltL1sDoubleTauBigOR + process.hltL2TauTagNNProducer) diff --git a/RecoTauTag/HLTProducers/src/L2TauTagFilter.cc b/RecoTauTag/HLTProducers/src/L2TauTagFilter.cc index 9b52a5a8c3b80..7e3e2b0ea9e7d 100644 --- a/RecoTauTag/HLTProducers/src/L2TauTagFilter.cc +++ b/RecoTauTag/HLTProducers/src/L2TauTagFilter.cc @@ -26,7 +26,8 @@ class L2TauTagFilter : public HLTFilter { l1TauSrc_(cfg.getParameter("L1TauSrc")), l1TauSrcToken_(consumes(l1TauSrc_)), l2OutcomesToken_(consumes>(cfg.getParameter("L2Outcomes"))), - discrWP_(cfg.getParameter("DiscrWP")) {} + discrWP_(cfg.getParameter("DiscrWP")), + l1PtTh_(cfg.getParameter("l1TauPtThreshold")) {} static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; makeHLTFilterDescription(desc); @@ -35,6 +36,7 @@ class L2TauTagFilter : public HLTFilter { ->setComment("Which trigger should the L1 Taus collection pass"); desc.add("L2Outcomes", edm::InputTag(""))->setComment("L2 CNN outcomes"); desc.add("DiscrWP", 0.1227)->setComment("value of discriminator threshold"); + desc.add("l1TauPtThreshold", 250)->setComment("value of L1Tau pass-through pt threshold"); descriptions.addWithDefaultLabel(desc); } @@ -55,7 +57,7 @@ class L2TauTagFilter : public HLTFilter { throw cms::Exception("Inconsistent Data", "L2TauTagFilter::hltFilter") << "CNN output size != L1 taus size \n"; } for (size_t l1_idx = 0; l1_idx < l1Taus.size(); l1_idx++) { - if (L2Outcomes[l1_idx] >= discrWP_) { + if (L2Outcomes[l1_idx] >= discrWP_ || l1Taus[l1_idx]->pt() > l1PtTh_) { filterproduct.addObject(nTauPassed, l1Taus[l1_idx]); nTauPassed++; } @@ -70,6 +72,7 @@ class L2TauTagFilter : public HLTFilter { const edm::EDGetTokenT l1TauSrcToken_; const edm::EDGetTokenT> l2OutcomesToken_; const double discrWP_; + const double l1PtTh_; }; //define this as a plug-in diff --git a/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc b/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc index 9b6621a9d4ab7..93c6e10e56ca7 100644 --- a/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc +++ b/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc @@ -255,18 +255,21 @@ void L2TauNNProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti edm::ParameterSetDescription desc; desc.add("debugLevel", 0)->setComment("set debug level for printing out info"); edm::ParameterSetDescription l1TausPset; - l1TausPset.add("L1CollectionName", "")->setComment("Name of collections"); - l1TausPset.add("L1TauTrigger", edm::InputTag("")) + l1TausPset.add("L1CollectionName", "DoubleTau")->setComment("Name of collections"); + l1TausPset.add("L1TauTrigger", edm::InputTag("hltL1sDoubleTauBigOR")) ->setComment("Which trigger should the L1 Taus collection pass"); - desc.addVPSet("L1Taus", l1TausPset); - desc.add("hbheInput", edm::InputTag(""))->setComment("HBHE recHit collection"); - desc.add("hoInput", edm::InputTag(""))->setComment("HO recHit Collection"); - desc.add("ebInput", edm::InputTag(""))->setComment("EB recHit Collection"); - desc.add("eeInput", edm::InputTag(""))->setComment("EE recHit Collection"); + edm::ParameterSet l1TausPSetDefault; + l1TausPSetDefault.addParameter("L1CollectionName", "DoubleTau"); + l1TausPSetDefault.addParameter("L1TauTrigger", edm::InputTag("hltL1sDoubleTauBigOR")); + desc.addVPSet("L1Taus", l1TausPset, {l1TausPSetDefault}); + desc.add("hbheInput", edm::InputTag("hltHbhereco"))->setComment("HBHE recHit collection"); + desc.add("hoInput", edm::InputTag("hltHoreco"))->setComment("HO recHit Collection"); + desc.add("ebInput", edm::InputTag("hltEcalRecHit:EcalRecHitsEB"))->setComment("EB recHit Collection"); + desc.add("eeInput", edm::InputTag("hltEcalRecHit:EcalRecHitsEE"))->setComment("EE recHit Collection"); desc.add("pataVertices", edm::InputTag("hltPixelVerticesSoA")) ->setComment("patatrack vertices collection"); desc.add("pataTracks", edm::InputTag("hltPixelTracksSoA"))->setComment("patatrack collection"); - desc.add("BeamSpot", edm::InputTag(""))->setComment("BeamSpot Collection"); + desc.add("BeamSpot", edm::InputTag("hltOnlineBeamSpot"))->setComment("BeamSpot Collection"); desc.add("maxVtx", 100)->setComment("max output collection size (number of accepted vertices)"); desc.add("fractionSumPt2", 0.3)->setComment("threshold on sumPt2 fraction of the leading vertex"); desc.add("minSumPt2", 0.)->setComment("min sumPt2"); @@ -403,8 +406,8 @@ void L2TauNNProducer::fillL1TauVars(tensorflow::Tensor& cellGridMatrix, const st auto getCell = [&](NNInputs input) -> float& { return getCellImpl(cellGridMatrix, tau_idx, phi_idx, eta_idx, input); }; - getCell(NNInputs::l1Tau_pt) = allTaus[tau_idx]->polarP4().pt(); - getCell(NNInputs::l1Tau_eta) = allTaus[tau_idx]->polarP4().eta(); + getCell(NNInputs::l1Tau_pt) = allTaus[tau_idx]->pt(); + getCell(NNInputs::l1Tau_eta) = allTaus[tau_idx]->eta(); getCell(NNInputs::l1Tau_hwIso) = allTaus[tau_idx]->hwIso(); } } @@ -675,8 +678,8 @@ void L2TauNNProducer::fillPatatracks(tensorflow::Tensor& cellGridMatrix, }; const int nTaus = static_cast(allTaus.size()); for (tau_idx = 0; tau_idx < nTaus; tau_idx++) { - const float tauEta = allTaus[tau_idx]->polarP4().eta(); - const float tauPhi = allTaus[tau_idx]->polarP4().phi(); + const float tauEta = allTaus[tau_idx]->eta(); + const float tauPhi = allTaus[tau_idx]->phi(); auto maxTracks = patatracks_tsoa.stride(); auto const* quality = patatracks_tsoa.qualityData(); @@ -826,7 +829,7 @@ void L2TauNNProducer::produce(edm::Event& event, const edm::EventSetup& eventset for (size_t tau_pos = 0; tau_pos < nTau; ++tau_pos) { const auto tau_idx = TauCollectionMap[inp_idx][tau_pos]; if (debugLevel_ > 0) { - edm::LogInfo("DebugInfo") << event.id().event() << " \t " << (allTaus[tau_idx])->polarP4().pt() << " \t " + edm::LogInfo("DebugInfo") << event.id().event() << " \t " << (allTaus[tau_idx])->pt() << " \t " << tau_score.at(tau_idx) << std::endl; } (*tau_tags)[tau_pos] = tau_score.at(tau_idx); diff --git a/RecoTauTag/RecoTau/plugins/DeepTauId.cc b/RecoTauTag/RecoTau/plugins/DeepTauId.cc index 9e6fc7c103db2..6fa3a45c9a342 100644 --- a/RecoTauTag/RecoTau/plugins/DeepTauId.cc +++ b/RecoTauTag/RecoTau/plugins/DeepTauId.cc @@ -1163,9 +1163,9 @@ class DeepTauId : public deep_tau::DeepTauBase { desc.add("save_inputs", false); desc.add("is_online", false); - desc.add>("VSeWP"); - desc.add>("VSmuWP"); - desc.add>("VSjetWP"); + desc.add>("VSeWP", {"-1."}); + desc.add>("VSmuWP", {"-1."}); + desc.add>("VSjetWP", {"-1."}); desc.addUntracked("basicTauDiscriminators", edm::InputTag("basicTauDiscriminators")); desc.addUntracked("basicTauDiscriminatorsdR03", edm::InputTag("basicTauDiscriminatorsdR03"));