Skip to content

Commit

Permalink
clang check RecoMET
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlange6 committed Oct 9, 2017
1 parent a37ee8e commit affc3af
Show file tree
Hide file tree
Showing 67 changed files with 173 additions and 173 deletions.
2 changes: 1 addition & 1 deletion RecoMET/METAlgorithms/interface/MuonMETInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct MuonMETInfo {
MuonMETInfo():
ecalE(0), hcalE(0), hoE(0),
ecalPos(0,0,0),hcalPos(0,0,0), hoPos(0,0,0),
useAverage(0), useTkAssociatorPositions(0),useHO(0){ }
useAverage(false), useTkAssociatorPositions(false),useHO(false){ }

};

Expand Down
2 changes: 1 addition & 1 deletion RecoMET/METAlgorithms/interface/SignAlgoResolutions.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace metsig {
double eval(const resolutionType & type, const resolutionFunc & func, const double & et, const double & phi, const double & eta) const; // for example getvalue(caloHF,ET,et,phi,eta,p);
metsig::SigInputObj evalPF(const reco::PFCandidate* candidate) const;
metsig::SigInputObj evalPFJet(const reco::PFJet *jet) const;
bool isFilled() const {return functionmap_.size()>0;}
bool isFilled() const {return !functionmap_.empty();}

private:
double getfunc(const resolutionType & type,const resolutionFunc & func, std::vector<double> & x) const;
Expand Down
8 changes: 4 additions & 4 deletions RecoMET/METAlgorithms/src/EcalHaloAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EcalHaloAlgo::EcalHaloAlgo()
SumEnergyThreshold = 0.;
NHitsThreshold =0;

geo = 0;
geo = nullptr;
}

EcalHaloData EcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, edm::Handle<reco::PhotonCollection>& ThePhotons, edm::Handle<reco::SuperClusterCollection>& TheSuperClusters, edm::Handle<EBRecHitCollection>& TheEBRecHits, edm::Handle<EERecHitCollection>& TheEERecHits, edm::Handle<ESRecHitCollection>& TheESRecHits, edm::Handle<HBHERecHitCollection>& TheHBHERecHits, const edm::EventSetup& TheSetup)
Expand Down Expand Up @@ -60,8 +60,8 @@ EcalHaloData EcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, edm::H

// Get Det Id of the rechit
DetId id = DetId(hit->id());
const CaloSubdetectorGeometry* TheSubGeometry = 0;
const CaloCellGeometry* cell = 0 ;
const CaloSubdetectorGeometry* TheSubGeometry = nullptr;
const CaloCellGeometry* cell = nullptr ;

// Get EB geometry
TheSubGeometry = TheCaloGeometry.getSubdetectorGeometry(DetId::Ecal, 1);
Expand Down Expand Up @@ -194,7 +194,7 @@ EcalHaloData EcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, edm::H



geo = 0;
geo = nullptr;
edm::ESHandle<CaloGeometry> pGeo;
TheSetup.get<CaloGeometryRecord>().get(pGeo);
geo = pGeo.product();
Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METAlgorithms/src/MuonMETAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//

