From 5c584d2b091defa692a934e4254660502f4045c6 Mon Sep 17 00:00:00 2001 From: iarspider Date: Wed, 4 Aug 2021 16:37:40 +0200 Subject: [PATCH] [GCC 11] Fix "this pointer is null" in RecoJets/JetProducers Log file: https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/slc7_amd64_gcc11/CMSSW_12_1_X_2021-08-02-1100/RecoJets/JetProducers Error message: ``` In function 'constexpr decltype (t1.eta()) reco::deltaR2(const T1&, const T2&) [with T1 = reco::Jet; T2 = reco::Candidate]', inlined from 'constexpr decltype (t1.eta()) reco::deltaR(const T1&, const T2&) [with T1 = reco::Jet; T2 = reco::Candidate]' at /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/e3e3f354f3bbc00899d20eeb240b2272/opt/cmssw/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_1_X_2021-08-02-1100/src/DataFormats/Math/interface/deltaR.h:31:21, inlined from 'PileupJetIdentifier PileupJetIdAlgo::computeIdVariables(const reco::Jet*, float, const reco::Vertex*, const VertexCollection&, double, bool)' at /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/e3e3f354f3bbc00899d20eeb240b2272/opt/cmssw/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_1_X_2021-08-02-1100/src/RecoJets/JetProducers/src/PileupJetIdAlgo.cc:668:42: /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/e3e3f354f3bbc00899d20eeb240b2272/opt/cmssw/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_1_X_2021-08-02-1100/src/DataFormats/Math/interface/deltaR.h:19:22: error: 'this' pointer is null [-Werror=nonnull] 19 | Float p2 = t2.phi(); | ~~~~~~^~ /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/e3e3f354f3bbc00899d20eeb240b2272/opt/cmssw/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_1_X_2021-08-02-1100/src/DataFormats/Math/interface/deltaR.h:21:22: error: 'this' pointer is null [-Werror=nonnull] 21 | Float e2 = t2.eta(); | ~~~~~~^~ ``` --- RecoJets/JetProducers/src/PileupJetIdAlgo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoJets/JetProducers/src/PileupJetIdAlgo.cc b/RecoJets/JetProducers/src/PileupJetIdAlgo.cc index d2920772711e1..a5994a7b67fb4 100644 --- a/RecoJets/JetProducers/src/PileupJetIdAlgo.cc +++ b/RecoJets/JetProducers/src/PileupJetIdAlgo.cc @@ -664,7 +664,7 @@ PileupJetIdentifier PileupJetIdAlgo::computeIdVariables(const reco::Jet* jet, } internalId_.dRLeadCent_ = reco::deltaR(*jet, *lLead); - if (lSecond == nullptr) { + if (lSecond != nullptr) { internalId_.dRLead2nd_ = reco::deltaR(*jet, *lSecond); } internalId_.dRMean_ /= jetPt;