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

Clang-tidy checks for HiggsAnalysis #20810

Merged
merged 2 commits into from Oct 8, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions HiggsAnalysis/HiggsToGammaGamma/src/PhotonFixCMS.cc
Expand Up @@ -50,7 +50,7 @@ bool PhotonFixCMS::initialise(const edm::EventSetup &iSetup, const std::string &
EBDetId eb(id,ip+1);

const CaloCellGeometry *cellGeometry = barrelGeometry->getGeometry(eb);
GlobalPoint crystalPos = cellGeometry->getPosition();
const GlobalPoint& crystalPos = cellGeometry->getPosition();
bc[85*iz+ie][ip][0]=crystalPos.eta();
bc[85*iz+ie][ip][1]=crystalPos.phi();
}
Expand Down Expand Up @@ -103,7 +103,7 @@ if(iz==0) PhotonFix::endcapCrystal(ix,iy,valid[ix][iy]);
val_count+=1;

const CaloCellGeometry *cellGeometry = endcapGeometry->getGeometry(ee);
GlobalPoint crystalPos = cellGeometry->getPosition();
const GlobalPoint& crystalPos = cellGeometry->getPosition();
ec[iz][ix][iy][0]=asinh(crystalPos.x()/fabs(crystalPos.z()));
ec[iz][ix][iy][1]=asinh(crystalPos.y()/fabs(crystalPos.z()));
}
Expand Down
6 changes: 3 additions & 3 deletions HiggsAnalysis/Skimming/interface/HeavyChHiggsToTauNuSkim.h
Expand Up @@ -27,15 +27,15 @@
#include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"

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

class HeavyChHiggsToTauNuSkim : public edm::EDFilter {

public:
explicit HeavyChHiggsToTauNuSkim(const edm::ParameterSet&);
~HeavyChHiggsToTauNuSkim();
~HeavyChHiggsToTauNuSkim() override;

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

private:
double deltaPhi(double phi1, double phi2){
Expand Down
4 changes: 2 additions & 2 deletions HiggsAnalysis/Skimming/interface/HiggsTo2GammaSkim.h
Expand Up @@ -31,10 +31,10 @@ class HiggsTo2GammaSkim : public edm::EDFilter {
explicit HiggsTo2GammaSkim(const edm::ParameterSet&);

// Destructor
~HiggsTo2GammaSkim();
~HiggsTo2GammaSkim() override;

/// Get event properties to send to builder to fill seed collection
virtual bool filter(edm::Event&, const edm::EventSetup& );
bool filter(edm::Event&, const edm::EventSetup& ) override;


private:
Expand Down
6 changes: 3 additions & 3 deletions HiggsAnalysis/Skimming/interface/HiggsToWW2LeptonsSkim.h
Expand Up @@ -29,10 +29,10 @@
class HiggsToWW2LeptonsSkim : public edm::EDFilter {
public:
explicit HiggsToWW2LeptonsSkim(const edm::ParameterSet&);
~HiggsToWW2LeptonsSkim();
virtual void endJob() ;
~HiggsToWW2LeptonsSkim() override;
void endJob() override ;

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

private:
double singleTrackPtMin_;
Expand Down
4 changes: 2 additions & 2 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsPreFilter.h
Expand Up @@ -32,10 +32,10 @@ class HiggsToZZ4LeptonsPreFilter : public edm::EDFilter {
explicit HiggsToZZ4LeptonsPreFilter(const edm::ParameterSet&);

// Destructor
~HiggsToZZ4LeptonsPreFilter();
~HiggsToZZ4LeptonsPreFilter() override;

/// Get event properties to send to builder to fill seed collection
virtual bool filter(edm::Event&, const edm::EventSetup& );
bool filter(edm::Event&, const edm::EventSetup& ) override;


private:
Expand Down
4 changes: 2 additions & 2 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsSkim.h
Expand Up @@ -35,10 +35,10 @@ class HiggsToZZ4LeptonsSkim : public edm::EDFilter {
explicit HiggsToZZ4LeptonsSkim(const edm::ParameterSet&);

// Destructor
~HiggsToZZ4LeptonsSkim();
~HiggsToZZ4LeptonsSkim() override;

/// Get event properties to send to builder to fill seed collection
virtual bool filter(edm::Event&, const edm::EventSetup& );
bool filter(edm::Event&, const edm::EventSetup& ) override;


private:
Expand Down
4 changes: 2 additions & 2 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsSkimEff.h
Expand Up @@ -33,10 +33,10 @@ class HiggsToZZ4LeptonsSkimEff : public edm::EDAnalyzer {
explicit HiggsToZZ4LeptonsSkimEff(const edm::ParameterSet&);

// Destructor
~HiggsToZZ4LeptonsSkimEff();
~HiggsToZZ4LeptonsSkimEff() override;

/// Get event properties to send to builder to fill seed collection
virtual void analyze(const edm::Event&, const edm::EventSetup& );
void analyze(const edm::Event&, const edm::EventSetup& ) override;


private:
Expand Down
2 changes: 1 addition & 1 deletion SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.cc
Expand Up @@ -67,7 +67,7 @@ HSCPDeDxInfoProducer::~HSCPDeDxInfoProducer(){}
// ------------ method called once each job just before starting event loop ------------
void HSCPDeDxInfoProducer::beginRun(edm::Run const& run, const edm::EventSetup& iSetup)
{
if(useCalibration && calibGains.size()==0){
if(useCalibration && calibGains.empty()){
edm::ESHandle<TrackerGeometry> tkGeom;
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom );
m_off = tkGeom->offsetDU(GeomDetEnumerators::PixelBarrel); //index start at the first pixel
Expand Down
6 changes: 3 additions & 3 deletions SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.h
Expand Up @@ -33,11 +33,11 @@
class HSCPDeDxInfoProducer : public edm::stream::EDProducer<> {
public:
explicit HSCPDeDxInfoProducer(const edm::ParameterSet&);
~HSCPDeDxInfoProducer();
~HSCPDeDxInfoProducer() override;

private:
virtual void beginRun(edm::Run const& run, const edm::EventSetup&) override;
virtual void produce(edm::Event&, const edm::EventSetup&) override;
void beginRun(edm::Run const& run, const edm::EventSetup&) override;
void produce(edm::Event&, const edm::EventSetup&) override;

void makeCalibrationMap(const TrackerGeometry& tkGeom);
void processHit(const TrackingRecHit* recHit, float trackMomentum, float& cosine, susybsm::HSCPDeDxInfo& hscpDeDxInfo, LocalPoint HitLocalPos);
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/HSCPHLTFilter.cc
Expand Up @@ -24,12 +24,12 @@ using namespace edm;
class HSCPHLTFilter : public edm::EDFilter {
public:
explicit HSCPHLTFilter(const edm::ParameterSet&);
~HSCPHLTFilter();
~HSCPHLTFilter() override;

private:
virtual void beginJob() override ;
virtual bool filter(edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override ;
void beginJob() override ;
bool filter(edm::Event&, const edm::EventSetup&) override;
void endJob() override ;
bool isDuplicate(unsigned int Run, unsigned int Event);

bool IncreasedTreshold(const trigger::TriggerEvent& trEv, const edm::InputTag& InputPath, double NewThreshold, double etaCut, int NObjectAboveThreshold, bool averageThreshold);
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/HSCPTreeBuilder.cc
Expand Up @@ -117,13 +117,13 @@ using namespace __gnu_cxx;
class HSCPTreeBuilder : public edm::EDFilter {
public:
explicit HSCPTreeBuilder(const edm::ParameterSet&);
~HSCPTreeBuilder();
~HSCPTreeBuilder() override;


private:
virtual void beginJob() override ;
virtual bool filter(edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override ;
void beginJob() override ;
bool filter(edm::Event&, const edm::EventSetup&) override;
void endJob() override ;
int ClosestMuonIndex(reco::TrackRef track, std::vector<reco::MuonRef>);

const edm::EventSetup* iSetup_;
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/HSCPValidator.cc
Expand Up @@ -516,7 +516,7 @@ void HSCPValidator::makeSimDigiPlotsECAL(const edm::Event& iEvent)
// 3) Match to digis
int numMatchedSimHitsEventEB = 0;
int numMatchedDigisEventEB = 0;
const PCaloHitContainer* phitsEB=0;
const PCaloHitContainer* phitsEB=nullptr;
phitsEB = ebSimHits.product();
for(SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack)
{
Expand All @@ -537,7 +537,7 @@ void HSCPValidator::makeSimDigiPlotsECAL(const edm::Event& iEvent)
mySimHitsEB.push_back(*simHitItr);
++simHitItr;
}
if(mySimHitsEB.size()==0)
if(mySimHitsEB.empty())
{
std::cout << "Could not find matching EB PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack" << std::endl;
continue;
Expand Down Expand Up @@ -597,7 +597,7 @@ void HSCPValidator::makeSimDigiPlotsECAL(const edm::Event& iEvent)
// EE next
int numMatchedSimHitsEventEE = 0;
int numMatchedDigisEventEE = 0;
const PCaloHitContainer* phitsEE=0;
const PCaloHitContainer* phitsEE=nullptr;
phitsEE = eeSimHits.product();
for(SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack)
{
Expand All @@ -618,7 +618,7 @@ void HSCPValidator::makeSimDigiPlotsECAL(const edm::Event& iEvent)
mySimHitsEE.push_back(*simHitItr);
++simHitItr;
}
if(mySimHitsEE.size()==0)
if(mySimHitsEE.empty())
{
std::cout << "Could not find matching EE PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack" << std::endl;
continue;
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/HSCPValidator.h
Expand Up @@ -44,13 +44,13 @@
class HSCPValidator : public edm::EDAnalyzer {
public:
explicit HSCPValidator(const edm::ParameterSet&);
~HSCPValidator();
~HSCPValidator() override;


private:
virtual void beginJob() ;
virtual void analyze(const edm::Event&, const edm::EventSetup&);
virtual void endJob() ;
void beginJob() override ;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override ;
std::string intToString(int num);
void makeGenPlots(const edm::Event& iEvent);
void makeSimTrackPlots(const edm::Event& iEvent);
Expand Down
2 changes: 1 addition & 1 deletion SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.cc
Expand Up @@ -166,7 +166,7 @@ HSCParticleProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {
i--;
}
}
bool filterResult = !Filter_ || (Filter_ && hscp->size()>=1);
bool filterResult = !Filter_ || (Filter_ && !hscp->empty());



Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.h
Expand Up @@ -54,12 +54,12 @@
class HSCParticleProducer : public edm::EDFilter {
public:
explicit HSCParticleProducer(const edm::ParameterSet&);
~HSCParticleProducer();
~HSCParticleProducer() override;

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

std::vector<susybsm::HSCParticle> getHSCPSeedCollection(edm::Handle<reco::TrackCollection>& trackCollectionHandle, edm::Handle<reco::MuonCollection>& muonCollectionHandle, edm::Handle<reco::MuonCollection>& MTmuonCollectionHandle);

Expand Down
10 changes: 5 additions & 5 deletions SUSYBSMAnalysis/HSCP/plugins/HSCParticleSelector.cc
Expand Up @@ -16,12 +16,12 @@
class HSCParticleSelector : public edm::EDFilter {
public:
explicit HSCParticleSelector(const edm::ParameterSet&);
~HSCParticleSelector();
~HSCParticleSelector() override;

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

edm::EDGetTokenT<susybsm::HSCParticleCollection> sourceToken_;

Expand Down Expand Up @@ -85,7 +85,7 @@ bool HSCParticleSelector::filter(edm::Event& iEvent, const edm::EventSetup& iSet
}
}

bool filterResult = !Filter_ || (Filter_ && output->size()>=1);
bool filterResult = !Filter_ || (Filter_ && !output->empty());

iEvent.put(std::move(result));

Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/MuonSegmentProducer.cc
Expand Up @@ -48,12 +48,12 @@
class MuonSegmentProducer : public edm::EDProducer {
public:
explicit MuonSegmentProducer(const edm::ParameterSet&);
~MuonSegmentProducer();
~MuonSegmentProducer() override;

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

edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken;
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken;
Expand Down
10 changes: 5 additions & 5 deletions SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc
Expand Up @@ -108,17 +108,17 @@
class SimHitShifter : public edm::EDProducer {
public:
explicit SimHitShifter(const edm::ParameterSet&);
~SimHitShifter();
~SimHitShifter() override;
//edm::ESHandle <RPCGeometry> rpcGeo;
virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
std::map<int,float> shiftinfo;


private:
std::string ShiftFileName;
virtual void beginJob() override;
virtual void produce(edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override ;
void beginJob() override;
void produce(edm::Event&, const edm::EventSetup&) override;
void endJob() override ;

};

Expand Down
10 changes: 5 additions & 5 deletions SUSYBSMAnalysis/HSCP/plugins/Skim_HSCPFilter.cc
Expand Up @@ -51,12 +51,12 @@
class HSCPFilter : public edm::EDFilter {
public:
explicit HSCPFilter(const edm::ParameterSet&);
~HSCPFilter();
~HSCPFilter() override;

private:
virtual void beginJob() override ;
virtual bool filter(edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override ;
void beginJob() override ;
bool filter(edm::Event&, const edm::EventSetup&) override;
void endJob() override ;
bool filterFlag;
#ifdef THIS_IS_AN_EVENT_EXAMPLE
edm::EDGetTokenT<ExampleData> pInToken;
Expand Down Expand Up @@ -141,7 +141,7 @@ HSCPFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)

if(!filterFlag) return true;

if(recoVertex.size()<1) return false;
if(recoVertex.empty()) return false;

using reco::MuonCollection;

Expand Down
Expand Up @@ -57,7 +57,7 @@
class HighPtTrackEcalDetIdProducer : public edm::EDProducer {
public:
explicit HighPtTrackEcalDetIdProducer(const edm::ParameterSet&);
~HighPtTrackEcalDetIdProducer();
~HighPtTrackEcalDetIdProducer() override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
void produce(edm::Event&, const edm::EventSetup&) override;
private:
Expand Down Expand Up @@ -133,9 +133,9 @@ HighPtTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::EventSetup&
++itTrack) {
if(itTrack->pt()>ptcut_){
TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *itTrack, parameters_, TrackDetectorAssociator::InsideOut);
if(info.crossedEcalIds.size()==0) break;
if(info.crossedEcalIds.empty()) break;

if(info.crossedEcalIds.size()>0){
if(!info.crossedEcalIds.empty()){
DetId centerId = info.crossedEcalIds.front();

const CaloSubdetectorTopology* topology = caloTopology_->getSubdetectorTopology(DetId::Ecal,centerId.subdetId());
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/Skim_MonoPhotonSkimmer.cc
Expand Up @@ -42,12 +42,12 @@
class MonoPhotonSkimmer : public edm::EDFilter {
public:
explicit MonoPhotonSkimmer(const edm::ParameterSet&);
~MonoPhotonSkimmer();
~MonoPhotonSkimmer() override;

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

// ----------member data ---------------------------
edm::EDGetTokenT<reco::PhotonCollection> _phoToken;
Expand Down
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/plugins/Skim_ProduceIsolationMap.cc
Expand Up @@ -71,8 +71,8 @@ using namespace edm;
class ProduceIsolationMap : public edm::EDProducer {
public:
explicit ProduceIsolationMap(const edm::ParameterSet&);
~ProduceIsolationMap();
virtual void produce(edm::Event&, const edm::EventSetup&) override;
~ProduceIsolationMap() override;
void produce(edm::Event&, const edm::EventSetup&) override;
private:
edm::EDGetTokenT<reco::TrackCollection> TKToken_;
edm::EDGetTokenT<reco::TrackCollection> inputCollectionToken_;
Expand Down Expand Up @@ -144,8 +144,8 @@ ProduceIsolationMap::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *itTrack, parameters_, TrackDetectorAssociator::InsideOut);


if(info.ecalRecHits.size()>0){IsolationInfoColl[TkIndex].Set_ECAL_Energy(info.coneEnergy(IsolationConeDR_, TrackDetMatchInfo::EcalRecHits));}
if(info.hcalRecHits.size()>0){IsolationInfoColl[TkIndex].Set_HCAL_Energy(info.coneEnergy(IsolationConeDR_, TrackDetMatchInfo::HcalRecHits));}
if(!info.ecalRecHits.empty()){IsolationInfoColl[TkIndex].Set_ECAL_Energy(info.coneEnergy(IsolationConeDR_, TrackDetMatchInfo::EcalRecHits));}
if(!info.hcalRecHits.empty()){IsolationInfoColl[TkIndex].Set_HCAL_Energy(info.coneEnergy(IsolationConeDR_, TrackDetMatchInfo::HcalRecHits));}
// if(info.hcalRecHits.size()>0){IsolationInfoColl[TkIndex].Set_HCAL_Energy(info.hcalConeEnergy());}
// if(info.ecalRecHits.size()>0){IsolationInfoColl[TkIndex].Set_ECAL_Energy(info.ecalConeEnergy());}

Expand Down