Skip to content

Commit

Permalink
Merge pull request #11006 from gartung/EgammaAnalysis-ElectronTools-f…
Browse files Browse the repository at this point in the history
…ix-clang-warning

fix clang static analyzer warning using namespace in header
  • Loading branch information
davidlange6 committed Aug 30, 2015
2 parents e39f2f8 + 915b360 commit 6118ec0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 40 deletions.
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

0 comments on commit 6118ec0

Please sign in to comment.