From d0c7a056748a076af2892bd96e075614888c5dd9 Mon Sep 17 00:00:00 2001 From: Roger Date: Tue, 13 Mar 2018 15:07:56 +0100 Subject: [PATCH] code corrections by clang --- PhysicsTools/PatAlgos/plugins/PATTauProducer.cc | 2 +- RecoTauTag/RecoTau/plugins/PFRecoTauChargedHadronProducer.cc | 2 +- .../RecoTau/plugins/PFRecoTauDiscriminationAgainstMuon2.cc | 4 ++-- RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc | 2 +- RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc | 2 +- RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc | 2 +- RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc | 2 +- RecoTauTag/RecoTau/plugins/RecoTauProducer.cc | 2 +- RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc b/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc index 7628094347860..48bfd546b87c1 100755 --- a/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc @@ -484,7 +484,7 @@ void PATTauProducer::produce(edm::Event & iEvent, const edm::EventSetup & iSetup aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand; aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand; // extraction of tau lifetime information - if( tauTransverseImpactParameterSrc_.label() != "" ) { + if( !tauTransverseImpactParameterSrc_.label().empty() ) { edm::Handle tauLifetimeInfos; iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos); const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef]; diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauChargedHadronProducer.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauChargedHadronProducer.cc index 7c55ed24792b1..826376ad1c67e 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauChargedHadronProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauChargedHadronProducer.cc @@ -126,7 +126,7 @@ PFRecoTauChargedHadronProducer::PFRecoTauChargedHadronProducer(const edm::Parame // check if we want to apply a final output selection if ( cfg.exists("outputSelection") ) { std::string selection = cfg.getParameter("outputSelection"); - if ( selection != "" ) { + if ( !selection.empty() ) { outputSelector_.reset(new StringCutObjectSelector(selection)); } } diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationAgainstMuon2.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationAgainstMuon2.cc index 20ceac68ae576..fac5c70b4bfa7 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationAgainstMuon2.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationAgainstMuon2.cc @@ -96,7 +96,7 @@ class PFRecoTauDiscriminationAgainstMuon2 final : public PFTauDiscriminationProd void PFRecoTauDiscriminationAgainstMuon2::beginEvent(const edm::Event& evt, const edm::EventSetup& es) { - if ( srcMuons_.label() != "" ) { + if ( !srcMuons_.label().empty() ) { evt.getByToken(Muons_token, muons_); } } @@ -187,7 +187,7 @@ double PFRecoTauDiscriminationAgainstMuon2::discriminate(const reco::PFTauRef& p } else throw cms::Exception("Type Mismatch") << "The PFTau was not made from PFCandidates, and PFRecoTauDiscriminationAgainstMuon2 only works with PFTaus made from PFCandidates. Please use PFRecoTauDiscriminationAgainstMuonSimple instead.\n"; } - if ( srcMuons_.label() != "" ) { + if ( !srcMuons_.label().empty() ) { size_t numMuons = muons_->size(); for ( size_t idxMuon = 0; idxMuon < numMuons; ++idxMuon ) { reco::MuonRef muon(muons_, idxMuon); diff --git a/RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc b/RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc index 42c89d5754ed0..30ec20c68cc7c 100644 --- a/RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc +++ b/RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc @@ -112,7 +112,7 @@ void RecoTauPatJetRegionProducer::produce(edm::Event& evt, const edm::EventSetup // (needed for recinstruction of boosted taus) edm::Handle jetToPFCandMap; std::vector > fastJetToPFCandMap; - if ( pfCandAssocMapSrc_.label() != "" ) { + if ( !pfCandAssocMapSrc_.label().empty() ) { evt.getByToken(pfCandAssocMap_token, jetToPFCandMap); fastJetToPFCandMap.resize(nJets); for ( size_t ijet = 0; ijet < nJets; ++ijet ) { diff --git a/RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc b/RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc index 9198d470432f1..7df763fd335f2 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc @@ -95,7 +95,7 @@ RecoTauCleanerImpl::RecoTauCleanerImpl(const edm::ParameterSet& pset) // Check if we want to apply a final output selection if ( pset.exists("outputSelection") ) { std::string selection = pset.getParameter("outputSelection"); - if ( selection != "" ) { + if ( !selection.empty() ) { outputSelector_.reset(new StringCutObjectSelector(selection)); } } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc b/RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc index e57963cf3c376..45b7605794ead 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc @@ -113,7 +113,7 @@ void RecoTauJetRegionProducer::produce(edm::Event& evt, const edm::EventSetup& e // (needed for recinstruction of boosted taus) edm::Handle jetToPFCandMap; std::vector > fastJetToPFCandMap; - if ( pfCandAssocMapSrc_.label() != "" ) { + if ( !pfCandAssocMapSrc_.label().empty() ) { evt.getByToken(pfCandAssocMap_token, jetToPFCandMap); fastJetToPFCandMap.resize(nJets); for ( size_t ijet = 0; ijet < nJets; ++ijet ) { diff --git a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc index f450569191a53..f0de72c6037c4 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc @@ -114,7 +114,7 @@ RecoTauPiZeroProducer::RecoTauPiZeroProducer(const edm::ParameterSet& pset) // Check if we want to apply a final output selection if (pset.exists("outputSelection")) { std::string selection = pset.getParameter("outputSelection"); - if (selection != "") { + if (!selection.empty()) { outputSelector_.reset( new StringCutObjectSelector(selection)); } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauProducer.cc b/RecoTauTag/RecoTau/plugins/RecoTauProducer.cc index 693e6e287cc8c..87f6f8220ef26 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauProducer.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauProducer.cc @@ -118,7 +118,7 @@ RecoTauProducer::RecoTauProducer(const edm::ParameterSet& pset) // Check if we want to apply a final output selection if ( pset.exists("outputSelection") ) { std::string selection = pset.getParameter("outputSelection"); - if ( selection != "" ) { + if ( !selection.empty() ) { outputSelector_.reset(new StringCutObjectSelector(selection)); } } diff --git a/RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc b/RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc index 8177d2d0ea5ed..9a9cb9c804f75 100644 --- a/RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc +++ b/RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc @@ -207,7 +207,7 @@ RecoTauVertexAssociator::RecoTauVertexAssociator(const edm::ParameterSet& pset, } if ( pset.exists("vertexSelection") ) { std::string vertexSelection = pset.getParameter("vertexSelection"); - if ( vertexSelection != "" ) { + if ( !vertexSelection.empty() ) { vertexSelector_ = new StringCutObjectSelector(vertexSelection); } }