Skip to content

Commit

Permalink
code corrections by clang
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-wolf committed Mar 13, 2018
1 parent 8bba3d3 commit d0c7a05
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion PhysicsTools/PatAlgos/plugins/PATTauProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<PFTauTIPAssociationByRef> tauLifetimeInfos;
iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("outputSelection");
if ( selection != "" ) {
if ( !selection.empty() ) {
outputSelector_.reset(new StringCutObjectSelector<reco::PFRecoTauChargedHadron>(selection));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/RecoPatTauJetRegionProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void RecoTauPatJetRegionProducer::produce(edm::Event& evt, const edm::EventSetup
// (needed for recinstruction of boosted taus)
edm::Handle<JetToPackedCandidateAssociation> jetToPFCandMap;
std::vector<std::unordered_set<unsigned> > fastJetToPFCandMap;
if ( pfCandAssocMapSrc_.label() != "" ) {
if ( !pfCandAssocMapSrc_.label().empty() ) {
evt.getByToken(pfCandAssocMap_token, jetToPFCandMap);
fastJetToPFCandMap.resize(nJets);
for ( size_t ijet = 0; ijet < nJets; ++ijet ) {
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/RecoTauCleaner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ RecoTauCleanerImpl<Prod>::RecoTauCleanerImpl(const edm::ParameterSet& pset)
// Check if we want to apply a final output selection
if ( pset.exists("outputSelection") ) {
std::string selection = pset.getParameter<std::string>("outputSelection");
if ( selection != "" ) {
if ( !selection.empty() ) {
outputSelector_.reset(new StringCutObjectSelector<reco::PFTau>(selection));
}
}
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/RecoTauJetRegionProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void RecoTauJetRegionProducer::produce(edm::Event& evt, const edm::EventSetup& e
// (needed for recinstruction of boosted taus)
edm::Handle<JetToPFCandidateAssociation> jetToPFCandMap;
std::vector<std::unordered_set<unsigned> > fastJetToPFCandMap;
if ( pfCandAssocMapSrc_.label() != "" ) {
if ( !pfCandAssocMapSrc_.label().empty() ) {
evt.getByToken(pfCandAssocMap_token, jetToPFCandMap);
fastJetToPFCandMap.resize(nJets);
for ( size_t ijet = 0; ijet < nJets; ++ijet ) {
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/RecoTauPiZeroProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("outputSelection");
if (selection != "") {
if (!selection.empty()) {
outputSelector_.reset(
new StringCutObjectSelector<reco::RecoTauPiZero>(selection));
}
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/RecoTauProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("outputSelection");
if ( selection != "" ) {
if ( !selection.empty() ) {
outputSelector_.reset(new StringCutObjectSelector<reco::PFTau>(selection));
}
}
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ RecoTauVertexAssociator::RecoTauVertexAssociator(const edm::ParameterSet& pset,
}
if ( pset.exists("vertexSelection") ) {
std::string vertexSelection = pset.getParameter<std::string>("vertexSelection");
if ( vertexSelection != "" ) {
if ( !vertexSelection.empty() ) {
vertexSelector_ = new StringCutObjectSelector<reco::Vertex>(vertexSelection);
}
}
Expand Down

0 comments on commit d0c7a05

Please sign in to comment.