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

[LLVM10] PhysicsTools fix clang warnings #29581

Merged
merged 2 commits into from
May 5, 2020
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
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void LeptonInJetProducer<T>::produce(edm::StreamID streamID, edm::Event &iEvent,
std::vector<fastjet::PseudoJet> lClusterParticles;
float lepPt(-1), lepEta(-1), lepPhi(-1);
int lepId(-1);
for (auto const d : itJet.daughterPtrVector()) {
for (auto const &d : itJet.daughterPtrVector()) {
fastjet::PseudoJet p(d->px(), d->py(), d->pz(), d->energy());
lClusterParticles.emplace_back(p);
}
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/plugins/LeptonJetVarProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ std::tuple<float, float, float> LeptonJetVarProducer<T>::calculatePtRatioRel(edm
auto ptrel = lepp4.Vect().Cross((jetp4 - lepp4).Vect().Unit()).R();

unsigned int jndau = 0;
for (const auto _d : jet->daughterPtrVector()) {
for (const auto& _d : jet->daughterPtrVector()) {
const auto d = dynamic_cast<const pat::PackedCandidate*>(_d.get());
if (d->charge() == 0)
continue;
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/ONNXRuntime/test/testONNXRuntime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(testONNXRuntime);
void testONNXRuntime::checkAll() {
std::string model_path = edm::FileInPath("PhysicsTools/ONNXRuntime/test/data/model.onnx").fullPath();
ONNXRuntime rt(model_path);
for (const unsigned &batch_size : {1, 2, 4}) {
for (const unsigned batch_size : {1, 2, 4}) {
FloatArrays input_values{
std::vector<float>(batch_size * 2, 1),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ void ShiftedPFCandidateProducerForPFNoPUMEt::produce(edm::Event& evt, const edm:
originalPFCandidate != originalPFCandidates->end();
++originalPFCandidate) {
const reco::PFJet* jet_matched = nullptr;
for (std::vector<const reco::PFJet*>::iterator jet = selectedJets.begin(); jet != selectedJets.end(); ++jet) {
for (std::vector<reco::PFCandidatePtr>::const_iterator jetConstituent = (*jet)->getPFConstituents().begin();
jetConstituent != (*jet)->getPFConstituents().end() && jet_matched == nullptr;
++jetConstituent) {
if (deltaR2(originalPFCandidate->p4(), (*jetConstituent)->p4()) < dR2Match)
jet_matched = (*jet);
for (auto jet : selectedJets) {
for (auto jetc : jet->getPFConstituents()) {
if (deltaR2(originalPFCandidate->p4(), jetc->p4()) < dR2Match) {
jet_matched = jet;
break;
}
}
if (jet_matched)
break;
}

double shift = 0.;
Expand Down