Skip to content
Snippets Groups Projects
Commit 69b14cdf authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'cppcheck.LArG4Barrel-20201112' into 'master'

LArG4Barrel: Fix cppcheck warnings.

See merge request atlas/athena!38186
parents 519c9f67 2696c7cf
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 46 deletions
......@@ -12,12 +12,12 @@
AccMap* AccMap::s_thePointer=nullptr;
AccMap::AccMap()
: m_directory ("/afs/cern.ch/atlas/offline/data/lar/calo_data"),
m_nmax (14)
{
int i1[10]={0,0,3,2,9,12,10,9,0,2}; // first fold
int i2[10]={2,1,12,12,13,13,13,13,1,4}; // last fold for 10 electronic regions
m_directory="/afs/cern.ch/atlas/offline/data/lar/calo_data";
m_nmax=14;
m_xmin.resize(m_nmax);
m_xmax.resize(m_nmax);
m_ymin.resize(m_nmax);
......@@ -132,7 +132,7 @@ int AccMap::Region(int region, int sampling, int eta) const
return elecregion;
}
void AccMap::SetDirectory(std::string dir)
void AccMap::SetDirectory(const std::string& dir)
{
m_directory=dir;
}
/*
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 AccMap_h
#define AccMap_h
#ifndef LARG4BARREL_ACCMAP_H
#define LARG4BARREL_ACCMAP_H
#include "CurrMap.h"
......@@ -17,7 +17,7 @@ class AccMap {
public:
~AccMap();
static AccMap* GetAccMap();
void SetDirectory(std::string dir);
void SetDirectory(const std::string& dir);
void Reset();
int Region(int region, int sampling, int eta) const;
CurrMap* GetMap(int ifold, int ielecregion) const;
......
......@@ -8,7 +8,7 @@ LArCoudeAbsorbers* LArCoudeAbsorbers::s_instance=nullptr;
PhysicalVolumeAccessor* LArCoudeAbsorbers::s_theCoudes=nullptr;
LArCoudeAbsorbers* LArCoudeAbsorbers::GetInstance(std::string strDetector)
LArCoudeAbsorbers* LArCoudeAbsorbers::GetInstance(const std::string& strDetector)
{
if (s_instance==nullptr) {
s_instance = new LArCoudeAbsorbers(strDetector);
......
/*
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 LARG4BARREL_LArCoudeAbsorbers_H
......@@ -17,7 +17,7 @@ private:
bool m_filled;
static LArCoudeAbsorbers* s_instance;
public:
static LArCoudeAbsorbers* GetInstance(std::string strDetector="") ;
static LArCoudeAbsorbers* GetInstance(const std::string& strDetector="") ;
double XCentCoude(int stackid, int cellid) const;
double YCentCoude(int stackid, int cellid) const;
double PhiRot(int stackid, int cellid) const;
......
......@@ -8,7 +8,7 @@ LArCoudeElectrodes* LArCoudeElectrodes::s_instance=nullptr;
PhysicalVolumeAccessor* LArCoudeElectrodes::s_theCoudes=nullptr;
LArCoudeElectrodes* LArCoudeElectrodes::GetInstance(std::string strDetector)
LArCoudeElectrodes* LArCoudeElectrodes::GetInstance(const std::string& strDetector)
{
if (s_instance==nullptr) {
s_instance = new LArCoudeElectrodes(strDetector);
......
/*
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 LARG4BARREL_LArCoudeElectrodes_H
......@@ -17,7 +17,7 @@ private:
bool m_filled;
static LArCoudeElectrodes* s_instance;
public:
static LArCoudeElectrodes* GetInstance(std::string strDetector="") ;
static LArCoudeElectrodes* GetInstance(const std::string& strDetector="") ;
double XCentCoude(int stackid, int cellid) const;
double YCentCoude(int stackid, int cellid) const;
double PhiRot(int stackid, int cellid) const;
......
......@@ -12,7 +12,7 @@ LArStraightAbsorbers* LArStraightAbsorbers::s_instance=nullptr;
PhysicalVolumeAccessor* LArStraightAbsorbers::s_theAbsorbers=nullptr;
LArStraightAbsorbers* LArStraightAbsorbers::GetInstance(std::string strDetector)
LArStraightAbsorbers* LArStraightAbsorbers::GetInstance(const std::string& strDetector)
{
if (s_instance==nullptr) {
s_instance = new LArStraightAbsorbers(strDetector);
......
/*
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 LARG4BARREL_LArStraightAbsorbers_H
......@@ -20,7 +20,7 @@ private:
static LArStraightAbsorbers* s_instance;
int m_parity;
public:
static LArStraightAbsorbers* GetInstance(std::string strDetector="") ;
static LArStraightAbsorbers* GetInstance(const std::string& strDetector="") ;
double XCentAbs(int stackid, int cellid) const;
double YCentAbs(int stackid, int cellid) const;
double SlantAbs(int stackid, int cellid) const;
......
......@@ -12,7 +12,7 @@ LArStraightElectrodes* LArStraightElectrodes::s_instance=nullptr;
PhysicalVolumeAccessor* LArStraightElectrodes::s_theElectrodes=nullptr;
LArStraightElectrodes* LArStraightElectrodes::GetInstance(std::string strDetector)
LArStraightElectrodes* LArStraightElectrodes::GetInstance(const std::string& strDetector)
{
if (s_instance==nullptr) {
s_instance = new LArStraightElectrodes(strDetector);
......
/*
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 LARG4BARREL_LArStraightElectrodes_H
......@@ -20,7 +20,7 @@ private:
static LArStraightElectrodes* s_instance;
int m_parity;
public:
static LArStraightElectrodes* GetInstance(std::string strDetector="") ;
static LArStraightElectrodes* GetInstance(const std::string& strDetector="") ;
double XCentEle(int stackid, int cellid) const;
double YCentEle(int stackid, int cellid) const;
double SlantEle(int stackid, int cellid) const;
......
......@@ -15,15 +15,15 @@
#include <fstream>
MapEta::MapEta(int isampling)
: m_directory ("/afs/cern.ch/atlas/offline/data/lar/calo_data"),
m_init (0),
m_nx (0),
m_ny (0),
m_resp (0),
m_xt0 (0),
m_xt1 (0),
m_xt2 (0)
{
m_directory="/afs/cern.ch/atlas/offline/data/lar/calo_data";
m_nx=0;
m_ny=0;
m_init=0;
m_resp=0;
m_xt0=0;
m_xt1=0;
m_xt2=0;
Initialize(isampling);
}
......@@ -36,7 +36,7 @@ MapEta::~MapEta()
}
void MapEta::SetDirectory(std::string dir)
void MapEta::SetDirectory(const std::string& dir)
{
m_directory=dir;
}
......
/*
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 LARG4BARREL_MapEta_H
......@@ -23,7 +23,7 @@ private:
public:
~MapEta();
MapEta(int isampling);
void SetDirectory(std::string dir);
void SetDirectory(const std::string& dir);
void Initialize(int isampling);
int Nx() const {return m_nx;}
int Ny() const {return m_ny;}
......
......@@ -7,7 +7,7 @@
#include <string>
#include <assert.h>
G4LogicalVolume* PhysicalVolumeAccessor::GetLV(std::string name)
G4LogicalVolume* PhysicalVolumeAccessor::GetLV(const std::string& name)
{
G4LogicalVolumeStore *lvs=G4LogicalVolumeStore::GetInstance();
for (unsigned int i=0;i<lvs->size();i++)
......@@ -19,13 +19,13 @@ G4LogicalVolume* PhysicalVolumeAccessor::GetLV(std::string name)
return nullptr;
}
PhysicalVolumeAccessor::PhysicalVolumeAccessor(std::string name)
PhysicalVolumeAccessor::PhysicalVolumeAccessor(const std::string& name)
{
m_theLogicalVolume=GetLV(name);
}
PhysicalVolumeAccessor::PhysicalVolumeAccessor(std::string name,
std::string PVname)
PhysicalVolumeAccessor::PhysicalVolumeAccessor(const std::string& name,
const std::string& PVname)
{
m_theLogicalVolume=GetLV(name);
assert (m_theLogicalVolume!=nullptr);
......@@ -50,7 +50,7 @@ const G4VPhysicalVolume* PhysicalVolumeAccessor::GetPhysicalVolume(int icopy) co
}
}
void PhysicalVolumeAccessor::SetPhysicalVolumeList(std::string name)
void PhysicalVolumeAccessor::SetPhysicalVolumeList(const std::string& name)
{
// assert (m_thePhysicalVolumes.size()==0);
for (int i=0;i<m_theLogicalVolume->GetNoDaughters();i++)
......
/*
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 PhysicalVolumeAccessor_H
......@@ -17,14 +17,14 @@ typedef std::map<int,G4VPhysicalVolume *, std::less<int> > PVMap;
class PhysicalVolumeAccessor {
public:
PhysicalVolumeAccessor(std::string);
PhysicalVolumeAccessor(std::string,const std::string);
PhysicalVolumeAccessor(const std::string&);
PhysicalVolumeAccessor(const std::string&,const std::string&);
const G4VPhysicalVolume* GetPhysicalVolume(int) const;
void SetPhysicalVolumeList(std::string);
void SetPhysicalVolumeList(const std::string&);
private:
G4LogicalVolume* m_theLogicalVolume;
PVMap m_thePhysicalVolumes;
G4LogicalVolume *GetLV(std::string);
G4LogicalVolume *GetLV(const std::string&);
};
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "PsMap.h"
......@@ -12,9 +12,8 @@
PsMap* PsMap::s_thePointer=nullptr;
PsMap::PsMap()
: m_directory ("/afs/cern.ch/atlas/offline/data/lar/calo_data")
{
m_directory="/afs/cern.ch/atlas/offline/data/lar/calo_data";
#ifndef LARG4_STAND_ALONE
//std::string larLocation = PathResolver::find_directory("lar","DATAPATH");
std::string larLocation = PathResolver::find_directory("LArG4Barrel","ATLASCALDATA");
......@@ -74,7 +73,7 @@ CurrMap* PsMap::GetMap(int module) const
}
}
void PsMap::SetDirectory(std::string dir)
void PsMap::SetDirectory(const std::string& dir)
{
m_directory=dir;
}
/*
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 LARG4BARREL_PsMap_h
......@@ -17,7 +17,7 @@ class PsMap {
public:
~PsMap();
static PsMap* GetPsMap();
void SetDirectory(std::string dir);
void SetDirectory(const std::string& dir);
void Reset();
CurrMap* GetMap (int module) const;
private:
......
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