Skip to content
Snippets Groups Projects
Commit 97d05749 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

LArG4Code: Fix cppcheck warnings.

 - Pass class instances by const reference, not by value.
parent 81511495
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ namespace LArG4 {
m_energy3(0.)
{}
CalibrationHit(LArG4Identifier ident,
CalibrationHit(const LArG4Identifier& ident,
G4double energy0 = 0.,
G4double energy1 = 0.,
G4double energy2 = 0.,
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LARG4SIMPLESD_H
#define LARG4SIMPLESD_H
#ifndef LARG4CODE_LARG4SIMPLESD_H
#define LARG4CODE_LARG4SIMPLESD_H
#include "G4VSensitiveDetector.hh"
......@@ -69,7 +69,7 @@ public:
G4bool ProcessHits(G4Step* a_step, G4TouchableHistory*) override;
/// First method translates to this - also for fast sims
G4bool SimpleHit( LArG4Identifier lar_id , G4double time , G4double energy );
G4bool SimpleHit( const LArG4Identifier& lar_id , G4double time , G4double energy );
/// End of athena event processing
void EndOfAthenaEvent( LArHitContainer* hitContnainer );
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LARG4CODE_SDWRAPPER_H
......@@ -58,7 +58,7 @@ namespace LArG4
using SDList_t = std::vector< std::unique_ptr<SDType> >;
/// Construct the wrapper from the output collection name
SDWrapper(const std::string& name, const std::string& hitCollectionName, std::string deadHitCollectionName="");
SDWrapper(const std::string& name, const std::string& hitCollectionName, const std::string& deadHitCollectionName="");
/// Add an SD to this wrapper
void addSD(std::unique_ptr<SDType> sd);
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "LArG4Code/LArG4SimpleSD.h"
......@@ -136,7 +136,7 @@ G4bool LArG4SimpleSD::ProcessHits(G4Step* a_step,G4TouchableHistory*)
return result;
}
G4bool LArG4SimpleSD::SimpleHit( LArG4Identifier lar_id , G4double time , G4double energy )
G4bool LArG4SimpleSD::SimpleHit( const LArG4Identifier& lar_id , G4double time , G4double energy )
{
// Build the hit from the calculator results.
Identifier id = ConvertID( lar_id );
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "LArG4Code/SDWrapper.h"
......@@ -26,7 +26,7 @@ namespace LArG4
//-------------------------------------------------------------------------
template<class SDType, class HitContainerType>
SDWrapper<SDType, HitContainerType>::
SDWrapper(const std::string& name, const std::string& hitCollectionName, std::string deadHitCollectionName)
SDWrapper(const std::string& name, const std::string& hitCollectionName, const std::string& deadHitCollectionName)
: G4VSensitiveDetector(name),
m_hitCollName(hitCollectionName),
m_hitColl(hitCollectionName),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment