Skip to content

Commit

Permalink
Try to conform with coding convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Jun 22, 2017
1 parent b46156d commit 8f6332e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions SimDataFormats/CaloTest/interface/ParticleFlux.h
Expand Up @@ -12,7 +12,7 @@ class ParticleFlux {

public:

ParticleFlux(std::string name="", int id=0) : detName(name), detId(id) {}
ParticleFlux(std::string name="", int id=0) : detName_(name), detId_(id) {}
virtual ~ParticleFlux() {}

struct flux {
Expand All @@ -23,20 +23,20 @@ class ParticleFlux {
flux(int id=0, int typ=0, float t=0) : pdgId(id), vxType(typ), tof(t) {}
};

std::string getName() const {return detName;}
int getId() const {return detId;}
unsigned int getComponents() const {return fluxVector.size();}
std::vector<ParticleFlux::flux> getFlux() const {return fluxVector;}
void setName(const std::string nm) {detName = nm;}
void setId(const int id) {detId = id;}
std::string const& getName() const {return detName_;}
int getId() const {return detId_;}
unsigned int getComponents() const {return fluxVector_.size();}
std::vector<ParticleFlux::flux> getFlux() const& {return fluxVector_;}
void setName(const std::string nm) {detName_ = nm;}
void setId(const int id) {detId_ = id;}
void addFlux(const ParticleFlux::flux f);
void clear();

private:

std::string detName;
int detId;
std::vector<flux> fluxVector;
std::string detName_;
int detId_;
std::vector<flux> fluxVector_;

};

Expand Down
4 changes: 2 additions & 2 deletions SimDataFormats/CaloTest/src/ParticleFlux.cc
@@ -1,9 +1,9 @@
#include "SimDataFormats/CaloTest/interface/ParticleFlux.h"

void ParticleFlux::addFlux(ParticleFlux::flux f) {
fluxVector.push_back(f);
fluxVector_.push_back(f);
}

void ParticleFlux::clear() {
fluxVector.clear();
fluxVector_.clear();
}
4 changes: 2 additions & 2 deletions SimDataFormats/CaloTest/src/classes_def.xml
Expand Up @@ -15,8 +15,8 @@
<class name="std::vector<HcalTestHistoClass::Hit>"/>
<class name="std::vector<HcalTestHistoClass::QIE>"/>

<class name="ParticleFlux" ClassVersion="12">
<version ClassVersion="12" checksum="2310794562"/>
<class name="ParticleFlux" ClassVersion="13">
<version ClassVersion="13" checksum="2329907515"/>
</class>
<class name="edm::Wrapper<ParticleFlux>"/>
<class name="ParticleFlux::flux"/>
Expand Down
8 changes: 4 additions & 4 deletions SimG4CMS/Forward/test/SimG4FluxAnalyzer.cc
Expand Up @@ -64,11 +64,11 @@ SimG4FluxAnalyzer::SimG4FluxAnalyzer(const edm::ParameterSet& iConfig) {
lvNames_ = iConfig.getParameter<std::vector<std::string> >("LVNames");
#ifdef EDM_ML_DEBUG
std::cout << "SimG4FluxAnalyzer:: for " << lvNames_.size() << " names:";
for (auto name : lvNames_) std::cout << " " << name;
for (const auto& name : lvNames_) std::cout << " " << name;
std::cout << std::endl;
#endif

for (auto name : lvNames_) {
for (const auto& name : lvNames_) {
std::string tagn = name+"ParticleFlux";
tok_PF_.push_back(consumes<ParticleFlux>(edm::InputTag("g4SimHits",tagn)));
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -117,7 +117,7 @@ void SimG4FluxAnalyzer::analyze(const edm::Event& iEvent,
#ifdef EDM_ML_DEBUG
unsigned int k(0);
#endif
for (auto token : tok_PF_) {
for (const auto& token : tok_PF_) {
edm::Handle<ParticleFlux> pFlux;
iEvent.getByToken(token, pFlux);
if (pFlux.isValid()) {
Expand All @@ -131,7 +131,7 @@ void SimG4FluxAnalyzer::analyze(const edm::Event& iEvent,
++k;
unsigned k1(0);
#endif
for (auto element : flux) {
for (const auto& element : flux) {
detName_.push_back(name); detId_.push_back(id);
pdgId_.push_back(element.pdgId);
vxType_.push_back(element.vxType);
Expand Down

0 comments on commit 8f6332e

Please sign in to comment.