Skip to content

Commit

Permalink
fix clang static analyzer warning using namespace in header
Browse files Browse the repository at this point in the history
  • Loading branch information
gartung committed Aug 28, 2015
1 parent 96ab5d7 commit 74b48eb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
15 changes: 6 additions & 9 deletions L1Trigger/L1TCalorimeter/interface/L1GObject.h
Expand Up @@ -2,11 +2,8 @@
#define L1GObject_h

#include <iostream>
using std::iostream;
using std::ostream;

#include <string>
using std::string;

#include "DataFormats/Candidate/interface/LeafCandidate.h"
#include "DataFormats/Math/interface/LorentzVector.h"
Expand All @@ -30,10 +27,10 @@ class L1GObject : public reco::LeafCandidate
L1GObject(unsigned int et, unsigned int eta, unsigned int phi)
: myEt(et), myEta(eta), myPhi(phi), myName("L1GObject") {initialize();}

L1GObject(unsigned int et, unsigned int eta, unsigned int phi, string name)
L1GObject(unsigned int et, unsigned int eta, unsigned int phi, std::string name)
: myEt(et), myEta(eta), myPhi(phi), myName(name) {initialize();}

L1GObject(unsigned int packedObject, string name = "L1GObject") {
L1GObject(unsigned int packedObject, std::string name = "L1GObject") {
myEt = (packedObject & 0xFFFF0000) >> 16;
myEta = (packedObject & 0x0000FF00) >> 8;
myPhi = (packedObject & 0x000000FF);
Expand Down Expand Up @@ -94,7 +91,7 @@ class L1GObject : public reco::LeafCandidate

// Access functions

string name() const {return myName;}
std::string name() const {return myName;}

bool empty() const {return false;}

Expand Down Expand Up @@ -157,7 +154,7 @@ class L1GObject : public reco::LeafCandidate
else return false;
}

friend ostream& operator<<(ostream &os, const L1GObject& t)
friend std::ostream& operator<<(std::ostream &os, const L1GObject& t)
{
os << "L1GObject : Name = " << t.name()
<< "(Et, Eta, Phi) = ("
Expand All @@ -173,7 +170,7 @@ class L1GObject : public reco::LeafCandidate
void setEt(unsigned int et) {myEt = et;}
void setEta(unsigned int eta) {myEta = eta;}
void setPhi(unsigned int phi) {myPhi = phi;}
void setName(string name) {myName = name;}
void setName(std::string name) {myName = name;}
void setLSB(double lsb) {myLSB = lsb;}

void initialize()
Expand Down Expand Up @@ -231,7 +228,7 @@ class L1GObject : public reco::LeafCandidate
unsigned int myEt;
unsigned int myEta;
unsigned int myPhi;
string myName;
std::string myName;

double myLSB;
double etaValues[11];
Expand Down
Expand Up @@ -18,7 +18,8 @@
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
#include "FWCore/Framework/interface/ESHandle.h"

using namespace edm;
using namespace std;
using namespace l1t;

L1TCaloUpgradeToGCTConverter::L1TCaloUpgradeToGCTConverter(const ParameterSet& iConfig):
Expand Down
31 changes: 14 additions & 17 deletions L1Trigger/L1TCalorimeter/plugins/L1TCaloUpgradeToGCTConverter.h
Expand Up @@ -42,35 +42,32 @@

#include <vector>

using namespace std;
using namespace edm;


//
// class declaration
//

class L1TCaloUpgradeToGCTConverter : public EDProducer {
class L1TCaloUpgradeToGCTConverter : public edm::EDProducer {
public:
explicit L1TCaloUpgradeToGCTConverter(const ParameterSet&);
explicit L1TCaloUpgradeToGCTConverter(const edm::ParameterSet&);
~L1TCaloUpgradeToGCTConverter();

static void fillDescriptions(ConfigurationDescriptions& descriptions);
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
virtual void produce(Event&, EventSetup const&) override;
virtual void produce(edm::Event&, edm::EventSetup const&) override;
virtual void beginJob();
virtual void endJob();
virtual void beginRun(Run const&iR, EventSetup const&iE);
virtual void endRun(Run const& iR, EventSetup const& iE);

EDGetToken EGammaToken_;
EDGetToken RlxTauToken_;
EDGetToken IsoTauToken_;
EDGetToken JetToken_;
EDGetToken EtSumToken_;
EDGetToken HfSumsToken_;
EDGetToken HfCountsToken_;
virtual void beginRun(edm::Run const&iR, edm::EventSetup const&iE);
virtual void endRun(edm::Run const& iR, edm::EventSetup const& iE);

edm::EDGetToken EGammaToken_;
edm::EDGetToken RlxTauToken_;
edm::EDGetToken IsoTauToken_;
edm::EDGetToken JetToken_;
edm::EDGetToken EtSumToken_;
edm::EDGetToken HfSumsToken_;
edm::EDGetToken HfCountsToken_;

int bxMin_;
int bxMax_;
Expand Down

0 comments on commit 74b48eb

Please sign in to comment.