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

fix clang static analyzer warning using namespace in header #11006

Merged
merged 1 commit into from Aug 30, 2015
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
Expand Up @@ -20,7 +20,6 @@
#include "TMVA/Tools.h"
#include "TMVA/Reader.h"

using namespace std;

#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
Expand All @@ -40,7 +39,6 @@ using namespace std;

#include "DataFormats/PatCandidates/interface/Electron.h"

using namespace reco;

class EGammaMvaEleEstimatorCSA14{
public:
Expand Down
Expand Up @@ -20,7 +20,6 @@
#ifndef STANDALONE
#endif

using namespace std;

class ElectronEffectiveArea{
public:
Expand Down Expand Up @@ -65,6 +64,7 @@ class ElectronEffectiveArea{
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta,
ElectronEffectiveAreaTarget EffectiveAreaTarget = kEleEAData2011) {

using namespace std;
Double_t EffectiveArea = 0;


Expand Down
Expand Up @@ -8,11 +8,6 @@
#include <sstream>
#include <iostream>

using std::string;
using std::vector;
using std::ifstream;
using std::istringstream;
using std::cout;

namespace edm {
class StreamID;
Expand Down Expand Up @@ -77,11 +72,11 @@ class ElectronEnergyCalibrator

private:
void init();
void splitString( const string &fullstr,
vector<string> &elements,
const string &delimiter
void splitString( const std::string &fullstr,
std::vector<std::string> &elements,
const std::string &delimiter
);
double stringToDouble(const string &str);
double stringToDouble(const std::string &str);

double newEnergy_ ;
double newEnergyError_ ;
Expand Down
32 changes: 14 additions & 18 deletions EgammaAnalysis/ElectronTools/interface/PFIsolationEstimator.h
Expand Up @@ -50,10 +50,6 @@
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"

using namespace std;
using namespace edm;
using namespace reco;


class PFIsolationEstimator{
public:
Expand All @@ -75,16 +71,16 @@ class PFIsolationEstimator{


float fGetIsolation(const reco::PFCandidate * pfCandidate,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices );
vector<float > fGetIsolationInRings(const reco::PFCandidate * pfCandidate,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);
std::vector<float > fGetIsolationInRings(const reco::PFCandidate * pfCandidate,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);

float fGetIsolation(const reco::Photon* photon,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices );
vector<float > fGetIsolationInRings(const reco::Photon* photon,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);
std::vector<float > fGetIsolationInRings(const reco::Photon* photon,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);

float fGetIsolation(const reco::GsfElectron* electron,const reco::PFCandidateCollection* pfParticlesColl,const reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices );
vector<float > fGetIsolationInRings(const reco::GsfElectron* electron,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);
std::vector<float > fGetIsolationInRings(const reco::GsfElectron* electron,const reco::PFCandidateCollection* pfParticlesColl,reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices);


VertexRef chargedHadronVertex(edm::Handle< reco::VertexCollection > verticies, const reco::PFCandidate& pfcand );
reco::VertexRef chargedHadronVertex(edm::Handle< reco::VertexCollection > verticies, const reco::PFCandidate& pfcand );

void setConeSize(float fValue = 0.4){ fConeSize = fValue;};

Expand Down Expand Up @@ -138,10 +134,10 @@ class PFIsolationEstimator{
float getIsolationCharged(){ fIsolationCharged = fIsolationInRingsCharged[0]; return fIsolationCharged; };
float getIsolationChargedAll(){ return fIsolationChargedAll; };

vector<float > getIsolationInRingsPhoton(){ return fIsolationInRingsPhoton; };
vector<float > getIsolationInRingsNeutral(){ return fIsolationInRingsNeutral; };
vector<float > getIsolationInRingsCharged(){ return fIsolationInRingsCharged; };
vector<float > getIsolationInRingsChargedAll(){ return fIsolationInRingsChargedAll; };
std::vector<float > getIsolationInRingsPhoton(){ return fIsolationInRingsPhoton; };
std::vector<float > getIsolationInRingsNeutral(){ return fIsolationInRingsNeutral; };
std::vector<float > getIsolationInRingsCharged(){ return fIsolationInRingsCharged; };
std::vector<float > getIsolationInRingsChargedAll(){ return fIsolationInRingsChargedAll; };


void setNumbersOfRings(int iValue = 1){iNumberOfRings = iValue;};
Expand All @@ -165,11 +161,11 @@ class PFIsolationEstimator{
float fIsolationCharged;
float fIsolationChargedAll;

vector<float > fIsolationInRings;
vector<float > fIsolationInRingsPhoton;
vector<float > fIsolationInRingsNeutral;
vector<float > fIsolationInRingsCharged;
vector<float > fIsolationInRingsChargedAll;
std::vector<float > fIsolationInRings;
std::vector<float > fIsolationInRingsPhoton;
std::vector<float > fIsolationInRingsNeutral;
std::vector<float > fIsolationInRingsCharged;
std::vector<float > fIsolationInRingsChargedAll;

Bool_t checkClosestZVertex;
float fConeSize;
Expand Down Expand Up @@ -230,7 +226,7 @@ class PFIsolationEstimator{
float fVy;
float fVz;

SuperClusterRef refSC;
reco::SuperClusterRef refSC;
bool pivotInBarrel;

math::XYZVector vtxWRTCandidate;
Expand Down
20 changes: 10 additions & 10 deletions EgammaAnalysis/ElectronTools/src/EGammaMvaEleEstimatorCSA14.cc
Expand Up @@ -259,7 +259,7 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const reco::GsfElectron& ele,
}

if ( (fMVAType != EGammaMvaEleEstimatorCSA14::kTrig) && (fMVAType != EGammaMvaEleEstimatorCSA14::kNonTrig) && (fMVAType != EGammaMvaEleEstimatorCSA14::kNonTrigPhys14) ) {
std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << endl;
std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << std::endl;
return -9999;
}

Expand Down Expand Up @@ -352,8 +352,8 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const reco::GsfElectron& ele,


if(printDebug) {
cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
cout << " fbrem " << fMVAVar_fbrem
std::cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << std::endl;
std::cout << " fbrem " << fMVAVar_fbrem
<< " kfchi2 " << fMVAVar_kfchi2
<< " mykfhits " << fMVAVar_kfhits
<< " gsfchi2 " << fMVAVar_gsfchi2
Expand All @@ -373,8 +373,8 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const reco::GsfElectron& ele,
<< " d0 " << fMVAVar_d0
<< " ip3d " << fMVAVar_ip3d
<< " eta " << fMVAVar_eta
<< " pt " << fMVAVar_pt << endl;
cout << " ### MVA " << mva << endl;
<< " pt " << fMVAVar_pt << std::endl;
std::cout << " ### MVA " << mva << std::endl;
}


Expand All @@ -393,7 +393,7 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const pat::Electron& ele,
}

if ( (fMVAType != EGammaMvaEleEstimatorCSA14::kTrig) && (fMVAType != EGammaMvaEleEstimatorCSA14::kNonTrig) && (fMVAType != EGammaMvaEleEstimatorCSA14::kNonTrigPhys14) ) {
std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << endl;
std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << std::endl;
return -9999;
}

Expand Down Expand Up @@ -456,8 +456,8 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const pat::Electron& ele,


if(printDebug) {
cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
cout << " fbrem " << fMVAVar_fbrem
std::cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << std::endl;
std::cout << " fbrem " << fMVAVar_fbrem
<< " kfchi2 " << fMVAVar_kfchi2
<< " mykfhits " << fMVAVar_kfhits
<< " gsfchi2 " << fMVAVar_gsfchi2
Expand All @@ -475,8 +475,8 @@ Double_t EGammaMvaEleEstimatorCSA14::mvaValue(const pat::Electron& ele,
<< " IoEmIoP " << fMVAVar_IoEmIoP
<< " eleEoPout " << fMVAVar_eleEoPout
<< " eta " << fMVAVar_eta
<< " pt " << fMVAVar_pt << endl;
cout << " ### MVA " << mva << endl;
<< " pt " << fMVAVar_pt << std::endl;
std::cout << " ### MVA " << mva << std::endl;
}


Expand Down