Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HLT] [CLANG] Fix warnings reported by llvm16 in CLANG IBs #41541

Merged
merged 3 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool HLTPFTauPairLeadTrackDzMatchFilter::hltFilter(edm::Event& ev,
const size_t n_taus = taus.size();

// Combine taus into pairs and check the dz matching
size_t npairs = 0, nfail_dz = 0;
size_t npairs = 0;
if (n_taus > 1)
for (size_t t1 = 0; t1 < n_taus; ++t1) {
if (taus[t1].leadPFChargedHadrCand().isNull() || taus[t1].leadPFChargedHadrCand()->trackRef().isNull() ||
Expand All @@ -88,7 +88,6 @@ bool HLTPFTauPairLeadTrackDzMatchFilter::hltFilter(edm::Event& ev,

// do not form a pair if dz is too large
if (std::abs(dz) > tauLeadTrackMaxDZ_) {
++nfail_dz;
continue;
}

Expand Down
2 changes: 0 additions & 2 deletions RecoTauTag/HLTProducers/src/L2TauJetsMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void L2TauJetsMerger::produce(edm::StreamID iSId, edm::Event& iEvent, const edm:
//and removing the collinear jets
CaloJetCollection myTmpJets;

int iL1Jet = 0;
for (vtoken_cjets::const_iterator s = jetSrc_token.begin(); s != jetSrc_token.end(); ++s) {
edm::Handle<CaloJetCollection> tauJets;
iEvent.getByToken(*s, tauJets);
Expand All @@ -42,7 +41,6 @@ void L2TauJetsMerger::produce(edm::StreamID iSId, edm::Event& iEvent, const edm:
myTmpJets.push_back(myJet);
}
}
iL1Jet++;
}

std::unique_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection);
Expand Down
25 changes: 0 additions & 25 deletions RecoTauTag/HLTProducers/src/L2TauPixelTrackMatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "DataFormats/Math/interface/deltaPhi.h"

// all these debug printouts will need to be removed at some point
//#define DBG_PRINT(arg) (arg)
#define DBG_PRINT(arg)

L2TauPixelTrackMatch::L2TauPixelTrackMatch(const edm::ParameterSet& conf) {
m_jetSrc = consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("JetSrc"));
m_jetMinPt = conf.getParameter<double>("JetMinPt");
Expand All @@ -38,7 +34,6 @@ void L2TauPixelTrackMatch::produce(edm::StreamID, edm::Event& ev, const edm::Eve
ev.getByToken(m_beamSpotTag, bsHandle);
const reco::BeamSpot& bs = *bsHandle;
math::XYZPoint beam_spot(bs.x0(), bs.y0(), bs.z0());
DBG_PRINT(cout << endl << "beamspot " << beam_spot << endl);

// *** Pick up pixel tracks ***

Expand Down Expand Up @@ -73,52 +68,32 @@ void L2TauPixelTrackMatch::produce(edm::StreamID, edm::Event& ev, const edm::Eve
trk.vtx = math::XYZPoint(bs.x(dz), bs.y(dz), dz);
good_tracks.push_back(trk);
}
DBG_PRINT(cout << "got " << good_tracks.size() << " good tracks; " << n_jets << " tau jets" << endl);

// *** Match tau jets to intertesting tracks and assign them new vertices ***

// the new product
std::unique_ptr<CaloJetCollection> new_tau_jets(new CaloJetCollection);
int n_uniq = 0;
if (!good_tracks.empty())
for (size_t i = 0; i < n_jets; ++i) {
reco::CaloJetRef jet = tau_jets[i];
if (jet->pt() < m_jetMinPt || std::abs(jet->eta()) > m_jetMaxEta)
continue;

DBG_PRINT(cout << i << " :" << endl);

size_t n0 = new_tau_jets->size();

for (vector<TinyTrack>::const_iterator itrk = good_tracks.begin(); itrk != good_tracks.end(); ++itrk) {
DBG_PRINT(cout << " trk pt,eta,phi,z: " << itrk->pt << " " << itrk->eta << " " << itrk->phi << " "
<< itrk->vtx.z() << " \t\t ");

math::XYZTLorentzVector new_jet_dir = Jet::physicsP4(itrk->vtx, *jet, itrk->vtx);
float dphi = reco::deltaPhi(new_jet_dir.phi(), itrk->phi);
float deta = new_jet_dir.eta() - itrk->eta;

DBG_PRINT(cout << " jet pt,deta,dphi,dr: " << jet->pt() << " " << deta << " " << dphi << " "
<< sqrt(dphi * dphi + deta * deta) << endl);

if (dphi * dphi + deta * deta > m_deltaR * m_deltaR)
continue;

DBG_PRINT(cout << " jet-trk match!" << endl);

// create a jet copy and assign a new vertex to it
CaloJet new_jet = *jet;
new_jet.setVertex(itrk->vtx);

new_tau_jets->push_back(new_jet);
}
DBG_PRINT(cout << " nmatchedjets " << new_tau_jets->size() - n0 << endl);
if (new_tau_jets->size() - n0 > 0)
n_uniq++;

///if (jet_with_vertices.size()) new_tau_jets->push_back(jet_with_vertices);
}
DBG_PRINT(cout << "n_uniq_matched_jets " << n_uniq << endl << "storing njets " << new_tau_jets->size() << endl);

// store the result
ev.put(std::move(new_tau_jets));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ void TauJetSelectorForHLTTrackSeeding::produce(edm::StreamID iStreamID,
if (ptTrk > ptTrkMaxInCaloCone_)
continue;

int ntrk2 = 0;
double ptTrk2 = 0.;

for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); track++) {
double trackEta = track->eta() - etaJet;
double trackPhi = deltaPhi(track->phi(), phiJet);
double deltaR2 = trackEta * trackEta + trackPhi * trackPhi;
if (deltaR2 < isolationConeSize2) {
ntrk2++;
ptTrk2 += track->pt();
}
}
Expand Down