diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/BCM_GeoModel/BCM_Wall.h b/InnerDetector/InDetDetDescr/BCM_GeoModel/BCM_GeoModel/BCM_Wall.h index c0321489a790920507f732966691d45c7136465a..c59631bbbc78afffc15f4b7de3ccc2d53c1cf9e6 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/BCM_GeoModel/BCM_Wall.h +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/BCM_GeoModel/BCM_Wall.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -22,7 +22,7 @@ class StoredMaterialManager; class BCM_Wall { public: - GeoPhysVol* Build(double halfX, double halfY, double thick, std::string logname, const GeoMaterial* material); + GeoPhysVol* Build(double halfX, double halfY, double thick, const std::string& logname, const GeoMaterial* material); GeoPhysVol* Build(double halfX, double halfY, double thick_one, double thick_two, const GeoMaterial* material_one, const GeoMaterial* material_two, const StoredMaterialManager* mat_mgr); GeoPhysVol* Build(double halfX, double halfY, double thick_one, double thick_two, double thick_three, const GeoMaterial* material_one, const GeoMaterial* material_two, const GeoMaterial* material_three, const StoredMaterialManager* mat_mgr); }; diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx index 1e6f9c0b2e123ec46513807c425f0fc9af305ff1..b521163ea54a826851c28f8b6761ad0fc7fbe4af 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BCM_GeoModel/BCM_Builder.h" @@ -195,7 +195,7 @@ StatusCode InDetDD::BCM_Builder::build(GeoVPhysVol* pv) { //parameters via jobOptions int moduleNo; - const std::vector<double>* module_property = NULL; + const std::vector<double>* module_property = nullptr; for(moduleNo = 0; moduleNo < 8; moduleNo++) { unsigned int mask = (1 << moduleNo); @@ -248,7 +248,7 @@ StatusCode InDetDD::BCM_Builder::build(GeoVPhysVol* pv) GeoNameTag* tag = new GeoNameTag("BCM Module"); tag->ref(); if (materialManager){ - GeoVPhysVol* bcmModPhys = bcm.Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &msg(MSG::INFO) : NULL)); + GeoVPhysVol* bcmModPhys = bcm.Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &msg(MSG::INFO) : nullptr)); Phys->add(tag); Phys->add(new GeoIdentifierTag(k)); Phys->add(xform); diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_GeometryManager.cxx b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_GeometryManager.cxx index 71f2b2b9567dd5bf4937940742d634da4211aacd..a542b3ce59e96fb57a9abc1779f480752b23852a 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_GeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_GeometryManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BCM_GeoModel/BCM_GeometryManager.h" @@ -15,7 +15,7 @@ BCM_ModuleParameters* BCM_GeometryManager::Module(int module_number) if((mask & m_on) == mask) return &(m_moduli[module_number]); else - return NULL; + return nullptr; } void BCM_GeometryManager::ModuleOn(int module_number) diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Module.cxx b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Module.cxx index 4f87dc1acebb730cfa5eec5f635fd80e629fc469..65eb4743035591f86c9cf25824a7dce6b94a275c 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Module.cxx +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Module.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BCM_GeoModel/BCM_Module.h" @@ -52,7 +52,7 @@ GeoPhysVol* BCM_Module::Build(const StoredMaterialManager* mat_mgr, const BCM_Mo const GeoMaterial* g10 = mat_mgr->getMaterial("std::G10"); //first try the Diamond const GeoMaterial* diamond = mat_mgr->getMaterial("pix::Diamond"); - if(diamond == NULL) + if(diamond == nullptr) { diamond = mat_mgr->getMaterial("std::Carbon"); // if(msg) diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Wall.cxx b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Wall.cxx index 1d54f83aeac178bd884362a1345adef8aa2c977a..9e02d16c4f1ca5befa1257eeba5c59caebe733cb 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Wall.cxx +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Wall.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BCM_GeoModel/BCM_Wall.h" @@ -12,7 +12,7 @@ #include "GeoModelKernel/GeoIdentifierTag.h" #include "GeoModelKernel/GeoTransform.h" -GeoPhysVol* BCM_Wall::Build(double halfX, double halfY, double thick, std::string logname,const GeoMaterial* material) +GeoPhysVol* BCM_Wall::Build(double halfX, double halfY, double thick, const std::string& logname,const GeoMaterial* material) { const GeoBox* bcmWallBox = new GeoBox(halfX, halfY, thick/2); const GeoLogVol* bcmWallLog = new GeoLogVol(logname, bcmWallBox, material); diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/BLM_GeoModel/BLM_Wall.h b/InnerDetector/InDetDetDescr/BLM_GeoModel/BLM_GeoModel/BLM_Wall.h index 6e9cacb179ebad6ecd3fde7ee3043f7e2151f528..92ec50e19d0f2c1501fc1e926d11c428598b5343 100755 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/BLM_GeoModel/BLM_Wall.h +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/BLM_GeoModel/BLM_Wall.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ class BLM_Wall GeoPhysVol* BuildLayerV(double thick, const GeoMaterial* material); GeoPhysVol* BuildHolder(const GeoMaterial* material); GeoPhysVol* BuildScrew(double length, const GeoMaterial* material); - GeoPhysVol* BuildBlock(double X, double Y, double Z, std::string logname, const GeoMaterial* material); + GeoPhysVol* BuildBlock(double X, double Y, double Z, const std::string& logname, const GeoMaterial* material); GeoPhysVol* BuildClamp(const GeoMaterial* material); static constexpr double s_width = 18; diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx index 2b5eb1226bdaedd62d9cf1c578029aa7f2007a6c..21fe7d9cac544fc01b3fa1fe5164a52a96bde9c2 100644 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BLM_GeoModel/BLM_Builder.h" @@ -200,7 +200,7 @@ StatusCode InDetDD::BLM_Builder::build(GeoVPhysVol* pv) ATH_MSG_DEBUG(" --> BLM parameters via jobOptions or default"); //parameters via jobOptions int moduleNo; - const std::vector<double>* module_property = NULL; + const std::vector<double>* module_property = nullptr; for(moduleNo = 0; moduleNo < 12; moduleNo++) { unsigned int mask = (1 << moduleNo); @@ -253,7 +253,7 @@ StatusCode InDetDD::BLM_Builder::build(GeoVPhysVol* pv) GeoNameTag* tag = new GeoNameTag("BLM Module"); tag->ref(); if (materialManager){ - GeoVPhysVol* blmModPhys = blm.Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &msg(MSG::INFO) : NULL)); + GeoVPhysVol* blmModPhys = blm.Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &msg(MSG::INFO) : nullptr)); Phys->add(tag); Phys->add(new GeoIdentifierTag(k)); Phys->add(xform); diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_GeometryManager.cxx b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_GeometryManager.cxx index 99e6f0429367b931ca68c19dc2f1eb7d6a86fa83..999e2dde7728e3e841bf9abef326d61e84115ef7 100755 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_GeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_GeometryManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BLM_GeoModel/BLM_GeometryManager.h" @@ -15,7 +15,7 @@ BLM_ModuleParameters* BLM_GeometryManager::Module(unsigned int module_number) if((mask & m_on) == mask) return &(m_moduli[module_number]); else - return NULL; + return nullptr; } void BLM_GeometryManager::ModuleOn(unsigned int module_number) diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Module.cxx b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Module.cxx index e25113ccb5b9676a58f3f365fea57641cd64e3ce..f7b4c8056e18206275da7c7e7ee6949ba4e7cea9 100755 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Module.cxx +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Module.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BLM_GeoModel/BLM_Module.h" @@ -33,7 +33,7 @@ GeoPhysVol* BLM_Module::Build(const StoredMaterialManager* mat_mgr, const BLM_Mo const GeoMaterial* copper = mat_mgr->getMaterial("std::Copper"); const GeoMaterial* g10 = mat_mgr->getMaterial("std::G10"); const GeoMaterial* diamond = mat_mgr->getMaterial("pix::Diamond"); - if(diamond == NULL) + if(diamond == nullptr) { diamond = mat_mgr->getMaterial("std::Carbon"); // if(msg) @@ -46,7 +46,7 @@ GeoPhysVol* BLM_Module::Build(const StoredMaterialManager* mat_mgr, const BLM_Mo // } const GeoMaterial* stainless_steel = mat_mgr->getMaterial("std::Iron"); const GeoMaterial* peek = mat_mgr->getMaterial("pix::Peek"); - if(peek == NULL) + if(peek == nullptr) { if(msg) (*msg) << "BLM _ PEEK _ MISSING." << endmsg; diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Wall.cxx b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Wall.cxx index 4202510a9c01fa99c055b34601fafe3f5f48369c..7285bc16404a09ff50de15ef19f98ab00fde8196 100755 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Wall.cxx +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Wall.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "BLM_GeoModel/BLM_Wall.h" @@ -34,7 +34,7 @@ GeoPhysVol* BLM_Wall::BuildClamp(const GeoMaterial* material) return blmWallPhys; } -GeoPhysVol* BLM_Wall::BuildBlock(double X, double Y, double Z, std::string logname, const GeoMaterial* material) +GeoPhysVol* BLM_Wall::BuildBlock(double X, double Y, double Z, const std::string& logname, const GeoMaterial* material) { const GeoBox* blmWallBox = new GeoBox(X/2, Y/2, Z/2); const GeoLogVol* blmWallLog = new GeoLogVol(logname, blmWallBox, material); @@ -105,7 +105,7 @@ GeoPhysVol* BLM_Wall::BuildHolder(const GeoMaterial* material) GeoPhysVol* BLM_Wall::BuildLayerI(double thick, const GeoMaterial* material, bool hole) { - if(hole == true) + if(hole) { const GeoShape* blmWallBox = new GeoBox(s_width/2, thick/2, s_extended_length/2); const GeoShape* blmWallHole = new GeoTube(0, s_hole_r, thick); diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h index 5f17b84770f8d0c3135d84656872af33b95143a0..eadd654ac2e4015ce51528eda71791559d69aac4 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETMATERIALMANAGER_H @@ -39,21 +39,21 @@ public: InDetMaterialManager(const std::string & managerName, StoreGateSvc* detStore); InDetMaterialManager(const std::string & managerName, StoreGateSvc* detStore, - IRDBRecordset_ptr weightTable, + const IRDBRecordset_ptr& weightTable, const std::string & space = "", bool extraFunctionality = false); InDetMaterialManager(const std::string & managerName, StoreGateSvc* detStore, - IRDBRecordset_ptr weightTable, - IRDBRecordset_ptr compositionTable, + const IRDBRecordset_ptr& weightTable, + const IRDBRecordset_ptr& compositionTable, const std::string & space = ""); InDetMaterialManager(const std::string & managerName, InDetDD::AthenaComps *); ~InDetMaterialManager(); - void addWeightTable(IRDBRecordset_ptr weightTable, const std::string & space = ""); - void addWeightMaterial(std::string materialName, std::string materialBase, double weight, int linearWeightFlag); - void addCompositionTable(IRDBRecordset_ptr compositionTable, const std::string & space = ""); - void addScalingTable(IRDBRecordset_ptr scalingTable); + void addWeightTable(const IRDBRecordset_ptr& weightTable, const std::string & space = ""); + void addWeightMaterial(const std::string& materialName, const std::string& materialBase, double weight, int linearWeightFlag); + void addCompositionTable(const IRDBRecordset_ptr& compositionTable, const std::string & space = ""); + void addScalingTable(const IRDBRecordset_ptr& scalingTable); bool hasMaterial(const std::string &materialName) const; @@ -189,7 +189,7 @@ private: const StoredMaterialManager * retrieveManager(const StoreGateSvc* detStore); const GeoMaterial* getAdditionalMaterial(const std::string & materialName) const; bool compareDensity(double d1, double d2) const; - void addWeightTableOld(IRDBRecordset_ptr weightTable, const std::string & space); + void addWeightTableOld(const IRDBRecordset_ptr& weightTable, const std::string & space); // Internal versions. The public versions allow materials to be have extra scaling. const GeoMaterial* getMaterialInternal(const std::string & materialName) const; diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h index 888c8fc667bba6ea19844c4deb6f84efc2b01e64..60fbd00e60697049b740783bcc02840feaab0596 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetDD_ServiceVolume_H @@ -24,7 +24,7 @@ namespace InDetDD { GeoShapeHolder(const GeoShape *); GeoShapeHolder(const GeoShapeHolder &); GeoShapeHolder & operator=(const GeoShapeHolder &); - GeoShapeHolder & operator=(GeoShapeHolder &&); + GeoShapeHolder & operator=(GeoShapeHolder &&) noexcept; ~GeoShapeHolder(); const GeoShape * get() const {return m_geoShape;} void set(const GeoShape *); diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/TopLevelPlacements.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/TopLevelPlacements.h index 25eb359371b4a91c12c66f2dd8b6ece0fc4a1a50..6f745b46f2ca5664f79461a77db4833cbafd4756 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/TopLevelPlacements.h +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/TopLevelPlacements.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETGEOMODELUTILS_TOPLEVELPLACEMENTS_H @@ -19,7 +19,7 @@ class TopLevelPlacements public: - TopLevelPlacements(IRDBRecordset_ptr topLevelTable); + TopLevelPlacements(const IRDBRecordset_ptr& topLevelTable); ~TopLevelPlacements(); bool present(const std::string & partName) const; @@ -34,7 +34,7 @@ private: GeoTrf::Transform3D transform; }; - void fillPlacements(IRDBRecordset_ptr topLevelTable); + void fillPlacements(const IRDBRecordset_ptr& topLevelTable); GeoTrf::Transform3D partTransform(const IRDBRecord* record) const; Part * getPart(const std::string & partName) const; diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx index 6db95bcdf313b8b5031dd52e3311b687df587282..97ed221eeab130da297f6d826495fa71e5b89d51 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -30,15 +30,15 @@ namespace InDetDD { // Get version tag and node for InDet. DecodeVersionKey versionKey("InnerDetector"); - std::string detectorKey = versionKey.tag(); - std::string detectorNode = versionKey.node(); + const std::string& detectorKey = versionKey.tag(); + const std::string& detectorNode = versionKey.node(); log << MSG::DEBUG << "Retrieving Record Sets from database ..." << endmsg; log << MSG::DEBUG << "Key = " << detectorKey << " Node = " << detectorNode << endmsg; m_xMatTable = rdbSvc->getRecordsetPtr("InDetExtraMaterial", detectorKey, detectorNode); - const StoredMaterialManager* theGeoMaterialManager = 0; + const StoredMaterialManager* theGeoMaterialManager = nullptr; sc = detStore->retrieve(theGeoMaterialManager, "MATERIALS"); if (sc.isFailure()) log << MSG::FATAL << "Could not locate GeoModel Material manager" << endmsg; m_materialManager = theGeoMaterialManager; diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ExtraMaterial.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ExtraMaterial.cxx index e1bcdf5209690e6f7acbca201a7ee8880e0e07d4..b75259ad608485bd27f8b8fc25cdae693ae6e74f 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ExtraMaterial.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ExtraMaterial.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/ExtraMaterial.h" @@ -19,13 +19,15 @@ #include "GeoModelInterfaces/StoredMaterialManager.h" -#include <string> -#include <sstream> #include <iostream> +#include <sstream> +#include <string> +#include <utility> + namespace InDetDD { ExtraMaterial::ExtraMaterial(IRDBRecordset_ptr xMatTable, const StoredMaterialManager* matManager) - : m_xMatTable(xMatTable), + : m_xMatTable(std::move(xMatTable)), m_matManager(matManager) {} @@ -36,12 +38,12 @@ namespace InDetDD { void ExtraMaterial::add(GeoPhysVol* parent, const std::string& region, double zParent) { - add(parent, 0, region, zParent); + add(parent, nullptr, region, zParent); } void ExtraMaterial::add(GeoFullPhysVol* parent, const std::string& region, double zParent) { - add(0, parent, region, zParent); + add(nullptr, parent, region, zParent); } void diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/GenericTubeMaker.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/GenericTubeMaker.cxx index 46f83349168a8dd261a62ba01c191b511918d610..c7601770b516aa6acc8876c60235a0529c23f254 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/GenericTubeMaker.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/GenericTubeMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/GenericTubeMaker.h" @@ -35,7 +35,7 @@ namespace InDetDD { const GeoShape* GenericTubeMaker::buildShape() { - const GeoShape* shape = 0; + const GeoShape* shape = nullptr; switch (m_volData.shape()) { case TubeVolData::TUBE: @@ -73,23 +73,23 @@ namespace InDetDD { void GenericTubeMaker::placeVolume(GeoPhysVol* parent, GeoVPhysVol* child, double zParent) { - placeVolume(parent, 0, child, zParent); + placeVolume(parent, nullptr, child, zParent); } void GenericTubeMaker::placeVolume(GeoFullPhysVol* fullparent, GeoVPhysVol* child, double zParent) { - placeVolume(0, fullparent, child, zParent); + placeVolume(nullptr, fullparent, child, zParent); } void GenericTubeMaker::placeVolTwoSide(GeoPhysVol* parentPos, GeoPhysVol* parentNeg, GeoVPhysVol* child, double zParent) { - placeVolTwoSide(parentPos, parentNeg, 0, 0, child, zParent); + placeVolTwoSide(parentPos, parentNeg, nullptr, nullptr, child, zParent); } void GenericTubeMaker::placeVolTwoSide(GeoFullPhysVol* fullparentPos, GeoFullPhysVol* fullparentNeg, GeoVPhysVol* child, double zParent) { - placeVolTwoSide(0, 0, fullparentPos, fullparentNeg, child, zParent); + placeVolTwoSide(nullptr, nullptr, fullparentPos, fullparentNeg, child, zParent); } void @@ -97,7 +97,7 @@ namespace InDetDD { for (int iRepeat = 0; iRepeat < m_volData.nRepeat(); iRepeat++) { double phi = m_volData.phiStep() * iRepeat; - GeoTransform* xform = 0; + GeoTransform* xform = nullptr; double zOffset = m_volData.zMid() - zParent; if (zOffset != 0 || iRepeat > 0) { xform = new GeoTransform(GeoTrf::TranslateZ3D(zOffset) * GeoTrf::RotateZ3D(phi)); diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetDDAthenaComps.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetDDAthenaComps.cxx index e7d6579b0cb79fc0c0d3e3caf8c0f50bc24e1c8f..97658d9e71035dd20ad4e0833aded6641175d00d 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetDDAthenaComps.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetDDAthenaComps.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/InDetDDAthenaComps.h" @@ -7,10 +7,10 @@ namespace InDetDD { AthenaComps::AthenaComps(const std::string& msgStreamName) : m_msg(msgStreamName), - m_detStore(0), - m_geoDbTagSvc(0), - m_rdbAccessSvc(0), - m_geometryDBSvc(0) + m_detStore(nullptr), + m_geoDbTagSvc(nullptr), + m_rdbAccessSvc(nullptr), + m_geometryDBSvc(nullptr) {} void diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx index cf163cd72ef086313cf3bd24b3eaeff40547f1d1..f8de9e7d01a1734d1e0890bd953503389c04808f 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/InDetMaterialManager.h" @@ -25,20 +25,20 @@ InDetMaterialManager::InDetMaterialManager(const std::string& managerName, : m_managerName(managerName), m_msg(managerName), m_extraFunctionality(false), - m_athenaComps(0) { + m_athenaComps(nullptr) { m_materialManager = retrieveManager(detStore); } // Constructor InDetMaterialManager::InDetMaterialManager(const std::string& managerName, StoreGateSvc* detStore, - IRDBRecordset_ptr weightTable, + const IRDBRecordset_ptr& weightTable, const std::string& space, bool extraFunctionality) : m_managerName(managerName), m_msg(managerName), m_extraFunctionality(extraFunctionality), - m_athenaComps(0) { + m_athenaComps(nullptr) { m_materialManager = retrieveManager(detStore); if (weightTable) addWeightTable(weightTable, space); @@ -51,13 +51,13 @@ InDetMaterialManager::InDetMaterialManager(const std::string& managerName, } InDetMaterialManager::InDetMaterialManager(const std::string& managerName, StoreGateSvc* detStore, - IRDBRecordset_ptr weightTable, - IRDBRecordset_ptr compositionTable, + const IRDBRecordset_ptr& weightTable, + const IRDBRecordset_ptr& compositionTable, const std::string& space) : m_managerName(managerName), m_msg(managerName), m_extraFunctionality(true), - m_athenaComps(0) { + m_athenaComps(nullptr) { m_materialManager = retrieveManager(detStore); if (weightTable) addWeightTable(weightTable, space); @@ -127,7 +127,7 @@ InDetMaterialManager::getAdditionalMaterial(const std::string& materialName) con if ((iter = m_store.find(materialName)) != m_store.end()) { return iter->second; } else { - return 0; + return nullptr; } } @@ -221,7 +221,7 @@ InDetMaterialManager::getMaterialInternal(const std::string& origMaterialName, newName2 = origMaterialName + "Modified"; } - const GeoMaterial* newMaterial = 0; + const GeoMaterial* newMaterial = nullptr; // First see if we already have the modified material const GeoMaterial* material = getAdditionalMaterial(newName2); @@ -265,7 +265,7 @@ InDetMaterialManager::getMaterialScaledInternal(const std::string& origMaterialN // Don't allow large scale factors if (scaleFactor > 1000 || scaleFactor < 0.001) { msg(MSG::ERROR) << "Scale factor must be between 0.001 and 1000." << endmsg; - return 0; + return nullptr; } const GeoMaterial* origMaterial = getMaterialInternal(origMaterialName); @@ -274,7 +274,7 @@ InDetMaterialManager::getMaterialScaledInternal(const std::string& origMaterialN // then just return the orginal material if (newName.empty() && scaleFactor == 1.) return origMaterial; - const GeoMaterial* newMaterial = 0; + const GeoMaterial* newMaterial = nullptr; if (origMaterial) { double density = origMaterial->getDensity() * scaleFactor; @@ -321,7 +321,7 @@ InDetMaterialManager::compareDensity(double d1, double d2) const { } void -InDetMaterialManager::addWeightTable(IRDBRecordset_ptr weightTable, const std::string& space) { +InDetMaterialManager::addWeightTable(const IRDBRecordset_ptr& weightTable, const std::string& space) { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading in weight table: " << weightTable->nodeName() << endmsg; // If not using geometryDBSvc revert to old version if (!db()) { @@ -361,7 +361,7 @@ InDetMaterialManager::addWeightTable(IRDBRecordset_ptr weightTable, const std::s } void -InDetMaterialManager::addWeightMaterial(std::string materialName, std::string materialBase, double weight, +InDetMaterialManager::addWeightMaterial(const std::string& materialName, const std::string& materialBase, double weight, int linearWeightFlag) { // Weight in gr weight = weight * GeoModelKernelUnits::gram; @@ -378,7 +378,7 @@ InDetMaterialManager::addWeightMaterial(std::string materialName, std::string ma } void -InDetMaterialManager::addWeightTableOld(IRDBRecordset_ptr weightTable, const std::string& space) { +InDetMaterialManager::addWeightTableOld(const IRDBRecordset_ptr& weightTable, const std::string& space) { for (unsigned int i = 0; i < weightTable->size(); i++) { const IRDBRecord* record = (*weightTable)[i]; std::string materialName = record->getString("MATERIAL"); @@ -406,7 +406,7 @@ InDetMaterialManager::addWeightTableOld(IRDBRecordset_ptr weightTable, const std } void -InDetMaterialManager::addCompositionTable(IRDBRecordset_ptr compositionTable, const std::string& space) { +InDetMaterialManager::addCompositionTable(const IRDBRecordset_ptr& compositionTable, const std::string& space) { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading in composition table: " << compositionTable->nodeName() << endmsg; if (!db()) { @@ -431,7 +431,7 @@ InDetMaterialManager::addCompositionTable(IRDBRecordset_ptr compositionTable, co } void -InDetMaterialManager::addScalingTable(IRDBRecordset_ptr scalingTable) { +InDetMaterialManager::addScalingTable(const IRDBRecordset_ptr& scalingTable) { if (!scalingTable) return; if (db()->getTableSize(scalingTable) == 0) return; @@ -466,7 +466,7 @@ InDetMaterialManager::getMaterialForVolume(const std::string& materialName, doub // Make sure we have a valid volume size. if (volume <= 0) { msg(MSG::ERROR) << "Invalid volume : " << volume << endmsg; - return 0; + return nullptr; } // Find if material is in the weight table. @@ -543,7 +543,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& materialName // Make sure we have a valid volume size. if (volume <= 0 || length <= 0) { msg(MSG::ERROR) << "Invalid volume or length : " << volume << ", " << length << endmsg; - return 0; + return nullptr; } // First look in the predefinded collections @@ -612,7 +612,7 @@ InDetMaterialManager::getMaterialForVolumeLength(const std::string& name, // Make sure we have a valid volume size. if (volume <= 0 || length <= 0) { msg(MSG::ERROR) << "Invalid volume or length : " << volume << ", " << length << endmsg; - return 0; + return nullptr; } if (!factors.empty() && factors.size() < materialComponents.size()) { @@ -746,7 +746,7 @@ InDetMaterialManager::getMaterialInternal(const std::string& name, const std::vector<std::string>& materialComponents, const std::vector<double>& fracWeight, double density) { - const GeoMaterial* newMaterial = 0; + const GeoMaterial* newMaterial = nullptr; // First see if we already have the material const GeoMaterial* material = getAdditionalMaterial(name); @@ -776,7 +776,7 @@ const IGeometryDBSvc* InDetMaterialManager::db() { if (m_athenaComps) return m_athenaComps->geomDB(); - return 0; + return nullptr; } void @@ -834,7 +834,7 @@ InDetMaterialManager::addTextFileMaterials() { // If not flag that there are undefined materials and go to next material bool compsDefined = true; for (unsigned int iComp = 0; iComp < tmpMat.numComponents(); ++iComp) { - std::string compName = tmpMat.compName(iComp); + const std::string& compName = tmpMat.compName(iComp); MatMap::iterator iter2 = materials.find(compName); if (iter2 != materials.end()) { if (!iter2->second.isCreated()) { diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx index 90e12319d193fbdcff1f982012690120b48238a2..13c975be9d110714c1cf207c7fc08aa46d9fe9bc 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // @@ -103,8 +103,8 @@ namespace InDetDD { m_zmax(0), //m_volId(0), m_zsymm(false), - m_geoShape(0), - m_material(0), + m_geoShape(nullptr), + m_material(nullptr), m_phiLoc(0), m_phiWidth(0), m_needsRotation(false), @@ -165,7 +165,7 @@ namespace InDetDD { m_safety = safety; } std::lock_guard<std::mutex> lock(m_mutex); - m_geoShape = 0; + m_geoShape = nullptr; } void @@ -221,7 +221,7 @@ namespace InDetDD { // << halflength << ", " // << materialName << std::endl; - const GeoShape* serviceShape = 0; + const GeoShape* serviceShape = nullptr; double volume = 0; // Check if service needs to be shifted @@ -257,7 +257,7 @@ namespace InDetDD { serviceShape = shapeTmp; } else if (m_shapeType == "PGON3" || m_shapeType == "PGON4") { // Outer edge - GeoPgon* shapeTmp1 = 0; + GeoPgon* shapeTmp1 = nullptr; if (m_shapeType == "PGON3") { shapeTmp1 = new GeoPgon(m_phiLoc, 2 * M_PI, m_sides); shapeTmp1->addPlane(-halflength, 0, m_rmax); @@ -274,7 +274,7 @@ namespace InDetDD { // Don't trust boolean volume calculation. volume = shapeTmp1->volume(); // Inner edge - GeoShape* shapeTmp2 = 0; + GeoShape* shapeTmp2 = nullptr; if (m_rmin == m_rmin2) { shapeTmp2 = new GeoTube(0, m_rmin, halflength + 0.1 * Gaudi::Units::mm); volume -= 2 * M_PI * m_rmin * m_rmin * halflength; @@ -317,7 +317,7 @@ namespace InDetDD { std::cout << "ServiceVolume: ERROR: Unrecognized shape for services" << m_shapeType << std::endl; } - if (!volume && serviceShape != 0) volume = serviceShape->volume(); + if (!volume && serviceShape != nullptr) volume = serviceShape->volume(); m_volume = volume; m_geoShape.set(serviceShape); @@ -361,13 +361,13 @@ namespace InDetDD { m_splittableR = m_splittableZ = true; if (m_shapeType == "CUSTOM") { m_splittableR = m_splittableZ = false; - } else if (!(m_shapeType == "" || m_shapeType == "TUBE" || m_shapeType == "TUBS")) { + } else if (!(m_shapeType.empty() || m_shapeType == "TUBE" || m_shapeType == "TUBS")) { m_splittableR = false; } } GeoShapeHolder::GeoShapeHolder() - : m_geoShape(0) + : m_geoShape(nullptr) {} GeoShapeHolder::GeoShapeHolder(const GeoShape* geoShape) @@ -395,7 +395,7 @@ namespace InDetDD { } GeoShapeHolder& - GeoShapeHolder::operator = (GeoShapeHolder&& rhs) { + GeoShapeHolder::operator = (GeoShapeHolder&& rhs) noexcept { if (&rhs != this) { if (m_geoShape) m_geoShape->unref();//this geoshape will be overwritten, so decrement its reference m_geoShape = rhs.m_geoShape; //simply equate the pointers @@ -416,6 +416,6 @@ namespace InDetDD { void GeoShapeHolder::reset() { if (m_geoShape) m_geoShape->unref(); - m_geoShape = 0; + m_geoShape = nullptr; } } // end namespace diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx index 051655368a5a21d76dc99a196a975bc4b87e315d..b9e6d835c9d2ad6345a98afecc0d33e0961f1665 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx @@ -1,7 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ +#include <utility> + + + #include "InDetGeoModelUtils/ServiceVolumeMaker.h" #include "InDetGeoModelUtils/ServiceVolume.h" #include "InDetGeoModelUtils/InDetDDAthenaComps.h" @@ -85,7 +89,7 @@ namespace InDetDD { ServiceVolumeMakerMgr::ServiceVolumeMakerMgr(IRDBRecordset_ptr table, const ServiceVolumeSchema& schema, InDetDD::AthenaComps* athenaComps) - : m_table(table), + : m_table(std::move(table)), m_schema(schema), m_athenaComps(athenaComps) {} @@ -225,8 +229,8 @@ namespace InDetDD { const IGeoDbTagSvc* geoDbTag = m_athenaComps->geoDbTagSvc(); DecodeVersionKey versionKey(geoDbTag, "Pixel"); - std::string detectorKey = versionKey.tag(); - std::string detectorNode = versionKey.node(); + const std::string& detectorKey = versionKey.tag(); + const std::string& detectorNode = versionKey.node(); IRDBRecordset_ptr PixelBarrelGeneral = rdbSvc->getRecordsetPtr("PixelBarrelGeneral", detectorKey, detectorNode); IRDBRecordset_ptr PixelLayer = rdbSvc->getRecordsetPtr("PixelLayer", detectorKey, detectorNode); @@ -245,7 +249,7 @@ namespace InDetDD { IRDBRecordset_ptr table, const ServiceVolumeSchema& schema, InDetDD::AthenaComps* athenaComps) : m_label(label) { - m_mgr = new ServiceVolumeMakerMgr(table, schema, athenaComps); + m_mgr = new ServiceVolumeMakerMgr(std::move(table), schema, athenaComps); m_layerShift = m_mgr->readLayerShift(); // std::cout<<"LAYER SHIFT "<<m_layerShift[0]<<" "<<m_layerShift[1]<<" "<<m_layerShift[2]<<" // "<<m_layerShift[3]<<std::endl; diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/TopLevelPlacements.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/TopLevelPlacements.cxx index 272f6baff632e069ade7205056398382a96a5412..4068dd1f5c57e8b8f4a2438ff25d39358e3ba488 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/TopLevelPlacements.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/TopLevelPlacements.cxx @@ -1,16 +1,18 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/TopLevelPlacements.h" #include "GaudiKernel/SystemOfUnits.h" -#include "RDBAccessSvc/IRDBRecordset.h" #include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" #include <iostream> +#include <utility> + const GeoTrf::Transform3D TopLevelPlacements::s_identityTransform = GeoTrf::Transform3D::Identity(); -TopLevelPlacements::TopLevelPlacements(IRDBRecordset_ptr topLevelTable) +TopLevelPlacements::TopLevelPlacements(const IRDBRecordset_ptr& topLevelTable) : m_noTopLevelTable(true) { fillPlacements(topLevelTable); } @@ -34,12 +36,12 @@ TopLevelPlacements::present(const std::string& partName) const { // If no table present assume everything is present. if (m_noTopLevelTable) return true; - return(getPart(partName) != 0); + return(getPart(partName) != nullptr); } void -TopLevelPlacements::fillPlacements(IRDBRecordset_ptr topLevelTable) { - if (topLevelTable.get() == 0) { +TopLevelPlacements::fillPlacements(const IRDBRecordset_ptr& topLevelTable) { + if (topLevelTable.get() == nullptr) { m_noTopLevelTable = true; return; } @@ -95,7 +97,7 @@ TopLevelPlacements::partTransform(const IRDBRecord* record) const { // List of the three transforms GeoTrf::Transform3D* xformList[3] = { - 0, 0, 0 + nullptr, nullptr, nullptr }; if (rotX != 0) xformList[0] = new GeoTrf::RotateX3D(rotX); if (rotY != 0) xformList[1] = new GeoTrf::RotateY3D(rotY); @@ -117,7 +119,7 @@ TopLevelPlacements::Part* TopLevelPlacements::getPart(const std::string& partName) const { std::map<std::string, Part*>::const_iterator iter; iter = m_parts.find(partName); - if (iter == m_parts.end()) return 0; + if (iter == m_parts.end()) return nullptr; return iter->second; } diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeBuilder.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeBuilder.cxx index af26ac0b1f7d0554fc95ab2b816340e4c18fe0e3..d90a199c4b146285acfb156914be985175ce7903 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetGeoModelUtils/VolumeBuilder.h" @@ -19,10 +19,10 @@ namespace InDetDD { : m_msg("InDetDDVolumeBuilder"), m_region("None"), // Empty refers to a valid region. Set some default so we can check it is actually set. m_zcenter(0), - m_services(0), - m_servEnvelope(0), - m_servChild(0), - m_matManager(0) { + m_services(nullptr), + m_servEnvelope(nullptr), + m_servChild(nullptr), + m_matManager(nullptr) { m_splitter.splitAll(zone, services); } @@ -31,9 +31,9 @@ namespace InDetDD { m_region("None"), // Empty refers to a valid region. Set some default so we can check it is actually set. m_zcenter(0), m_services(&services), - m_servEnvelope(0), - m_servChild(0), - m_matManager(0) + m_servEnvelope(nullptr), + m_servChild(nullptr), + m_matManager(nullptr) {} VolumeBuilder::VolumeBuilder(const Zone& zone, const std::vector<const ServiceVolume* >& services, @@ -42,10 +42,10 @@ namespace InDetDD { : m_msg("InDetDDVolumeBuilder"), m_region("None"), // Empty refers to a valid region. Set some default so we can check it is actually set. m_zcenter(0), - m_services(0), + m_services(nullptr), m_servEnvelope(&servEnvelope), m_servChild(&servChild), - m_matManager(0) { + m_matManager(nullptr) { m_splitter.splitAll(zone, services); } @@ -203,7 +203,7 @@ namespace InDetDD { } const ServiceVolume& param = *(services()[iElement]); // If the subelement does not belong to the current region return 0. - if (param.region() != m_region) return 0; + if (param.region() != m_region) return nullptr; const GeoShape* serviceShape = param.getShape(); double volume = param.origVolume(); @@ -243,8 +243,7 @@ namespace InDetDD { bool VolumeBuilder::isEnvelopeOrChild(int iElement) { const ServiceVolume& param = *(services()[iElement]); - if (param.envelopeNum() == 0 && param.envelopeParent() == 0) return false; - return true; + return !(param.envelopeNum() == 0 && param.envelopeParent() == 0); } int @@ -273,8 +272,7 @@ namespace InDetDD { if (param1.zsymm() == 1) { double zmin = (param1.zmin() * param2.zmin()); double zmax = (param1.zmax() * param2.zmax()); - if (zmin > 0 && zmax > 0) return true; - return false; + return zmin > 0 && zmax > 0; } return true; } diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitterUtils.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitterUtils.cxx index 5d89d3c9984c45b7cee60bf21cc675550b8c09b7..506f97f16291c72f4885e0d6735db2205d75aa9d 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitterUtils.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/VolumeSplitterUtils.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -352,7 +352,7 @@ namespace InDetDD { m_last(false), m_z(0), m_r(0), - m_child(0) + m_child(nullptr) {} Point::Point(double z, double r) @@ -361,7 +361,7 @@ namespace InDetDD { m_last(false), m_z(z), m_r(r), - m_child(0) + m_child(nullptr) {} Segment::Segment(const std::string& label, const Point& start, const Point& end, bool rotated) @@ -375,7 +375,7 @@ namespace InDetDD { void SegmentList::add(const std::string& label, const Point& start, const Point& end, bool rotated) { - m_segments.push_back(Segment(label, start, end, rotated)); + m_segments.emplace_back(label, start, end, rotated); } void diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/src/PixelID.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/src/PixelID.cxx index a181aa5d1005d9b2e42c8f8480915a9ebf61854b..ecb59aaa441fb11b33b4552daae67118160252a9 100644 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/src/PixelID.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/src/PixelID.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -31,7 +31,7 @@ PixelID::PixelID(void) m_PHI_INDEX_INDEX(6), m_ETA_INDEX_INDEX(7), m_ETA_MODULE_OFFSET(999), - m_dict(0), + m_dict(nullptr), m_wafer_hash_max(0), m_pixel_hash_max(0) { m_barrel_field.add_value(0); diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/src/SCT_ID.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/src/SCT_ID.cxx index 8e1411ec4e8f8997af467e64dd2f06406b6e56db..b1064a6ec65e9939bcf418e7c7d3b9ea460cc27a 100644 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/src/SCT_ID.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/src/SCT_ID.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -30,7 +30,7 @@ namespace{ SCT_ID::SCT_ID(void) : m_neighboursByEta{invalidHashFunc, invalidHashFunc, invalidHashFunc , invalidHashFunc, invalidHashFunc}, - m_dict(0), + m_dict(nullptr), m_wafer_hash_max(0), m_strip_hash_max(0), m_barrel_field(0), diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/src/SiliconID.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/src/SiliconID.cxx index e4637fd50cffd7a46ed4db644cc962d0efe5ba85..c9af19c95c0e9f62b942f29865edd4c743a7785f 100644 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/src/SiliconID.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/src/SiliconID.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -25,8 +25,8 @@ SiliconID::SiliconID(void) : m_wafer_hash_max(0), m_pixel_wafer_hash_max(0), - m_pixel_helper(0), - m_sct_helper(0) + m_pixel_helper(nullptr), + m_sct_helper(nullptr) {} SiliconID::SiliconID(const PixelID* pixel_helper, const SCT_ID* sct_helper) diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/src/TRT_ID.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/src/TRT_ID.cxx index 5b782eb408f61a074b55ff46a3ce57c4d59df7b8..ee22982020a6ad95b8cddf69b9db7ae13698a098 100644 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/src/TRT_ID.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/src/TRT_ID.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -33,7 +33,7 @@ TRT_ID::TRT_ID(void) m_LAYER_OR_WHEEL_INDEX(4), m_STRAW_LAYER_INDEX(5), m_STRAW_INDEX(6), - m_dict(0), + m_dict(nullptr), m_module_hash_max(0), m_straw_layer_hash_max(0), m_straw_hash_max(0) { diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/test/SCT_ID_test.cxx b/InnerDetector/InDetDetDescr/InDetIdentifier/test/SCT_ID_test.cxx index b06eb5c04b5f5a5808aa8e65cd6f12a91cf447ae..77a29e9afb1eb398d54f09d75a7817a3d21838fc 100644 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/test/SCT_ID_test.cxx +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/test/SCT_ID_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /* */ @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_SUITE(SCT_ID_Test) const int nWafersUsingIterator = std::accumulate(sctId.wafer_begin(), sctId.wafer_end(), 0,[](int s, Identifier ){return s+1;}); BOOST_TEST(nWafersUsingIterator == 8176); //expanded iterator usage - const int nStripsUsingIterator = std::accumulate(sctId.strip_begin(), sctId.strip_end(), 0,[](int s, ExpandedIdentifier ){return s+1;}); + const int nStripsUsingIterator = std::accumulate(sctId.strip_begin(), sctId.strip_end(), 0,[](int s, const ExpandedIdentifier& ){return s+1;}); BOOST_TEST(nStripsUsingIterator == 8176 * 6 * 128); //complete test, more-or-less equivalent to "test wafer packing" in original code auto context = sctId.wafer_context(); diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx index f719917d7baa0d1781cdcdeb84eb1ee288fafe10..856956f15c959d2bce57866f62cac7a19a053f59 100644 --- a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx +++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx @@ -8,7 +8,7 @@ ** @date Sun 22 Sep 2019 10:21:50 BST ** ** - ** Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration **/ @@ -155,7 +155,7 @@ StatusCode SiRegSelCondAlg::execute(const EventContext& ctx) const if (element->isPixel()) { const PixelID* pixelId = dynamic_cast<const PixelID*>(element->getIdHelper()); - if ( pixelId!=0 ) { + if ( pixelId!=nullptr ) { barrelEC = pixelId->barrel_ec(element->identify()); if ( std::fabs(barrelEC)>3 ) continue; // skip DBM modules layerDisk = pixelId->layer_disk(element->identify()); @@ -168,7 +168,7 @@ StatusCode SiRegSelCondAlg::execute(const EventContext& ctx) const } else { // it's an SCT element const SCT_ID* sctId = dynamic_cast<const SCT_ID*>(element->getIdHelper()); - if ( sctId!=0 ) { + if ( sctId!=nullptr ) { barrelEC = sctId->barrel_ec(element->identify()); layerDisk = sctId->layer_disk(element->identify()); // Avoid use of SCT_CablingTool. Instead of diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/TRT_RegSelCondAlg.cxx b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/TRT_RegSelCondAlg.cxx index 58416fbac60c189aef74525a394cfd063afe00e5..2ff6868cf1aba468659b691fb919fbad0cd922fc 100644 --- a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/TRT_RegSelCondAlg.cxx +++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/TRT_RegSelCondAlg.cxx @@ -8,7 +8,7 @@ ** @date Sun 22 Sep 2019 10:21:50 BST ** ** - ** Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration **/ @@ -116,7 +116,7 @@ StatusCode TRT_RegSelCondAlg::execute(const EventContext& ctx) const // Get the id helper - const TRT_ID* idHelper = 0; + const TRT_ID* idHelper = nullptr; if ( detStore()->retrieve( idHelper, "TRT_ID" ).isFailure() ) { msg(MSG::FATAL) << "Could not get TRT ID helper" << endmsg; return StatusCode::FAILURE; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Routing2.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Routing2.h index 55d1f822a5f8145d97bb0eb361b652713546fc8f..db3dbe36e02eb8ef6a7e4a466ecc6098999c87b9 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Routing2.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Routing2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef Routing2_H @@ -65,9 +65,9 @@ private: HRoute m_MSTM_HRouteInner; HRoute m_MSTI_HRoute; - double eosTolerance( DetType::Type type, DetType::Part part); - double eosLength( DetType::Type type, DetType::Part part); - double eosHalfThickness( DetType::Type type, DetType::Part part); + double eosTolerance( DetType::Type type, DetType::Part part) const; + double eosLength( DetType::Type type, DetType::Part part) const; + double eosHalfThickness( DetType::Type type, DetType::Part part) const; void connect( ServiceVolume* prev, ServiceVolume* newv); void routeBarrelLayer(LayerContainer::const_iterator bl, LayerContainer::const_iterator blend, ServicesTracker& tracker, VRoute& route); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactoryFS.cxx index 56518c48da1133d46551056f255c1f80f195dc11..2a50756a2f7cf692a39eb449e7d49dc44223e78f 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/EndPlateFactoryFS.h" @@ -27,12 +27,14 @@ #include "GaudiKernel/SystemOfUnits.h" #include <iostream> +#include <utility> + EndPlateFactoryFS::EndPlateFactoryFS(StoreGateSvc *detStore, ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("EndPlateFactoryFS") { diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx index e37a4958a677c53661a88968783ce0e3376b8305..b0ff0d2bba1e65df9ad730585a347a860a2c6e05 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatAthenaComps.h" @@ -7,7 +7,7 @@ InDetServMatAthenaComps::InDetServMatAthenaComps() : InDetDD::AthenaComps("InDetServMatGeoModel"), - m_builderTool(0) + m_builderTool(nullptr) {} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx index 2d3a9a1208ba8f2ca3acb56068f7148b6d162a49..18fd1d5169961199e2aafaef2d40126e00cc0372 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatBuilderToolSLHC.h" @@ -30,8 +30,8 @@ InDetServMatBuilderToolSLHC::InDetServMatBuilderToolSLHC(const std::string& t, m_rdbAccessSvc("RDBAccessSvc",name), m_geometryDBSvc("InDetGeometryDBSvc",name), m_init(false), - m_athenaComps(0), - m_geoMgr(0) + m_athenaComps(nullptr), + m_geoMgr(nullptr) { declareInterface<IInDetServMatBuilderTool>(this); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx index 90d46fee057c8fbfbd70c5def4fd3ce4f5a2b395..725791050a80a4aa3201afd35934a6fd9d285355 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatFactory.h" @@ -43,7 +43,7 @@ InDetServMatFactory::InDetServMatFactory(InDetDD::AthenaComps * athenaComps) : InDetDD::DetectorFactoryBase(athenaComps), - m_manager(0) + m_manager(nullptr) { } @@ -140,7 +140,7 @@ void InDetServMatFactory::create(GeoPhysVol *world ) // Create the envelope for the Pixel Services: // Only need if join1 if false. - const GeoShapeUnion *ServVolAux = 0; + const GeoShapeUnion *ServVolAux = nullptr; if (!join1) { GeoPcon* pixServP = new GeoPcon(0.,2*Gaudi::Units::pi); @@ -233,8 +233,8 @@ void InDetServMatFactory::create(GeoPhysVol *world ) sctTrtServ->addPlane(ZMaxIDet, RMaxFwdTRTC, RMaxIDet); } - const GeoShape * ServVol = 0; - if (ServVolAux == 0) { + const GeoShape * ServVol = nullptr; + if (ServVolAux == nullptr) { ServVol = sctTrtServ; } else { ServVol = new GeoShapeUnion(sctTrtServ, ServVolAux); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC2.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC2.cxx index a1d34bf14ff80dc8224648a4947be4ef700b5baf..4eca4ab677613f0dd2958becb706094c9d714fe7 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC2.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC2.cxx @@ -1,7 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ +#include <utility> + + + #include "InDetServMatGeoModel/InDetServMatFactoryDC2.h" // Pixel, SCT and TRT factories @@ -28,8 +32,8 @@ InDetServMatFactoryDC2::InDetServMatFactoryDC2(StoreGateSvc *detStore,ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), - m_manager(0), + m_rdbAccess(std::move(pRDBAccess)), + m_manager(nullptr), m_msg("InDetServMatFactoryDC2") { diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx index 23de53ce9dbdccb880e7c4eacde3be131dea8e8e..d963fcbcf01cf0071fa76cb07cc2c047740dd267 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatFactoryDC3.h" @@ -42,7 +42,7 @@ InDetServMatFactoryDC3::InDetServMatFactoryDC3(InDetDD::AthenaComps * athenaComps) : InDetDD::DetectorFactoryBase(athenaComps), - m_manager(0) + m_manager(nullptr) {} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryFS.cxx index 82b6249ee5d8238807af18dcf80f25a96264a8d9..2badc7a8633f3bb0a3304c4810755e2fadbc57f5 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatFactoryFS.h" @@ -35,11 +35,13 @@ #include "GaudiKernel/PhysicalConstants.h" #include <iostream> +#include <utility> + InDetServMatFactoryFS::InDetServMatFactoryFS(StoreGateSvc *detStore,ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), - m_manager(0), + m_rdbAccess(std::move(pRDBAccess)), + m_manager(nullptr), m_msg("InDetServMatFactoryFS") { @@ -140,8 +142,8 @@ void InDetServMatFactoryFS::create(GeoPhysVol *world ) // Create the envelope for the Pixel Services: // Only need if join1 if false. - GeoPcon* pixServP = 0; - GeoPcon* pixServM = 0; + GeoPcon* pixServP = nullptr; + GeoPcon* pixServM = nullptr; if (!join1) { pixServP = new GeoPcon(0.,2*Gaudi::Units::pi); @@ -234,11 +236,11 @@ void InDetServMatFactoryFS::create(GeoPhysVol *world ) sctTrtServP->addPlane(ZMaxIDet, RMaxFwdTRTC, RMaxIDet); } - const GeoShape * ServVolP = 0; - const GeoShape * ServVolM = 0; + const GeoShape * ServVolP = nullptr; + const GeoShape * ServVolM = nullptr; - if (pixServP == 0) { + if (pixServP == nullptr) { ServVolP = sctTrtServP; ServVolM = sctTrtServM; } else { diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx index 734e6a88ccc12817337327f168be237259347c05..c4ad49a3554d4227c2b4fac9929c5595ce83df26 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatFactorySLHC.h" @@ -43,7 +43,7 @@ InDetServMatFactorySLHC::InDetServMatFactorySLHC(InDetServMatAthenaComps * athenaComps) : InDetDD::DetectorFactoryBase(athenaComps), m_athenaComps(athenaComps), - m_manager(0) + m_manager(nullptr) { // create a new det manager m_manager = new InDetDD::InDetServMatManager(); @@ -67,8 +67,8 @@ void InDetServMatFactorySLHC::create(GeoPhysVol *world ) fetchTables(); - InDetDD::Zone * zone = 0; - const GeoShape * envelopeShape = 0; + InDetDD::Zone * zone = nullptr; + const GeoShape * envelopeShape = nullptr; if (simpleEnvelope() || oldEnvelope()) { // tube diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx index a76cac7e98ba6c2ba5f612c57145d6a50c2152cf..3ed4ec07eb3eca7aec8c6a546c7ce7557977910f 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatGeometryManager.h" @@ -14,7 +14,7 @@ InDetServMatGeometryManager::InDetServMatGeometryManager(InDetDD::AthenaComps * athenaComps) : m_athenaComps(athenaComps), - m_matMgr(0) + m_matMgr(nullptr) { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initializing InDetServMatGeometryManager" << endmsg; @@ -24,18 +24,18 @@ InDetServMatGeometryManager::InDetServMatGeometryManager(InDetDD::AthenaComps * // Get version tag and node for Pixel. DecodeVersionKey pixelVersionKey(geoDbTag,"Pixel"); - std::string pixelDetectorKey = pixelVersionKey.tag(); - std::string pixelDetectorNode = pixelVersionKey.node(); + const std::string& pixelDetectorKey = pixelVersionKey.tag(); + const std::string& pixelDetectorNode = pixelVersionKey.node(); // Get version tag and node for SCT. DecodeVersionKey sctVersionKey(geoDbTag,"SCT"); - std::string sctDetectorKey = sctVersionKey.tag(); - std::string sctDetectorNode = sctVersionKey.node(); + const std::string& sctDetectorKey = sctVersionKey.tag(); + const std::string& sctDetectorNode = sctVersionKey.node(); //// Get version tag and node for InnerDetector. DecodeVersionKey indetVersionKey(geoDbTag,"InnerDetector"); - std::string indetDetectorKey = indetVersionKey.tag(); - std::string indetDetectorNode = indetVersionKey.node(); + const std::string& indetDetectorKey = indetVersionKey.tag(); + const std::string& indetDetectorNode = indetVersionKey.node(); ///////////////////////////////////////////////////////// // diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatTool.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatTool.cxx index 90ecb6779daad969c9456acbddab21262337d684..cd2131be8ae1344173383a59492fb96ff093e563 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatTool.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/InDetServMatTool.h" @@ -39,8 +39,8 @@ InDetServMatTool::InDetServMatTool( const std::string& type, const std::string& m_builderTool(""), m_devVersion(false), m_forFrozenShowers(false), - m_manager(0), - m_athenaComps(0) + m_manager(nullptr), + m_athenaComps(nullptr) { declareProperty("DevVersion",m_devVersion); declareProperty("FrozenShowers",m_forFrozenShowers); @@ -160,7 +160,7 @@ StatusCode InDetServMatTool::create() } } - if ( 0 == m_detector ) { + if ( nullptr == m_detector ) { // Create the InDetServMatNode instance try { // @@ -234,7 +234,7 @@ StatusCode InDetServMatTool::clear() SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<InDetDD::InDetServMatManager>::ID(),m_manager->getName()); if(proxy) { proxy->reset(); - m_manager = 0; + m_manager = nullptr; } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC2.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC2.cxx index 5d9dc131c24a532a52ff7f4214cfeb7f9e273d60..e8fb6197cc87c5e0b0769a7ecada27b6f6b0aaa1 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC2.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC2.cxx @@ -1,7 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ +#include <utility> + + + #include "InDetServMatGeoModel/PixelServMatFactoryDC2.h" // GeoModel includes @@ -30,7 +34,7 @@ PixelServMatFactoryDC2::PixelServMatFactoryDC2(StoreGateSvc *detStore, ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("PixelServmatFactoryDC2") { diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx index 8966410a585d3811692d809ea64d6e3d4969b557..6ffebfeac95b614e997458199ab4dcf34103bb56 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/PixelServMatFactoryDC3.h" @@ -136,7 +136,7 @@ void PixelServMatFactoryDC3::create(GeoPhysVol *mother) o << ii; std::string logName = "PixServ"+o.str(); - const GeoShape* serviceTube = 0; + const GeoShape* serviceTube = nullptr; if (ii==0 || ii==2 || ii==6 || ii==1){ double angGapWid = M_PI/40.; double angSectorWid = M_PI/6.; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryFS.cxx index e07e1390921383bab198a00c1dee51ecfb5d8054..a8626684e102deecd6d7b9fd0417acc7f963e82d 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/PixelServMatFactoryFS.h" @@ -23,19 +23,21 @@ // StoreGate includes #include "StoreGate/StoreGateSvc.h" -#include "RDBAccessSvc/IRDBRecord.h" -#include "RDBAccessSvc/IRDBRecordset.h" -#include "RDBAccessSvc/IRDBAccessSvc.h" -#include "GeoModelUtilities/DecodeVersionKey.h" #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/SystemOfUnits.h" +#include "GeoModelUtilities/DecodeVersionKey.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" #include <iostream> +#include <utility> + PixelServMatFactoryFS::PixelServMatFactoryFS(StoreGateSvc *detStore, ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("PixelServMatFactoryFS") { } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx index 29a3e38864260657d5432e15ce268471803f4116..1200d8628b842fc7fb88af8914ad8a6e97261e0a 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Route.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/Route.h" @@ -14,7 +14,7 @@ ServiceVolume* Route::entryVolume( double pos, bool ascending, Athena::MsgStream msg << MSG::DEBUG << "entering entryVolume with ascending = " << ascending << " and pos = " << pos << endmsg; - if (volumes().empty()) return 0; + if (volumes().empty()) return nullptr; // if (volumes().front()->contains(pos)) return volumes().front(); // else if (volumes().back()->contains(pos)) return volumes().back(); @@ -52,10 +52,10 @@ ServiceVolume* Route::exitVolume( bool ascending, Athena::MsgStreamMember& msg) msg << MSG::DEBUG << "entering exitVolume with ascending = " << ascending << " and route.exit() = " << exit() << endmsg; - if (m_exitVolume != 0) return m_exitVolume; + if (m_exitVolume != nullptr) return m_exitVolume; // returns the volume closest to the exit point, coming from the given direction - if (volumes().empty()) return 0; + if (volumes().empty()) return nullptr; if ( ascending) { for (VolumeContainer::const_iterator i=volumes().begin(); i!=volumes().end(); ++i) { if ((**i).contains(exit())) return *i; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Routing2.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Routing2.cxx index 81df341000332484790ef9b6c41837e633c14b22..ffaeaa7c2484187809b9f6eb40e1c23736804b3e 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Routing2.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/Routing2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/Routing2.h" @@ -292,8 +292,7 @@ void Routing2::routeEndcapPixel(ServicesTracker& tracker) bool Routing2::isRoutedOutsideSupportTube(LayerContainer::const_iterator bl, HRoute& route) { - if ( (**bl).rMax() > route.radius()) return true; - return false; + return (**bl).rMax() > route.radius(); } void Routing2::routeInnerBarrelPixel(ServicesTracker& tracker) @@ -521,7 +520,7 @@ void Routing2::connectRoutes( Route& in, Route& out) { // choose volume to connect to ServiceVolume* entryVol = out.entryVolume(in.position(),true,msgStream()); - if (entryVol == 0) entryVol = createSingleRouteVolume( out); + if (entryVol == nullptr) entryVol = createSingleRouteVolume( out); ServiceVolume* exitVol = in.exitVolume(true,msgStream()); // maybe check volumes are connectable? entryVol->addPrevious(exitVol); @@ -532,15 +531,15 @@ void Routing2::connectRoutes( Route& in, Route& out) while (true) { nextVol->addLayers( exitVol->layers()); nextVol = nextVol->next(); - if (nextVol == 0) break; + if (nextVol == nullptr) break; } } ServiceVolume* Routing2::createSingleRouteVolume( Route& rt) { - ServiceVolume* vol(0); + ServiceVolume* vol(nullptr); HRoute* hrt = dynamic_cast<HRoute*>(&rt); - if (hrt != 0) { + if (hrt != nullptr) { vol = new ServiceVolume( ServiceVolume::Cylinder, rt.position()-0.5*m_c_ServiceCylinderThickness, rt.position()+0.5*m_c_ServiceCylinderThickness, @@ -557,12 +556,12 @@ ServiceVolume* Routing2::createSingleRouteVolume( Route& rt) return vol; } -double Routing2::eosTolerance( DetType::Type /*type*/, DetType::Part /*part*/) +double Routing2::eosTolerance( DetType::Type /*type*/, DetType::Part /*part*/) const { return m_c_EosTolerance; } -double Routing2::eosLength( DetType::Type type, DetType::Part part) +double Routing2::eosLength( DetType::Type type, DetType::Part part) const { using namespace DetType; if (type == Pixel) { @@ -576,7 +575,7 @@ double Routing2::eosLength( DetType::Type type, DetType::Part part) } -double Routing2::eosHalfThickness( DetType::Type /*type*/, DetType::Part /*part*/) +double Routing2::eosHalfThickness( DetType::Type /*type*/, DetType::Part /*part*/) const { return m_c_halfEosThick; } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC2.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC2.cxx index 7af4c7bdd64dd47af5f72eaa8bed6a3cfa04ff54..028f68d54bef9ce669f91934e588dc299212f757 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC2.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SCT_ServMatFactoryDC2.h" @@ -38,7 +38,7 @@ SCT_ServMatFactoryDC2::SCT_ServMatFactoryDC2(StoreGateSvc *detStore,ServiceHandle<IRDBAccessSvc>& pRDBAccess) : m_detStore(detStore), m_rdbAccess(pRDBAccess), - m_materialManager(0), + m_materialManager(nullptr), m_msg("SCT_ServMatFactoryDC2") { @@ -233,7 +233,7 @@ const GeoShape* SCT_ServMatFactoryDC2::createShape(int volType, { const double epsilon = 0.001*Gaudi::Units::mm; enum VOLTYPE{Tube=1, Cone, ICone}; - const GeoShape* IDShape = 0; + const GeoShape* IDShape = nullptr; if(volType == Tube) { IDShape = new GeoTube(rmin1,rmax1,halflength); } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx index fdc442e624a547a2ea8a5b22caed6a3f4d3fb079..d17bed30c612b305a3a4ef17067d5dd5f6004c21 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SCT_ServMatFactoryDC3.h" @@ -226,7 +226,7 @@ const GeoShape* SCT_ServMatFactoryDC3::createShape(int volType, { const double epsilon = 0.001*Gaudi::Units::mm; enum VOLTYPE{Tube=1, Cone, ICone}; - const GeoShape* IDShape = 0; + const GeoShape* IDShape = nullptr; if(volType == Tube) { IDShape = new GeoTube(rmin1,rmax1,halflength); } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryFS.cxx index 60af3962afa92c78494f2a1b2c82acee0eaacdc8..ddb94c498e9ed1065ee263a97c6a02d593e70de3 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SCT_ServMatFactoryFS.h" @@ -103,12 +103,12 @@ void SCT_ServMatFactoryFS::create(GeoPhysVol *motherP,GeoPhysVol *motherM) double volumeCut = 0; - const GeoTubs* tubeUp = 0; // - const GeoTubs* tubeDown = 0; // Turn some booleans into single placements. - const GeoTube* tube = 0; // Shapes for such placements - const GeoCons* cons = 0; // + const GeoTubs* tubeUp = nullptr; // + const GeoTubs* tubeDown = nullptr; // Turn some booleans into single placements. + const GeoTube* tube = nullptr; // Shapes for such placements + const GeoCons* cons = nullptr; // - const GeoPcon* servicePcon = 0; // helper shape + const GeoPcon* servicePcon = nullptr; // helper shape const GeoShape* serviceTube = serviceTubeTmp; if( tubeHelper.volData().maxRadius() > minRofGap && tubeHelper.volData().phiStart() < phiWid/2.) { @@ -149,7 +149,7 @@ void SCT_ServMatFactoryFS::create(GeoPhysVol *motherP,GeoPhysVol *motherM) // Here we have SctHSP pcon // Break it into 4 individual placements: 1 tube, 1 cone and 2 tubs servicePcon = dynamic_cast<const GeoPcon*>(serviceTube); - if(servicePcon==0 || servicePcon->getNPlanes()!=3) continue; + if(servicePcon==nullptr || servicePcon->getNPlanes()!=3) continue; // Shape 1. Tube. Rmax = Rmin of the cutout tube = new GeoTube(servicePcon->getRMinPlane(0), @@ -175,7 +175,7 @@ void SCT_ServMatFactoryFS::create(GeoPhysVol *motherP,GeoPhysVol *motherM) std::string materialName = tubeHelper.materialName(); const GeoMaterial* material = m_materialManager->getMaterialForVolume(materialName, serviceTubeTmp->volume()-volumeCut); - if(tubeUp==0) { + if(tubeUp==nullptr) { const GeoLogVol* servLog = new GeoLogVol(logName,serviceTube,material); GeoVPhysVol* servPhys = new GeoPhysVol(servLog); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesLayer.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesLayer.cxx index 44d5f5c5a20fcd88eda69a286788605e0ebbdb36..e6a9488ab4aa2c93a5234e85923da9554b987b54 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesLayer.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesLayer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/ServicesLayer.h" @@ -14,7 +14,7 @@ ServicesLayer::ServicesLayer( double radius, double halfLength, int nStaves, int nModulesPerStave, int nChipsPerModule) : m_radius(radius), m_zPos(0.), m_rMin(0.), m_rMax(0.), m_halfLength(halfLength), m_nStaves(nStaves), m_type(type), m_part(part), m_number(num), - m_lastVolume(0), m_suffix(suffix), + m_lastVolume(nullptr), m_suffix(suffix), m_nModulesPerStave(nModulesPerStave), m_nChipsPerModule(nChipsPerModule) { if (part == DetType::Barrel) { @@ -33,7 +33,7 @@ ServicesLayer::ServicesLayer( double zpos, double rmin, double rmax, int nStaves int nModulesPerStave, int nChipsPerModule) : m_radius(0.), m_zPos(zpos), m_rMin(rmin), m_rMax(rmax), m_halfLength(0.), m_nStaves(nStaves), m_type(type), m_part(part), m_number(num), - m_lastVolume(0), m_suffix(suffix), + m_lastVolume(nullptr), m_suffix(suffix), m_nModulesPerStave(nModulesPerStave), m_nChipsPerModule(nChipsPerModule) { if (part == DetType::Endcap) { diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx index 9bc3c8c479001c5898df9b391a7944bc77ab91c1..7b8a115be8ced10e2f48afbcb79aa59014ba73a5 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/ServicesTracker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/ServicesTracker.h" @@ -18,7 +18,7 @@ using namespace std; ServicesTracker::ServicesTracker(const Athena::MsgStreamMember& msg): - m_geoMgr(0), + m_geoMgr(nullptr), m_msg(msg) { m_barrelLayers.clear(); @@ -133,7 +133,7 @@ void ServicesTracker::addEosMaterial( const ServiceVolume& vol, std::vector<Serv ServiceMaterial::Entry eos( name, layer->nStaves(), 0); ServiceMaterial::EntryContainer entries( 1, eos); - result.push_back( ServiceMaterial( name, entries)); + result.emplace_back( name, entries); // msg(MSG::INFO) << "Added EOS material to volume " << vol.name() << endmsg; } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx index be17c5463e9709c08f7118379e55710cb2d0e1c4..d76e029cb370804aa026074a049b2e2f5683e659 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SquirrelCageFactory.h" @@ -60,7 +60,7 @@ void SquirrelCageFactory::create(GeoPhysVol *mother) // Get table version // This is a work around to allow running with older DB releases. std::string sqversionStr = rdbAccessSvc()->getChildTag("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node()); - size_t pos = sqversionStr.find("-"); + size_t pos = sqversionStr.find('-'); int sqversion = 0; if (pos != std::string::npos && pos+1 != sqversionStr.size()) { std::istringstream tmpStr(sqversionStr.substr(pos+1)); @@ -356,7 +356,7 @@ void SquirrelCageFactory::create(GeoPhysVol *mother) // Get table version // This is a work around to allow running with older DB releases. std::string sqversionStr = rdbAccessSvc()->getChildTag("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node()); - size_t pos = sqversionStr.find("-"); + size_t pos = sqversionStr.find('-'); int sqversion = 0; if (pos != std::string::npos && pos+1 != sqversionStr.size()) { std::istringstream tmpStr(sqversionStr.substr(pos+1)); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactoryFS.cxx index 823f69cd0762607fc012720b8340751b5d6cfad5..c592c0cb900381a5ca1ea53299cd3df38734f589 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SquirrelCageFactoryFS.h" @@ -26,12 +26,14 @@ #include "GaudiKernel/SystemOfUnits.h" #include <iostream> +#include <utility> + SquirrelCageFactoryFS::SquirrelCageFactoryFS(StoreGateSvc *detStore, ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("SquirrelCageFactoryFS") { @@ -61,7 +63,7 @@ void SquirrelCageFactoryFS::create(GeoPhysVol *motherP, GeoPhysVol *motherM) // Get table version // This is a work around to allow running with older DB releases. std::string sqversionStr = m_rdbAccess->getChildTag("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node()); - size_t pos = sqversionStr.find("-"); + size_t pos = sqversionStr.find('-'); int sqversion = 0; if (pos != std::string::npos && pos+1 != sqversionStr.size()) { std::istringstream tmpStr(sqversionStr.substr(pos+1)); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx index 0f7536d4d92735b05104e7e2499a9100d864b58e..eec1ebc28d97471f02f043eb1f345ae9106cf833 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SupportRailFactory.h" @@ -28,8 +28,8 @@ #include "CxxUtils/checker_macros.h" +#include <cmath> #include <iostream> -#include <math.h> SupportRailFactory::SupportRailFactory(InDetDD::AthenaComps * athenaComps, diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactoryFS.cxx index 7011b20cb5566ccaabbb19d6b3b8457e1632fcb1..d6f50a9b2ffa1d81841cf164a900fcdbd00e8dba 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/SupportRailFactoryFS.h" @@ -27,13 +27,15 @@ #include "GaudiKernel/SystemOfUnits.h" #include <iostream> -#include <math.h> +#include <utility> + +#include <cmath> SupportRailFactoryFS::SupportRailFactoryFS(StoreGateSvc *detStore, ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("SupportRailFactoryFS") { @@ -138,7 +140,7 @@ void SupportRailFactoryFS::create(GeoPhysVol *motherP,GeoPhysVol *motherM) GeoVPhysVol* supportPhys = new GeoPhysVol(supportLog); - GeoTransform* pos = 0; + GeoTransform* pos = nullptr; // // Barrel steel rails // diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC2.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC2.cxx index 2cd5c03876ac9f47b28cdd37ce5cbaab9f8abdde..a06ce96d3ae69d29fe7e1ac2438ced8b1a4a7b64 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC2.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/TRT_ServMatFactoryDC2.h" @@ -30,11 +30,13 @@ #define TRTELEMENTSINEL 9 #include <sstream> +#include <utility> + TRT_ServMatFactoryDC2::TRT_ServMatFactoryDC2(StoreGateSvc *detStore,ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), - m_materialManager(0), + m_rdbAccess(std::move(pRDBAccess)), + m_materialManager(nullptr), m_msg("ServMatFactoryDC2") { @@ -167,7 +169,7 @@ const GeoShape* TRT_ServMatFactoryDC2::createShape(int volType, { const double epsilon = 0.001*Gaudi::Units::mm; enum VOLTYPE{Tube=1, Cone, ICone}; - const GeoShape* IDShape = 0; + const GeoShape* IDShape = nullptr; if(volType == Tube) { IDShape = new GeoTube(rmin1,rmax1,halflength); } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx index 84ddec23e6874fc80c39ac5727d2f74f92431372..b01d4e2ebb0768cd2590b1a1230236a0cebf7fc1 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/TRT_ServMatFactoryDC3.h" @@ -91,7 +91,7 @@ void TRT_ServMatFactoryDC3::create(GeoPhysVol *mother) std::ostringstream o; o << ii; std::string logName = "TrtPanel"+o.str(); - const GeoShape* serviceTube = 0; + const GeoShape* serviceTube = nullptr; if ( fabs(rmax) < minRofGap ){ serviceTube = new GeoTube(fabs(rmin),fabs(rmax),halflength); }else{ @@ -164,7 +164,7 @@ void TRT_ServMatFactoryDC3::create(GeoPhysVol *mother) // will eventually define all the materials. double fractionRL = (*inel)[ii]->getFloat("MATER"); std::string trtMaterialName = (*inel)[ii]->getString("RADL"); - const GeoMaterial* cylMat = 0; + const GeoMaterial* cylMat = nullptr; // if( trtMaterialName != "std::Carbon"){ @@ -211,7 +211,7 @@ void TRT_ServMatFactoryDC3::create(GeoPhysVol *mother) { const double epsilon = 0.001*Gaudi::Units::mm; enum VOLTYPE{Tube=1, Cone, ICone}; - const GeoShape* IDShape = 0; + const GeoShape* IDShape = nullptr; if(volType == Tube) { IDShape = new GeoTube(rmin1,rmax1,halflength); } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryFS.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryFS.cxx index ff2905579814a84b5713663c589f9b141004ba3b..a3afe3377abc2b46fe3f828a73a666a91d2862a0 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryFS.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryFS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "InDetServMatGeoModel/TRT_ServMatFactoryFS.h" @@ -28,12 +28,14 @@ #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/SystemOfUnits.h" -#include <sstream> #include <iostream> +#include <sstream> +#include <utility> + TRT_ServMatFactoryFS::TRT_ServMatFactoryFS(StoreGateSvc *detStore,ServiceHandle<IRDBAccessSvc> pRDBAccess) : m_detStore(detStore), - m_rdbAccess(pRDBAccess), + m_rdbAccess(std::move(pRDBAccess)), m_msg("TRT_ServMatFactoryFS") { @@ -111,10 +113,10 @@ void TRT_ServMatFactoryFS::create(GeoPhysVol *motherP, GeoPhysVol *motherM) logName = "Trt" + logName; const GeoTube* serviceTube = dynamic_cast<const GeoTube*>(serviceTubeTmp); - if(serviceTube==0) continue; + if(serviceTube==nullptr) continue; - const GeoTubs* tubeUp = 0; - const GeoTubs* tubeDown = 0; + const GeoTubs* tubeUp = nullptr; + const GeoTubs* tubeDown = nullptr; if (tubeHelper.name() == "FwdServ") { tubeUp = new GeoTubs(serviceTube->getRMin(),serviceTube->getRMax(),serviceTube->getZHalfLength(),phiWidSQ*0.5,M_PI-phiWidSQ); @@ -125,7 +127,7 @@ void TRT_ServMatFactoryFS::create(GeoPhysVol *motherP, GeoPhysVol *motherM) tubeDown = new GeoTubs(serviceTube->getRMin(),serviceTube->getRMax(),serviceTube->getZHalfLength(),M_PI+phiWid*0.5,M_PI-phiWid); } - if(tubeUp==0) continue; + if(tubeUp==nullptr) continue; std::string materialName = tubeHelper.materialName(); //const GeoMaterial* material = m_materialManager->getMaterialForVolume(materialName, serviceTube->volume()); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx index 4d3fd1e31c444c03cd127073cc9103f8d813e896..6f7f4f65646a718bee18a7f507c6cbe5c82b682e 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -30,7 +30,7 @@ InDet::BeamPipeBuilder::BeamPipeBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_beamPipeFromDb(true), - m_beamPipeMgr(0), + m_beamPipeMgr(nullptr), m_beamPipeMgrName("BeamPipe"), m_beamPipeEnvelope(1.*Gaudi::Units::mm), m_beamPipeOffsetX(0.*Gaudi::Units::mm), @@ -113,7 +113,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindri beamPipeTopVolume->getX().translation().y(), beamPipeTopVolume->getX().translation().z()); const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol(); - const GeoTube* beamPipeTube = 0; + const GeoTube* beamPipeTube = nullptr; if (beamPipeLogVolume){ // get the geoShape and translate Trk::GeoShapeConverter geoShaper; @@ -125,7 +125,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindri if(beamPipeTopVolume->getNameOfChildVol(i)=="SectionC03"){ PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i); const GeoLogVol* childLogVolume = childTopVolume->getLogVol(); - const GeoTube* childTube = 0; + const GeoTube* childTube = nullptr; if (childLogVolume){ childTube = dynamic_cast<const GeoTube*>(childLogVolume->getShape()); @@ -163,7 +163,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindri m_beamPipeRho); // binned layer material for the beam pipe possible - Trk::LayerMaterialProperties* beamPipeLayerMaterial=0; + Trk::LayerMaterialProperties* beamPipeLayerMaterial=nullptr; if ( m_beamPipeBinsZ == 1) beamPipeLayerMaterial = new Trk::HomogeneousLayerMaterial(beamPipeMaterial, 1.0); else { diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx index f12714475323156a23af2e6d94665c5f48cfc2ba..4f0c3846ab72e38d8d3ca773bd885b7014604809 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -30,7 +30,7 @@ InDet::BeamPipeBuilderCond::BeamPipeBuilderCond(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_beamPipeFromDb(true), - m_beamPipeMgr(0), + m_beamPipeMgr(nullptr), m_beamPipeMgrName("BeamPipe"), m_beamPipeEnvelope(1.*Gaudi::Units::mm), m_beamPipeOffsetX(0.*Gaudi::Units::mm), @@ -114,7 +114,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >*> InDet: beamPipeTopVolume->getX().translation().y(), beamPipeTopVolume->getX().translation().z()); const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol(); - const GeoTube* beamPipeTube = 0; + const GeoTube* beamPipeTube = nullptr; if (beamPipeLogVolume){ // get the geoShape and translate Trk::GeoShapeConverter geoShaper; @@ -126,7 +126,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >*> InDet: if(beamPipeTopVolume->getNameOfChildVol(i)=="SectionC03"){ PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i); const GeoLogVol* childLogVolume = childTopVolume->getLogVol(); - const GeoTube* childTube = 0; + const GeoTube* childTube = nullptr; if (childLogVolume){ childTube = dynamic_cast<const GeoTube*>(childLogVolume->getShape()); @@ -164,7 +164,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >*> InDet: m_beamPipeRho); // binned layer material for the beam pipe possible - Trk::LayerMaterialProperties* beamPipeLayerMaterial=0; + Trk::LayerMaterialProperties* beamPipeLayerMaterial=nullptr; if ( m_beamPipeBinsZ == 1) beamPipeLayerMaterial = new Trk::HomogeneousLayerMaterial(beamPipeMaterial, 1.0); else { diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/DiscOverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/DiscOverlapDescriptor.cxx index 785414b07a0c2af3a88259f31860957dd5508957..1f4f21918e4646884d42e0dd1a1e12efb41d6fa5 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/DiscOverlapDescriptor.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/DiscOverlapDescriptor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -52,7 +52,7 @@ bool InDet::DiscOverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceInt const InDetDD::SiDetectorElement* pElement = dynamic_cast<const InDetDD::SiDetectorElement*>(tsf.associatedDetectorElement()); // first add the target surface - surfaces.push_back(Trk::SurfaceIntersection(Trk::Intersection(pos, 0., true),&tsf)); + surfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf); int etaModule = m_sctIdHelper.load()->eta_module(tsf.associatedDetectorElementIdentifier()); // return empty cell vector @@ -77,16 +77,16 @@ bool InDet::DiscOverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceInt // 3 -> If it is smaller than the number of rings (i.e. the surface doen't belong to the outermost ring), // look for the surfaces in the ring with bigger eta value (it returns 2 or 3 surfaces)// - if (m_bin_array && m_singleBinUtils->size() != 0){ + if (m_bin_array && !m_singleBinUtils->empty()){ - const Trk::Surface* samePhi_PrevEta = NULL; - const Trk::Surface* samePhi_NextEta = NULL; + const Trk::Surface* samePhi_PrevEta = nullptr; + const Trk::Surface* samePhi_NextEta = nullptr; - const Trk::Surface* previousPhi_PrevEta = NULL; - const Trk::Surface* nextPhi_PrevEta = NULL; + const Trk::Surface* previousPhi_PrevEta = nullptr; + const Trk::Surface* nextPhi_PrevEta = nullptr; - const Trk::Surface* previousPhi_NextEta = NULL; - const Trk::Surface* nextPhi_NextEta = NULL; + const Trk::Surface* previousPhi_NextEta = nullptr; + const Trk::Surface* nextPhi_NextEta = nullptr; unsigned int Util = m_singleBinUtils->size() - 1 - etaModule; diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx index 8b643ebd56747fbdd8e3b44caa67b2fcd65521dc..a0bbb16d186b5c30a31afcab2eaf9633c8471138 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ bool InDet::PixelOverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceIn { // first add the target surface - it's always worth - cSurfaces.push_back(Trk::SurfaceIntersection(Trk::Intersection(pos, 0., true),&tsf)); + cSurfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf); // make sure the return vector is cleared @@ -50,7 +50,7 @@ bool InDet::PixelOverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceIn double positionPhi = pos.phi() + M_PI; // 8-cell-connectivity depending on track/surface geometry // nPhi - can be jump + or - - const InDetDD::SiDetectorElement* nElement = 0; + const InDetDD::SiDetectorElement* nElement = nullptr; // robust mode --> return 9 surfaces if (m_robustMode) { addNextInPhi(sElement,cSurfaces); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx index 26f66afbe71619d92322eeb8d0be21b1f4549daf..2bd6f588ca394a4aaed13ed812cd2f761c8a366c 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////// @@ -139,7 +139,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome //////////////////////////////////////////////////////////////////////////////////////////////////////// // The Overall Geometry - Trk::TrackingGeometry* trackingGeometry = 0; + Trk::TrackingGeometry* trackingGeometry = nullptr; // retrieve all the layers and sort them unsigned int numLayBuilders = m_layerBuilders.size(); @@ -185,11 +185,11 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome const std::vector<const Trk::CylinderLayer*>* cylinderLayers = m_layerBuilders[ilb]->cylindricalLayers(); // (a) std::vector<const Trk::Layer*> cylinderVolumeLayers; - if (cylinderLayers && cylinderLayers->size()){ + if (cylinderLayers && !cylinderLayers->empty()){ // screen output ATH_MSG_DEBUG( " Processing CylinderLayers : " ); // the ones to be filled into the double-vector - for (auto& cylIter : *cylinderLayers){ + for (const auto & cylIter : *cylinderLayers){ // get the CylinderBounds const Trk::CylinderBounds& cylBounds = (cylIter)->surfaceRepresentation().bounds(); double currentR = cylBounds.r(); @@ -234,10 +234,10 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome const std::vector<const Trk::DiscLayer*>* discLayers = m_layerBuilders[ilb]->discLayers(); std::vector<const Trk::Layer*> discVolumeLayersNeg; std::vector<const Trk::Layer*> discVolumeLayersPos; - if (discLayers && discLayers->size()){ + if (discLayers && !discLayers->empty()){ // screen output ATH_MSG_DEBUG( " Processing DiscLayers : " ); - for (auto& discIter : *discLayers){ + for (const auto & discIter : *discLayers){ // get the DiscBounds const Trk::DiscBounds* discBounds = dynamic_cast<const Trk::DiscBounds*> (&(discIter->surfaceRepresentation().bounds())); @@ -327,21 +327,21 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome // -------------------------------------------------------------------------------------------------- // first the beampipe volume - Trk::TrackingVolume* beamPipeVolume = 0; + Trk::TrackingVolume* beamPipeVolume = nullptr; // the Volume Bounds Trk::CylinderVolumeBounds* beamPipeBounds = new Trk::CylinderVolumeBounds(overallRmin,overallExtendZ); // BinnedArray needed - Trk::BinnedArray<Trk::Layer>* beamPipeLayerArray = 0; + Trk::BinnedArray<Trk::Layer>* beamPipeLayerArray = nullptr; const std::vector<const Trk::CylinderLayer*>* beamPipeVec = m_beamPipeBuilder->cylindricalLayers(); - if (beamPipeVec->size()) + if (!beamPipeVec->empty()) beamPipeLayerArray = m_layerArrayCreator->cylinderLayerArray(*beamPipeVec,0.,beamPipeBounds->outerRadius(),Trk::arbitrary); delete beamPipeVec; // create the TrackingVolume - beamPipeVolume = new Trk::TrackingVolume(0, + beamPipeVolume = new Trk::TrackingVolume(nullptr, beamPipeBounds, *m_materialProperties, beamPipeLayerArray, - 0, + nullptr, "InDet::BeamPipe"); // set the color code beamPipeVolume->registerColorCode(46); @@ -382,8 +382,8 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome ATH_MSG_DEBUG( " + color code : " << colorCode ); // maxmmal z extend for volume set & endcap inner z - double currentSetExtendZ = ( (*pndlIter).size() || (*ppdlIter).size() ) ? discMaxZ[ilb] : cylinderExtendsInZ[ilb]; - double currentEndcapInnerZ = ( (*pndlIter).size() || (*ppdlIter).size() ) ? discMinZ[ilb] : currentSetExtendZ; + double currentSetExtendZ = ( !(*pndlIter).empty() || !(*ppdlIter).empty() ) ? discMaxZ[ilb] : cylinderExtendsInZ[ilb]; + double currentEndcapInnerZ = ( !(*pndlIter).empty() || !(*ppdlIter).empty() ) ? discMinZ[ilb] : currentSetExtendZ; // radii for the sectors double currentCentralOuterR = 0.; @@ -412,7 +412,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome // 1 - radial packing, volumes can't be put in in central / ec sectors // 2 - only central sector exists // 3 - standard ecn / central / ecp sectors split - bool endcapsExist = (*pndlIter).size() && (*ppdlIter).size() ; + bool endcapsExist = !(*pndlIter).empty() && !(*ppdlIter).empty() ; // case flag set PackCase caseFlag = (currentSetExtendZ < centralExtendZ && endcapsExist) ? contained : split; if (currentSetExtendZ > centralExtendZ && currentEndcapInnerZ < centralExtendZ && endcapsExist) caseFlag = radial; @@ -460,7 +460,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome // build the name std::string volumeBase = m_namespace+"Detectors::"+baseName; // cylinder layers exist ------------------------------- - if ((*pclIter).size()){ + if (!(*pclIter).empty()){ ATH_MSG_VERBOSE( " -> central sector is being build." ); // create the cylinder barrel @@ -480,7 +480,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome } // negative disc layers exist ------------------------------ - if ((*pndlIter).size()){ + if (!(*pndlIter).empty()){ ATH_MSG_VERBOSE( " -> negative endcap is being build." ); // create the cylinder barrel @@ -499,7 +499,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome negativeSectorVolumes.push_back(negEndcap); } // positive disc layers exist -------------------------------- - if ((*ppdlIter).size()){ + if (!(*ppdlIter).empty()){ ATH_MSG_VERBOSE( " -> positive endcap is being build." ); // create the cylinder barrel @@ -542,7 +542,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome overallRmax, enclosingVolumeRadius, -overallExtendZ, overallExtendZ, 1, true, - m_namespace+"Gaps::CentralEnclosure") : 0; + m_namespace+"Gaps::CentralEnclosure") : nullptr; // push the detector container into the ID volumes idVolumes.push_back(detectorContainer); @@ -560,7 +560,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome m_replaceJointBoundaries); // if packing is needed ------------------------------------------------------------------ - const Trk::TrackingVolume* highestIdVolume = 0; + const Trk::TrackingVolume* highestIdVolume = nullptr; if (enclose){ // negative positions @@ -569,7 +569,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome posIter != negDiscPositionZ.end(); ++posIter) (*posIter) *= -1; - const Trk::TrackingVolume* negativeEnclosure = negDiscPositionZ.size() ? + const Trk::TrackingVolume* negativeEnclosure = !negDiscPositionZ.empty() ? m_trackingVolumeCreator->createGapTrackingVolume(*m_materialProperties, 0., enclosingVolumeRadius, -enclosingVolumeHalfZ, -overallExtendZ, @@ -581,7 +581,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome 1, false, m_namespace+"Gaps::NegativeEnclosure"); - const Trk::TrackingVolume* positiveEnclosure = m_enclosingDiscPositionZ.size() ? + const Trk::TrackingVolume* positiveEnclosure = !m_enclosingDiscPositionZ.empty() ? m_trackingVolumeCreator->createGapTrackingVolume(*m_materialProperties, 0., enclosingVolumeRadius, overallExtendZ, enclosingVolumeHalfZ, @@ -720,14 +720,14 @@ const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilder::packVolumeTripl volumeBase+"::NegativeSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (negVolSize ? negVolumes[0] : 0); + (negVolSize ? negVolumes[0] : nullptr); const Trk::TrackingVolume* centralVolume = (cenVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(centralVolumes, *m_materialProperties, volumeBase+"::CentralSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (cenVolSize ? centralVolumes[0] : 0) ; + (cenVolSize ? centralVolumes[0] : nullptr) ; const Trk::TrackingVolume* positiveVolume = ( posVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(posVolumes, @@ -735,7 +735,7 @@ const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilder::packVolumeTripl volumeBase+"::PositiveSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (posVolSize ? posVolumes[0] : 0); + (posVolSize ? posVolumes[0] : nullptr); if (!negativeVolume && !positiveVolume){ ATH_MSG_DEBUG( "No negative/positive sector given - no packing needed, returning central container!" ); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx index b4857202b0bc363d21f27c2c27aa3289ce7f599f..19cc4698af3267ee1ab2184711a0b543c425002a 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////// @@ -140,7 +140,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome //////////////////////////////////////////////////////////////////////////////////////////////////////// // The Overall Geometry - Trk::TrackingGeometry* trackingGeometry = 0; + Trk::TrackingGeometry* trackingGeometry = nullptr; // retrieve all the layers and sort them unsigned int numLayBuilders = m_layerBuilders.size(); @@ -187,15 +187,15 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome ATH_MSG_DEBUG( "[ LayerBuilder : '" << m_layerBuilders[ilb]->identification() << "' ] being processed. " ); // (a) cylinder std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> cylinderLayersPair = m_layerBuilders[ilb]->cylindricalLayers(ctx); - auto cylinderLayers = cylinderLayersPair.second; + const auto *cylinderLayers = cylinderLayersPair.second; // (a) std::vector<const Trk::Layer*> cylinderVolumeLayers; - if (cylinderLayers && cylinderLayers->size()){ + if (cylinderLayers && !cylinderLayers->empty()){ range=EventIDRange::intersect(range,cylinderLayersPair.first); // screen output ATH_MSG_DEBUG( " Processing CylinderLayers : " ); // the ones to be filled into the double-vector - for (auto& cylIter : *cylinderLayers){ + for (const auto & cylIter : *cylinderLayers){ // get the CylinderBounds const Trk::CylinderBounds& cylBounds = (cylIter)->surfaceRepresentation().bounds(); double currentR = cylBounds.r(); @@ -238,14 +238,14 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome // (b) discs std::pair<EventIDRange, const std::vector<const Trk::DiscLayer*>*> discLayersPair = m_layerBuilders[ilb]->discLayers(ctx); - auto discLayers = discLayersPair.second; + const auto *discLayers = discLayersPair.second; std::vector<const Trk::Layer*> discVolumeLayersNeg; std::vector<const Trk::Layer*> discVolumeLayersPos; - if (discLayers && discLayers->size()){ + if (discLayers && !discLayers->empty()){ range=EventIDRange::intersect(range,discLayersPair.first); // screen output ATH_MSG_DEBUG( " Processing DiscLayers : " ); - for (auto& discIter : *discLayers){ + for (const auto & discIter : *discLayers){ // get the DiscBounds const Trk::DiscBounds* discBounds = dynamic_cast<const Trk::DiscBounds*> (&(discIter->surfaceRepresentation().bounds())); @@ -335,24 +335,24 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome // -------------------------------------------------------------------------------------------------- // first the beampipe volume - Trk::TrackingVolume* beamPipeVolume = 0; + Trk::TrackingVolume* beamPipeVolume = nullptr; // the Volume Bounds Trk::CylinderVolumeBounds* beamPipeBounds = new Trk::CylinderVolumeBounds(overallRmin,overallExtendZ); // BinnedArray needed - Trk::BinnedArray<Trk::Layer>* beamPipeLayerArray = 0; + Trk::BinnedArray<Trk::Layer>* beamPipeLayerArray = nullptr; std::pair<EventIDRange,const std::vector<const Trk::CylinderLayer*>*> beamPipeVecPair = m_beamPipeBuilder->cylindricalLayers(ctx); - auto beamPipeVec = beamPipeVecPair.second; - if (beamPipeVec->size()){ + const auto *beamPipeVec = beamPipeVecPair.second; + if (!beamPipeVec->empty()){ range=EventIDRange::intersect(range,beamPipeVecPair.first); beamPipeLayerArray = m_layerArrayCreator->cylinderLayerArray(*beamPipeVec,0.,beamPipeBounds->outerRadius(),Trk::arbitrary); } delete beamPipeVec; // create the TrackingVolume - beamPipeVolume = new Trk::TrackingVolume(0, + beamPipeVolume = new Trk::TrackingVolume(nullptr, beamPipeBounds, *m_materialProperties, beamPipeLayerArray, - 0, + nullptr, "InDet::BeamPipe"); // set the color code beamPipeVolume->registerColorCode(46); @@ -393,8 +393,8 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome ATH_MSG_DEBUG( " + color code : " << colorCode ); // maxmmal z extend for volume set & endcap inner z - double currentSetExtendZ = ( (*pndlIter).size() || (*ppdlIter).size() ) ? discMaxZ[ilb] : cylinderExtendsInZ[ilb]; - double currentEndcapInnerZ = ( (*pndlIter).size() || (*ppdlIter).size() ) ? discMinZ[ilb] : currentSetExtendZ; + double currentSetExtendZ = ( !(*pndlIter).empty() || !(*ppdlIter).empty() ) ? discMaxZ[ilb] : cylinderExtendsInZ[ilb]; + double currentEndcapInnerZ = ( !(*pndlIter).empty() || !(*ppdlIter).empty() ) ? discMinZ[ilb] : currentSetExtendZ; // radii for the sectors double currentCentralOuterR = 0.; @@ -423,7 +423,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome // 1 - radial packing, volumes can't be put in in central / ec sectors // 2 - only central sector exists // 3 - standard ecn / central / ecp sectors split - bool endcapsExist = (*pndlIter).size() && (*ppdlIter).size() ; + bool endcapsExist = !(*pndlIter).empty() && !(*ppdlIter).empty() ; // case flag set PackCase caseFlag = (currentSetExtendZ < centralExtendZ && endcapsExist) ? contained : split; if (currentSetExtendZ > centralExtendZ && currentEndcapInnerZ < centralExtendZ && endcapsExist) caseFlag = radial; @@ -471,7 +471,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome // build the name std::string volumeBase = m_namespace+"Detectors::"+baseName; // cylinder layers exist ------------------------------- - if ((*pclIter).size()){ + if (!(*pclIter).empty()){ ATH_MSG_VERBOSE( " -> central sector is being build." ); // create the cylinder barrel @@ -491,7 +491,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome } // negative disc layers exist ------------------------------ - if ((*pndlIter).size()){ + if (!(*pndlIter).empty()){ ATH_MSG_VERBOSE( " -> negative endcap is being build." ); // create the cylinder barrel @@ -510,7 +510,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome negativeSectorVolumes.push_back(negEndcap); } // positive disc layers exist -------------------------------- - if ((*ppdlIter).size()){ + if (!(*ppdlIter).empty()){ ATH_MSG_VERBOSE( " -> positive endcap is being build." ); // create the cylinder barrel @@ -553,7 +553,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome overallRmax, enclosingVolumeRadius, -overallExtendZ, overallExtendZ, 1, true, - m_namespace+"Gaps::CentralEnclosure") : 0; + m_namespace+"Gaps::CentralEnclosure") : nullptr; // push the detector container into the ID volumes idVolumes.push_back(detectorContainer); @@ -571,7 +571,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome m_replaceJointBoundaries); // if packing is needed ------------------------------------------------------------------ - const Trk::TrackingVolume* highestIdVolume = 0; + const Trk::TrackingVolume* highestIdVolume = nullptr; if (enclose){ // negative positions @@ -580,7 +580,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome posIter != negDiscPositionZ.end(); ++posIter) (*posIter) *= -1; - const Trk::TrackingVolume* negativeEnclosure = negDiscPositionZ.size() ? + const Trk::TrackingVolume* negativeEnclosure = !negDiscPositionZ.empty() ? m_trackingVolumeCreator->createGapTrackingVolume(*m_materialProperties, 0., enclosingVolumeRadius, -enclosingVolumeHalfZ, -overallExtendZ, @@ -592,7 +592,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome 1, false, m_namespace+"Gaps::NegativeEnclosure"); - const Trk::TrackingVolume* positiveEnclosure = m_enclosingDiscPositionZ.size() ? + const Trk::TrackingVolume* positiveEnclosure = !m_enclosingDiscPositionZ.empty() ? m_trackingVolumeCreator->createGapTrackingVolume(*m_materialProperties, 0., enclosingVolumeRadius, overallExtendZ, enclosingVolumeHalfZ, @@ -732,14 +732,14 @@ const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilderCond::packVolumeT volumeBase+"::NegativeSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (negVolSize ? negVolumes[0] : 0); + (negVolSize ? negVolumes[0] : nullptr); const Trk::TrackingVolume* centralVolume = (cenVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(centralVolumes, *m_materialProperties, volumeBase+"::CentralSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (cenVolSize ? centralVolumes[0] : 0) ; + (cenVolSize ? centralVolumes[0] : nullptr) ; const Trk::TrackingVolume* positiveVolume = ( posVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(posVolumes, @@ -747,7 +747,7 @@ const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilderCond::packVolumeT volumeBase+"::PositiveSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (posVolSize ? posVolumes[0] : 0); + (posVolSize ? posVolumes[0] : nullptr); if (!negativeVolume && !positiveVolume){ ATH_MSG_DEBUG( "No negative/positive sector given - no packing needed, returning central container!" ); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx index 35e24d55fcbffc9059a13b14c81a0d576d87a8cd..8b1116730d68cc914ce4afa91db93040fac4637b 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -35,7 +35,7 @@ bool InDet::SCT_OverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceInt cSurfaces.reserve(newCapacity); // first add the target surface and the backside surface (in the if statement) - cSurfaces.push_back(Trk::SurfaceIntersection(Trk::Intersection(pos,0.,true),&tsf)); + cSurfaces.emplace_back(Trk::Intersection(pos,0.,true),&tsf); // make sure the return vector is cleared const InDetDD::SiDetectorElement* sElement = dynamic_cast<const InDetDD::SiDetectorElement*>(tsf.associatedDetectorElement()); @@ -50,7 +50,7 @@ bool InDet::SCT_OverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceInt // 8-cell-connectivity depending on track/surface geometry // nPhi - can be jump + or - - const InDetDD::SiDetectorElement* nElement = 0; + const InDetDD::SiDetectorElement* nElement = nullptr; // robust mode --> return 9 (*2) surfaces if (m_robustMode) { diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx index ef70dd63c6f859d3f155ecffb152856ae7ea6571..8fc38d989b4c5590eeecf9ef242c092289548e97 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -52,10 +52,10 @@ double InDet::SiLayerBuilder::s_splitRadius = 0.; InDet::SiLayerBuilder::SiLayerBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_pixelCase(true), - m_siMgr(0), + m_siMgr(nullptr), m_siMgrLocation("Pixel"), - m_pixIdHelper(0), - m_sctIdHelper(0), + m_pixIdHelper(nullptr), + m_sctIdHelper(nullptr), m_setLayerAssociation(true), m_barrelLayerBinsZ(100), m_barrelLayerBinsPhi(1), @@ -112,7 +112,7 @@ StatusCode InDet::SiLayerBuilder::initialize() ATH_MSG_DEBUG( "initialize()" ); // get Pixel Detector Description Manager if (m_pixelCase){ - const InDetDD::PixelDetectorManager* pixMgr = 0; + const InDetDD::PixelDetectorManager* pixMgr = nullptr; if ((detStore()->retrieve(pixMgr, m_siMgrLocation)).isFailure()) { ATH_MSG_ERROR( "Could not get PixelDetectorManager '" << m_siMgrLocation << "', no layers for Pixel Detector will be built. " ); } else { @@ -123,7 +123,7 @@ StatusCode InDet::SiLayerBuilder::initialize() ATH_MSG_ERROR("Could not get Pixel ID helper"); } } else { - const InDetDD::SCT_DetectorManager* sctMgr = 0; + const InDetDD::SCT_DetectorManager* sctMgr = nullptr; if ((detStore()->retrieve(sctMgr, m_siMgrLocation)).isFailure()) { ATH_MSG_ERROR( "Could not get SCT_DetectorManager '" << m_siMgrLocation << "', no layers for SCT Detector will be built. " ); } else { @@ -150,7 +150,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric { // split mode 2nd part return the already built layers - if (m_splitMode && s_splitCylinderLayers.size() ){ + if (m_splitMode && !s_splitCylinderLayers.empty() ){ ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitCylinderLayers.size() << " cylinder layers." ); ATH_MSG_VERBOSE( " Split radius was set to " << s_splitRadius ); std::vector<const Trk::CylinderLayer*>* splitCylinderLayers = dressCylinderLayers(s_splitCylinderLayers); @@ -164,7 +164,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric // sanity check for ID Helper if (!m_pixIdHelper && !m_sctIdHelper){ ATH_MSG_ERROR("Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up."); - return 0; + return nullptr; } // take the numerlogoy @@ -179,7 +179,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric // screen output ATH_MSG_DEBUG( "Configured to build " << barrelLayers << " (active) barrel layers (out of " << siNumerology.numLayers() << " )" ); - if (m_barrelAdditionalLayerR.size()) + if (!m_barrelAdditionalLayerR.empty()) ATH_MSG_DEBUG( "Additionally " << m_barrelAdditionalLayerR.size() << " material layers will be built."); // split mode for SLHC setup @@ -316,7 +316,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric // construct detection layers for (auto& layerRadiusIter : layerRadius) { - Trk::CylinderLayer* activeLayer = 0; + Trk::CylinderLayer* activeLayer = nullptr; double currentLayerRadius = 10e10; bool splitDone = false; // non-equidistant binning used ? auto-detection @@ -438,7 +438,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric ATH_MSG_DEBUG( " -> With Thickness : " << currentLayerThickness << " - includes envelope tolerance : " << m_barrelEnvelope ); ATH_MSG_DEBUG( " -> With Zmin/Zmax : " << -currentLayerExtend << " / " << currentLayerExtend ); - if ( nonEquidistantBinning && layerZboundaries[layerCounter].size() ){ + if ( nonEquidistantBinning && !layerZboundaries[layerCounter].empty() ){ // overrule the min bin - with the min radius // do the output to screen double currentZ = -currentLayerExtend; @@ -452,7 +452,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric msg(MSG::DEBUG) << endmsg; } // prepare the right overlap descriptor - Trk::OverlapDescriptor* olDescriptor = 0; + Trk::OverlapDescriptor* olDescriptor = nullptr; if (m_pixelCase) olDescriptor = new InDet::PixelOverlapDescriptor; else olDescriptor = new InDet::SCT_OverlapDescriptor; @@ -510,7 +510,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() { // split mode 2nd - if (m_splitMode && s_splitDiscLayers.size() ){ + if (m_splitMode && !s_splitDiscLayers.empty() ){ ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitDiscLayers.size() << " disc layers." ); std::vector<const Trk::DiscLayer*>* splitDiscs = new std::vector<const Trk::DiscLayer*>(s_splitDiscLayers); s_splitDiscLayers.clear(); @@ -519,7 +519,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() // sanity check for ID Helper if (!m_pixIdHelper && !m_sctIdHelper){ ATH_MSG_ERROR("Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up."); - return 0; + return nullptr; } // check for DBMS @@ -588,13 +588,13 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st // initialize for checks (pos/neg discs -> 2 times discs) for (unsigned int endcap=0; endcap<2*endcapLayers; endcap++){ - discPhiMin.push_back(std::vector<double>()); - discPhiMax.push_back(std::vector<double>()); - discPhiSectors.push_back(std::vector<int>()); - discSurfaces.push_back( std::vector<Trk::SurfaceOrderPosition>() ); + discPhiMin.emplace_back(); + discPhiMax.emplace_back(); + discPhiSectors.emplace_back(); + discSurfaces.emplace_back( ); // auto-detection - discRingMinR.push_back(std::vector<double>()); - discRingMaxR.push_back(std::vector<double>()); + discRingMinR.emplace_back(); + discRingMaxR.emplace_back(); } // end of for loop int endcapModules = 0; @@ -643,7 +643,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st takeBigger( discRmax[currentlayer],currentRmax); //fill the number of phi sectors for the different rings - if (!discPhiSectors[currentlayer].size()){ + if (discPhiSectors[currentlayer].empty()){ ATH_MSG_VERBOSE("Pre-processing Elements from Disk/Layer (id from idHelper): " << currentdisk << "/" << currentlayer ); // prepare the ring bins, initialise the first one to be something big discPhiMin[currentlayer] = std::vector<double>(diskRings,100.); @@ -754,7 +754,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st ATH_MSG_DEBUG( " --> " << irings << " R sector has " << discPhiSectors[discCounter][irings] << " phi sectors. " ); // prepare the binned array, it can be with one to several rings - Trk::BinnedArray<Trk::Surface>* currentBinnedArray = 0; + Trk::BinnedArray<Trk::Surface>* currentBinnedArray = nullptr; std::vector<Trk::BinUtility*>* singleBinUtils = new std::vector<Trk::BinUtility*>; bool weOwnSingleBinUtils{true}; if (discRsectors==1){ @@ -790,7 +790,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st } else { ATH_MSG_VERBOSE("Constructing a two-dimensional BinnedArray."); // get the binning in R first (can still be improved with non-aequidistant binning) - Trk::BinUtility* currentSteerBinUtility = 0; + Trk::BinUtility* currentSteerBinUtility = nullptr; if (m_endcapComplexRingBinning && discRsectors > 1 ){ // respecting the actual element boundaires ATH_MSG_VERBOSE("Non-equidistant binning detected."); @@ -850,7 +850,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st const std::vector<const Trk::Surface*>& arraySurfaces = currentBinnedArray->arrayObjects(); size_t dsumCheckSurfaces = 0; double lastPhi = 0.; - for (auto& asurfIter : arraySurfaces){ + for (const auto & asurfIter : arraySurfaces){ if ( asurfIter ) { ++dsumCheckSurfaces; usmIter = uniqueSurfaceMap.find(asurfIter); @@ -879,7 +879,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st Trk::DiscBounds* activeLayerBounds = new Trk::DiscBounds(rMin,rMax); // prepare the right overlap descriptor - Trk::OverlapDescriptor* olDescriptor = 0; + Trk::OverlapDescriptor* olDescriptor = nullptr; if (m_pixelCase) olDescriptor = new InDet::PixelOverlapDescriptor; //else olDescriptor = new InDet::SCT_OverlapDescriptor; @@ -951,7 +951,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st std::sort(sortIter, sortEnd, zSorter); // if there are additional layers to be built - never build for the DBM loop - if (m_endcapAdditionalLayerPosZ.size() && !isDBM){ + if (!m_endcapAdditionalLayerPosZ.empty() && !isDBM){ // sort also the additional layer z positions auto addLayerIter = m_endcapAdditionalLayerPosZ.begin(); auto addLayerIterEnd = m_endcapAdditionalLayerPosZ.end(); @@ -983,7 +983,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st double rMin = layerZposition > 0. ? layerRmin : lastRmin; double rMax = layerZposition > 0. ? layerRmax : lastRmax; // the passive layer - Trk::DiscLayer* passiveLayer = 0; + Trk::DiscLayer* passiveLayer = nullptr; // passive layer creation Amg::Transform3D* passiveDiscTransf = new Amg::Transform3D; (*passiveDiscTransf) = Amg::Translation3D(0.,0.,*addLayerIter); @@ -998,7 +998,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st // cleanup of the layer material -------------------------------------------------------------- delete passiveLayerMaterial; } else - passiveLayer = new Trk::DiscLayer(passiveDiscTransf, new Trk::DiscBounds(rMin,rMax), 0); + passiveLayer = new Trk::DiscLayer(passiveDiscTransf, new Trk::DiscBounds(rMin,rMax), nullptr); ATH_MSG_DEBUG( " -> At Z - Position : " << *addLayerIter ); ATH_MSG_DEBUG( " -> With Rmin/Rmax (corr) : " << rMin << " / " << rMax ); @@ -1031,7 +1031,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLa std::vector< const Trk::CylinderLayer* >* cylinderLayers = new std::vector< const Trk::CylinderLayer* >; // --------------------------- start of additional layer construction loop ------------------------------- // for the additional layer - if (m_barrelAdditionalLayerR.size()){ + if (!m_barrelAdditionalLayerR.empty()){ auto cylLayerIter = detectionLayers.begin(); auto cylLayerIterEnd = detectionLayers.end(); auto addLayerIter = m_barrelAdditionalLayerR.begin(); @@ -1041,7 +1041,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLa double cylLayerExtend = 0; for ( ; addLayerIter != addLayerIterEnd && addLayerTypeIter != addLayerTypeIterEnd; ) { // build the passive layer if it is smaller the current cylLayerIter - or if it is the last one - if ( m_splitMode && s_splitCylinderLayers.size() ){ + if ( m_splitMode && !s_splitCylinderLayers.empty() ){ ATH_MSG_DEBUG("Called in split mode with split radius = " << s_splitRadius ); ATH_MSG_DEBUG("[- X -] Skipping additional layer " ); ATH_MSG_DEBUG( " -> With Radius : " << *addLayerIter ); @@ -1059,13 +1059,13 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLa cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend), *passiveLayerMaterial, 1.*Gaudi::Units::mm, - 0,0)); + nullptr,0)); // cleanup of the layer material -------------------------------------------------------------- delete passiveLayerMaterial; } else { ATH_MSG_DEBUG("[- N -] Building an additional NavigationLayer for volume dimension control"); // create the passive layer - cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend),0)); + cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend),nullptr)); } ATH_MSG_DEBUG( " -> With Radius : " << *addLayerIter ); // increase the additional layer radii @@ -1078,7 +1078,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLa ++cylLayerIter; } } else - for (auto& cylLayerIter : detectionLayers ) { + for (const auto & cylLayerIter : detectionLayers ) { ATH_MSG_DEBUG("[- D -] Registering detection CylinderLayer"); ATH_MSG_DEBUG( " -> With Radius : " << cylLayerIter->bounds().r() ); cylinderLayers->push_back(cylLayerIter); @@ -1088,7 +1088,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLa const Trk::LayerMaterialProperties* InDet::SiLayerBuilder::barrelLayerMaterial(double r, double hz) const { - Trk::LayerMaterialProperties* layerMaterial = 0; + Trk::LayerMaterialProperties* layerMaterial = nullptr; // --------------- material estimation ---------------------------------------------------------------- // -- material with 1D binning Trk::BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -hz, hz, Trk::open, Trk::binZ); @@ -1108,7 +1108,7 @@ const Trk::LayerMaterialProperties* InDet::SiLayerBuilder::barrelLayerMaterial(d const Trk::LayerMaterialProperties* InDet::SiLayerBuilder::endcapLayerMaterial(double rMin, double rMax) const { - Trk::LayerMaterialProperties* layerMaterial = 0; + Trk::LayerMaterialProperties* layerMaterial = nullptr; // --------------- material estimation ---------------------------------------------------------------- Trk::BinUtility layerBinUtilityR(m_endcapLayerBinsR,rMin,rMax,Trk::open, Trk::binR); @@ -1138,8 +1138,8 @@ void InDet::SiLayerBuilder::registerSurfacesToLayer(const std::vector<const Trk: const InDetDD::SiDetectorElement* detElement = dynamic_cast<const InDetDD::SiDetectorElement*>((*laySurfIter)->associatedDetectorElement()); // register the backise if necessary --------------------------------------------------- - const InDetDD::SiDetectorElement* otherSideElement = detElement ? detElement->otherSide() : 0; - const Trk::Surface* otherSideSurface = otherSideElement ? &(otherSideElement->surface()) : 0; + const InDetDD::SiDetectorElement* otherSideElement = detElement ? detElement->otherSide() : nullptr; + const Trk::Surface* otherSideSurface = otherSideElement ? &(otherSideElement->surface()) : nullptr; if (otherSideSurface) Trk::ILayerBuilder::associateLayer(lay, *otherSideSurface); } } diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx index c338cee92450824e6933072ae0880681735c1dc4..69edd0eb3dea224dd180fc2e1633dfba1f59613a 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -53,10 +53,10 @@ double InDet::SiLayerBuilderCond::s_splitRadius = 0.; InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_pixelCase(true), - m_siMgr(0), + m_siMgr(nullptr), m_siMgrLocation("Pixel"), - m_pixIdHelper(0), - m_sctIdHelper(0), + m_pixIdHelper(nullptr), + m_sctIdHelper(nullptr), m_setLayerAssociation(true), m_barrelLayerBinsZ(100), m_barrelLayerBinsPhi(1), @@ -113,7 +113,7 @@ StatusCode InDet::SiLayerBuilderCond::initialize() ATH_MSG_DEBUG( "initialize()" ); // get Pixel Detector Description Manager if (m_pixelCase){ - const InDetDD::PixelDetectorManager* pixMgr = 0; + const InDetDD::PixelDetectorManager* pixMgr = nullptr; if ((detStore()->retrieve(pixMgr, m_siMgrLocation)).isFailure()) { ATH_MSG_ERROR( "Could not get PixelDetectorManager '" << m_siMgrLocation << "', no layers for Pixel Detector will be built. " ); } else { @@ -125,7 +125,7 @@ StatusCode InDet::SiLayerBuilderCond::initialize() } ATH_CHECK(m_PixelReadKey.initialize()); } else { - const InDetDD::SCT_DetectorManager* sctMgr = 0; + const InDetDD::SCT_DetectorManager* sctMgr = nullptr; if ((detStore()->retrieve(sctMgr, m_siMgrLocation)).isFailure()) { ATH_MSG_ERROR( "Could not get SCT_DetectorManager '" << m_siMgrLocation << "', no layers for SCT Detector will be built. " ); } else { @@ -173,7 +173,7 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si { // split mode 2nd part return the already built layers - if (m_splitMode && s_splitCylinderLayers.size() ){ + if (m_splitMode && !s_splitCylinderLayers.empty() ){ ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitCylinderLayers.size() << " cylinder layers." ); ATH_MSG_VERBOSE( " Split radius was set to " << s_splitRadius ); std::vector<const Trk::CylinderLayer*>* splitCylinderLayers = dressCylinderLayers(s_splitCylinderLayers); @@ -205,7 +205,7 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si // screen output ATH_MSG_DEBUG( "Configured to build " << barrelLayers << " (active) barrel layers (out of " << siNumerology.numLayers() << " )" ); - if (m_barrelAdditionalLayerR.size()) + if (!m_barrelAdditionalLayerR.empty()) ATH_MSG_DEBUG( "Additionally " << m_barrelAdditionalLayerR.size() << " material layers will be built."); // split mode for SLHC setup @@ -348,7 +348,7 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si // construct detection layers for (auto& layerRadiusIter : layerRadius) { - Trk::CylinderLayer* activeLayer = 0; + Trk::CylinderLayer* activeLayer = nullptr; double currentLayerRadius = 10e10; bool splitDone = false; // non-equidistant binning used ? auto-detection @@ -470,7 +470,7 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si ATH_MSG_DEBUG( " -> With Thickness : " << currentLayerThickness << " - includes envelope tolerance : " << m_barrelEnvelope ); ATH_MSG_DEBUG( " -> With Zmin/Zmax : " << -currentLayerExtend << " / " << currentLayerExtend ); - if ( nonEquidistantBinning && layerZboundaries[layerCounter].size() ){ + if ( nonEquidistantBinning && !layerZboundaries[layerCounter].empty() ){ // overrule the min bin - with the min radius // do the output to screen double currentZ = -currentLayerExtend; @@ -484,7 +484,7 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si msg(MSG::DEBUG) << endmsg; } // prepare the right overlap descriptor - Trk::OverlapDescriptor* olDescriptor = 0; + Trk::OverlapDescriptor* olDescriptor = nullptr; if (m_pixelCase) olDescriptor = new InDet::PixelOverlapDescriptor; else olDescriptor = new InDet::SCT_OverlapDescriptor; @@ -547,7 +547,7 @@ std::pair<EventIDRange, const std::vector<const Trk::DiscLayer*>*> InDet::SiLaye // TODO: remove s_splitDiscLayers cache to make threadsafe. ignored for now as is only for ITk // split mode 2nd - if (m_splitMode && s_splitDiscLayers.size() ){ + if (m_splitMode && !s_splitDiscLayers.empty() ){ ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitDiscLayers.size() << " disc layers." ); std::vector<const Trk::DiscLayer*>* splitDiscs = new std::vector<const Trk::DiscLayer*>(s_splitDiscLayers); s_splitDiscLayers.clear(); @@ -580,7 +580,7 @@ std::pair<EventIDRange, const std::vector<const Trk::DiscLayer*>*> InDet::SiLaye std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBuilderCond::createDiscLayers(const EventContext& ctx, std::vector<const Trk::DiscLayer*>* dLayers) const { // this is the DBM flag - bool isDBM = (dLayers!=NULL); + bool isDBM = (dLayers!=nullptr); // get general layout SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> readHandle = retrieveSiDetElements(ctx); @@ -633,13 +633,13 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu // initialize for checks (pos/neg discs -> 2 times discs) for (unsigned int endcap=0; endcap<2*endcapLayers; endcap++){ - discPhiMin.push_back(std::vector<double>()); - discPhiMax.push_back(std::vector<double>()); - discPhiSectors.push_back(std::vector<int>()); - discSurfaces.push_back( std::vector<Trk::SurfaceOrderPosition>() ); + discPhiMin.emplace_back(); + discPhiMax.emplace_back(); + discPhiSectors.emplace_back(); + discSurfaces.emplace_back( ); // auto-detection - discRingMinR.push_back(std::vector<double>()); - discRingMaxR.push_back(std::vector<double>()); + discRingMinR.emplace_back(); + discRingMaxR.emplace_back(); } // end of for loop int endcapModules = 0; @@ -688,7 +688,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu takeBigger( discRmax[currentlayer],currentRmax); //fill the number of phi sectors for the different rings - if (!discPhiSectors[currentlayer].size()){ + if (discPhiSectors[currentlayer].empty()){ ATH_MSG_VERBOSE("Pre-processing Elements from Disk/Layer (id from idHelper): " << currentdisk << "/" << currentlayer ); // prepare the ring bins, initialise the first one to be something big discPhiMin[currentlayer] = std::vector<double>(diskRings,100.); @@ -799,7 +799,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu ATH_MSG_DEBUG( " --> " << irings << " R sector has " << discPhiSectors[discCounter][irings] << " phi sectors. " ); // prepare the binned array, it can be with one to several rings - Trk::BinnedArray<Trk::Surface>* currentBinnedArray = 0; + Trk::BinnedArray<Trk::Surface>* currentBinnedArray = nullptr; std::vector<Trk::BinUtility*>* singleBinUtils = new std::vector<Trk::BinUtility*>; bool weOwnSingleBinUtils{true}; if (discRsectors==1){ @@ -835,7 +835,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu } else { ATH_MSG_VERBOSE("Constructing a two-dimensional BinnedArray."); // get the binning in R first (can still be improved with non-aequidistant binning) - Trk::BinUtility* currentSteerBinUtility = 0; + Trk::BinUtility* currentSteerBinUtility = nullptr; if (m_endcapComplexRingBinning && discRsectors > 1 ){ // respecting the actual element boundaires ATH_MSG_VERBOSE("Non-equidistant binning detected."); @@ -895,7 +895,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu const std::vector<const Trk::Surface*>& arraySurfaces = currentBinnedArray->arrayObjects(); size_t dsumCheckSurfaces = 0; double lastPhi = 0.; - for (auto& asurfIter : arraySurfaces){ + for (const auto & asurfIter : arraySurfaces){ if ( asurfIter ) { ++dsumCheckSurfaces; usmIter = uniqueSurfaceMap.find(asurfIter); @@ -924,7 +924,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu Trk::DiscBounds* activeLayerBounds = new Trk::DiscBounds(rMin,rMax); // prepare the right overlap descriptor - Trk::OverlapDescriptor* olDescriptor = 0; + Trk::OverlapDescriptor* olDescriptor = nullptr; if (m_pixelCase) olDescriptor = new InDet::PixelOverlapDescriptor; //else olDescriptor = new InDet::SCT_OverlapDescriptor; @@ -998,7 +998,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu std::sort(sortIter, sortEnd, zSorter); // if there are additional layers to be built - never build for the DBM loop - if (m_endcapAdditionalLayerPosZ.size() && !isDBM){ + if (!m_endcapAdditionalLayerPosZ.empty() && !isDBM){ // sort also the additional layer z positions auto addLayerIter = m_endcapAdditionalLayerPosZ.begin(); auto addLayerIterEnd = m_endcapAdditionalLayerPosZ.end(); @@ -1030,7 +1030,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu double rMin = layerZposition > 0. ? layerRmin : lastRmin; double rMax = layerZposition > 0. ? layerRmax : lastRmax; // the passive layer - Trk::DiscLayer* passiveLayer = 0; + Trk::DiscLayer* passiveLayer = nullptr; // passive layer creation Amg::Transform3D* passiveDiscTransf = new Amg::Transform3D; (*passiveDiscTransf) = Amg::Translation3D(0.,0.,*addLayerIter); @@ -1043,7 +1043,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu *passiveLayerMaterial, 1.*Gaudi::Units::mm); } else - passiveLayer = new Trk::DiscLayer(passiveDiscTransf, new Trk::DiscBounds(rMin,rMax), 0); + passiveLayer = new Trk::DiscLayer(passiveDiscTransf, new Trk::DiscBounds(rMin,rMax), nullptr); ATH_MSG_DEBUG( " -> At Z - Position : " << *addLayerIter ); ATH_MSG_DEBUG( " -> With Rmin/Rmax (corr) : " << rMin << " / " << rMax ); @@ -1072,7 +1072,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind std::vector< const Trk::CylinderLayer* >* cylinderLayers = new std::vector< const Trk::CylinderLayer* >; // --------------------------- start of additional layer construction loop ------------------------------- // for the additional layer - if (m_barrelAdditionalLayerR.size()){ + if (!m_barrelAdditionalLayerR.empty()){ auto cylLayerIter = detectionLayers.begin(); auto cylLayerIterEnd = detectionLayers.end(); auto addLayerIter = m_barrelAdditionalLayerR.begin(); @@ -1082,7 +1082,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind double cylLayerExtend = 0; for ( ; addLayerIter != addLayerIterEnd && addLayerTypeIter != addLayerTypeIterEnd; ) { // build the passive layer if it is smaller the current cylLayerIter - or if it is the last one - if ( m_splitMode && s_splitCylinderLayers.size() ){ + if ( m_splitMode && !s_splitCylinderLayers.empty() ){ ATH_MSG_DEBUG("Called in split mode with split radius = " << s_splitRadius ); ATH_MSG_DEBUG("[- X -] Skipping additional layer " ); ATH_MSG_DEBUG( " -> With Radius : " << *addLayerIter ); @@ -1100,13 +1100,13 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend), *passiveLayerMaterial, 1.*Gaudi::Units::mm, - 0,0)); + nullptr,0)); // cleanup of the layer material -------------------------------------------------------------- delete passiveLayerMaterial; } else { ATH_MSG_DEBUG("[- N -] Building an additional NavigationLayer for volume dimension control"); // create the passive layer - cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend),0)); + cylinderLayers->push_back(new Trk::CylinderLayer(new Trk::CylinderBounds(*addLayerIter,cylLayerExtend),nullptr)); } ATH_MSG_DEBUG( " -> With Radius : " << *addLayerIter ); // increase the additional layer radii @@ -1119,7 +1119,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind ++cylLayerIter; } } else - for (auto& cylLayerIter : detectionLayers ) { + for (const auto & cylLayerIter : detectionLayers ) { ATH_MSG_DEBUG("[- D -] Registering detection CylinderLayer"); ATH_MSG_DEBUG( " -> With Radius : " << cylLayerIter->bounds().r() ); cylinderLayers->push_back(cylLayerIter); @@ -1129,7 +1129,7 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind const Trk::LayerMaterialProperties* InDet::SiLayerBuilderCond::barrelLayerMaterial(double r, double hz) const { - Trk::LayerMaterialProperties* layerMaterial = 0; + Trk::LayerMaterialProperties* layerMaterial = nullptr; // --------------- material estimation ---------------------------------------------------------------- // -- material with 1D binning Trk::BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -hz, hz, Trk::open, Trk::binZ); @@ -1149,7 +1149,7 @@ const Trk::LayerMaterialProperties* InDet::SiLayerBuilderCond::barrelLayerMateri const Trk::LayerMaterialProperties* InDet::SiLayerBuilderCond::endcapLayerMaterial(double rMin, double rMax) const { - Trk::LayerMaterialProperties* layerMaterial = 0; + Trk::LayerMaterialProperties* layerMaterial = nullptr; // --------------- material estimation ---------------------------------------------------------------- Trk::BinUtility layerBinUtilityR(m_endcapLayerBinsR,rMin,rMax,Trk::open, Trk::binR); @@ -1179,8 +1179,8 @@ void InDet::SiLayerBuilderCond::registerSurfacesToLayer(const std::vector<const const InDetDD::SiDetectorElement* detElement = dynamic_cast<const InDetDD::SiDetectorElement*>((*laySurfIter)->associatedDetectorElement()); // register the backise if necessary --------------------------------------------------- - const InDetDD::SiDetectorElement* otherSideElement = detElement ? detElement->otherSide() : 0; - const Trk::Surface* otherSideSurface = otherSideElement ? &(otherSideElement->surface()) : 0; + const InDetDD::SiDetectorElement* otherSideElement = detElement ? detElement->otherSide() : nullptr; + const Trk::Surface* otherSideSurface = otherSideElement ? &(otherSideElement->surface()) : nullptr; if (otherSideSurface) Trk::ILayerBuilderCond::associateLayer(lay, *otherSideSurface); } } diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx index 4a975bc65e5061e639cc9b9cfb594abfa9d1e9c2..fc54f8798b151a9d023fc50c9f5792a58937a3a2 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////// @@ -131,7 +131,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome //////////////////////////////////////////////////////////////////////////////////////////////////////// // The Overall Geometry - Trk::TrackingGeometry* trackingGeometry = 0; + Trk::TrackingGeometry* trackingGeometry = nullptr; // get the dimensions from the envelope service const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary(); @@ -145,7 +145,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome double maximumLayerExtendZ = 0.; double maximumLayerRadius = 0.; std::vector<InDet::LayerSetup> layerSetups; - for ( auto& lProvider : m_layerProviders){ + for ( const auto & lProvider : m_layerProviders){ // screen output ATH_MSG_DEBUG( "[ LayerBuilder : '" << lProvider->identification() << "' ] being processed. " ); // retrieve the layers @@ -195,7 +195,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome // now check what is in the cache // [a] nothing in the cache or new setup is compatible (in this case sectorZ are updated in all setups) - if (!layerSetupCache.size() || setupFitsCache(lSetup,layerSetupCache) ){ + if (layerSetupCache.empty() || setupFitsCache(lSetup,layerSetupCache) ){ ATH_MSG_VERBOSE(" -> cache is empty or new sector fits cache setup - add this one to the cache."); } else { // [b] cache is not empty - let's see what is going on: @@ -214,7 +214,7 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome } // check if the cache is empty - if (layerSetupCache.size()){ + if (!layerSetupCache.empty()){ ATH_MSG_DEBUG( "[ STEP 3 ] : Flush the remaining cache into the ID detector volume vector." ); // set the maximum radius to the last layer radius double flushRadius = 0.5*(maximumLayerRadius + envelopeVolumeRadius); @@ -385,7 +385,7 @@ InDet::LayerSetup InDet::StagedTrackingGeometryBuilder::estimateLayerSetup(const return InDet::LayerSetup(idName, m_colorCodesConfig[ilS], negLayers, cenLayers, posLayers, cenMinR, cenMaxR, cenMaxZ, m_layerBinningTypeCenter[ilS], - posLayers.size(), posMinR, posMaxR, posMinZ, posMaxZ, m_layerBinningTypeEndcap[ilS]); + !posLayers.empty(), posMinR, posMaxR, posMinZ, posMaxZ, m_layerBinningTypeEndcap[ilS]); } @@ -394,7 +394,7 @@ void InDet::StagedTrackingGeometryBuilder::estimateLayerDimensions(const std::ve double& rMin, double& rMax, double& zMin, double& zMax) const { // parse through the layers and estimate - for (auto& layer : layers){ + for (const auto & layer : layers){ // the thickness of the layer needs to be taken into account double thickness = layer->thickness(); // get the center @@ -475,7 +475,7 @@ bool InDet::StagedTrackingGeometryBuilder::setupFitsCache(LayerSetup& layerSetup bool InDet::StagedTrackingGeometryBuilder::ringLayout(const std::vector<const Trk::Layer*>& layers, std::vector<double>& rmins, std::vector<double>& rmaxs) const { // get the maximum extent in z ATH_MSG_INFO("Checking for Ring layout ... "); - for (auto& ring : layers){ + for (const auto & ring : layers){ // Surface const Trk::Surface& ringSurface = ring->surfaceRepresentation(); const Trk::DiscBounds* ringBounds = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds())); @@ -514,7 +514,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createTrackingV // now sort the necessary layers --- for the sub volumes std::vector< std::vector< const Trk::Layer*> > groupedDiscs(ringRmins.size(), std::vector< const Trk::Layer*>() ); // second loop over the rings - for (auto& ring : layers){ + for (const auto & ring : layers){ // Surface const Trk::Surface& ringSurface = ring->surfaceRepresentation(); const Trk::DiscBounds* ringBounds = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds())); @@ -577,7 +577,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createFlushVolu (std::vector<InDet::LayerSetup>& layerSetupCache, double innerRadius, double& outerRadius, double extendZ) const { // the return volume - const Trk::TrackingVolume* flushVolume = 0; + const Trk::TrackingVolume* flushVolume = nullptr; // if (layerSetupCache.size() == 1 ){ ATH_MSG_VERBOSE(" -> single sector setup - synchronising from inner (" << innerRadius << ") to outer (" << outerRadius << ") radius."); @@ -675,14 +675,14 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl volumeBase+"::NegativeSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (negVolSize ? negVolumes[0] : 0); + (negVolSize ? negVolumes[0] : nullptr); const Trk::TrackingVolume* centralVolume = (cenVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(centralVolumes, *m_materialProperties, volumeBase+"::CentralSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (cenVolSize ? centralVolumes[0] : 0) ; + (cenVolSize ? centralVolumes[0] : nullptr) ; const Trk::TrackingVolume* positiveVolume = ( posVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(posVolumes, @@ -690,7 +690,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl volumeBase+"::PositiveSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (posVolSize ? posVolumes[0] : 0); + (posVolSize ? posVolumes[0] : nullptr); if (!negativeVolume && !positiveVolume){ ATH_MSG_DEBUG( "No negative/positive sector given - no packing needed, returning central container!" ); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx index f88833a8d419ee12c01a2e1598279f1659da37e6..a4f8825474f02c438d633895ece9f34e058dbe7b 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////// @@ -132,7 +132,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome //////////////////////////////////////////////////////////////////////////////////////////////////////// // The Overall Geometry - Trk::TrackingGeometry* trackingGeometry = 0; + Trk::TrackingGeometry* trackingGeometry = nullptr; // get the dimensions from the envelope service const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getInDetRZBoundary(); @@ -147,7 +147,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome double maximumLayerRadius = 0.; std::vector<InDet::LayerSetup> layerSetups; EventIDRange range; - for ( auto& lProvider : m_layerProviders){ + for ( const auto & lProvider : m_layerProviders){ // screen output ATH_MSG_DEBUG( "[ LayerBuilder : '" << lProvider->identification() << "' ] being processed. " ); // retrieve the layers @@ -198,7 +198,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome // now check what is in the cache // [a] nothing in the cache or new setup is compatible (in this case sectorZ are updated in all setups) - if (!layerSetupCache.size() || setupFitsCache(lSetup,layerSetupCache) ){ + if (layerSetupCache.empty() || setupFitsCache(lSetup,layerSetupCache) ){ ATH_MSG_VERBOSE(" -> cache is empty or new sector fits cache setup - add this one to the cache."); } else { // [b] cache is not empty - let's see what is going on: @@ -217,7 +217,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeome } // check if the cache is empty - if (layerSetupCache.size()){ + if (!layerSetupCache.empty()){ ATH_MSG_DEBUG( "[ STEP 3 ] : Flush the remaining cache into the ID detector volume vector." ); // set the maximum radius to the last layer radius double flushRadius = 0.5*(maximumLayerRadius + envelopeVolumeRadius); @@ -388,7 +388,7 @@ InDet::LayerSetup InDet::StagedTrackingGeometryBuilderCond::estimateLayerSetup(c return InDet::LayerSetup(idName, m_colorCodesConfig[ilS], negLayers, cenLayers, posLayers, cenMinR, cenMaxR, cenMaxZ, m_layerBinningTypeCenter[ilS], - posLayers.size(), posMinR, posMaxR, posMinZ, posMaxZ, m_layerBinningTypeEndcap[ilS]); + !posLayers.empty(), posMinR, posMaxR, posMinZ, posMaxZ, m_layerBinningTypeEndcap[ilS]); } @@ -397,7 +397,7 @@ void InDet::StagedTrackingGeometryBuilderCond::estimateLayerDimensions(const std double& rMin, double& rMax, double& zMin, double& zMax) const { // parse through the layers and estimate - for (auto& layer : layers){ + for (const auto & layer : layers){ // the thickness of the layer needs to be taken into account double thickness = layer->thickness(); // get the center @@ -478,7 +478,7 @@ bool InDet::StagedTrackingGeometryBuilderCond::setupFitsCache(LayerSetup& layerS bool InDet::StagedTrackingGeometryBuilderCond::ringLayout(const std::vector<const Trk::Layer*>& layers, std::vector<double>& rmins, std::vector<double>& rmaxs) const { // get the maximum extent in z ATH_MSG_INFO("Checking for Ring layout ... "); - for (auto& ring : layers){ + for (const auto & ring : layers){ // Surface const Trk::Surface& ringSurface = ring->surfaceRepresentation(); const Trk::DiscBounds* ringBounds = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds())); @@ -517,7 +517,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createTrack // now sort the necessary layers --- for the sub volumes std::vector< std::vector< const Trk::Layer*> > groupedDiscs(ringRmins.size(), std::vector< const Trk::Layer*>() ); // second loop over the rings - for (auto& ring : layers){ + for (const auto & ring : layers){ // Surface const Trk::Surface& ringSurface = ring->surfaceRepresentation(); const Trk::DiscBounds* ringBounds = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds())); @@ -580,7 +580,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createFlush (std::vector<InDet::LayerSetup>& layerSetupCache, double innerRadius, double& outerRadius, double extendZ) const { // the return volume - const Trk::TrackingVolume* flushVolume = 0; + const Trk::TrackingVolume* flushVolume = nullptr; // if (layerSetupCache.size() == 1 ){ ATH_MSG_VERBOSE(" -> single sector setup - synchronising from inner (" << innerRadius << ") to outer (" << outerRadius << ") radius."); @@ -678,14 +678,14 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::packVolumeT volumeBase+"::NegativeSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (negVolSize ? negVolumes[0] : 0); + (negVolSize ? negVolumes[0] : nullptr); const Trk::TrackingVolume* centralVolume = (cenVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(centralVolumes, *m_materialProperties, volumeBase+"::CentralSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (cenVolSize ? centralVolumes[0] : 0) ; + (cenVolSize ? centralVolumes[0] : nullptr) ; const Trk::TrackingVolume* positiveVolume = ( posVolSize > 1) ? m_trackingVolumeCreator->createContainerTrackingVolume(posVolumes, @@ -693,7 +693,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::packVolumeT volumeBase+"::PositiveSector", m_buildBoundaryLayers, m_replaceJointBoundaries) : - (posVolSize ? posVolumes[0] : 0); + (posVolSize ? posVolumes[0] : nullptr); if (!negativeVolume && !positiveVolume){ ATH_MSG_DEBUG( "No negative/positive sector given - no packing needed, returning central container!" ); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx index 50d448df154f77c52b969836c88dbad1d8992d38..07ae23ed749da1e5e7dc823aba24aa3bc83d468e 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ namespace { // constructor InDet::TRT_LayerBuilder::TRT_LayerBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_trtMgr(0), + m_trtMgr(nullptr), m_trtMgrLocation("TRT"), m_layerStrawRadius(2.0*Gaudi::Units::mm), m_layerThickness(0.1*Gaudi::Units::mm), @@ -136,7 +136,7 @@ StatusCode InDet::TRT_LayerBuilder::finalize() const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindricalLayers() const { - if (!m_trtMgr) return 0; + if (!m_trtMgr) return nullptr; ATH_MSG_DEBUG( "Building cylindrical layers for the TRT " ); @@ -146,10 +146,10 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr const InDetDD::TRT_Numerology* trtNums = m_trtMgr->getNumerology(); // get the TRT ID Helper - const TRT_ID* trtIdHelper = 0; + const TRT_ID* trtIdHelper = nullptr; if (detStore()->retrieve(trtIdHelper, "TRT_ID").isFailure()) { ATH_MSG_ERROR("Could not get TRT ID helper"); - return 0; + return nullptr; } int nBarrelRings = trtNums->getNBarrelRings(); @@ -204,7 +204,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr if (nTotalBarrelLayers==0) { ATH_MSG_WARNING( "nTotalBarrelLayers = 0 ... aborting and returning 0 !" ); - return 0; + return nullptr; } // calculate delta(R) steps and delta(R) @@ -213,7 +213,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr double layerHalflength = layerZmax; // prepare the material - if ( fabs(rDiff) <= 0.1 ) return 0; + if ( fabs(rDiff) <= 0.1 ) return nullptr; // ilay - for accessing the straw layers and for material decission int ilay = 0; @@ -235,7 +235,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr // create the layers for ( ; layerRadiusIter != layerRadiusIterEnd; ++layerRadiusIter ) { // ----- prepare the BinnedLayerMaterial ----------------------------------------------------- - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtility1DZ(m_barrelLayerBinsZ,-layerHalflength, layerHalflength, Trk::open, Trk::binZ); if (m_barrelLayerBinsPhi==1){ @@ -334,7 +334,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr aSurfaces->push_back(new Trk::PlaneSurface(new Amg::Transform3D(Amg::getTransformFromRotTransl(elementRotation, outerCenter)))); // now register it to for building the array - layerApproachSurfaces.push_back( std::pair< Trk::SharedObject<const Trk::ApproachSurfaces>, Amg::Vector3D >( Trk::SharedObject<const Trk::ApproachSurfaces>(aSurfaces),elementCenter)); + layerApproachSurfaces.emplace_back( Trk::SharedObject<const Trk::ApproachSurfaces>(aSurfaces),elementCenter); // screen output ATH_MSG_VERBOSE("---> Sector " << phisec << " - posneg - " << posneg << " - with central phi = " << elementSurface->center().phi() ); // sector phi centers @@ -362,7 +362,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr * now that SharedObject is a shared_ptr typeded do the same with empty deleter */ Trk::SharedObject<const Trk::Surface> sharedSurface(currentStraw, Trk::do_not_delete<const Trk::Surface>); - strawsPerPhiSecLayer.push_back(Trk::SurfaceOrderPosition(sharedSurface, strawOrderPos)); + strawsPerPhiSecLayer.emplace_back(sharedSurface, strawOrderPos); // and record ++sectorStraws; } // loop over straws done @@ -385,7 +385,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr Trk::BinnedArray2D<Trk::Surface>* layerStrawPhiSector = new Trk::BinnedArray2D<Trk::Surface>(strawsPerPhiSecLayer,layerStrawPhiZUtility); ATH_MSG_VERBOSE("---> Sector " << phisec << " - BinnedArray for straws prepared for " << strawsPerPhiSecLayer.size() << " straws."); // fill the array - layerSectorArrays.push_back(std::pair< Trk::BinnedArray<Trk::Surface>*, Amg::Vector3D >(layerStrawPhiSector, layerSectorPosition)); + layerSectorArrays.emplace_back(layerStrawPhiSector, layerSectorPosition); // ---------------- enf of phi sector ---------------------------------------------------- } // loop over PhiSectors done @@ -433,7 +433,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr // do not give every layer material properties if (assignMaterial) { // ----- prepare the BinnedLayerMaterial ----------------------------------------------------- - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -layerHalflength, layerHalflength, Trk::open, Trk::binZ ); if (m_barrelLayerBinsPhi==1){ @@ -479,10 +479,10 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( const InDetDD::TRT_Numerology* trtNums = m_trtMgr->getNumerology(); // get the TRT ID Helper - const TRT_ID* trtIdHelper = 0; + const TRT_ID* trtIdHelper = nullptr; if (detStore()->retrieve(trtIdHelper, "TRT_ID").isFailure()) { ATH_MSG_ERROR("Could not get TRT ID helper"); - return 0; + return nullptr; } unsigned int nEndcapWheels = trtNums->getNEndcapWheels(); unsigned int nEndcapPhiSectors = trtNums->getNEndcapPhi(); @@ -494,7 +494,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( double zMin = 10e10; double zMax = 0.; - const Trk::DiscBounds* sectorDiscBounds = 0; + const Trk::DiscBounds* sectorDiscBounds = nullptr; // preloop for overall numbers for (unsigned int iwheel=0; iwheel<nEndcapWheels; ++iwheel) @@ -516,19 +516,19 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( } if (numTotalLayers==0) { ATH_MSG_WARNING( "numTotalLayers = 0 ... aborting and returning 0 !" ); - return 0; + return nullptr; } - Trk::DiscBounds* fullDiscBounds = sectorDiscBounds ? new Trk::DiscBounds(sectorDiscBounds->rMin(), sectorDiscBounds->rMax()) : 0; + Trk::DiscBounds* fullDiscBounds = sectorDiscBounds ? new Trk::DiscBounds(sectorDiscBounds->rMin(), sectorDiscBounds->rMax()) : nullptr; if (!fullDiscBounds) { ATH_MSG_WARNING( "fullDiscBounds do not exist ... aborting and returning 0 !" ); - return 0; + return nullptr; } PtrVectorWrapper<Trk::DiscLayer> endcapLayers; // the BinUtility for the material - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtilityR(m_endcapLayerBinsR, fullDiscBounds->rMin(), @@ -646,7 +646,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( takeSmaller(zMin,zPos); takeBigger(zMax,zPos); Trk::SharedObject<const Trk::Surface> sharedSurface(currentStraw, [](const Trk::Surface*){}); - strawPerEndcapLayer.push_back(Trk::SurfaceOrderPosition(sharedSurface, strawOrderPos)); + strawPerEndcapLayer.emplace_back(sharedSurface, strawOrderPos); ++numberOfStraws; } } @@ -658,7 +658,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( } Trk::BinUtility* currentBinUtility = new Trk::BinUtility(numberOfStraws, -M_PI, M_PI, Trk::closed, Trk::binPhi); Trk::BinnedArray<Trk::Surface>* strawArray = new Trk::BinnedArray1D<Trk::Surface>(strawPerEndcapLayer, currentBinUtility); - Trk::DiscLayer* currentLayer = 0; + Trk::DiscLayer* currentLayer = nullptr; // redefine the discZ discZ = 0.5*(zMin+zMax); @@ -711,8 +711,8 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers( } // model/real geometry } // end of posneg loop - delete layerMaterial; layerMaterial = 0; - delete fullDiscBounds; fullDiscBounds = 0; + delete layerMaterial; layerMaterial = nullptr; + delete fullDiscBounds; fullDiscBounds = nullptr; return endcapLayers.release(); diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx index 832f106603ec294f960b5781a0396f1e0a221f5b..120a54d08cd1a08a929127f6b8ee2e900a77f34d 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ namespace { // constructor InDet::TRT_LayerBuilderCond::TRT_LayerBuilderCond(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), - m_trtMgr(0), + m_trtMgr(nullptr), m_trtMgrLocation("TRT"), m_layerStrawRadius(2.0*Gaudi::Units::mm), m_layerThickness(0.1*Gaudi::Units::mm), @@ -149,7 +149,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: const InDetDD::TRT_Numerology* trtNums = m_trtMgr->getNumerology(); // get the TRT ID Helper - const TRT_ID* trtIdHelper = 0; + const TRT_ID* trtIdHelper = nullptr; if (detStore()->retrieve(trtIdHelper, "TRT_ID").isFailure()) { ATH_MSG_ERROR("Could not get TRT ID helper"); return std::pair<EventIDRange,const std::vector<const Trk::CylinderLayer* >* >(range,nullptr); @@ -240,7 +240,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: // create the layers for ( ; layerRadiusIter != layerRadiusIterEnd; ++layerRadiusIter ) { // ----- prepare the BinnedLayerMaterial ----------------------------------------------------- - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtility1DZ(m_barrelLayerBinsZ,-layerHalflength, layerHalflength, Trk::open, Trk::binZ); if (m_barrelLayerBinsPhi==1){ @@ -339,7 +339,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: aSurfaces->push_back(new Trk::PlaneSurface(new Amg::Transform3D(Amg::getTransformFromRotTransl(elementRotation, outerCenter)))); // now register it to for building the array - layerApproachSurfaces.push_back( std::pair< Trk::SharedObject<const Trk::ApproachSurfaces>, Amg::Vector3D >( Trk::SharedObject<const Trk::ApproachSurfaces>(aSurfaces),elementCenter)); + layerApproachSurfaces.emplace_back( Trk::SharedObject<const Trk::ApproachSurfaces>(aSurfaces),elementCenter); // screen output ATH_MSG_VERBOSE("---> Sector " << phisec << " - posneg - " << posneg << " - with central phi = " << elementSurface->center().phi() ); // sector phi centers @@ -367,7 +367,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: * now that SharedObject is a shared_ptr typeded do the same with empty deleter */ Trk::SharedObject<const Trk::Surface> sharedSurface(currentStraw, Trk::do_not_delete<const Trk::Surface>); - strawsPerPhiSecLayer.push_back(Trk::SurfaceOrderPosition(sharedSurface, strawOrderPos)); + strawsPerPhiSecLayer.emplace_back(sharedSurface, strawOrderPos); // and record ++sectorStraws; } // loop over straws done @@ -392,7 +392,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: Trk::BinnedArray2D<Trk::Surface>* layerStrawPhiSector = new Trk::BinnedArray2D<Trk::Surface>(strawsPerPhiSecLayer,layerStrawPhiZUtility); ATH_MSG_VERBOSE("---> Sector " << phisec << " - BinnedArray for straws prepared for " << strawsPerPhiSecLayer.size() << " straws."); // fill the array - layerSectorArrays.push_back(std::pair< Trk::BinnedArray<Trk::Surface>*, Amg::Vector3D >(layerStrawPhiSector, layerSectorPosition)); + layerSectorArrays.emplace_back(layerStrawPhiSector, layerSectorPosition); // ---------------- enf of phi sector ---------------------------------------------------- } // loop over PhiSectors done @@ -444,7 +444,7 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet: // do not give every layer material properties if (assignMaterial) { // ----- prepare the BinnedLayerMaterial ----------------------------------------------------- - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -layerHalflength, layerHalflength, Trk::open, Trk::binZ ); if (m_barrelLayerBinsPhi==1){ @@ -492,7 +492,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT const InDetDD::TRT_Numerology* trtNums = m_trtMgr->getNumerology(); // get the TRT ID Helper - const TRT_ID* trtIdHelper = 0; + const TRT_ID* trtIdHelper = nullptr; if (detStore()->retrieve(trtIdHelper, "TRT_ID").isFailure()) { ATH_MSG_ERROR("Could not get TRT ID helper"); return std::pair<EventIDRange,const std::vector<const Trk::DiscLayer* >* >(range,nullptr); @@ -507,7 +507,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT double zMin = 10e10; double zMax = 0.; - const Trk::DiscBounds* sectorDiscBounds = 0; + const Trk::DiscBounds* sectorDiscBounds = nullptr; // preloop for overall numbers for (unsigned int iwheel=0; iwheel<nEndcapWheels; ++iwheel) @@ -532,7 +532,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT return std::pair<EventIDRange,const std::vector<const Trk::DiscLayer* >* >(range,nullptr); } - Trk::DiscBounds* fullDiscBounds = sectorDiscBounds ? new Trk::DiscBounds(sectorDiscBounds->rMin(), sectorDiscBounds->rMax()) : 0; + Trk::DiscBounds* fullDiscBounds = sectorDiscBounds ? new Trk::DiscBounds(sectorDiscBounds->rMin(), sectorDiscBounds->rMax()) : nullptr; if (!fullDiscBounds) { ATH_MSG_WARNING( "fullDiscBounds do not exist ... aborting and returning 0 !" ); return std::pair<EventIDRange,const std::vector<const Trk::DiscLayer* >* >(range,nullptr); @@ -541,7 +541,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT PtrVectorWrapper<Trk::DiscLayer> endcapLayers; // the BinUtility for the material - Trk::BinnedLayerMaterial* layerMaterial = 0; + Trk::BinnedLayerMaterial* layerMaterial = nullptr; // -- material with 1D binning Trk::BinUtility layerBinUtilityR(m_endcapLayerBinsR, fullDiscBounds->rMin(), @@ -659,7 +659,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT takeSmaller(zMin,zPos); takeBigger(zMax,zPos); Trk::SharedObject<const Trk::Surface> sharedSurface(currentStraw, [](const Trk::Surface*){}); - strawPerEndcapLayer.push_back(Trk::SurfaceOrderPosition(sharedSurface, strawOrderPos)); + strawPerEndcapLayer.emplace_back(sharedSurface, strawOrderPos); ++numberOfStraws; } } @@ -671,7 +671,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT } Trk::BinUtility* currentBinUtility = new Trk::BinUtility(numberOfStraws, -M_PI, M_PI, Trk::closed, Trk::binPhi); Trk::BinnedArray<Trk::Surface>* strawArray = new Trk::BinnedArray1D<Trk::Surface>(strawPerEndcapLayer, currentBinUtility); - Trk::DiscLayer* currentLayer = 0; + Trk::DiscLayer* currentLayer = nullptr; // redefine the discZ discZ = 0.5*(zMin+zMax); @@ -724,8 +724,8 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT } // model/real geometry } // end of posneg loop - delete layerMaterial; layerMaterial = 0; - delete fullDiscBounds; fullDiscBounds = 0; + delete layerMaterial; layerMaterial = nullptr; + delete fullDiscBounds; fullDiscBounds = nullptr; return std::make_pair(range,endcapLayers.release()); } diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_OverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_OverlapDescriptor.cxx index 843692feeb2ed90fd307315bd49e37614a21a5b1..de8f02a793cb2bb120211d8e3f161a78e74a993c 100755 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_OverlapDescriptor.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_OverlapDescriptor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ bool InDet::TRT_OverlapDescriptor::reachableSurfaces(std::vector<Trk::SurfaceInt if (strawInt != 0 && strawInt < strawMax && strawMax != -999){ // get the next straw Identifier nextID = m_trtIdHelper->straw_id(trtBaseElement->identify(), strawInt+nextInt); - const Trk::Surface* nextStraw = (strawInt > 1 && strawInt < strawMax) ? (&(trtBaseElement->surface(nextID))) : 0; + const Trk::Surface* nextStraw = (strawInt > 1 && strawInt < strawMax) ? (&(trtBaseElement->surface(nextID))) : nullptr; if (nextStraw) nextInt = checkAndFill(cSurfaces, *nextStraw, position, dir); } @@ -66,7 +66,7 @@ int InDet::TRT_OverlapDescriptor::checkAndFill(std::vector<Trk::SurfaceIntersect double d2 = (sDirection.cross((sfIntersection.position-sCenter))).squaredNorm(); // check it bool acceptSurface = d2 < (m_outsideTolerance*m_outsideTolerance*rSurface2); - if (acceptSurface) cSurfaces.push_back( Trk::SurfaceIntersection(sfIntersection, &sf) ); + if (acceptSurface) cSurfaces.emplace_back(sfIntersection, &sf ); // give the break signal if it's really inside return ( d2 < (m_breakTolerance*m_breakTolerance*rSurface2) ? 0 : (sfIntersection.position.phi() > sf.center().phi() ? 1 : -1) ); } diff --git a/InnerDetector/InDetDetDescr/PixelCabling/src/PixelCablingSvc.cxx b/InnerDetector/InDetDetDescr/PixelCabling/src/PixelCablingSvc.cxx index ca140338787f75a194bfb802fa81ed10e915406b..1b46c82038bf61b7a36d8d3edb85c385f7a5ba4f 100644 --- a/InnerDetector/InDetDetDescr/PixelCabling/src/PixelCablingSvc.cxx +++ b/InnerDetector/InDetDetDescr/PixelCabling/src/PixelCablingSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -17,8 +17,8 @@ PixelCablingSvc::PixelCablingSvc(const std::string& name, ISvcLocator*svc): AthService(name,svc), m_detStore("DetectorStore", name), - m_detManager(0), - m_idHelper(0) + m_detManager(nullptr), + m_idHelper(nullptr) { } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.cxx index 701c5e29b6a93c5158dbd9535692bfaf56a7e968..1549c3cb7400c7860ea55415b38117c8ce7f79ba 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -125,7 +125,7 @@ GeoVPhysVol* DBM_Module::Build() const GeoMaterial* air = m_mat_mgr->getMaterial("std::Air"); //first try the Diamond const GeoMaterial* diamond = m_mat_mgr->getMaterial("pix::Diamond"); - if(diamond == NULL) + if(diamond == nullptr) { diamond = m_mat_mgr->getMaterial("std::Carbon"); } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx index a6b04e82f64cae7f152fdefe2178d1a550542fae..e001e0857fec4fcbde1f1b80b7285cae720c826e 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -25,6 +25,8 @@ #include <algorithm> #include <cmath> +#include <utility> + using std::max; GeoPixelDetailedStaveSupport::GeoPixelDetailedStaveSupport(InDetDD::PixelDetectorManager* ddmgr, @@ -32,7 +34,7 @@ GeoPixelDetailedStaveSupport::GeoPixelDetailedStaveSupport(InDetDD::PixelDetecto : GeoPixelStaveSupport (ddmgr, mgr), m_transform(GeoTrf::Transform3D::Identity()) { - m_staveEnvelopShape=0; + m_staveEnvelopShape=nullptr; m_bVerbose = (m_gmt_mgr->msgLvl(MSG::DEBUG)); m_physVol = Build(); @@ -435,7 +437,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { omega_shape->addVertex(foam2x,foam2y); omega_shape->addVertex(foam1x,foam1y); - GeoLogVol * omega_logVol = 0; + GeoLogVol * omega_logVol = nullptr; // Create composite material made of omega+glue if a thickness of glue is defined is DB if(OmegaGlueThick<0.0001) { @@ -508,7 +510,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { } // Create composite material made of faceplate + grease if a thickness of grease is defined is DB - GeoLogVol * faceplate_logVol = 0; + GeoLogVol * faceplate_logVol = nullptr; if(FacePlateGreaseThick<0.0001) { m_gmt_mgr->msg(MSG::INFO)<<"** FacePlate : without grease"<<endmsg; @@ -572,7 +574,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { double wingZmin=0., wingZmax=0.; int nbModuleSvc = m_gmt_mgr->PixelModuleServiceNumber(); - GeoLogVol * wingflex_logVol = 0; + GeoLogVol * wingflex_logVol = nullptr; double wingFlexPosX = 0.; double wingFlexPosY = 0.; @@ -615,7 +617,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { if(!(ModuleNumber_flex%2==1&&iModule==0))lname<<"A"; // scaled material - const GeoMaterial* scaledFlexMaterial=0; + const GeoMaterial* scaledFlexMaterial=nullptr; if(bFlexAndWing){ std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(iModule+1,"staveA"); scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName); @@ -633,7 +635,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { // GeoTransform* cableflex_xform = new GeoTransform(GeoTrf::Transform3D(Gaudi::Units::HepRotation(0.0,0.0,-fabs(flex_angle)),cableflex_pos)); GeoTransform* cableflex_xform = new GeoTransform(GeoTrf::Transform3D(cableflex_pos*GeoTrf::RotateZ3D(fabs(flex_angle)))); - GeoLogVol * cableflex_logVol = 0; + GeoLogVol * cableflex_logVol = nullptr; if(bFlexAndWing||bFlexConstantThickness) cableflex_logVol= new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial); else @@ -731,9 +733,9 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { GeoTrf::Translation3D cableflex_pos2((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,-ModulePosZ-flexGapZ*0.5); GeoTransform* cableflex_xform2 = new GeoTransform(GeoTrf::Transform3D(cableflex_pos2*GeoTrf::RotateZ3D(fabs(flex_angle)))); - GeoLogVol * cableflex_logVol = 0; + GeoLogVol * cableflex_logVol = nullptr; - const GeoMaterial* scaledFlexMaterial=0; + const GeoMaterial* scaledFlexMaterial=nullptr; if(bFlexAndWing){ std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(iModule+1,"staveC"); scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName); @@ -826,7 +828,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { const GeoTube* coolingPipe = new GeoTube(0.0,TubeOuterDiam*0.5,MiddleSectionLength*0.5); const GeoTube* coolingPipeInner = new GeoTube(0.0,TubeInnerDiam*0.5,MiddleSectionLength*0.5); - GeoLogVol * cp_logVol = 0; + GeoLogVol * cp_logVol = nullptr; // Create composite material made of omega+glue if a thickness of glue is defined is DB if(TubeGlueThick<0.0001) { @@ -888,12 +890,12 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { // ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------ - m_endblockAPhysVol=0; - m_endblockCPhysVol=0; + m_endblockAPhysVol=nullptr; + m_endblockCPhysVol=nullptr; m_endblockZpos=0.; m_endblockLength=0.; - m_endblockFlexPhysVol=0; - m_endblockFlexTrf=0; + m_endblockFlexPhysVol=nullptr; + m_endblockFlexTrf=nullptr; m_endblockLength=MechanicalStaveEndBlockLength-safetyMarginZ*4.; @@ -921,9 +923,9 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { endblock_shape->addVertex(plate4x,plate4y); const GeoMaterial* endblock_material_weight = m_mat_mgr->getMaterialForVolume("pix::EndblockA_IBLwght",endblock_shape->volume()); - GeoLogVol * endblock_logVol = 0; - GeoLogVol * endblockA_logVol = 0; - GeoLogVol * endblockC_logVol = 0; + GeoLogVol * endblock_logVol = nullptr; + GeoLogVol * endblockA_logVol = nullptr; + GeoLogVol * endblockC_logVol = nullptr; if(endblock_material_weight){ double endblockOmegaOverlap=m_gmt_mgr->IBLStaveMechanicalStaveEndBlockOmegaOverlap(); double omegaStaveVolume = omega_shape->volume(); @@ -1008,7 +1010,7 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { // Box and coordinates GeoBox * cableflex_shape = new GeoBox(EndblockFlexThickness*0.5,FlexWidth*0.5,(m_endblockLength+m_endblockSrvLength)*.5); - const GeoMaterial* scaledFlexMaterial=0; + const GeoMaterial* scaledFlexMaterial=nullptr; if(bFlexAndWing){ std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(1,"doglegA"); scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName); @@ -1040,9 +1042,9 @@ GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ( ) { // ----------- service cooling pipe // ------------------------------------------------------------------------------------------------------------ - m_serviceCoolPipePhysVol = 0; - m_serviceCoolPipeTrfA = 0; - m_serviceCoolPipeTrfC = 0; + m_serviceCoolPipePhysVol = nullptr; + m_serviceCoolPipeTrfA = nullptr; + m_serviceCoolPipeTrfC = nullptr; if(bFlexAndWing){ @@ -1211,7 +1213,7 @@ GeoPhysVol* GeoPixelDetailedStaveSupport::getEndblockEnvelopShape(int iObject) c GeoTransform* GeoPixelDetailedStaveSupport::getEndblockEnvelopShapeTrf(int iObject) const { if(iObject==0) - return 0; + return nullptr; else if(iObject==1) return m_endblockFlexTrf; else if(iObject==2) @@ -1228,7 +1230,7 @@ GeoSimplePolygonBrep* GeoPixelDetailedStaveSupport::computeStaveEnvelopShape( do if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"GeoSimplePolygonBrep* GeoPixelDetailedStaveSupport::computeStaveEnvelopShape( double safetyMargin )"<<endmsg; - if(safetyMargin<0 || m_staveEnvelopShape==0 || m_staveEnvelopShape->getNVertices()<=0) + if(safetyMargin<0 || m_staveEnvelopShape==nullptr || m_staveEnvelopShape->getNVertices()<=0) return m_staveEnvelopShape; // stave envelop shape (translated vs stave offsets / module) @@ -1365,11 +1367,13 @@ void GeoPixelDetailedStaveSupport::GetSurroundingConvexShape(std::vector<double> if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"Convex shape "<<iException.size()<<endmsg; - if(iException.size()==0) + if(iException.empty()) for(int i=0; i<(int)xVertices.size(); i++)iException.push_back(0); std::vector<int>iRemoved; - for(int i=0; i<(int)xVertices.size(); i++)iRemoved.push_back(0); + iRemoved.reserve((int)xVertices.size()); + +for(int i=0; i<(int)xVertices.size(); i++)iRemoved.push_back(0); // removing process is based on the sign of Z component of vector product (Pi-1,Pi)x(Pi,Pi+1) // for each set of successive points Pi-1, Pi, Pi+1 @@ -1658,7 +1662,7 @@ GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NormalizeDir(GeoTrf::Vector3D v) GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NeighbourPoint_Rad(GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta) { - GeoTrf::Vector3D vNorm=NormalizeDir(v); + GeoTrf::Vector3D vNorm=NormalizeDir(std::move(v)); double xnew=p.x()+delta*vNorm.x(); double ynew=p.y()+delta*vNorm.y(); return GeoTrf::Vector3D(xnew,ynew,0.0); @@ -1666,7 +1670,7 @@ GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NeighbourPoint_Rad(GeoTrf::Vector GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NeighbourPoint_Perp(GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta, int iDir) { - GeoTrf::Vector3D vNorm=NormalizeDir(v); + GeoTrf::Vector3D vNorm=NormalizeDir(std::move(v)); double xnew=p.x()-iDir*delta*vNorm.y(); double ynew=p.y()+iDir*delta*vNorm.x(); return GeoTrf::Vector3D(xnew,ynew,0.0); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.cxx index f270dc310b449e5b50d5155500780caa9a265e4d..5db9512e17b8e57228b715c9a36b882545924df1 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPixelDisk.h" @@ -35,7 +35,7 @@ GeoVPhysVol* GeoPixelDisk::Build( ) { // it is 360 deg / 24 modules = 15 deg int nbECSector = m_gmt_mgr->PixelECNSectors1(); if(nbECSector==0){ - return 0; + return nullptr; } // // Dimensions from class methods. diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.cxx index 24092ddfb554dd97228d09bf06ebb7fa25aaa485..f428e2aeca168713c68a7bc7550d7abf5fa5648c 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPixelEndCap.h" @@ -57,9 +57,9 @@ GeoVPhysVol* GeoPixelEndCap::Build( ) { // // Place the disks and cables on both sides // - GeoPixelDiskSLHC * pdslhc = 0; - GeoPixelDisk * pd = 0; - GeoPixelECCable * pecc = 0; + GeoPixelDiskSLHC * pdslhc = nullptr; + GeoPixelDisk * pd = nullptr; + GeoPixelECCable * pecc = nullptr; if (m_gmt_mgr->slhc()) { pdslhc = new GeoPixelDiskSLHC (m_DDmgr, m_gmt_mgr); } else { @@ -83,7 +83,7 @@ GeoVPhysVol* GeoPixelEndCap::Build( ) { GeoNameTag * tag = new GeoNameTag(nameTag.str()); GeoAlignableTransform* xform = new GeoAlignableTransform(GeoTrf::TranslateZ3D(zdisk)); - GeoVPhysVol * diskPhys = 0; + GeoVPhysVol * diskPhys = nullptr; if (m_gmt_mgr->slhc()) { diskPhys = pdslhc->Build(); } else { diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.cxx index 0f9cfbbb7bd8c7611e346255237308bd5bc47401..0b0434e366c44e06235f21d133e655c460cb1e91 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPixelEnvelope.h" @@ -52,7 +52,7 @@ GeoVPhysVol* GeoPixelEnvelope::Build( ) { // This can either be a simple tube or a more general PCON. // const GeoShape * envelopeShape; - InDetDD::Zone * pixZone = 0; + InDetDD::Zone * pixZone = nullptr; if (m_gmt_mgr->PixelSimpleEnvelope()) { double rmin = m_gmt_mgr->PixelRMin(); double rmax = m_gmt_mgr->PixelRMax(); @@ -78,7 +78,7 @@ GeoVPhysVol* GeoPixelEnvelope::Build( ) { const GeoLogVol* envelopeLog = new GeoLogVol("Pixel",envelopeShape,air); GeoFullPhysVol* envelopePhys = new GeoFullPhysVol(envelopeLog); - GeoPixelServices * pixServices = 0; + GeoPixelServices * pixServices = nullptr; if(m_gmt_mgr->DoServices() ) { // Takes ownership of pixZone pixServices = new GeoPixelServices(m_DDmgr, m_gmt_mgr, pixZone); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.cxx index d54992a67d7efd76a0ec36916ea8f66b56562483..3bbc2496ba1d98870ebcbf97ddb2d0f3bc9d2ee4 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // Build the global support frame @@ -129,7 +129,7 @@ void GeoPixelFrame::BuildAndPlace(GeoFullPhysVol * parent, int section) // Make the side // Put the side in a box - GeoPhysVol * sideEnvelopePV = 0; + GeoPhysVol * sideEnvelopePV = nullptr; double zSideCenter = 0; int numElements = m_gmt_mgr->PixelFrameNumSideElements(section); @@ -161,7 +161,7 @@ void GeoPixelFrame::BuildAndPlace(GeoFullPhysVol * parent, int section) zSideMin = std::min(zSideMin, zminInput); zSideMax = std::max(zSideMax, zmaxInput); } - GeoShape * sideElementShape = 0; + GeoShape * sideElementShape = nullptr; GeoTrf::Transform3D rotateShape(GeoTrf::Transform3D::Identity()); double shapeVolume = 0; if (same(zMin1,zMin2) && same(zMax1,zMax2)) { diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.cxx index 9069edf4c677e97f934a489590ef30467a10a5bd..1586fadb70b350654d6c5f137c4d4a2fa8877cfb 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -27,10 +27,10 @@ GeoPixelIBLFwdServices::GeoPixelIBLFwdServices(InDetDD::PixelDetectorManager* dd m_bFwdComplexGeometry_CAD(false), m_bFwdComplexGeometry_Mod1(false), m_section(section), - m_supportPhysA(0), - m_supportPhysC(0), - m_xformSupportA(0), - m_xformSupportC(0) + m_supportPhysA(nullptr), + m_supportPhysC(nullptr), + m_xformSupportA(nullptr), + m_xformSupportC(nullptr) { } @@ -78,11 +78,11 @@ GeoVPhysVol* GeoPixelIBLFwdServices::Build() m_xformSupportA = fwdSvc.getSupportTrfA(); m_xformSupportC = fwdSvc.getSupportTrfC(); - if(m_supportPhysA==0) { + if(m_supportPhysA==nullptr) { m_gmt_mgr->msg(MSG::ERROR) <<"Build IBL fwd services - CAD tool design : the PixelGeoModel package is not meant to be used to build this design"<<endmsg; m_gmt_mgr->msg(MSG::ERROR) <<" : check that the GeoTorus object is defined in GeoModelKernel/GeoModel"<<endmsg; } - return 0; + return nullptr; } @@ -97,9 +97,9 @@ GeoVPhysVol* GeoPixelIBLFwdServices::Build() m_xformSupportA = fwdSvc.getSupportTrfA(); m_xformSupportC = fwdSvc.getSupportTrfC(); - return 0; + return nullptr; } - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.cxx index d01fe38ec70046b0895737d707f1bd3af7b2b052..10ab9baea72e387c02e42a3c054724bd0e7e3f93 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -36,10 +36,10 @@ GeoPixelIBLFwdSvcCADModel::GeoPixelIBLFwdSvcCADModel(InDetDD::PixelDetectorManag PixelGeometryManager* mgr, int /*section*/) : GeoVPixelFactory(ddmgr, mgr), - m_supportPhysA(0), - m_supportPhysC(0), - m_xformSupportA(0), - m_xformSupportC(0) + m_supportPhysA(nullptr), + m_supportPhysC(nullptr), + m_xformSupportA(nullptr), + m_xformSupportC(nullptr) { } @@ -66,7 +66,7 @@ GeoVPhysVol* GeoPixelIBLFwdSvcCADModel::Build() double layerRadius = m_gmt_mgr->PixelLayerRadius(); // check if sectors are properly defined - if(nSectors==0) return 0; + if(nSectors==0) return nullptr; double angle=360./(double)nSectors*Gaudi::Units::deg; // Defines the IBL_Fwd02 section in the IBL services area @@ -119,10 +119,10 @@ GeoVPhysVol* GeoPixelIBLFwdSvcCADModel::Build() double breakAngle = 11.*Gaudi::Units::deg; // Loop over the wavy shape sections to build a cable and a cooling pipe - const GeoShape * gblShapeCableA = 0; - const GeoShape * gblShapeCoolingA = 0; - const GeoShape * gblShapeCableC = 0; - const GeoShape * gblShapeCoolingC = 0; + const GeoShape * gblShapeCableA = nullptr; + const GeoShape * gblShapeCoolingA = nullptr; + const GeoShape * gblShapeCableC = nullptr; + const GeoShape * gblShapeCoolingC = nullptr; for(int i=0; i<4; i++) { totalLength+=devLgFwdSvc[i]; @@ -269,7 +269,7 @@ GeoVPhysVol* GeoPixelIBLFwdSvcCADModel::Build() GeoTrf::Transform3D supportTrfC = GeoTrf::TranslateZ3D(middleC); m_xformSupportC = new GeoTransform(supportTrfC); - return 0; + return nullptr; #endif diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.cxx index 1bcce3088716af9e3d2034831495b35fbb9df06c..bb2a366f3b2c2e2e5aa8c7f9daf46c6921ed2780 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -32,10 +32,10 @@ GeoPixelIBLFwdSvcModel1::GeoPixelIBLFwdSvcModel1(InDetDD::PixelDetectorManager* PixelGeometryManager* mgr, int /*section*/) : GeoVPixelFactory (ddmgr, mgr), - m_supportPhysA(0), - m_supportPhysC(0), - m_xformSupportA(0), - m_xformSupportC(0) + m_supportPhysA(nullptr), + m_supportPhysC(nullptr), + m_xformSupportA(nullptr), + m_xformSupportC(nullptr) { } @@ -53,7 +53,7 @@ GeoVPhysVol* GeoPixelIBLFwdSvcModel1::Build() double layerRadius = m_gmt_mgr->PixelLayerRadius(); // check if sectors are properly defined - if(nSectors==0) return 0; + if(nSectors==0) return nullptr; double angle=360./(double)nSectors*Gaudi::Units::deg; // Defines the IBL_Fwd02 section in the IBL services area @@ -151,10 +151,10 @@ GeoVPhysVol* GeoPixelIBLFwdSvcModel1::Build() if(bFirstLin)nbSteps++; // Loop over the wavy shape sections to build a cable and a cooling pipe - const GeoShape * gblShapeCableA = 0; - const GeoShape * gblShapeCoolingA = 0; - const GeoShape * gblShapeCableC = 0; - const GeoShape * gblShapeCoolingC = 0; + const GeoShape * gblShapeCableA = nullptr; + const GeoShape * gblShapeCoolingA = nullptr; + const GeoShape * gblShapeCableC = nullptr; + const GeoShape * gblShapeCoolingC = nullptr; // deltaPhi = (2.*pi)/28.; // deltaPhi = .2815; @@ -310,7 +310,7 @@ GeoVPhysVol* GeoPixelIBLFwdSvcModel1::Build() GeoTrf::Transform3D supportTrfC = GeoTrf::TranslateZ3D(middleC); m_xformSupportC = new GeoTransform(supportTrfC); - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.cxx index 0c59c0a3f5234423ebc5281d0f7ee37ec61efa40..a42ac3320114399bf6a343cfdc850ee7eb09f7eb 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -27,10 +27,10 @@ GeoPixelIFlexServices::GeoPixelIFlexServices(InDetDD::PixelDetectorManager* ddmg int iSection) : GeoVPixelFactory(ddmgr, mgr), m_section(iSection), - m_supportPhysA(0), - m_supportPhysC(0), - m_xformSupportA(0), - m_xformSupportC(0) + m_supportPhysA(nullptr), + m_supportPhysC(nullptr), + m_xformSupportA(nullptr), + m_xformSupportC(nullptr) { } @@ -48,7 +48,7 @@ GeoVPhysVol* GeoPixelIFlexServices::Build() int nSectors = m_gmt_mgr->NPixelSectors(); // check if sectors are properly defined - if(nSectors==0) return 0; + if(nSectors==0) return nullptr; double angle=360./(double)nSectors*Gaudi::Units::deg; double zmin=0., zmax=0.; @@ -146,8 +146,8 @@ GeoVPhysVol* GeoPixelIFlexServices::Build() cpPhysVolC->add(cp_service_inner_xform); cpPhysVolC->add(cp_service_inner_logPVC); - GeoLogVol* flex_logVolA = 0; - GeoLogVol* flex_logVolC = 0; + GeoLogVol* flex_logVolA = nullptr; + GeoLogVol* flex_logVolC = nullptr; double flex_angle = -15.001*Gaudi::Units::deg; if(m_gmt_mgr->PixelStaveAxe()==1) @@ -178,7 +178,7 @@ GeoVPhysVol* GeoPixelIFlexServices::Build() GeoBox * flex_shapeA = new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthA); GeoBox * flex_shapeC = new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthC); const GeoMaterial* flex_material = m_mat_mgr->getMaterial(flexMatName); - if(flex_material==0) + if(flex_material==nullptr) { m_gmt_mgr->msg(MSG::ERROR)<<"-> error while reading material "<<flexMatName<<__FILE__<< ":"<< __LINE__<<endmsg; std::abort(); @@ -206,7 +206,7 @@ GeoVPhysVol* GeoPixelIFlexServices::Build() m_gmt_mgr->msg(MSG::DEBUG)<<"IFlex material : "<<m_section<<" "<<IflexMatName<<endmsg; const GeoMaterial* Iflex_material = m_mat_mgr->getMaterial(IflexMatName); - if(Iflex_material==0) + if(Iflex_material==nullptr) { m_gmt_mgr->msg(MSG::ERROR)<<"-> error while reading material "<<IflexMatName<<__FILE__<< ":"<< __LINE__<<endmsg; std::abort(); @@ -291,5 +291,5 @@ GeoVPhysVol* GeoPixelIFlexServices::Build() // std::cout<<"Section final C "<<m_section<<" - "<<middleC-halfLengthC<<" "<<middleC+halfLengthC<<" "<<middleC<<std::endl; // std::cout<<"Section ---"<<std::endl; - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.cxx index 0ee3f0ae47d303218389cc6eff7bfc4fcd277fb5..5417eb43ab9dbfc6c6e105355eab16c3d2338b86 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPixelLadder.h" @@ -30,7 +30,7 @@ GeoPixelLadder::GeoPixelLadder(InDetDD::PixelDetectorManager* m_DDmgr, GeoPixelSiCrystal& theSensor, GeoPixelStaveSupport* staveSupport) : GeoVPixelFactory (m_DDmgr, mgr), - m_theLadder(0), + m_theLadder(nullptr), m_theSensor(theSensor), m_staveSupport(staveSupport) { @@ -60,7 +60,7 @@ GeoPixelLadder::GeoPixelLadder(InDetDD::PixelDetectorManager* m_DDmgr, m_thicknessN = std::max(m_thicknessN, m_staveSupport->thicknessN()+safety); } - const GeoShape * ladderShape = 0; + const GeoShape * ladderShape = nullptr; // If upper and lower thicknesses are within 100 um. Make them the same. if (std::abs(m_thicknessP - m_thicknessN) < 0.1*Gaudi::Units::mm) { @@ -159,7 +159,7 @@ GeoPixelLadder::~GeoPixelLadder(){ GeoVPhysVol* GeoPixelLadder::Build( ) { // Something went wrong while building the ladder logical volume - if(!m_theLadder) return 0; + if(!m_theLadder) return nullptr; // Create the ladder physVolume GeoPhysVol* ladderPhys = new GeoPhysVol(m_theLadder); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.cxx index 63330a7192e262c15bb4e8651a581dd427390072..f308ccd42c383183618b1410eefa6c628c4e7e53 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPrimitives/GeoPrimitives.h" @@ -37,12 +37,12 @@ GeoPixelLayer::GeoPixelLayer(InDetDD::PixelDetectorManager* ddmgr, PixelGeometryManager* mgr) : GeoVPixelFactory (ddmgr, mgr) { - m_supportPhysA=0; - m_supportPhysC=0; - m_supportMidRing=0; - m_xformSupportA=0; - m_xformSupportC=0; - m_xformSupportMidRing=0; + m_supportPhysA=nullptr; + m_supportPhysC=nullptr; + m_supportMidRing=nullptr; + m_xformSupportA=nullptr; + m_xformSupportC=nullptr; + m_xformSupportMidRing=nullptr; } GeoVPhysVol* GeoPixelLayer::Build() { @@ -70,7 +70,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { bool isBLayer = false; if(m_gmt_mgr->GetLD() == 0) isBLayer = true; GeoPixelSiCrystal theSensor(m_DDmgr, m_gmt_mgr, isBLayer); - GeoPixelStaveSupport * staveSupport = 0; + GeoPixelStaveSupport * staveSupport = nullptr; if (staveLayout ==0 || staveLayout==1) { staveSupport = new GeoPixelTMT (m_DDmgr, m_gmt_mgr); } @@ -91,7 +91,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { if(!staveSupport) { m_gmt_mgr->msg(MSG::ERROR)<<"No stave support corresponding to the staveLayout "<<staveLayout<<" could be defined "<<endmsg; - return 0; + return nullptr; } m_gmt_mgr->msg(MSG::INFO)<<"*** LAYER "<<m_gmt_mgr->GetLD()<<" planar/3D modules : "<< staveSupport->PixelNPlanarModule()<<" "<<staveSupport->PixelN3DModule()<<endmsg; @@ -186,7 +186,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { int maxLadType = 0; std::vector<GeoVPhysVol *> ladderServicesArray; GeoTrf::Transform3D ladderServicesTransform(GeoTrf::Transform3D::Identity()); - GeoVPhysVol* pigtailPhysVol = 0; + GeoVPhysVol* pigtailPhysVol = nullptr; GeoTrf::Transform3D transPigtail(GeoTrf::Transform3D::Identity()); // Only make services in non SLHC geometries @@ -210,7 +210,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { // NB. vector initializes its contents to zero. //std::vector<GeoVPhysVol *> ladderServicesArray(2*(maxLadType+1)); ladderServicesArray.resize(2*(maxLadType+1)); - GeoPixelLadderServices *firstLadderServices = 0; + GeoPixelLadderServices *firstLadderServices = nullptr; for(int iPhi = 0; iPhi < nSectors; iPhi++) { m_gmt_mgr->SetPhi(iPhi); int ladderType = m_gmt_mgr->PixelFluidOrient(m_gmt_mgr->GetLD(), iPhi); @@ -344,7 +344,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { // GeoFullPhysVol* layerPhys = new GeoFullPhysVol(layerLog); // phys vol - GeoFullPhysVol* layerPhys = 0; + GeoFullPhysVol* layerPhys = nullptr; // // A few variables needed below @@ -445,7 +445,7 @@ GeoVPhysVol* GeoPixelLayer::Build() { } // delete staveSupport; - if(layerPhys==0) + if(layerPhys==nullptr) { m_gmt_mgr->msg(MSG::ERROR)<<"layerPhys = 0 in GeoPixelLayer in "<<__FILE__<<endmsg; std::abort(); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.cxx index d8dab4ea30a7df52ff0e3d82666d83b742416dfb..abe0731317b6cb78d51aaadc3f7f81524cc85997 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "GeoPixelModule.h" @@ -74,7 +74,7 @@ GeoPixelModule::GeoPixelModule(InDetDD::PixelDetectorManager* m_DDmgr, m_theModule->ref(); } else { - const GeoShape * gblShape = 0; + const GeoShape * gblShape = nullptr; gblShape = addShape(gblShape, moduleShape, GeoTrf::Transform3D::Identity() ); double svcWidth = width*.6; diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.cxx index 585f2f5ccc4a5a6c954a2f39a66b655753f5f282..63fcfa8b702c338b86e5d7524188b7d4bd189276 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // @@ -29,7 +29,7 @@ GeoPixelOldFrame::GeoPixelOldFrame(InDetDD::PixelDetectorManager* ddmgr, GeoVPhysVol* GeoPixelOldFrame::Build() { - return 0; + return nullptr; } GeoVPhysVol* GeoPixelOldFrame::BuildBox() { diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.cxx index ca78c00469dbd20c0d235abd8c81dd1564a78762..21b593635f01355239f1ad62063cedd0df1bfb81 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // @@ -114,8 +114,8 @@ GeoPixelServices::GeoPixelServices(InDetDD::PixelDetectorManager* ddmgr, PixelGeometryManager* mgr, InDetDD::Zone * pixZone) : GeoVPixelFactory(ddmgr, mgr), - m_pixServBuilder(0), - m_servMatBuilder(0), + m_pixServBuilder(nullptr), + m_servMatBuilder(nullptr), m_layerShift(0) { @@ -479,5 +479,5 @@ void GeoPixelServices::initializeOld(const std::string & a) // For interface GeoVPhysVol* GeoPixelServices::Build() { - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.cxx index 4e314b60dd9ad77d5043cf1ab5831de2ee477673..7ac073a74358ea84a2ee14cc1f13918547552b84 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // @@ -146,7 +146,7 @@ GeoVPhysVol* GeoPixelSiCrystal::Build() { std::string logname{"siLog"}; // There is not a strong need to give the blayer a different name but leave it for now. if(m_isBLayer) logname = "siBLayLog"; - auto logVolume = new GeoLogVol(logname,siBox,siMat); + auto *logVolume = new GeoLogVol(logname,siBox,siMat); //(sar) ...to here diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.cxx index 5448e1c9d715090df9b869cde5a3c1a7cbde573c..f8c813cbe54d429cbd9888e9200dc16345c0a5e1 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // Build detailed stave support : face plate + carbon foam + cable flex + cooling pipe + end blocks @@ -84,9 +84,9 @@ GeoVPhysVol* GeoPixelStaveRing::Build(){ m_gmt_mgr->msg(MSG::DEBUG)<<"-> IBL stave ring "<<m_zPosition<<" "<<m_innerRadius<<" "<<m_outerRadius<<endmsg; const GeoTube* ring_tube = new GeoTube(m_innerRadius,m_outerRadius,ringWidth*0.5); const GeoMaterial* ring_material_weight = m_mat_mgr->getMaterialForVolume("pix::StaveRing_IBLwght",ring_tube->volume()); - m_gmt_mgr->msg(MSG::DEBUG)<<"IBL stave ring weighted material : "<<(ring_material_weight==0)<<endmsg; + m_gmt_mgr->msg(MSG::DEBUG)<<"IBL stave ring weighted material : "<<(ring_material_weight==nullptr)<<endmsg; - GeoLogVol * logVol = 0; + GeoLogVol * logVol = nullptr; if(ring_material_weight) logVol = new GeoLogVol(m_ringName,ring_tube,ring_material_weight); else { @@ -109,7 +109,7 @@ GeoVPhysVol* GeoPixelStaveRing::Build(){ // create log and phys volumes const GeoTube* ring_tube = new GeoTube(m_innerRadius,m_outerRadius,ringWidth*0.5); const GeoMaterial* ring_material_weight = m_mat_mgr->getMaterialForVolume("pix::StaveRingMid_IBLwght",ring_tube->volume()); - GeoLogVol *logVol=0; + GeoLogVol *logVol=nullptr; if(ring_material_weight) logVol = new GeoLogVol(m_ringName,ring_tube,ring_material_weight); else { diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.cxx index 348896d0bb539cb1ce6d0686f87e090988e354fb..41c0a956df321d7ae7ecfce7bc2c26b8742ed6a8 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -29,8 +29,8 @@ GeoPixelStaveRingServices::GeoPixelStaveRingServices(InDetDD::PixelDetectorManag GeoPixelLadder& ladder, GeoPixelStaveSupport& staveSupport): GeoVPixelFactory (ddmgr, mgr), m_ladder(ladder),m_staveSupport(staveSupport), - m_supportPhysA(0),m_supportPhysC(0),m_supportMidRing(0), - m_xformSupportA(0), m_xformSupportC(0), m_xformSupportMidRing(0) + m_supportPhysA(nullptr),m_supportPhysC(nullptr),m_supportMidRing(nullptr), + m_xformSupportA(nullptr), m_xformSupportC(nullptr), m_xformSupportMidRing(nullptr) { } @@ -313,6 +313,6 @@ GeoVPhysVol* GeoPixelStaveRingServices::Build() m_xformSupportMidRing = new GeoTransform(ring_posM); - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.cxx index 6e6933deda38f9fbf4c49c8f2b805821066c4574..0233c3a0a9a58d819bd6c493e40c5aa6604f72bf 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // Build The TMT. @@ -89,7 +89,7 @@ GeoVPhysVol* GeoPixelTMT::Build() { double angleydzn = 0; double angleydzp = 0; - const GeoShape * shape = 0; + const GeoShape * shape = nullptr; if (w1 == w2 && theta == 0) { // Its a box shape = new GeoBox(0.5*w1, 0.5*widthy, 0.5*length); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx index f7d2886abe61a8628df69847100227aee789721c..bdf9ff996490da07e59f8d207089bd3f2b875401 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "OraclePixGeoManager.h" @@ -59,16 +59,16 @@ OraclePixGeoManager::OraclePixGeoManager(PixelGeoModelAthenaComps * athenaComps) m_PlanarModuleNumber(0), m_3DModuleNumber(0), m_dbm(false), - m_legacyManager(0), - m_gangedIndexMap(0), - m_frameElementMap(0), - m_diskRingIndexMap(0), - m_zPositionMap(0), + m_legacyManager(nullptr), + m_gangedIndexMap(nullptr), + m_frameElementMap(nullptr), + m_diskRingIndexMap(nullptr), + m_zPositionMap(nullptr), m_dbVersion(0), m_defaultLengthUnit(Gaudi::Units::mm) { - m_commonItems = 0; - m_pDDmgr = 0; + m_commonItems = nullptr; + m_pDDmgr = nullptr; init(); } @@ -83,8 +83,8 @@ OraclePixGeoManager::init() // Get version tag and node for Pixel. DecodeVersionKey versionKey(geoDbTag,"Pixel"); - std::string detectorKey = versionKey.tag(); - std::string detectorNode = versionKey.node(); + const std::string& detectorKey = versionKey.tag(); + const std::string& detectorNode = versionKey.node(); // Get version tag and node for InnerDetector. DecodeVersionKey indetVersionKey(geoDbTag,"InnerDetector"); @@ -375,26 +375,14 @@ bool OraclePixGeoManager::isLDPresent() { bool OraclePixGeoManager::isBarrel() { - if(m_BarrelEndcap == 0) { - return true; - } else { - return false; - } + return m_BarrelEndcap == 0; } bool OraclePixGeoManager::isEndcap() { - if(m_BarrelEndcap == 1) { - return true; - } else { - return false; - } + return m_BarrelEndcap == 1; return false; } bool OraclePixGeoManager::isDBM() { - if(m_BarrelEndcap == 2) { - return true; - } else { - return false; - } + return m_BarrelEndcap == 2; } bool OraclePixGeoManager::DoServices() { @@ -423,7 +411,7 @@ bool OraclePixGeoManager::Alignable() const { PixelDetectorManager* OraclePixGeoManager::GetPixelDDManager() { - if(m_pDDmgr == NULL) { + if(m_pDDmgr == nullptr) { // // retrieve the pointer to the DD manager // @@ -448,7 +436,7 @@ OraclePixGeoManager::distortedMatManager() const{ // which thickness is given in % of r.l. // ///////////////////////////////////////////////////////// -double OraclePixGeoManager::CalculateThickness(double tck,string mat) { +double OraclePixGeoManager::CalculateThickness(double tck,const string& mat) { const GeoMaterial* material = m_pMatMgr->getMaterial(mat); double rl = material->getRadLength(); material->ref(); @@ -2212,8 +2200,7 @@ bool OraclePixGeoManager::IBLFlexAndWingDefined() { // int index = PixelStaveIndex(m_currentLD); int index=0; - if (db()->testField(m_PixelIBLFlex,"FLEXMIDGAP",index)) return true; - return false; + return db()->testField(m_PixelIBLFlex,"FLEXMIDGAP",index); } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h index c39b290982cb03f47eafcb64ab71fe131bad79cf..343b6488d7934f6b620c6d2660cd5c152f76c174 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef OraclePixelGeoManager_H @@ -834,7 +834,7 @@ class OraclePixGeoManager : public PixelGeometryManager { ///// private: - double CalculateThickness(double,std::string); + double CalculateThickness(double,const std::string&); int determineDbVersion(); void addDefaultMaterials(); // return default length unit (Gaudi::Units::mm or Gaudi::Units::cm) diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx index fa5e3b08d5e5cbfde061d8d79e3379718f487475..baabecba98ec358b888c53da8c0cf455a5bc13d1 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // This file is basically a concatenation of all the *.cxx files. @@ -151,7 +151,7 @@ double GeoPixelCable::Length() { return zmax-zmin-m_epsilon; } -double GeoPixelCable::Thickness() { +double GeoPixelCable::Thickness() const { // // This is calculated from the Gaudi::Units::rad length of the cables and their mass // I have to go back on this later when I'll have defined a material @@ -1074,7 +1074,7 @@ GeoPixelServices::GeoPixelServices(InDetDD::PixelDetectorManager* ddmgr, m_nframe = 0; } -void GeoPixelServices::initialize(std::string a) +void GeoPixelServices::initialize(const std::string& a) { // // Here I inizialize the geometry information contained in the vectors @@ -1094,7 +1094,7 @@ void GeoPixelServices::initialize(std::string a) // service which is not attached to any LD. // if(LD != -1) m_gmt_mgr->SetCurrentLD(LD); - if(LD ==-1 || m_gmt_mgr->isLDPresent() == true) { + if(LD ==-1 || m_gmt_mgr->isLDPresent()) { double zpos,halflength; // // Retrieve/calculate the parameters for the volume. @@ -1122,11 +1122,7 @@ void GeoPixelServices::initialize(std::string a) // // bool twovolumes; - if(zpos > 0.00001 && r[0] >0.) { - twovolumes = true; - } else { - twovolumes = false; - } + twovolumes = zpos > 0.00001 && r[0] >0.; // only once for the inside endcaps as I already have two endcaps! if(m_gmt_mgr->isEndcap() && a == "Inside") twovolumes = false; m_rmin.push_back(fabs(r[0])); @@ -1597,9 +1593,9 @@ OraclePixGeoManager::OraclePixGeoManager() m_initialLayout(false), m_dc1Geometry(false), m_alignable(true), - m_commonItems(0), - m_pDDmgr(0), - m_pMatMgr(0) + m_commonItems(nullptr), + m_pDDmgr(nullptr), + m_pMatMgr(nullptr) { @@ -1620,8 +1616,8 @@ OraclePixGeoManager::OraclePixGeoManager() // Get version tag and node for Pixel. DecodeVersionKey versionKey("Pixel"); - std::string detectorKey = versionKey.tag(); - std::string detectorNode = versionKey.node(); + const std::string& detectorKey = versionKey.tag(); + const std::string& detectorNode = versionKey.node(); m_versionTag = rdbSvc->getChildTag("Pixel", versionKey.tag(), versionKey.node()); @@ -1732,38 +1728,22 @@ bool OraclePixGeoManager::isLDPresent() { if(isBarrel()) { if (m_initialLayout && m_currentLD == 1) return false; std::string a=uscore+std::to_string(m_currentLD); - if((*m_PixelBarrelGeneral)[0]->getInt("USELAYER"+a) == 1) { - return true; - } else { - return false; - } + return (*m_PixelBarrelGeneral)[0]->getInt("USELAYER"+a) == 1; } if(isEndcap() ) { if (m_initialLayout && m_currentLD == 1) return false; std::string a=uscore+std::to_string(m_currentLD); - if((*m_PixelEndcapGeneral)[0]->getInt("USEDISK"+a) == 1) { - return true; - } else { - return false; - } + return (*m_PixelEndcapGeneral)[0]->getInt("USEDISK"+a) == 1; } return false; } bool OraclePixGeoManager::isBarrel() { - if(m_BarrelEndcap == 0) { - return true; - } else { - return false; - } + return m_BarrelEndcap == 0; } bool OraclePixGeoManager::isEndcap() { - if(m_BarrelEndcap == 1) { - return true; - } else { - return false; - } + return m_BarrelEndcap == 1; return false; } ///////////////////////////////////////////////////////// @@ -1772,7 +1752,7 @@ bool OraclePixGeoManager::isEndcap() { // which thickness is given in % of r.l. // ///////////////////////////////////////////////////////// -double OraclePixGeoManager::CalculateThickness(double tck,string mat) { +double OraclePixGeoManager::CalculateThickness(double tck,const string& mat) { const GeoMaterial* material = m_pMatMgr->getMaterial(mat); double rl = material->getRadLength(); material->ref(); @@ -2112,7 +2092,7 @@ bool OraclePixGeoManager::Alignable() const { PixelDetectorManager* OraclePixGeoManager::GetPixelDDManager() { - if(m_pDDmgr == NULL) { + if(m_pDDmgr == nullptr) { // // retrieve the pointer to the DD manager // diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h index fe48702e33a5dedf0760fd3fcea815130471eb44..20b313b654bc7a34578dd7230a39bbf7e54db372 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -87,7 +87,7 @@ class GeoPixelCable : public GeoVPixelFactory { : GeoVPixelFactory (ddmgr, mgr), m_moduleNumber(0) {} virtual GeoVPhysVol* Build() override; - double Thickness(); + double Thickness() const; double Length(); void SetModuleNumber(int moduleNumber) {m_moduleNumber = moduleNumber;} int GetModuleNumber() {return m_moduleNumber;} @@ -294,7 +294,7 @@ class GeoPixelServices : public GeoVPixelFactory { int NCylinders(){return m_rmin.size();} void SetCylinder(int n) {m_nframe = n;} double ZPos() {return m_zpos[m_nframe];} - void initialize(std::string); + void initialize(const std::string&); private: std::vector<double> m_rmin,m_rmax,m_halflength,m_zpos; std::vector<std::string> m_material; @@ -701,7 +701,7 @@ class OraclePixGeoManager : public PixelGeometryManager { private: - double CalculateThickness(double,std::string); + double CalculateThickness(double,const std::string&); public: diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx index e464f8882e87c460780b3967d53c36160b4b96ef..3462ae87bbd10b4fecd9d2d52ed77411b28a59c6 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelDetectorFactory.h" @@ -35,7 +35,7 @@ using InDetDD::SiCommonItems; PixelDetectorFactory::PixelDetectorFactory(PixelGeoModelAthenaComps * athenaComps, const PixelSwitches & switches) : InDetDD::DetectorFactoryBase(athenaComps), - m_detectorManager(0), + m_detectorManager(nullptr), m_useDynamicAlignFolders(false) { // Create the detector manager diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx index 2e2cd4b14a7bafbd2b4c2e22e06931a7384727cd..c95e31a67dff4474e42fcd7c2dbd0cd873ac5212 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -33,7 +33,7 @@ using namespace PixelGeoDC2; PixelDetectorFactoryDC2::PixelDetectorFactoryDC2(PixelGeoModelAthenaComps * athenaComps, const PixelSwitches & switches) : InDetDD::DetectorFactoryBase(athenaComps), - m_detectorManager(0) + m_detectorManager(nullptr) { // Create the detector manager m_detectorManager = new PixelDetectorManager(detStore()); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx index eb010092c45f4103328eb2ad6d89eab9d2527632..b47d059e8ec14b67359244d7e5710303cb761739 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelDetectorFactorySR1.h" @@ -34,7 +34,7 @@ using InDetDD::SiCommonItems; PixelDetectorFactorySR1::PixelDetectorFactorySR1(PixelGeoModelAthenaComps * athenaComps, const PixelSwitches & switches) : InDetDD::DetectorFactoryBase(athenaComps), - m_detectorManager(0) + m_detectorManager(nullptr) { // Create the detector manager m_detectorManager = new PixelDetectorManager(detStore()); @@ -133,12 +133,12 @@ void PixelDetectorFactorySR1::create (GeoPhysVol *world) msg(MSG::ERROR) << "SR1 geometry must have 1 part" << endmsg; } - GeoVPhysVol* physVol = 0; - GeoAlignableTransform * transform = 0; + GeoVPhysVol* physVol = nullptr; + GeoAlignableTransform * transform = nullptr; - GeoPixelServices * pixServices = 0; + GeoPixelServices * pixServices = nullptr; if(m_geometryManager->DoServices() ) { - pixServices = new GeoPixelServices(m_detectorManager, m_geometryManager, 0); + pixServices = new GeoPixelServices(m_detectorManager, m_geometryManager, nullptr); } // Top level transform diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx index 9234c063ab77f8cdf30f51c1aa9c713c5c4c361b..c0d8c077ed89863f2ba7e2b6d124501b3fb6b04e 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -194,7 +194,7 @@ StatusCode PixelDetectorTool::create() switches.setServicesOnLadder(m_servicesOnLadder); switches.setServices(m_services); //Overwrite there for the time being. - const PixelID * idHelper = 0; + const PixelID * idHelper = nullptr; if (detStore()->retrieve(idHelper, "PixelID").isFailure()) { msg(MSG::FATAL) << "Could not get Pixel ID helper" << endmsg; return StatusCode::FAILURE; @@ -278,7 +278,7 @@ StatusCode PixelDetectorTool::create() } GeoPhysVol *world=&*theExpt->getPhysVol(); - m_manager = 0; + m_manager = nullptr; if (!m_devVersion) { @@ -337,7 +337,7 @@ StatusCode PixelDetectorTool::clear() SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<InDetDD::PixelDetectorManager>::ID(),m_manager->getName()); if(proxy) { proxy->reset(); - m_manager = 0; + m_manager = nullptr; } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx index 2c466073f9cb2de25f73f11c81d820a40d07f341..8212d701b1056f7920cd4c8b4d2f065bb979ad28 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelGeoModelAthenaComps.h" @@ -7,10 +7,10 @@ PixelGeoModelAthenaComps::PixelGeoModelAthenaComps() : InDetDD::AthenaComps("PixelGeoModel"), - m_bcmTool(0), - m_blmTool(0), - m_serviceBuilderTool(0), - m_idHelper(0) + m_bcmTool(nullptr), + m_blmTool(nullptr), + m_serviceBuilderTool(nullptr), + m_idHelper(nullptr) {} void diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx index ae310e3bb4f8c53a0ebb9623a349655b6b7e593e..dfdaf843478dd01f5e9fb69e2dd269a752e1dcd6 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeometryManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelGeometryManager.h" @@ -16,7 +16,7 @@ PixelGeometryManager::~PixelGeometryManager() // Default implementation return 0. PixelLegacyManager * PixelGeometryManager::legacyManager() { - return 0; + return nullptr; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.cxx index 8ae48dc8c516cbceb14531b58d4bd2aa9c75b6b9..35fddfaae85c6a3c9cb0d7af70b0c9b1c78c8440 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelMaterialMap.h" @@ -24,7 +24,7 @@ PixelMaterialMap::Key::operator<(const PixelMaterialMap::Key &rhs) const } -PixelMaterialMap::PixelMaterialMap(const IGeometryDBSvc * db, IRDBRecordset_ptr mapTable) +PixelMaterialMap::PixelMaterialMap(const IGeometryDBSvc * db, const IRDBRecordset_ptr& mapTable) { for (unsigned int i = 0; i < db->getTableSize(mapTable); i++) { int layerdisk = db->getInt(mapTable,"LAYERDISK",i); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.h index 8c09a65436731693729a7613289515fe689cb368..f6b373b16591f1420589d69be6f5bd0d6d55e554 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.h +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelMaterialMap.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef PixelMaterialMap_H @@ -17,7 +17,7 @@ class PixelMaterialMap { public: - PixelMaterialMap(const IGeometryDBSvc * db, IRDBRecordset_ptr mapTable); + PixelMaterialMap(const IGeometryDBSvc * db, const IRDBRecordset_ptr& mapTable); void addMaterial(int layerdisk, int typenum, const std::string & volumeName, const std::string & materialName); std::string getMaterial(int layerdisk, int typenum, const std::string & volumeName) const; diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.cxx index f824b894d2dd25830b86645ce72e532f938cbb0d..f2522df78ce80aacd042fc3c935129184cb205b6 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelStaveTypes.h" @@ -34,7 +34,7 @@ PixelStaveTypes::Key::operator<(const PixelStaveTypes::Key &rhs) const } -PixelStaveTypes::PixelStaveTypes(const IGeometryDBSvc * db, IRDBRecordset_ptr table) +PixelStaveTypes::PixelStaveTypes(const IGeometryDBSvc * db, const IRDBRecordset_ptr& table) { for (unsigned int i = 0; i < db->getTableSize(table); i++) { int layer = db->getInt(table,"LAYER",i); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.h index 447156941f2f38f81f9887958da6e9dc2c03964e..d7b2d2db36dda30a49d0a59f3a5b9e5f65ee91fb 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.h +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelStaveTypes.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef PixelStaveTypes_H @@ -14,7 +14,7 @@ class IGeometryDBSvc; class PixelStaveTypes { public : - PixelStaveTypes(const IGeometryDBSvc * db, IRDBRecordset_ptr table); + PixelStaveTypes(const IGeometryDBSvc * db, const IRDBRecordset_ptr& table); int getFluidType(int layer, int phiModule) const; int getBiStaveType(int layer, int phiModule) const; diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/PixelGeoModelXml/PixelGmxInterface.h b/InnerDetector/InDetDetDescr/PixelGeoModelXml/PixelGeoModelXml/PixelGmxInterface.h index ef471568dd8d41d90db2653d612b5870b42d3e83..82e5b370b054c29266d115512b006ed55266bd90 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/PixelGeoModelXml/PixelGmxInterface.h +++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/PixelGeoModelXml/PixelGmxInterface.h @@ -31,7 +31,7 @@ class PixelGmxInterface: public GmxInterface { void addSensor(std::string typeName, std::map<std::string, int> &index, int sequentialId, GeoVFullPhysVol *fpv) override final; // void addAlignable(int level, std::map<std::string, int> &index, GeoVFullPhysVol *fpv, GeoAlignableTransform *transform); - void makePixelModule(std::string typeName, std::map<std::string, std::string> &par); + void makePixelModule(const std::string& typeName, std::map<std::string, std::string> &par); template <typename T> void getparm(const std::string typeName, const std::string name, const std::map<std::string, std::string> &par, T &value) { @@ -65,7 +65,7 @@ class PixelGmxInterface: public GmxInterface { } } - std::string getstr(const std::string typeName, const std::string name, const std::map<std::string, std::string> &par); + std::string getstr(const std::string& typeName, const std::string& name, const std::map<std::string, std::string> &par); private: std::map<std::string, int> m_geometryMap; diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/ITkPixelDetectorTool.cxx b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/ITkPixelDetectorTool.cxx index 68a13e81614eb94a7655b4b064709a44ba86c5a1..c0667b9aa46529143d05865a081fb83586cee383 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/ITkPixelDetectorTool.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/ITkPixelDetectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "PixelGeoModelXml/ITkPixelDetectorTool.h" @@ -29,9 +29,9 @@ ITkPixelDetectorTool::ITkPixelDetectorTool(const std::string &type, m_detectorName("ITkPixel"), m_alignable(false), m_gmxFilename(""), - m_manager(0), - m_athenaComps(0), - m_commonItems(0), + m_manager(nullptr), + m_athenaComps(nullptr), + m_commonItems(nullptr), m_geoModelSvc("GeoModelSvc", name), m_rdbAccessSvc("RDBAccessSvc", name), m_geometryDBSvc("InDetGeometryDBSvc", name), @@ -172,7 +172,7 @@ StatusCode ITkPixelDetectorTool::clear() { SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<InDetDD::PixelDetectorManager>::ID(),m_manager->getName()); if(proxy) { proxy->reset(); - m_manager = 0; + m_manager = nullptr; } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelDetectorFactory.cxx b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelDetectorFactory.cxx index f45ed6ec94682b8efb57471e592e19f25d7c24f2..2f2132a973db80025885bebb214ec5c1ef3bc705 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelDetectorFactory.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelDetectorFactory.cxx @@ -80,7 +80,7 @@ namespace InDetDDSLHC { int flags(0); string gmxInput; - if (m_options->gmxFilename() == "") { + if (m_options->gmxFilename().empty()) { ATH_MSG_INFO( "gmxFilename not set; getting .gmx from Geometry database Blob" ); flags = 0x1; // Lowest bit ==> string; next bit implies gzip'd but we decided not to gzip @@ -98,7 +98,7 @@ namespace InDetDDSLHC { else { flags = 0; gmxInput = PathResolver::find_file(m_options->gmxFilename(), "DATAPATH"); - if (gmxInput == "") { // File not found + if (gmxInput.empty()) { // File not found string errMessage("PixelDetectorFactory::create: Unable to find file " + m_options->gmxFilename() + " with PathResolver; check filename and DATAPATH environment variable"); throw runtime_error(errMessage); @@ -135,8 +135,8 @@ namespace InDetDDSLHC { string PixelDetectorFactory::getBlob() { DecodeVersionKey versionKey(geoDbTagSvc(), "Pixel"); - std::string versionTag = versionKey.tag(); - std::string versionNode = versionKey.node(); + const std::string& versionTag = versionKey.tag(); + const std::string& versionNode = versionKey.node(); ATH_MSG_INFO( "getBlob: versionTag = " << versionTag ); ATH_MSG_INFO( "getBlob: versionNode = " << versionNode ); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx index b216ca7f7d1a85db016ab96c0a95bcba0ef4ec73..a2af4b785e45bc4150ba8efe7943a2e0a27e45dd 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx @@ -74,7 +74,7 @@ void PixelGmxInterface::addSensorType(string clas, string typeName, map<string, } } -void PixelGmxInterface::makePixelModule(string typeName, map<string, string> &par){ +void PixelGmxInterface::makePixelModule(const string& typeName, map<string, string> &par){ // // Get all parameters. @@ -144,7 +144,7 @@ void PixelGmxInterface::makePixelModule(string typeName, map<string, string> &pa m_geometryMap[typeName] = m_detectorManager->numDesigns() -1; } -string PixelGmxInterface::getstr(const string typeName, const string name, const map<string, string> &par) { +string PixelGmxInterface::getstr(const string& typeName, const string& name, const map<string, string> &par) { map<string, string>::const_iterator found; if ((found = par.find(name)) != par.end()) { return found->second; diff --git a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelDetectorManager.cxx b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelDetectorManager.cxx index dd6ae0e6b27fb11a70aeade2c82cbe23fe1c1119..555ace102c15c51fba468fc70050b5913feeaa86 100755 --- a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelDetectorManager.cxx +++ b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelDetectorManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "DetDescrConditions/AlignableTransformContainer.h" @@ -28,7 +28,7 @@ namespace InDetDD { PixelDetectorManager::PixelDetectorManager(StoreGateSvc* detStore, const std::string& name) : SiDetectorManager(detStore,name), - m_idHelper(0), + m_idHelper(nullptr), m_isLogical(false) // Change to true to change the definition of local module corrections { @@ -97,7 +97,7 @@ namespace InDetDD { if (idHash.is_valid()) { return m_elementCollection[idHash]; } else { - return 0; + return nullptr; } } @@ -325,7 +325,7 @@ namespace InDetDD { ibldist.resize(nstaves); iblbaseline.resize(nstaves); - const CondAttrListCollection* atrlistcol=0; + const CondAttrListCollection* atrlistcol=nullptr; if (StatusCode::SUCCESS==m_detStore->retrieve(atrlistcol,key)) { // loop over objects in collection for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) { @@ -581,7 +581,7 @@ namespace InDetDD { << " in the " << frame << " frame at level " << level); Identifier ident=Identifier(); - const CondAttrListCollection* atrlistcol=0; + const CondAttrListCollection* atrlistcol=nullptr; if (StatusCode::SUCCESS==m_detStore->retrieve(atrlistcol,key)) { // loop over objects in collection for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) { diff --git a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelModuleDesign.cxx b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelModuleDesign.cxx index c46c5f075ebc2286f1295bf530b7988c5f84d83c..ab98a328036496d8871f3b4ca226a9613aec5f06 100755 --- a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelModuleDesign.cxx +++ b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/src/PixelModuleDesign.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -18,6 +18,8 @@ #include "ReadoutGeometryBase/SiReadoutCellId.h" #include <cmath> +#include <utility> + namespace InDetDD { @@ -41,7 +43,7 @@ PixelModuleDesign::PixelModuleDesign(const double thickness, true, true, true, // phi,eta,depth axes symmetric carrierType, readoutSide), - m_diodeMap(matrix), + m_diodeMap(std::move(matrix)), m_readoutScheme(circuitsPerColumn,circuitsPerRow, cellColumnsPerCircuit,cellRowsPerCircuit, diodeColumnsPerCircuit,diodeRowsPerCircuit), diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx index bb2a8ca2828ae54a670acc14228bba1ae14383db..7c11d56c4a07635e8c0b2bde3fc94ad3ed89cbc1 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -252,7 +252,7 @@ SCT_CablingCondAlgFromCoraCool::execute(const EventContext& ctx) const { //so here we take whatever is in the database and map it onto numbers 0-15 {//scope this calculation, only slotMap should emerge //map slots onto 0-15 - typedef std::set<int> S; + using S = std::set<int>; S slots; for (; rodIt != last_rod; ++rodIt) { //type of 'slot' changed between COMP200 and CONDBR2: diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx index 3ff4ba3df8824264709fa359b99706e5399a6108..da3ea74dcab06ad44a2bd90be69d60bb0b727f0a 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -152,7 +152,7 @@ SCT_CablingCondAlgFromText::execute(const EventContext& ctx) const { } // Check Link variable looks OK // The maximum value of an int is 2147483647 in decimal and 0x7fffffff in hexadecimal. - if (Link.size()==0 or Link.size()>10) { + if (Link.empty() or Link.size()>10) { ATH_MSG_ERROR("An error occurred while reading the cabling file " << m_source.value() << ", Link (" << Link << ") cannot be converted to an integer"); continue; diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingUtilities.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingUtilities.cxx index d4644fd0ea9f28852b435470995357f7096ad14a..8cc9d6adb2981a8f7c2be981e3f989e9de1989fc 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingUtilities.cxx +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingUtilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /* @@ -25,7 +25,7 @@ namespace SCT_Cabling{ //do conversion if the string is not empty if (not hexOrDecString.empty()){ try{ - bool numberIsHex = (hexOrDecString.find("x") not_eq std::string::npos) or (hexOrDecString.find("X") not_eq std::string::npos); + bool numberIsHex = (hexOrDecString.find('x') not_eq std::string::npos) or (hexOrDecString.find('X') not_eq std::string::npos); if(numberIsHex){ istrm>>std::hex>>result; } else { diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h index 675062812259884a6ade843061e0abf507d9a683..08ce68a9681d6bb5e28573480d1184c7d812aa4f 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_IDENTIFIER_H @@ -45,7 +45,7 @@ public: Identifier getWaferId(); // For debugging purposes. - void print(); + void print() const; private: const SCT_ID* m_idHelper; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx index 0350cdedcc92ccada799cee8a55d232f4aff4e80..a8e02c8df3fbbd244a2a58bb010937e47faa4a65 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Barrel.h" @@ -252,7 +252,7 @@ void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const double pixelAttachmentZpos = parameters->pixelAttachmentZMin() + 0.5 * pixelAttachmentLength; // Build cylinder (with cut-outs) - const GeoShape * emiShieldShape = 0; + const GeoShape * emiShieldShape = nullptr; const GeoMaterial * material; const GeoTube * emiShieldTube = new GeoTube(innerRadius, outerRadius, 0.5*length); if (m_isOldGeometry) { diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx index 468c88ea01511cfc29cbdd37cda95d6c9043d342..68010fbedb524fbcd86af82115a63975824c5425 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_BarrelParameters.h" @@ -481,8 +481,7 @@ SCT_BarrelParameters::bearingMaterial() const bool SCT_BarrelParameters::includeFSI() const { - if (m_rdb->brlFSISize() > 0) {return true;} - return false; + return m_rdb->brlFSISize() > 0; } double @@ -860,7 +859,6 @@ SCT_BarrelParameters::activeLength() const bool SCT_BarrelParameters::isOldGeometry() const { - if (m_rdb->brlGeneral()->isFieldNull("CYLINDERLENGTH")) {return true;} - return false; + return m_rdb->brlGeneral()->isFieldNull("CYLINDERLENGTH"); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx index be090e023fb7b8c2eb068c498a43364ac1f6fffd..77166d7a3820233760c17cb8928e9e721415faf4 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_DataBase.h" @@ -23,8 +23,8 @@ SCT_DataBase::SCT_DataBase(SCT_GeoModelAthenaComps * athenaComps) // Get version tag and node for SCT DecodeVersionKey versionKey(geoDbTag,"SCT"); - std::string versionTag = versionKey.tag(); - std::string versionNode = versionKey.node(); + const std::string& versionTag = versionKey.tag(); + const std::string& versionNode = versionKey.node(); // Get version tag and node for InnerDetector. DecodeVersionKey indetVersionKey(geoDbTag,"InnerDetector"); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx index ef6af4c275dd7e994ee79f39486e6ce6d56c6ba1..0460e9f096c6386c25e4a7b7ae3fc4ebb819e628 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_ForwardModuleParameters.h" @@ -356,12 +356,7 @@ SCT_ForwardModuleParameters::fwdHybridIsOnInnerEdge(int iModuleType) const bool SCT_ForwardModuleParameters::fwdModuleConnectorPresent() const { - if(m_rdb->fwdModuleConnectorTable()->size() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdModuleConnectorTable()->size() > 0; } double diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx index f72533b1ed77d179bb36f09e7315296642e842e9..737dc6f4db03c6d291d34cc132a241c0c24fcb26 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_ForwardParameters.h" @@ -12,8 +12,10 @@ #include "SCT_GeoModel/SCT_FSIHelper.h" #include "GaudiKernel/SystemOfUnits.h" -#include <iostream> #include <cmath> +#include <iostream> +#include <memory> + SCT_ForwardParameters::SCT_ForwardParameters(SCT_DataBase* rdb) { @@ -257,12 +259,7 @@ SCT_ForwardParameters::fwdPatchPanelMaterial(int iType) const bool SCT_ForwardParameters::fwdPPConnectorPresent() const { - if (m_rdb->fwdPPCoolingSize() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdPPCoolingSize() > 0; } double @@ -295,12 +292,7 @@ SCT_ForwardParameters::fwdPPConnectorMaterial() const bool SCT_ForwardParameters::fwdPPCoolingPresent() const { - if (m_rdb->fwdPPCoolingSize() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdPPCoolingSize() > 0; } double @@ -436,12 +428,7 @@ SCT_ForwardParameters::fwdRingCoolingMaterial(int iRing) const bool SCT_ForwardParameters::fwdDiscFixationPresent() const { - if (m_rdb->fwdDiscFixationTable()->size() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdDiscFixationTable()->size() > 0; } double @@ -590,12 +577,7 @@ SCT_ForwardParameters::fsiVector(int iWheel) const bool SCT_ForwardParameters::fwdCylinderServicePresent() const { - if (m_rdb->fwdCylServSize() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdCylServSize() > 0; } int @@ -732,12 +714,7 @@ SCT_ForwardParameters::fwdTrtGapPos() const bool SCT_ForwardParameters::fwdOptoHarnessPresent() const { - if (m_rdb->fwdOptoHarnessTable()->size() > 0) { - return true; - } - else { - return false; - } + return m_rdb->fwdOptoHarnessTable()->size() > 0; } int @@ -774,12 +751,12 @@ SCT_ForwardParameters& SCT_ForwardParameters::operator=(const SCT_ForwardParameters& right) { if (this != &right) { m_rdb = right.m_rdb; - m_fsiHelper.reset(new FSIHelper(m_rdb)); + m_fsiHelper = std::make_unique<FSIHelper>(m_rdb); } return *this; } SCT_ForwardParameters::SCT_ForwardParameters(const SCT_ForwardParameters& right) { m_rdb = right.m_rdb; - m_fsiHelper.reset(new FSIHelper(m_rdb)); + m_fsiHelper = std::make_unique<FSIHelper>(m_rdb); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx index febcd3742017b2a2b3362c69bb672007f6692cf8..f4a949bd4779e73cdfb9f543d49abf9757d4c67a 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdRing.h" @@ -242,7 +242,7 @@ SCT_FwdRing::build(SCT_Identifier id) double zModuleServices = 0; double rModuleServices = 0; - GeoVPhysVol * moduleServices = 0; + GeoVPhysVol * moduleServices = nullptr; if (staggerUpperLower > 0){ // Upper zModuleServices = m_moduleServicesHiZPos * m_ringSide; rModuleServices = m_moduleServicesHiRPos; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx index bee92a61b250051cf4907d84bd5c812a9c156d65..fcfa2a3f02f5b73c7e79ecb618c7155492441eef 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdSensor.h" @@ -63,7 +63,7 @@ SCT_FwdSensor::getParameters() m_materialSensor = m_materials->getMaterial(parameters->fwdSensorMaterialFar(m_ringType)); - m_materialGlass = 0; + m_materialGlass = nullptr; if (m_ringType == 2) { // Only need to define glass if its a Truncated middle module. m_materialGlass = m_materials->getMaterial(parameters->fwdSensorMaterialNear(m_ringType)); } @@ -120,7 +120,7 @@ const GeoLogVol * SCT_FwdSensor::preBuild() 0.5 * m_lengthF); - const GeoTrd * sensorShapeN= 0; + const GeoTrd * sensorShapeN= nullptr; if (m_ringType != 3) { sensorShapeN= new GeoTrd(0.5 * m_thicknessN, 0.5 * m_thicknessN, 0.5 * m_innerWidthN, 0.5 * m_outerWidthN, @@ -128,7 +128,7 @@ const GeoLogVol * SCT_FwdSensor::preBuild() } - const GeoShape * sensorShape = 0; + const GeoShape * sensorShape = nullptr; if ((m_ringType == 2) || (m_ringType == 3)) { // For truncated middle and inner there is only one wafer. sensorShape = sensorShapeF; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx index d1f1202db517b8e3a63be21fe012193ab2c850a5..700f56ad4e53e17de7d2c3e5f614318ea4379368 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -79,7 +79,7 @@ GeoVPhysVol * SCT_FwdSubSpine::build() const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); const GeoBox * spineShape1 = new GeoBox( m_thickness1/2., m_width1/2., m_length1/2.); - const GeoBox * spineShape2 = 0; + const GeoBox * spineShape2 = nullptr; if (m_ringType != 3) spineShape2 = new GeoBox( m_thickness2/2., m_width2/2., m_length2/2.); const GeoBox * spineShape3 = new GeoBox( m_thickness3/2., m_width3/2., m_length3/2.); @@ -95,7 +95,7 @@ GeoVPhysVol * SCT_FwdSubSpine::build() double widthMain = parameters->fwdSpineWidth(m_ringType); // width of main spine - const GeoShape * subSpineMiddle = 0; + const GeoShape * subSpineMiddle = nullptr; // Inner sub spine double mountPosition = parameters->fwdModuleMountPoint(m_ringType); // mount point to physics center diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx index 0067266c1aafd8d4e088e0b217564cee060191f9..4ad93e2d94d2e665ad8a8726a5b52be0bc1b7d24 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" SCT_GeoModelAthenaComps::SCT_GeoModelAthenaComps() : InDetDD::AthenaComps("SCT_GeoModel"), - m_idHelper(0) + m_idHelper(nullptr) {} void diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx index 36a8b92569537aa74bc783b876b3eceb8981f7bb..a1ce2d5462ffbde159edb0b0b6d915880cc943ea 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx @@ -1,7 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ +#include <memory> + + + #include "SCT_GeoModel/SCT_GeometryManager.h" #include "InDetGeoModelUtils/DistortedMaterialManager.h" @@ -116,12 +120,12 @@ SCT_GeometryManager::operator=(const SCT_GeometryManager& right) { m_athenaComps = right.m_athenaComps; m_commonItems = right.m_commonItems; m_rdb = right.m_rdb; - m_barrelParameters.reset(new SCT_BarrelParameters(m_rdb)); - m_barrelModuleParameters.reset(new SCT_BarrelModuleParameters(m_rdb)); - m_forwardParameters.reset(new SCT_ForwardParameters(m_rdb)); - m_forwardModuleParameters.reset(new SCT_ForwardModuleParameters(m_rdb)); - m_generalParameters.reset(new SCT_GeneralParameters(m_rdb)); - m_distortedMatManager.reset(new InDetDD::DistortedMaterialManager()); + m_barrelParameters = std::make_unique<SCT_BarrelParameters>(m_rdb); + m_barrelModuleParameters = std::make_unique<SCT_BarrelModuleParameters>(m_rdb); + m_forwardParameters = std::make_unique<SCT_ForwardParameters>(m_rdb); + m_forwardModuleParameters = std::make_unique<SCT_ForwardModuleParameters>(m_rdb); + m_generalParameters = std::make_unique<SCT_GeneralParameters>(m_rdb); + m_distortedMatManager = std::make_unique<InDetDD::DistortedMaterialManager>(); } return *this; } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx index ca4fbc14c040a848ea0fa7180d8c84b9ead99036..b1ae436545330da047f82b1803c642cf8b2d4332 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Identifier.h" @@ -16,7 +16,7 @@ SCT_Identifier::getWaferId() return m_idHelper->wafer_id(m_barrelEC, m_layerDisk, m_phiModule, m_etaModule, m_side); } -void SCT_Identifier::print() +void SCT_Identifier::print() const { std::cout << "2/2/" << m_barrelEC << "/" << m_layerDisk << "/" diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx index aba3868c304d6ef9e141a1e41af68046ae960613..e101ee25996cf20702f3f00e7f8048dd7541af8c 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Ski.h" @@ -306,7 +306,7 @@ SCT_Ski::preBuild() GeoBox * envelope1 = new GeoBox(0.5 * (xmax1-xmin1), 0.5 * (ymax1-ymin1), 0.5 * m_length); GeoBox * envelope2 = new GeoBox(0.5 * (xmax2-xmin2), 0.5 * (ymax2-ymin2), 0.5 * m_length); - const GeoShape * skiEnvelopeShape = 0; + const GeoShape * skiEnvelopeShape = nullptr; const GeoShape & tmpShape = (*envelope1). add(*envelope2 << GeoTrf::Translate3D(xShift2, yShift2, 0)); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx index d95255ec71d607649a7aa5e8ef372ca6cad7c5d5..1335d96d65f099f9803bef9add7705d1a96a28b3 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // @@ -90,7 +90,7 @@ SCT_SkiAux::build() // width double xHarnessPos = 0; double yHarnessPos = 0; - if(m_harness != 0) { + if(m_harness != nullptr) { double radiusHarness = m_innerRadius + 0.5 * m_harness->thickness() + m_skiPowerTape->powerTapeThickness(); @@ -110,7 +110,7 @@ SCT_SkiAux::build() double radiusTape = m_innerRadius + 0.5 * m_skiPowerTape->thickness() + m_skiPowerTape->powerTapeThickness(); - if(m_harness != 0) {radiusTape += m_harness->thickness();} + if(m_harness != nullptr) {radiusTape += m_harness->thickness();} double xTapePos = radiusTape * cos(m_powerTapePhiOffset); double yTapePos = radiusTape * sin(m_powerTapePhiOffset); @@ -139,7 +139,7 @@ SCT_SkiAux::build() double halfAngleBracket = atan(0.5 * m_bracket->width()/m_innerRadius); double halfAnglePowerTape = atan(0.5 * m_skiPowerTape->width()/m_innerRadius); // Harness and power tape are at same phi - if(m_harness != 0) { + if(m_harness != nullptr) { double halfAngleHarness = atan(0.5 * m_harness->width()/m_innerRadius); halfAnglePowerTape = std::max(halfAnglePowerTape, halfAngleHarness); } @@ -182,7 +182,7 @@ SCT_SkiAux::build() } // Position the harness - if(m_harness != 0) { + if(m_harness != nullptr) { GeoTrf::Translation3D posHarness(xHarnessPos, yHarnessPos, 0); GeoTrf::RotateZ3D rotHarness(m_powerTapePhiOffset); skiAux->add(new GeoTransform(GeoTrf::Transform3D(posHarness*rotHarness))); diff --git a/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/src/SCT_DistortionsTool.cxx b/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/src/SCT_DistortionsTool.cxx index 6768701612f3d6c3ec52e279cc138c6783dbda32..3ffbdb4a345a388a2d47e34ed15ed9a0df5bb82d 100644 --- a/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/src/SCT_DistortionsTool.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/src/SCT_DistortionsTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_DistortionsTool.h" @@ -312,7 +312,7 @@ bool SCT_DistortionsTool::loadData() // ***** Jap1 ***** std::string file_name = PathResolver::find_file(m_textFileNameJ1, "DATAPATH"); - if (file_name.size()==0) { + if (file_name.empty()) { msg(MSG::WARNING) << "Hash file " << m_textFileNameJ1 << " not found! " << endmsg; return false; } @@ -328,7 +328,7 @@ bool SCT_DistortionsTool::loadData() // ***** Jap2 ***** std::string file_name2 = PathResolver::find_file(m_textFileNameJ2, "DATAPATH"); - if (file_name2.size()==0) { + if (file_name2.empty()) { msg(MSG::WARNING) <<"Hash file " << m_textFileNameJ2 << " not found! " << endmsg; return false; } @@ -345,7 +345,7 @@ bool SCT_DistortionsTool::loadData() // ***** UK ***** std::string file_name3 = PathResolver::find_file(m_textFileNameUK, "DATAPATH"); - if (file_name3.size()==0) { + if (file_name3.empty()) { msg(MSG::WARNING) << "Hash file " << m_textFileNameUK << " not found! " << endmsg; return false; } @@ -362,7 +362,7 @@ bool SCT_DistortionsTool::loadData() // ***** USA ***** std::string file_name4 = PathResolver::find_file(m_textFileNameUSA, "DATAPATH"); - if (file_name4.size()==0) { + if (file_name4.empty()) { msg(MSG::WARNING)<< "Hash file " << m_textFileNameUSA << " not found! " << endmsg; return false; } @@ -378,7 +378,7 @@ bool SCT_DistortionsTool::loadData() // ***** Scand ***** std::string file_name5 = PathResolver::find_file(m_textFileNameScand, "DATAPATH"); - if (file_name5.size()==0) { + if (file_name5.empty()) { msg(MSG::WARNING) << "Hash file " << m_textFileNameScand << " not found! " << endmsg; return false; } @@ -393,7 +393,7 @@ bool SCT_DistortionsTool::loadData() input5.close(); std::string pro_file_name = PathResolver::find_file(m_textFileNameProfiles, "DATAPATH"); - if (pro_file_name.size()==0) { + if (pro_file_name.empty()) { msg(MSG::WARNING) << "Profile file " << m_textFileNameProfiles << " not found! " << endmsg; } std::ifstream inputProfile(pro_file_name.c_str()); diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_DetectorManager.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_DetectorManager.cxx index edd48ee0c9f6b4f2ef048911c33cb7fdf4f7a756..d93c71efc1e4d28ab73739c28669c1959da0b609 100755 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_DetectorManager.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_DetectorManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_ReadoutGeometry/SCT_DetectorManager.h" @@ -29,7 +29,7 @@ namespace InDetDD { SCT_DetectorManager::SCT_DetectorManager( StoreGateSvc* detStore, const std::string& name ) : SiDetectorManager(detStore,name), - m_idHelper(0), + m_idHelper(nullptr), m_isLogical(false) // Change to true to change the definition of local module corrections { ATH_MSG_VERBOSE("Creating SCT_DetectorManager named " << name); @@ -82,7 +82,7 @@ namespace InDetDD { if (idHash.is_valid()) { return m_elementCollection[idHash]; } else { - return 0; + return nullptr; } } diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_ModuleSideDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_ModuleSideDesign.cxx index de593f48ec7d390637a0581f3a7b5de1bc964951..b05247a5cf59ee9c845d3aa0b408984c510b1a09 100755 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_ModuleSideDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/SCT_ModuleSideDesign.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -78,10 +78,10 @@ void SCT_ModuleSideDesign::neighboursOfCell(const SiCellId &cellId, int stripP = strip + 1; if (stripM >= m_scheme.shift()) { - neighbours.push_back(stripM); + neighbours.emplace_back(stripM); } if (stripP < m_scheme.diodes() + m_scheme.shift()) { - neighbours.push_back(stripP); + neighbours.emplace_back(stripP); } } diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx index 52bdc1b8aecd2ad43772c1eb112d8502496de1cb..867715e087286a6784f06e4d0ab098fd0f8166be 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include <stdexcept> @@ -54,10 +54,10 @@ void StripAnnulusDesign::neighboursOfCell(const SiCellId &cellId, std::vector<Si int stripP = strip + 1; if (stripM > 0) { - neighbours.push_back(stripM); + neighbours.emplace_back(stripM); } if (stripP < m_nStrips) { - neighbours.push_back(stripP); + neighbours.emplace_back(stripP); } return; diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx index bd39bc93b1db11fae5b906ca44b9f7b0588199b6..2f9529d41491c2249126eb715e8ca5704ef044ac 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_ReadoutGeometry/StripBoxDesign.h" @@ -65,10 +65,10 @@ void StripBoxDesign::neighboursOfCell(const SiCellId &cellId, int stripP = strip + 1; if (stripM >= 0) { - neighbours.push_back(stripM); + neighbours.emplace_back(stripM); } if (stripP < m_nStrips) { - neighbours.push_back(stripP); + neighbours.emplace_back(stripP); } return; diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx index dd10ddd2c48cf66aa8fa7974f266ae8fdc912cce..188526114eededb1d34d93c7f1d940e00739773c 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_ReadoutGeometry/StripStereoAnnulusDesign.h" @@ -124,10 +124,10 @@ void StripStereoAnnulusDesign::neighboursOfCell(const SiCellId &cellId, std::vec int stripP = strip + 1; if (stripM >= m_firstStrip[row]) { - neighbours.push_back(stripM); + neighbours.emplace_back(stripM); } if (stripP < m_firstStrip[row] + m_nStrips[row]) { - neighbours.push_back(stripP); + neighbours.emplace_back(stripP); } return; diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/StripGeoModelXml/StripGmxInterface.h b/InnerDetector/InDetDetDescr/StripGeoModelXml/StripGeoModelXml/StripGmxInterface.h index 31dcf6a94848170530c7c5ae46e8f9f607e69d65..f8d6e04126c53e964997aead0c99e7678c9a2a92 100644 --- a/InnerDetector/InDetDetDescr/StripGeoModelXml/StripGeoModelXml/StripGmxInterface.h +++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/StripGeoModelXml/StripGmxInterface.h @@ -33,8 +33,8 @@ public: void addSplitSensor(std::string typeName, std::map<std::string, int> &index, std::pair<std::string, int> &extraIndex, int sequentialId, GeoVFullPhysVol *fpv) override final; virtual void addAlignable(int level, std::map<std::string, int> &index, GeoVFullPhysVol *fpv, GeoAlignableTransform *transform) override; - void makeSiStripBox(std::string typeName, std::map<std::string, std::string> &par); - void makeStereoAnnulus(std::string typeName, std::map<std::string, std::string> &par); + void makeSiStripBox(const std::string& typeName, std::map<std::string, std::string> &par); + void makeStereoAnnulus(const std::string& typeName, std::map<std::string, std::string> &par); template <typename T> bool checkparm(const std::string /*typeName*/, const std::string name, const std::map<std::string, std::string> &par, T &value){ @@ -82,7 +82,7 @@ public: } } - std::string getstr(const std::string typeName, const std::string name, const std::map<std::string, std::string> &par); + std::string getstr(const std::string& typeName, const std::string& name, const std::map<std::string, std::string> &par); private: std::map<std::string, const InDetDD::SiDetectorDesign *> m_geometryMap; diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorFactory.cxx b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorFactory.cxx index 55a1117a2f76af76ce1e6505c4970ee8b074fae6..93e4652014f02281b1323b299c6ca5266b641819 100644 --- a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorFactory.cxx +++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorFactory.cxx @@ -86,7 +86,7 @@ void StripDetectorFactory::create(GeoPhysVol *world) { int flags(0); string gmxInput; - if (m_options->gmxFilename() == "") { + if (m_options->gmxFilename().empty()) { msg(MSG::INFO) << "gmxFilename not set; getting .gmx from Geometry database Blob" << endmsg; flags = 0x1; // Lowest bit ==> string; next bit implies gzip'd but we decided not to gzip gmxInput = getBlob(); @@ -103,7 +103,7 @@ void StripDetectorFactory::create(GeoPhysVol *world) { else { flags = 0; gmxInput = PathResolver::find_file(m_options->gmxFilename(), "DATAPATH"); - if (gmxInput == "") { // File not found + if (gmxInput.empty()) { // File not found string errMessage("StripDetectorFactory::create: Unable to find file " + m_options->gmxFilename() + " with PathResolver; check filename and DATAPATH environment variable"); throw runtime_error(errMessage); @@ -141,8 +141,8 @@ void StripDetectorFactory::create(GeoPhysVol *world) { string StripDetectorFactory::getBlob() { DecodeVersionKey versionKey(geoDbTagSvc(), "SCT"); - std::string versionTag = versionKey.tag(); - std::string versionNode = versionKey.node(); + const std::string& versionTag = versionKey.tag(); + const std::string& versionNode = versionKey.node(); msg(MSG::INFO) << "getBlob: versionTag = " << versionTag << endmsg; msg(MSG::INFO) << "getBlob: versionNode = " << versionNode << endmsg; diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorTool.cxx b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorTool.cxx index 059174d345afaddd3249a809a50473e41606c124..787c594a523039ba65f28e9453337965abcdbb4b 100644 --- a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorTool.cxx +++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripDetectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "StripGeoModelXml/StripDetectorTool.h" @@ -30,9 +30,9 @@ StripDetectorTool::StripDetectorTool(const std::string &type, m_detectorName("ITkStrip"), m_alignable(false), m_gmxFilename(""), - m_manager(0), - m_athenaComps(0), - m_commonItems(0), + m_manager(nullptr), + m_athenaComps(nullptr), + m_commonItems(nullptr), m_geoModelSvc("GeoModelSvc", name), m_rdbAccessSvc("RDBAccessSvc", name), m_geometryDBSvc("InDetGeometryDBSvc", name), @@ -192,7 +192,7 @@ StatusCode StripDetectorTool::clear() { SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<InDetDD::SCT_DetectorManager>::ID(),m_manager->getName()); if(proxy) { proxy->reset(); - m_manager = 0; + m_manager = nullptr; } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx index daf68b8362df284b3f80047bda850bff5c365f21..813eee80da582a62078aa68a0ebac99ffed86e52 100644 --- a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx +++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx @@ -106,7 +106,7 @@ void StripGmxInterface::addSensorType(string clas, string typeName, map<string, } -void StripGmxInterface::makeSiStripBox(string typeName, map<string, string> &par) { +void StripGmxInterface::makeSiStripBox(const string& typeName, map<string, string> &par) { // // Get all parameters. // @@ -234,7 +234,7 @@ double length(25.0); } } -void StripGmxInterface::makeStereoAnnulus(string typeName, map<std::string, string> &par) { +void StripGmxInterface::makeStereoAnnulus(const string& typeName, map<std::string, string> &par) { // // Get all parameters. // @@ -401,7 +401,7 @@ vector<double> endR; } -string StripGmxInterface::getstr(const string typeName, const string name, const map<string, string> &par) { +string StripGmxInterface::getstr(const string& typeName, const string& name, const map<string, string> &par) { map<string, string>::const_iterator found; if ((found = par.find(name)) != par.end()) { return found->second; diff --git a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/src/TRT_DetElementContainer.cxx b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/src/TRT_DetElementContainer.cxx index 3822c0ff6f7acf2b66f268426ed23c75e518ac35..a633736f0c6b2ff7068778f5b6bbf1144722e859 100644 --- a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/src/TRT_DetElementContainer.cxx +++ b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/src/TRT_DetElementContainer.cxx @@ -1,6 +1,6 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "TRT_ReadoutGeometry/TRT_DetElementContainer.h" @@ -100,7 +100,7 @@ namespace InDetDD{ void TRT_DetElementContainer::clear() { - for (auto p : m_trtcoll) { + for (auto *p : m_trtcoll) { delete p; } m_trtcoll.clear();