Commit e1163127 authored by Scott Snyder's avatar Scott Snyder Committed by Adam Edward Barton
Browse files

TrackRecord: Fix cppcheck warnings.

TrackRecord: Fix cppcheck warnings.

Pass strings by const reference, not by value.
parent 5086eb90
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TrackRecord_H
......@@ -14,7 +14,7 @@ public:
/** @brief Default destructor */
virtual ~TrackRecord() {}
/** @brief Constructor */
TrackRecord(int pdg, double e, const CLHEP::Hep3Vector& p, const CLHEP::Hep3Vector& x, double t, int bc, std::string vn)
TrackRecord(int pdg, double e, const CLHEP::Hep3Vector& p, const CLHEP::Hep3Vector& x, double t, int bc, const std::string& vn)
: m_PDG_code(pdg), m_Energy(e), m_Momentum(p), m_Position(x), m_Time(t), m_barCode(bc), m_volName(vn) {}
/** @brief Constructor */
TrackRecord(const TrackRecord& trc):m_PDG_code(trc.m_PDG_code), m_Energy(trc.m_Energy),
......@@ -59,7 +59,7 @@ public:
/** @brief bar code */
int GetBarCode() const {return m_barCode;}
/** @brief Set Volume name */
void SetVolName(std::string theName){m_volName=theName;}
void SetVolName(const std::string& theName){m_volName=theName;}
/** @brief Volume name */
std::string GetVolName() const {return m_volName;}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment