Skip to content

Commit

Permalink
Merge pull request #29581 from mrodozov/fix-llvm10-warns-phystools
Browse files Browse the repository at this point in the history
[LLVM10] PhysicsTools fix clang warnings
  • Loading branch information
cmsbuild authored May 5, 2020
2 parents 968b6b1 + d683d55 commit 2f66ee4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
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

0 comments on commit 2f66ee4

Please sign in to comment.