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 cppcheck #1275

Merged
merged 6 commits into from Sep 8, 2021
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
2 changes: 1 addition & 1 deletion offline/packages/KFParticle_sPHENIX/KFParticle_sPHENIX.h
Expand Up @@ -69,7 +69,7 @@ class KFParticle_sPHENIX : public SubsysReco, public KFParticle_nTuple, public K

///Parameters for the user to vary

void setDecayDescriptor(std::string decayDescriptor) { m_decayDescriptor = decayDescriptor; }
void setDecayDescriptor(const std::string &decayDescriptor) { m_decayDescriptor = decayDescriptor; }

static const int max_particles = 99;

Expand Down
2 changes: 1 addition & 1 deletion offline/packages/compressor/compress_clu_res_float32.cc
Expand Up @@ -35,7 +35,7 @@ uint64_t timeSinceEpochMillisec()
return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
}

void compress_clu_res_float32(std::string filename)
void compress_clu_res_float32(std::string &filename)
{
ofstream logFile;
logFile.open ("log.csv");
Expand Down
2 changes: 1 addition & 1 deletion offline/packages/tpccalib/PHTpcResiduals.h
Expand Up @@ -74,7 +74,7 @@ class PHTpcResiduals : public SubsysReco
void setSavehistograms( bool value ) { m_savehistograms = value; }

/// output file name for storing the space charge reconstruction matrices
void setOutputfile(std::string outputfile) {m_outputfile = outputfile;}
void setOutputfile(const std::string &outputfile) {m_outputfile = outputfile;}

private:

Expand Down
2 changes: 1 addition & 1 deletion offline/packages/trackbase/TrkrClusterv1.cc
Expand Up @@ -47,7 +47,7 @@ TrkrClusterv1::TrkrClusterv1()

for (int j = 0; j < 3; ++j)
{
for (int i = j; i < 3; ++i)
for (int i = 0; i < 3; ++i)
{
setSize(i, j, NAN);
setError(i, j, NAN);
Expand Down
2 changes: 1 addition & 1 deletion simulation/g4simulation/g4eval/SvtxClusterEval.cc
Expand Up @@ -940,7 +940,7 @@ void SvtxClusterEval::FillRecoClusterFromG4HitCache(){
std::multimap<PHG4Particle*, TrkrDefs::cluskey>::const_iterator lower_bound = temp_clusters_from_particles.lower_bound(g4particle);
std::multimap<PHG4Particle*, TrkrDefs::cluskey>::const_iterator upper_bound = temp_clusters_from_particles.upper_bound(g4particle);
std::multimap<PHG4Particle*, TrkrDefs::cluskey>::const_iterator cfp_iter;
for(cfp_iter = lower_bound;cfp_iter != upper_bound;cfp_iter++){
for(cfp_iter = lower_bound;cfp_iter != upper_bound;++cfp_iter){
TrkrDefs::cluskey cluster_key = cfp_iter->second;
clusters.insert(cluster_key);
}
Expand Down
2 changes: 1 addition & 1 deletion simulation/g4simulation/g4eval/SvtxTruthEval.cc
Expand Up @@ -255,7 +255,7 @@ void SvtxTruthEval::FillTruthHitsFromParticleCache(){
std::multimap<const int, PHG4Hit*>::const_iterator lower_bound = temp_clusters_from_particles.lower_bound(g4particle->get_track_id());
std::multimap<const int, PHG4Hit*>::const_iterator upper_bound = temp_clusters_from_particles.upper_bound(g4particle->get_track_id());
std::multimap<const int, PHG4Hit*>::const_iterator cfp_iter;
for(cfp_iter = lower_bound;cfp_iter != upper_bound;cfp_iter++){
for(cfp_iter = lower_bound;cfp_iter != upper_bound;++cfp_iter){
PHG4Hit* g4hit = cfp_iter->second;
truth_hits.insert(g4hit);
}
Expand Down
6 changes: 3 additions & 3 deletions simulation/g4simulation/g4tpc/PHG4TpcEndCapDetector.cc
Expand Up @@ -191,11 +191,11 @@ G4AssemblyVolume *PHG4TpcEndCapDetector::ConstructEndCapAssembly()
return assmeblyvol;
}

void PHG4TpcEndCapDetector ::AddLayer( //
void PHG4TpcEndCapDetector::AddLayer( //
G4AssemblyVolume *assmeblyvol,
G4double &z_start,
std::string _name, //! name base for this layer
std::string _material, //! material name in G4
const std::string &_name, //! name base for this layer
const std::string &_material, //! material name in G4
G4double _depth, //! depth in G4 units
double _percentage_filled //! percentage filled//
)
Expand Down
10 changes: 5 additions & 5 deletions simulation/g4simulation/g4tpc/PHG4TpcEndCapDetector.h
@@ -1,7 +1,7 @@
// Tell emacs that this is a C++ source
// -*- C++ -*-.
#ifndef PHG4TPCENDCAPDETECTOR_H
#define PHG4TPCENDCAPDETECTOR_H
#ifndef G4TPC_PHG4TPCENDCAPDETECTOR_H
#define G4TPC_PHG4TPCENDCAPDETECTOR_H

#include <g4main/PHG4Detector.h>
#include <Geant4/G4Types.hh>
Expand Down Expand Up @@ -63,11 +63,11 @@ class PHG4TpcEndCapDetector : public PHG4Detector
AddLayer( //
G4AssemblyVolume *assmeblyvol,
G4double &z_start,
std::string _name, //! name base for this layer
std::string _material, //! material name in G4
const std::string &_name, //! name base for this layer
const std::string &_material, //! material name in G4
G4double _depth, //! depth in G4 units
double _percentage_filled = 100 //! percentage filled//
);
};

#endif // PHG4TPCENDCAPDETECTOR_H
#endif // G4TPC_PHG4TPCENDCAPDETECTOR_H