//____________________________________________________________________________||
#include <math.h>
#include <cmath>
#include <vector>
#include "RecoMET/METAlgorithms/interface/MuonMETAlgo.h"
#include "DataFormats/METReco/interface/CaloMET.h"
Expand Down Expand Up @@ -72,7 +72,7 @@ template <class T> void MuonMETAlgo::MuonMETAlgo_run(const edm::View<reco::Muon>
float deltay = muCorrData.corrY();

const reco::Muon *mu = &inputMuons[i];
LorentzVector mup4 = mu->p4();
const LorentzVector& mup4 = mu->p4();

sumMuPx += mup4.px();
sumMuPy += mup4.py();
Expand Down
2 changes: 1 addition & 1 deletion RecoMET/METAlgorithms/src/PFSpecificAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//____________________________________________________________________________||
SpecificPFMETData PFSpecificAlgo::run(const edm::View<reco::Candidate>& pfCands)
{
if(!pfCands.size()) return SpecificPFMETData();
if(pfCands.empty()) return SpecificPFMETData();

double NeutralEMEt = 0.0;
double NeutralHadEt = 0.0;
Expand Down
14 changes: 7 additions & 7 deletions RecoMET/METAlgorithms/src/SignAlgoResolutions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"


#include <math.h>
#include <cmath>

#include <cstdlib>
#include <iostream>
Expand All @@ -33,8 +33,8 @@

metsig::SignAlgoResolutions::SignAlgoResolutions(const edm::ParameterSet &iConfig):
functionmap_(),
ptResol_(0),
phiResol_(0)
ptResol_(nullptr),
phiResol_(nullptr)
{
addResolutions(iConfig);
}
Expand Down Expand Up @@ -338,7 +338,7 @@ double metsig::SignAlgoResolutions::EtFunction( const functionPars &x, const fun
{
if(par.size()<3)
return 0.;
if(x.size()<1)
if(x.empty())
return 0.;
double et=x[0];
if(et<=0.)
Expand Down Expand Up @@ -384,7 +384,7 @@ metsig::SignAlgoResolutions::initializeJetResolutions( const edm::ParameterSet &
using namespace std;

// only reinitialize the resolutsion if the pointers are zero
if ( ptResol_ == 0 ) {
if ( ptResol_ == nullptr ) {
string resolutionsAlgo = iConfig.getParameter<std::string>("resolutionsAlgo");
string resolutionsEra = iConfig.getParameter<std::string>("resolutionsEra");

Expand All @@ -398,8 +398,8 @@ metsig::SignAlgoResolutions::initializeJetResolutions( const edm::ParameterSet &
if (stat(path.c_str(),&st)!=0) {
cerr<<"ERROR: tried to set path but failed, abort."<<endl;
}
string era(resolutionsEra);
string alg(resolutionsAlgo);
const string& era(resolutionsEra);
const string& alg(resolutionsAlgo);
string ptFileName = path + "/" + era + "_PtResolution_" +alg+".txt";
string phiFileName = path + "/" + era + "_PhiResolution_"+alg+".txt";

Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METAlgorithms/src/SignCaloSpecificAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SignCaloSpecificAlgo::makeVectorOutOfCaloTowers(edm::Handle<edm::View<reco::Cand
if(!noHF || subdet !=HcalForward)
signInputVec.push_back(temp);

wasused=1;
wasused=true;
hadIsDone = true;
}
else if( !emIsDone && id.det() == DetId::Ecal )
Expand All @@ -133,7 +133,7 @@ SignCaloSpecificAlgo::makeVectorOutOfCaloTowers(edm::Handle<edm::View<reco::Cand
}
metsig::SigInputObj temp(sign_tower_type,sign_tower_et,sign_tower_phi,sign_tower_sigma_et,sign_tower_sigma_phi);
signInputVec.push_back(temp);
wasused=1;
wasused=true;
emIsDone = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion RecoMET/METAlgorithms/src/SignPFSpecificAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

//____________________________________________________________________________||
metsig::SignPFSpecificAlgo::SignPFSpecificAlgo()
: resolutions_(0), algo_()
: resolutions_(nullptr), algo_()
{
clusteredParticlePtrs_.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions RecoMET/METAlgorithms/src/TCMETAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef math::XYZTLorentzVector LorentzVector;

//____________________________________________________________________________||
TCMETAlgo::TCMETAlgo()
: response_function_(0), showerRF_(0)
: response_function_(nullptr), showerRF_(nullptr)
{ }

//____________________________________________________________________________||
Expand Down Expand Up @@ -142,7 +142,7 @@ void TCMETAlgo::configure(const edm::ParameterSet& iConfig, edm::ConsumesCollect


showerRF_ = getResponseFunction_shower();
response_function_ = 0;
response_function_ = nullptr;

int rfType = iConfig.getParameter<int>("rf_type");

Expand Down Expand Up @@ -675,7 +675,7 @@ bool TCMETAlgo::isGoodTrack(const reco::TrackRef track)
if( !( ( track->qualityMask() & cut ) == cut ) ) return false;

bool isGoodAlgo = false;
if( trkAlgos_.size() == 0 ) isGoodAlgo = true;
if( trkAlgos_.empty() ) isGoodAlgo = true;
for( unsigned int i = 0; i < trkAlgos_.size(); i++ )
{
if( track->algo() == trkAlgos_.at(i) ) isGoodAlgo = true;
Expand Down
2 changes: 1 addition & 1 deletion RecoMET/METFilters/interface/EcalBoundaryInfoCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ template<class EcalDetId> class EcalBoundaryInfoCalculator {
edm::LogWarning("EcalBoundaryInfoCalculator") << "ERROR - RecHit belongs to wrong sub detector";
}

if (stati.size() > 0)
if (!stati.empty())
return true;
return false;

Expand Down
6 changes: 3 additions & 3 deletions RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
class BadGlobalMuonTagger : public edm::global::EDFilter<> {
public:
explicit BadGlobalMuonTagger(const edm::ParameterSet & iConfig);
virtual ~BadGlobalMuonTagger() {}
~BadGlobalMuonTagger() override {}

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

private:
edm::EDGetTokenT<edm::View<reco::Muon>> muons_;
Expand Down Expand Up @@ -68,7 +68,7 @@ BadGlobalMuonTagger::filter(edm::StreamID iID, edm::Event & iEvent, const edm::E
std::vector<int> goodMuon;

iEvent.getByToken(vtx_, vtx);
assert(vtx->size() >= 1);
assert(!vtx->empty());
const auto &PV = vtx->front().position();

std::unique_ptr<edm::PtrVector<reco::Muon>> out(new edm::PtrVector<reco::Muon>());
Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/BadParticleFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
class BadParticleFilter : public edm::global::EDFilter<> {
public:
explicit BadParticleFilter(const edm::ParameterSet&);
~BadParticleFilter();
~BadParticleFilter() override;

private:
virtual bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override;
bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override;

// ----------member data ---------------------------

Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/CSCTightHalo2015Filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class CSCTightHalo2015Filter : public edm::global::EDFilter<> {
public:

explicit CSCTightHalo2015Filter(const edm::ParameterSet & iConfig);
~CSCTightHalo2015Filter() {}
~CSCTightHalo2015Filter() override {}

private:

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/CSCTightHaloFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class CSCTightHaloFilter : public edm::global::EDFilter<> {
public:

explicit CSCTightHaloFilter(const edm::ParameterSet & iConfig);
~CSCTightHaloFilter() {}
~CSCTightHaloFilter() override {}

private:

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/CSCTightHaloTrkMuUnvetoFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class CSCTightHaloTrkMuUnvetoFilter : public edm::global::EDFilter<> {
public:

explicit CSCTightHaloTrkMuUnvetoFilter(const edm::ParameterSet & iConfig);
~CSCTightHaloTrkMuUnvetoFilter() {}
~CSCTightHaloTrkMuUnvetoFilter() override {}

private:

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
class ChargedHadronTrackResolutionFilter : public edm::global::EDFilter<> {
public:
explicit ChargedHadronTrackResolutionFilter(const edm::ParameterSet&);
~ChargedHadronTrackResolutionFilter();
~ChargedHadronTrackResolutionFilter() override;

private:
virtual bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override;
bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override;

// ----------member data ---------------------------

Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/EEBadScFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class EEBadScFilter : public edm::global::EDFilter<> {
public:

explicit EEBadScFilter(const edm::ParameterSet & iConfig);
~EEBadScFilter() {}
~EEBadScFilter() override {}

private:

// main filter function

virtual bool filter(edm::StreamID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
bool filter(edm::StreamID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

// function to calculate 5x5 energy and check rechit flags

Expand Down
4 changes: 2 additions & 2 deletions RecoMET/METFilters/plugins/EENoiseFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class EENoiseFilter : public edm::EDFilter {
public:

explicit EENoiseFilter(const edm::ParameterSet & iConfig);
~EENoiseFilter() {}
~EENoiseFilter() override {}

private:

virtual bool filter(edm::Event & iEvent, const edm::EventSetup & iSetup) override;
bool filter(edm::Event & iEvent, const edm::EventSetup & iSetup) override;

edm::EDGetTokenT<EcalRecHitCollection> ebRHSrcToken_;
edm::EDGetTokenT<EcalRecHitCollection> eeRHSrcToken_;
Expand Down
20 changes: 10 additions & 10 deletions RecoMET/METFilters/plugins/EcalDeadCellBoundaryEnergyFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
class EcalDeadCellBoundaryEnergyFilter: public edm::global::EDFilter<> {
public:
explicit EcalDeadCellBoundaryEnergyFilter(const edm::ParameterSet&);
~EcalDeadCellBoundaryEnergyFilter();
~EcalDeadCellBoundaryEnergyFilter() override;

private:
virtual void beginJob() override;
virtual bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
virtual void endJob() override;
void beginJob() override;
bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
void endJob() override;

// ----------member data ---------------------------
const int kMAX;
Expand Down Expand Up @@ -225,7 +225,7 @@ bool EcalDeadCellBoundaryEnergyFilter::filter(edm::StreamID, edm::Event& iEvent,
}

// RecHit is at EB boundary and should be processed
if (!detIdAlreadyChecked && deadNeighbourStati.size() == 0 && ebBoundaryCalc.checkRecHitHasInvalidNeighbour(
if (!detIdAlreadyChecked && deadNeighbourStati.empty() && ebBoundaryCalc.checkRecHitHasInvalidNeighbour(
*hit, ecalStatus)) {

BoundaryInformation gapinfo = ebBoundaryCalc.gapRecHits(
Expand All @@ -249,8 +249,8 @@ bool EcalDeadCellBoundaryEnergyFilter::filter(edm::StreamID, edm::Event& iEvent,
}

// RecHit is member of boundary and should be processed
if (!detIdAlreadyChecked && (passChannelLimitation || (limitDeadCellToChannelStatusEB_.size() == 0
&& deadNeighbourStati.size() > 0))) {
if (!detIdAlreadyChecked && (passChannelLimitation || (limitDeadCellToChannelStatusEB_.empty()
&& !deadNeighbourStati.empty()))) {

BoundaryInformation boundinfo = ebBoundaryCalc.boundaryRecHits(
(const edm::Handle<EcalRecHitCollection>&) EBRecHits, (const EcalRecHit *) &(*hit), theCaloTopology,
Expand Down Expand Up @@ -319,7 +319,7 @@ bool EcalDeadCellBoundaryEnergyFilter::filter(edm::StreamID, edm::Event& iEvent,
const CaloCellGeometry* cellGeom = subGeom->getGeometry(currDetId);
double eta = cellGeom->getPosition().eta();

if (!detIdAlreadyChecked && deadNeighbourStati.size() == 0 && eeBoundaryCalc.checkRecHitHasInvalidNeighbour(
if (!detIdAlreadyChecked && deadNeighbourStati.empty() && eeBoundaryCalc.checkRecHitHasInvalidNeighbour(
*hit, ecalStatus) && std::abs(eta) < 1.6) {

BoundaryInformation gapinfo = eeBoundaryCalc.gapRecHits(
Expand All @@ -343,8 +343,8 @@ bool EcalDeadCellBoundaryEnergyFilter::filter(edm::StreamID, edm::Event& iEvent,
}

// RecHit is member of boundary and should be processed
if (!detIdAlreadyChecked && (passChannelLimitation || (limitDeadCellToChannelStatusEE_.size() == 0
&& deadNeighbourStati.size() > 0))) {
if (!detIdAlreadyChecked && (passChannelLimitation || (limitDeadCellToChannelStatusEE_.empty()
&& !deadNeighbourStati.empty()))) {

BoundaryInformation boundinfo = eeBoundaryCalc.boundaryRecHits(
(const edm::Handle<EcalRecHitCollection>&) EERecHits, (const EcalRecHit *) &(*hit), theCaloTopology,
Expand Down
12 changes: 6 additions & 6 deletions RecoMET/METFilters/plugins/EcalDeadCellDeltaRFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
class EcalDeadCellDeltaRFilter : public edm::EDFilter {
public:
explicit EcalDeadCellDeltaRFilter(const edm::ParameterSet&);
~EcalDeadCellDeltaRFilter();
~EcalDeadCellDeltaRFilter() override;

private:
virtual bool filter(edm::Event&, const edm::EventSetup&) override;
virtual void beginJob() override;
virtual void endJob() override;
virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
virtual void endRun(const edm::Run&, const edm::EventSetup&) override;
bool filter(edm::Event&, const edm::EventSetup&) override;
void beginJob() override;
void endJob() override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
void endRun(const edm::Run&, const edm::EventSetup&) override;
virtual void envSet(const edm::EventSetup&);

// ----------member data ---------------------------
Expand Down
Loading

0 comments on commit affc3af

Please sign in to comment.