diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_LayerBuilderCond.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_LayerBuilderCond.cxx index 020a7253728185b5971a8270501f7a6733f2f55a..fde4091b051b9e75c0af5c009da079b91d56918e 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_LayerBuilderCond.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_LayerBuilderCond.cxx @@ -69,8 +69,7 @@ HGTD_LayerBuilderCond::HGTD_LayerBuilderCond(const std::string& t, const std::st } // destructor -HGTD_LayerBuilderCond::~HGTD_LayerBuilderCond() -{} +HGTD_LayerBuilderCond::~HGTD_LayerBuilderCond()= default; // Athena standard methods // initialize diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilderCond.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilderCond.cxx index 0b7ec7c56849564c83376fa8fa63d379a55481e6..c199b1bb29a135d6fcf4193352c1821c9c156b6b 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilderCond.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilderCond.cxx @@ -68,8 +68,7 @@ HGTD_TrackingGeometryBuilderCond::HGTD_TrackingGeometryBuilderCond(const std::st // destructor HGTD_TrackingGeometryBuilderCond::~HGTD_TrackingGeometryBuilderCond() -{ -} += default; // Athena standard methods // initialize diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/BeamPipeBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/BeamPipeBuilder.h index 22410b0eaa6b4d96ce1356d0495874ca095fd062..d05292deb77a2e3646977bcfe498e0ecc60e231b 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/BeamPipeBuilder.h +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/BeamPipeBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -55,13 +55,13 @@ namespace InDet { StatusCode finalize(); /** LayerBuilder interface method - returning Barrel-like layers */ - const std::vector< const Trk::CylinderLayer* >* cylindricalLayers() const; + const std::vector<Trk::CylinderLayer* >* cylindricalLayers() const; /** LayerBuilder interface method - returning Endcap-like layers */ - const std::vector< const Trk::DiscLayer* >* discLayers() const; + const std::vector<Trk::DiscLayer* >* discLayers() const; /** LayerBuilder interface method - returning Planar-like layers */ - const std::vector< const Trk::PlaneLayer* >* planarLayers() const; + const std::vector<Trk::PlaneLayer* >* planarLayers() const; /** Name identification */ const std::string& identification() const; @@ -92,10 +92,10 @@ namespace InDet { }; - inline const std::vector< const Trk::DiscLayer* >* BeamPipeBuilder::discLayers() const + inline const std::vector< Trk::DiscLayer* >* BeamPipeBuilder::discLayers() const { return 0; } - inline const std::vector< const Trk::PlaneLayer* >* BeamPipeBuilder::planarLayers() const + inline const std::vector< Trk::PlaneLayer* >* BeamPipeBuilder::planarLayers() const { return 0; } inline const std::string& BeamPipeBuilder::identification() const diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h index d03625f740d16f7ab7175f50c40a7ff26dc3c60e..63ef88fcdd59914c65bab96054c5c70fa7019fcc 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -81,23 +81,23 @@ namespace InDet { StatusCode finalize(); /** LayerBuilder interface method - returning Barrel-like layers */ - const std::vector< const Trk::CylinderLayer* >* cylindricalLayers() const; + const std::vector<Trk::CylinderLayer* >* cylindricalLayers() const; /** LayerBuilder interface method - returning Endcap-like layers */ - const std::vector< const Trk::DiscLayer* >* discLayers() const; + const std::vector<Trk::DiscLayer* >* discLayers() const; /** LayerBuilder interface method - returning Planar-like layers */ - const std::vector< const Trk::PlaneLayer* >* planarLayers() const; + const std::vector<Trk::PlaneLayer* >* planarLayers() const; /** Name identification */ const std::string& identification() const; private: - std::vector< const Trk::CylinderLayer* >* dressCylinderLayers(const std::vector< const Trk::CylinderLayer* >& dLayers) const; + std::vector<Trk::CylinderLayer* >* dressCylinderLayers(const std::vector<Trk::CylinderLayer* >& dLayers) const; /** create the disc layers, if no vector is given, then it's the first pass, else it's the DBM for the Pixels */ - std::vector< const Trk::DiscLayer* >* createDiscLayers(std::vector<const Trk::DiscLayer* >* dLayers = NULL) const; - std::vector< const Trk::DiscLayer* >* createRingLayers() const; + std::vector<Trk::DiscLayer*>* createDiscLayers(std::vector<Trk::DiscLayer*>* dLayers = nullptr) const; + std::vector<Trk::DiscLayer*>* createRingLayers() const; const Trk::LayerMaterialProperties* barrelLayerMaterial(double r, double hz) const; //!< helper method to construct barrel material const Trk::LayerMaterialProperties* endcapLayerMaterial(double rMin, double rMax) const; //!< helper method to construct endcap material @@ -135,8 +135,8 @@ namespace InDet { double m_splitTolerance; //!< difference in layer half length to provoke the split static double s_splitRadius; //!< Split radius for multiple pixel systems - static std::vector<const Trk::CylinderLayer*> s_splitCylinderLayers; //!< cached SLHC/split cylinder layers for projective layout - static std::vector<const Trk::DiscLayer*> s_splitDiscLayers; //!< cached SLHC/split disc layers for projective layout + static std::vector<Trk::CylinderLayer*> s_splitCylinderLayers; //!< cached SLHC/split cylinder layers for projective layout + static std::vector<Trk::DiscLayer*> s_splitDiscLayers; //!< cached SLHC/split disc layers for projective layout bool m_runGeometryValidation; //!< run the validation of the geometry ( no empty bins) @@ -148,7 +148,7 @@ namespace InDet { }; - inline const std::vector< const Trk::PlaneLayer* >* SiLayerBuilder::planarLayers() const + inline const std::vector<Trk::PlaneLayer*>* SiLayerBuilder::planarLayers() const { return 0; } inline const std::string& SiLayerBuilder::identification() const diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h index 8cce6b9cbfde041c12c4f8d84316188e06cd35b0..fa118663005b49bfcfe79ab4fdd080d60d9f53a3 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -82,14 +82,14 @@ namespace InDet { LayerSetup(const std::string& idName, int cCode, - const std::vector<const Trk::Layer*>& negLayers, - const std::vector<const Trk::Layer*>& cenLayers, - const std::vector<const Trk::Layer*>& posLayers, + const std::vector<Trk::Layer*>& negLayers, + const std::vector<Trk::Layer*>& cenLayers, + const std::vector<Trk::Layer*>& posLayers, double minRc, double maxRc, double zC, int binC, bool bec=false, double minRe=0., double maxRe=0., double zMinE=0., double zMaxE=0., int binE = 0) : - negativeLayers(negLayers), - centralLayers(cenLayers), - positiveLayers(posLayers), + negativeLayers(negLayers.begin(),negLayers.end()), + centralLayers(cenLayers.begin(),cenLayers.end()), + positiveLayers(posLayers.begin(),posLayers.end()), minRadiusCenter(minRc), maxRadiusCenter(maxRc), zExtendCenter(zC), @@ -151,13 +151,13 @@ namespace InDet { private: /** Private helper method, estimates the overal dimensions */ LayerSetup estimateLayerSetup(const std::string& idName, size_t ils, - const std::vector<const Trk::Layer*>& negLayers, - const std::vector<const Trk::Layer*>& centralLayers, - const std::vector<const Trk::Layer*>& posLayers, + const std::vector<Trk::Layer*>& negLayers, + const std::vector<Trk::Layer*>& centralLayers, + const std::vector<Trk::Layer*>& posLayers, double maxR, double maxZ) const; /** Private helper method to estimate the layer dimensions */ - void estimateLayerDimensions(const std::vector<const Trk::Layer*>& layers, + void estimateLayerDimensions(const std::vector<Trk::Layer*>& layers, double& rMin, double& rMax, double& zMin, double& zMax) const; /** Private helper method to check if a sector is compatible with the cache */ diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/TRT_LayerBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/TRT_LayerBuilder.h index 5bbe0a6ae80f3ded381c6c3fe71e541ac569bbf5..282956ba1777c4273cb1f6ac19295eac82191d0a 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/TRT_LayerBuilder.h +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/TRT_LayerBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -62,13 +62,13 @@ namespace InDet { StatusCode initialize(); /** LayerBuilder interface method - returning Barrel-like layers */ - const std::vector< const Trk::CylinderLayer* >* cylindricalLayers() const; + const std::vector<Trk::CylinderLayer*>* cylindricalLayers() const; /** LayerBuilder interface method - returning Endcap-like layers */ - const std::vector< const Trk::DiscLayer* >* discLayers() const; + const std::vector<Trk::DiscLayer*>* discLayers() const; /** LayerBuilder interface method - returning Planar-like layers */ - const std::vector< const Trk::PlaneLayer* >* planarLayers() const; + const std::vector<Trk::PlaneLayer*>* planarLayers() const; /** Name identification */ const std::string& identification() const; @@ -97,8 +97,8 @@ namespace InDet { }; - inline const std::vector< const Trk::PlaneLayer* >* TRT_LayerBuilder::planarLayers() const - { return 0; } + inline const std::vector<Trk::PlaneLayer* >* TRT_LayerBuilder::planarLayers() const + { return nullptr; } inline const std::string& TRT_LayerBuilder::identification() const { return m_identification; } diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx index 3dfded32caa9484359be3fc11ab374470cef3faa..c4d3e7f7412f5c818034e0c9f00f63ee6d558e43 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -69,8 +69,7 @@ InDet::BeamPipeBuilder::BeamPipeBuilder(const std::string& t, const std::string& } // destructor -InDet::BeamPipeBuilder::~BeamPipeBuilder() -{} +InDet::BeamPipeBuilder::~BeamPipeBuilder()= default; // Athena standard methods // initialize @@ -95,10 +94,10 @@ StatusCode InDet::BeamPipeBuilder::finalize() /** LayerBuilder interface method - returning Barrel-like layers */ -const std::vector< const Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindricalLayers() const +const std::vector< Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindricalLayers() const { - std::vector<const Trk::CylinderLayer*>* beamPipe = new std::vector<const Trk::CylinderLayer*>; + std::vector<Trk::CylinderLayer*>* beamPipe = new std::vector<Trk::CylinderLayer*>; // the geometry Amg::Transform3D beamPipeTransform; @@ -109,8 +108,10 @@ const std::vector< const Trk::CylinderLayer* >* InDet::BeamPipeBuilder::cylindri if (m_beamPipeMgr){ // get the central top volume PVConstLink beamPipeTopVolume = m_beamPipeMgr->getTreeTop(0); - if (m_beamPipeMgr->getNumTreeTops()==1){ // Beampipe implementation using assembly volume has only one tree top instead of 3 in the default case(union of a central and two forward beampipes) - beamPipeTopVolume = m_beamPipeMgr->getTreeTop(0)->getChildVol(0)->getChildVol(0);//the BeamPipeCentral volume is the child of the child volume of the top volume in this case + if (m_beamPipeMgr->getNumTreeTops()==1){ + // Beampipe implementation using assembly volume has only one tree top instead of 3 in the default case(union of a central and two forward beampipes) + beamPipeTopVolume = m_beamPipeMgr->getTreeTop(0)->getChildVol(0)->getChildVol(0); + //the BeamPipeCentral volume is the child of the child volume of the top volume in this case } beamPipeTransform = Amg::Translation3D(beamPipeTopVolume->getX().translation().x(), beamPipeTopVolume->getX().translation().y(), diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx index 987e1764b97ad7e49d059cbb5f899a93232e6654..3b191a3b43897d2b7aa1521b03faaadb8c2591de 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/BeamPipeBuilderCond.cxx @@ -71,8 +71,7 @@ InDet::BeamPipeBuilderCond::BeamPipeBuilderCond(const std::string& t, const std: } // destructor -InDet::BeamPipeBuilderCond::~BeamPipeBuilderCond() -{} +InDet::BeamPipeBuilderCond::~BeamPipeBuilderCond()= default; // Athena standard methods // initialize diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx index 61dc3fe291cc37ba09ba7f0eef3c5ae35c525b79..59ae6382aa3eba157c5f099421432d7be067901e 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx @@ -75,9 +75,7 @@ InDet::RobustTrackingGeometryBuilder::RobustTrackingGeometryBuilder(const std::s } // destructor -InDet::RobustTrackingGeometryBuilder::~RobustTrackingGeometryBuilder() -{ -} +InDet::RobustTrackingGeometryBuilder::~RobustTrackingGeometryBuilder()= default; // Athena standard methods // initialize @@ -182,7 +180,7 @@ Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeometry AT // retrieve the cylinder and disc layers ATH_MSG_DEBUG( "[ LayerBuilder : '" << m_layerBuilders[ilb]->identification() << "' ] being processed. " ); // (a) cylinder - const std::vector<const Trk::CylinderLayer*>* cylinderLayers = m_layerBuilders[ilb]->cylindricalLayers(); + const std::vector<Trk::CylinderLayer*>* cylinderLayers = m_layerBuilders[ilb]->cylindricalLayers(); // (a) std::vector<const Trk::Layer*> cylinderVolumeLayers; if (cylinderLayers && !cylinderLayers->empty()){ @@ -231,7 +229,7 @@ Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeometry AT endcapMinExtend = ( centralExtendZ > endcapMinExtend) ? 10e10 : endcapMinExtend; // (b) discs - const std::vector<const Trk::DiscLayer*>* discLayers = m_layerBuilders[ilb]->discLayers(); + const std::vector<Trk::DiscLayer*>* discLayers = m_layerBuilders[ilb]->discLayers(); std::vector<const Trk::Layer*> discVolumeLayersNeg; std::vector<const Trk::Layer*> discVolumeLayersPos; if (discLayers && !discLayers->empty()){ @@ -332,21 +330,9 @@ Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeometry AT Trk::CylinderVolumeBounds* beamPipeBounds = new Trk::CylinderVolumeBounds(overallRmin,overallExtendZ); // BinnedArray needed Trk::BinnedArray<Trk::Layer>* beamPipeLayerArray = nullptr; - const std::vector<const Trk::CylinderLayer*>* beamPipeVec = m_beamPipeBuilder->cylindricalLayers(); + const std::vector<Trk::CylinderLayer*>* beamPipeVec = m_beamPipeBuilder->cylindricalLayers(); if (!beamPipeVec->empty()) { - /* - * This is done correctly in RobustTrackingGeometryBuilderCond as the beamPipeBuilderCond - * return already what we want - * We do not fix it here / non condition tools - * as we assume the non-safe RobustTrackingGeometryBuilder - * is to be replaced by RobustTrackingGeometryBuilderCond - */ - auto mutablebeamPipeVec = std::vector<Trk::CylinderLayer*>(); - mutablebeamPipeVec.reserve(beamPipeVec->size()); - for (const Trk::CylinderLayer* lay : *beamPipeVec) { - mutablebeamPipeVec.push_back(const_cast<Trk::CylinderLayer*>(lay)); - } - beamPipeLayerArray = m_layerArrayCreator->cylinderLayerArray(mutablebeamPipeVec, 0., beamPipeBounds->outerRadius(), Trk::arbitrary); + beamPipeLayerArray = m_layerArrayCreator->cylinderLayerArray(*beamPipeVec, 0., beamPipeBounds->outerRadius(), Trk::arbitrary); } delete beamPipeVec; // create the TrackingVolume diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx index 8042fe1b4166145070919ca111f7fc73feb17163..73867ac39003b697cd6d618e6801d291aa65c780 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx @@ -76,9 +76,7 @@ InDet::RobustTrackingGeometryBuilderCond::RobustTrackingGeometryBuilderCond(cons } // destructor -InDet::RobustTrackingGeometryBuilderCond::~RobustTrackingGeometryBuilderCond() -{ -} +InDet::RobustTrackingGeometryBuilderCond::~RobustTrackingGeometryBuilderCond()= default; // Athena standard methods // initialize diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx index bd1a987359218f0a4f70ad0cef6d28acfe7cffd6..a8a3921317b7c5b3c525b759613e96d9653021d5 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx @@ -44,8 +44,8 @@ // STL #include <map> -std::vector<const Trk::CylinderLayer*> InDet::SiLayerBuilder::s_splitCylinderLayers; -std::vector<const Trk::DiscLayer*> InDet::SiLayerBuilder::s_splitDiscLayers; +std::vector<Trk::CylinderLayer*> InDet::SiLayerBuilder::s_splitCylinderLayers; +std::vector<Trk::DiscLayer*> InDet::SiLayerBuilder::s_splitDiscLayers; double InDet::SiLayerBuilder::s_splitRadius = 0.; // constructor @@ -109,8 +109,7 @@ InDet::SiLayerBuilder::SiLayerBuilder(const std::string& t, const std::string& n } // destructor -InDet::SiLayerBuilder::~SiLayerBuilder() -{} +InDet::SiLayerBuilder::~SiLayerBuilder()= default; // Athena standard methods // initialize @@ -154,14 +153,14 @@ StatusCode InDet::SiLayerBuilder::finalize() /** LayerBuilder interface method - returning Barrel-like layers */ -const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindricalLayers() const +const std::vector<Trk::CylinderLayer*>* InDet::SiLayerBuilder::cylindricalLayers() const { // split mode 2nd part return the already built layers 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); + std::vector<Trk::CylinderLayer*>* splitCylinderLayers = dressCylinderLayers(s_splitCylinderLayers); s_splitCylinderLayers.clear(); return splitCylinderLayers; } else if (m_splitMode){ @@ -327,7 +326,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric // [-B-] ------------------------ Construction of the layers ----------------------------------- // [-B-1] construct the detection layers - std::vector< const Trk::CylinderLayer* > cylinderDetectionLayers; + std::vector<Trk::CylinderLayer* > cylinderDetectionLayers; int layerCounter = 0; double currentLayerExtend = 0.; @@ -410,8 +409,8 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap; auto usmIter = uniqueSurfaceMap.end(); // ------- iterate - auto asurfIter = arraySurfaces.begin(); - auto asurfIterEnd = arraySurfaces.end(); + const auto *asurfIter = arraySurfaces.begin(); + const auto *asurfIterEnd = arraySurfaces.end(); for ( ; asurfIter != asurfIterEnd; ++asurfIter){ if ( (*asurfIter) ) { ++sumCheckBarrelModules; @@ -507,7 +506,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric // --------------------------- enf of detection layer construction loop ---------------------------------- ATH_MSG_DEBUG("Creating the final CylinderLayer collection with (potentially) additional layers."); - std::vector< const Trk::CylinderLayer* >* cylinderLayers = dressCylinderLayers(cylinderDetectionLayers); + std::vector<Trk::CylinderLayer* >* cylinderLayers = dressCylinderLayers(cylinderDetectionLayers); // multiply the check number in case of SCT sumCheckBarrelModules *= (m_pixelCase) ? 1 : 2; @@ -524,13 +523,13 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric } /** LayerBuilder interface method - returning Endcap-like layers */ -const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() const +const std::vector<Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() const { // split mode 2nd 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); + std::vector<Trk::DiscLayer*>* splitDiscs = new std::vector<Trk::DiscLayer*>(s_splitDiscLayers); s_splitDiscLayers.clear(); return splitDiscs; } @@ -545,7 +544,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() if (!nDBMLayers) return ((m_pixelCase and m_useRingLayout) ? createRingLayers() : createDiscLayers()); ATH_MSG_DEBUG( "Found " << m_siMgr->numerology().numEndcapsDBM() << " DBM layers active, building first ECs, then DBMS"); - std::vector<const Trk::DiscLayer*>* ecLayers = createDiscLayers(); + std::vector<Trk::DiscLayer*>* ecLayers = createDiscLayers(); if (ecLayers) { ATH_MSG_VERBOSE( "Created " << ecLayers->size() << " endcap layers w/o DBM."); ecLayers = createDiscLayers(ecLayers); @@ -556,7 +555,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers() } /** LayerBuilder interface method - returning Endcap-like layers */ -std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(std::vector<const Trk::DiscLayer*>* dLayers) const { +std::vector<Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(std::vector<Trk::DiscLayer*>* dLayers) const { // this is the DBM flag bool isDBM = (dLayers!=nullptr); @@ -732,7 +731,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st // [-B-] ------------------------ Construction of the layers ----------------------------------- // construct the layers - std::vector< const Trk::DiscLayer* >* discLayers = dLayers ? dLayers : new std::vector< const Trk::DiscLayer* >; + std::vector<Trk::DiscLayer*>* discLayers = dLayers ? dLayers : new std::vector<Trk::DiscLayer*>; std::vector<double>::iterator discZposIter = discZpos.begin(); int discCounter = 0; @@ -958,8 +957,8 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st // sort the vector Trk::DiscLayerSorterZ zSorter; - std::vector<const Trk::DiscLayer*>::iterator sortIter = discLayers->begin(); - std::vector<const Trk::DiscLayer*>::iterator sortEnd = discLayers->end(); + std::vector<Trk::DiscLayer*>::iterator sortIter = discLayers->begin(); + std::vector<Trk::DiscLayer*>::iterator sortEnd = discLayers->end(); std::sort(sortIter, sortEnd, zSorter); // if there are additional layers to be built - never build for the DBM loop @@ -1042,7 +1041,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st /** LayerBuilder interface method - returning ring-like layers */ /** this is ITk pixel specific and doesn't include DBM modules */ -std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createRingLayers() const { +std::vector<Trk::DiscLayer*>* InDet::SiLayerBuilder::createRingLayers() const { // get general layout InDetDD::SiDetectorElementCollection::const_iterator sidetIter = m_siMgr->getDetectorElementBegin(); @@ -1161,7 +1160,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createRingLayers() // [-B-] ------------------------ Construction of the layers ----------------------------------- // construct the layers - std::vector< const Trk::DiscLayer* >* discLayers = new std::vector< const Trk::DiscLayer* >; + std::vector<Trk::DiscLayer*>* discLayers = new std::vector<Trk::DiscLayer*>; std::vector<double>::iterator discZposIter = discZpos.begin(); int discCounter = 0; @@ -1277,8 +1276,8 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createRingLayers() // sort the vector Trk::DiscLayerSorterZ zSorter; - std::vector<const Trk::DiscLayer*>::iterator sortIter = discLayers->begin(); - std::vector<const Trk::DiscLayer*>::iterator sortEnd = discLayers->end(); + std::vector<Trk::DiscLayer*>::iterator sortIter = discLayers->begin(); + std::vector<Trk::DiscLayer*>::iterator sortEnd = discLayers->end(); std::sort(sortIter, sortEnd, zSorter); // if there are additional layers to be built - never build for the DBM loop @@ -1357,10 +1356,10 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createRingLayers() return discLayers; } -std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLayers(const std::vector< const Trk::CylinderLayer* >& detectionLayers ) const { +std::vector<Trk::CylinderLayer*>* InDet::SiLayerBuilder::dressCylinderLayers(const std::vector<Trk::CylinderLayer*>& detectionLayers ) const { - std::vector< const Trk::CylinderLayer* >* cylinderLayers = new std::vector< const Trk::CylinderLayer* >; + std::vector<Trk::CylinderLayer*>* cylinderLayers = new std::vector<Trk::CylinderLayer*>; // --------------------------- start of additional layer construction loop ------------------------------- // for the additional layer if (!m_barrelAdditionalLayerR.empty()){ diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx index f9c9cfd39d1e15e6e67ce1f437a9cc424f0c1832..53f9570279f628d00b943847ca95e8ac3f66d318 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx @@ -101,8 +101,7 @@ InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::s } // destructor -InDet::SiLayerBuilderCond::~SiLayerBuilderCond() -{} +InDet::SiLayerBuilderCond::~SiLayerBuilderCond()= default; // Athena standard methods // initialize @@ -406,8 +405,8 @@ InDet::SiLayerBuilderCond::cylindricalLayers(const EventContext& ctx, std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap; auto usmIter = uniqueSurfaceMap.end(); // ------- iterate - auto asurfIter = arraySurfaces.begin(); - auto asurfIterEnd = arraySurfaces.end(); + const auto *asurfIter = arraySurfaces.begin(); + const auto *asurfIterEnd = arraySurfaces.end(); for ( ; asurfIter != asurfIterEnd; ++asurfIter){ if ( (*asurfIter) ) { ++sumCheckBarrelModules; diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx index 74574d6f4a1cefa2339d3df6517cbcef6842e5d8..9197fca2b3dcf460fe5c9fb25093101ced29e41a 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx @@ -80,9 +80,7 @@ InDet::StagedTrackingGeometryBuilder::StagedTrackingGeometryBuilder(const std::s } // destructor -InDet::StagedTrackingGeometryBuilder::~StagedTrackingGeometryBuilder() -{ -} +InDet::StagedTrackingGeometryBuilder::~StagedTrackingGeometryBuilder()= default; // Athena standard methods // initialize @@ -156,9 +154,9 @@ Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeometry AT // screen output ATH_MSG_DEBUG( "[ LayerBuilder : '" << lProvider->identification() << "' ] being processed. " ); // retrieve the layers - std::vector<const Trk::Layer*> centralLayers = lProvider->centralLayers(); - std::vector<const Trk::Layer*> negativeLayers = lProvider->negativeLayers(); - std::vector<const Trk::Layer*> positiveLayers = lProvider->positiveLayers(); + std::vector<Trk::Layer*> centralLayers = lProvider->centralLayers(); + std::vector<Trk::Layer*> negativeLayers = lProvider->negativeLayers(); + std::vector<Trk::Layer*> positiveLayers = lProvider->positiveLayers(); ATH_MSG_VERBOSE(" -> retrieved " << centralLayers.size() << " central layers."); ATH_MSG_VERBOSE(" -> retrieved " << negativeLayers.size() << " layers on negative side."); ATH_MSG_VERBOSE(" -> retrieved " << positiveLayers.size() << " layers on positive side."); @@ -385,9 +383,9 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl /** Private helper method, estimates the overal dimensions */ InDet::LayerSetup InDet::StagedTrackingGeometryBuilder::estimateLayerSetup(const std::string& idName, size_t ilS, - const std::vector<const Trk::Layer*>& negLayers, - const std::vector<const Trk::Layer*>& cenLayers, - const std::vector<const Trk::Layer*>& posLayers, + const std::vector<Trk::Layer*>& negLayers, + const std::vector<Trk::Layer*>& cenLayers, + const std::vector<Trk::Layer*>& posLayers, double maxR, double maxZ) const { // prepare the dimensions @@ -429,7 +427,7 @@ InDet::LayerSetup InDet::StagedTrackingGeometryBuilder::estimateLayerSetup(const /** Private helper method to estimate the layer dimensions */ -void InDet::StagedTrackingGeometryBuilder::estimateLayerDimensions(const std::vector<const Trk::Layer*>& layers, +void InDet::StagedTrackingGeometryBuilder::estimateLayerDimensions(const std::vector<Trk::Layer*>& layers, double& rMin, double& rMax, double& zMin, double& zMax) const { // parse through the layers and estimate diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx index b6222dca70ee1776d99d9bc9c855092068abaeeb..08fb8af985838ce2b9339709fc4dbffc95971ac4 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx @@ -85,9 +85,7 @@ InDet::StagedTrackingGeometryBuilderCond::StagedTrackingGeometryBuilderCond(cons } // destructor -InDet::StagedTrackingGeometryBuilderCond::~StagedTrackingGeometryBuilderCond() -{ -} +InDet::StagedTrackingGeometryBuilderCond::~StagedTrackingGeometryBuilderCond()= default; // Athena standard methods // initialize diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx index 9305ee55bca08ef6b338361bfc80df91c3aab689..e0539b1b3520c3d83e8ece70ec3cc6fec137d720 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx @@ -43,7 +43,7 @@ namespace { { public: PtrVectorWrapper () - : m_ptr(new std::vector<const T *>) + : m_ptr(new std::vector<T *>) { } @@ -55,16 +55,16 @@ namespace { m_ptr->clear(); } } - std::vector<const T *> &operator*() { return *m_ptr; } - const std::vector<const T *> &operator*() const { return *m_ptr; } + std::vector<T *> &operator*() { return *m_ptr; } + const std::vector<T *> &operator*() const { return *m_ptr; } - std::vector<const T *> *operator->() { return m_ptr.get(); } - const std::vector<const T *> *operator->() const { return m_ptr.get(); } + std::vector<T *> *operator->() { return m_ptr.get(); } + const std::vector<T *> *operator->() const { return m_ptr.get(); } - std::vector<const T *> *release() { return m_ptr.release(); } + std::vector<T *> *release() { return m_ptr.release(); } private: - std::unique_ptr<std::vector<const T *> > m_ptr; + std::unique_ptr<std::vector<T *> > m_ptr; }; } @@ -109,8 +109,7 @@ InDet::TRT_LayerBuilder::TRT_LayerBuilder(const std::string& t, const std::strin } // destructor -InDet::TRT_LayerBuilder::~TRT_LayerBuilder() -{} +InDet::TRT_LayerBuilder::~TRT_LayerBuilder()= default; // Athena standard methods // initialize @@ -125,7 +124,7 @@ StatusCode InDet::TRT_LayerBuilder::initialize() } /** LayerBuilder interface method - returning Barrel-like layers */ -const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindricalLayers() const +const std::vector<Trk::CylinderLayer*>* InDet::TRT_LayerBuilder::cylindricalLayers() const { if (!m_trtMgr) return nullptr; @@ -475,7 +474,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr return barrelLayers.release(); } -const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers() const +const std::vector<Trk::DiscLayer*>* InDet::TRT_LayerBuilder::discLayers() const { diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx index 2aa40c09b933f8c535bd3f3f8acb511ffa9e5ac4..df8742eb81438d1c9ec09ed9132154a05cd06e50 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx @@ -109,8 +109,7 @@ InDet::TRT_LayerBuilderCond::TRT_LayerBuilderCond(const std::string& t, const st } // destructor -InDet::TRT_LayerBuilderCond::~TRT_LayerBuilderCond() -{} +InDet::TRT_LayerBuilderCond::~TRT_LayerBuilderCond()= default; // Athena standard methods // initialize diff --git a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerBuilder.h b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerBuilder.h index 067608e789e6861f65261039b36d9a5563f63fdb..18531047d2c6db48afe088c38d7cde2b14ba2983 100755 --- a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerBuilder.h +++ b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,61 +13,62 @@ #include "GaudiKernel/IAlgTool.h" #include "TrkSurfaces/Surface.h" // STL -#include <vector> #include <string> +#include <vector> namespace Trk { - class CylinderLayer; - class DiscLayer; - class PlaneLayer; - class Layer; - - /** Interface ID for ILayerBuilders*/ - static const InterfaceID IID_ILayerBuilder("ILayerBuilder", 1, 0); - - /** @class ILayerBuilder - Interface class ILayerBuilders - It inherits from IAlgTool. The actual implementation of the AlgTool depends on the SubDetector, - more detailed information should be found there. - - @author Andreas.Salzburger@cern.ch - */ - class ILayerBuilder : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~ILayerBuilder(){} - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_ILayerBuilder; } - - /** LayerBuilder interface method - returning Barrel-like layers */ - virtual const std::vector< const CylinderLayer* >* cylindricalLayers() const = 0; - - /** LayerBuilder interface method - returning Endcap-like layers */ - virtual const std::vector< const DiscLayer* >* discLayers() const = 0; - - /** LayerBuilder interface method - returning Planar-like layers */ - virtual const std::vector< const PlaneLayer* >* planarLayers() const = 0; - - /** Name identification */ - virtual const std::string& identification() const = 0; - - /** Validation Action: - Can be implemented optionally, outside access to internal validation steps */ - virtual void validationAction() const {} - - protected: - /** Protected method to register the Layer to the Surface */ - void associateLayer(const Layer& lay, Surface& sf) const { sf.associateLayer(lay); } - - }; +class CylinderLayer; +class DiscLayer; +class PlaneLayer; +class Layer; +/** Interface ID for ILayerBuilders*/ +static const InterfaceID IID_ILayerBuilder("ILayerBuilder", 1, 0); -} // end of namespace +/** @class ILayerBuilder + Interface class ILayerBuilders + It inherits from IAlgTool. The actual implementation of the AlgTool depends on + the SubDetector, more detailed information should be found there. + @author Andreas.Salzburger@cern.ch + */ +class ILayerBuilder : virtual public IAlgTool +{ -#endif // TRKDETDESCRINTERFACES_ILAYERBUILDER_H +public: + /**Virtual destructor*/ + virtual ~ILayerBuilder() {} + + /** AlgTool and IAlgTool interface methods */ + static const InterfaceID& interfaceID() { return IID_ILayerBuilder; } + + /** LayerBuilder interface method - returning Barrel-like layers */ + virtual const std::vector<CylinderLayer*>* cylindricalLayers() const = 0; + + /** LayerBuilder interface method - returning Endcap-like layers */ + virtual const std::vector<DiscLayer*>* discLayers() const = 0; + /** LayerBuilder interface method - returning Planar-like layers */ + virtual const std::vector<PlaneLayer*>* planarLayers() const = 0; + + /** Name identification */ + virtual const std::string& identification() const = 0; + + /** Validation Action: + Can be implemented optionally, outside access to internal validation steps + */ + virtual void validationAction() const {} + +protected: + /** Protected method to register the Layer to the Surface */ + void associateLayer(const Layer& lay, Surface& sf) const + { + sf.associateLayer(lay); + } +}; + +} // end of namespace + +#endif // TRKDETDESCRINTERFACES_ILAYERBUILDER_H diff --git a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerProvider.h b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerProvider.h index 87c2dd944675eb923e86afdd47f7cad3d99c6db2..7fcd4f62a80810eddcda110ccfff4cc1e98b5769 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerProvider.h +++ b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/ILayerProvider.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -12,49 +12,47 @@ // Gaudi #include "GaudiKernel/IAlgTool.h" // STL -#include <vector> #include <string> +#include <vector> namespace Trk { - class Layer; - - /** Interface ID for ILayerProviders*/ - static const InterfaceID IID_ILayerProvider("ILayerProvider", 1, 0); - - /** @class ILayerProvider - - Interface class ILayerProviders - it feeds into the StagedGeometryBuilder - - @author Andreas.Salzburger@cern.ch - */ - class ILayerProvider : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~ILayerProvider(){} - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_ILayerProvider; } - - /** LayerBuilder interface method - returning the layers at negative side */ - virtual const std::vector< const Layer* > negativeLayers() const = 0; - - /** LayerBuilder interface method - returning the central layers */ - virtual const std::vector< const Layer* > centralLayers() const = 0; - - /** LayerBuilder interface method - returning the layers at negative side */ - virtual const std::vector< const Layer* > positiveLayers() const = 0; - - /** Name identification */ - virtual const std::string& identification() const = 0; - - }; +class Layer; -} // end of namespace +/** Interface ID for ILayerProviders*/ +static const InterfaceID IID_ILayerProvider("ILayerProvider", 1, 0); +/** @class ILayerProvider -#endif // TRKDETDESCRINTERFACES_ILAYERPROVIDER_H + Interface class ILayerProviders + it feeds into the StagedGeometryBuilder + + @author Andreas.Salzburger@cern.ch + */ +class ILayerProvider : virtual public IAlgTool +{ + +public: + /**Virtual destructor*/ + virtual ~ILayerProvider() {} + + /** AlgTool and IAlgTool interface methods */ + static const InterfaceID& interfaceID() { return IID_ILayerProvider; } + /** LayerBuilder interface method - returning the layers at negative side */ + virtual const std::vector<Layer*> negativeLayers() const = 0; + + /** LayerBuilder interface method - returning the central layers */ + virtual const std::vector<Layer*> centralLayers() const = 0; + + /** LayerBuilder interface method - returning the layers at negative side */ + virtual const std::vector<Layer*> positiveLayers() const = 0; + + /** Name identification */ + virtual const std::string& identification() const = 0; +}; + +} // end of namespace + +#endif // TRKDETDESCRINTERFACES_ILAYERPROVIDER_H diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/TrkDetDescrTools/LayerProvider.h b/Tracking/TrkDetDescr/TrkDetDescrTools/TrkDetDescrTools/LayerProvider.h index c504756fd3ba14084676eba10983f5c220d75a2a..5114b4fcb1610d033afaacdd9ce76bc101d65e16 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrTools/TrkDetDescrTools/LayerProvider.h +++ b/Tracking/TrkDetDescr/TrkDetDescrTools/TrkDetDescrTools/LayerProvider.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -47,23 +47,23 @@ namespace Trk { StatusCode finalize(); /** LayerBuilder interface method - returning the layers at negative side */ - const std::vector< const Layer* > negativeLayers() const; + const std::vector<Layer*> negativeLayers() const; /** LayerBuilder interface method - returning the central layers */ - const std::vector< const Layer* > centralLayers() const; + const std::vector<Layer*> centralLayers() const; /** LayerBuilder interface method - returning the layers at negative side */ - const std::vector< const Layer* > positiveLayers() const; + const std::vector<Layer*> positiveLayers() const; /** Name identification */ const std::string& identification() const; private: /** LayerBuilder interface method - returning the layers at negative side */ - const std::vector< const Layer* > discLayers(int posneg) const; + const std::vector<Layer*> discLayers(int posneg) const; ToolHandle<ILayerBuilder> m_layerBuilder; - mutable std::vector<const Trk::Layer*> m_layerCache; + mutable std::vector<Trk::Layer*> m_layerCache; }; diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/src/LayerProvider.cxx b/Tracking/TrkDetDescr/TrkDetDescrTools/src/LayerProvider.cxx index db1651aff343daa5bd166a00d9a5d6e8ce28d913..fee6891c70bfcb50f66738082cf1143c86c00e22 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrTools/src/LayerProvider.cxx +++ b/Tracking/TrkDetDescr/TrkDetDescrTools/src/LayerProvider.cxx @@ -40,7 +40,7 @@ StatusCode Trk::LayerProvider::initialize() } /** LayerBuilder interface method - returning the layers at negative side */ -const std::vector< const Trk::Layer* > Trk::LayerProvider::negativeLayers() const +const std::vector<Trk::Layer*> Trk::LayerProvider::negativeLayers() const { // if any cache is there it has to be returned if (!m_layerCache.empty()) return m_layerCache; @@ -49,12 +49,12 @@ const std::vector< const Trk::Layer* > Trk::LayerProvider::negativeLayers() cons } /** LayerBuilder interface method - returning the central layers */ -const std::vector< const Trk::Layer* > Trk::LayerProvider::centralLayers() const +const std::vector<Trk::Layer*> Trk::LayerProvider::centralLayers() const { // central layers - std::vector< const Trk::Layer* > cLayers; + std::vector<Trk::Layer* > cLayers; // retrieving the cylinder layers from the layer builder - const std::vector< const Trk::CylinderLayer* >* cylinderLayers = m_layerBuilder->cylindricalLayers(); + const std::vector< Trk::CylinderLayer* >* cylinderLayers = m_layerBuilder->cylindricalLayers(); // loop over it and push into the return vector; if (cylinderLayers){ for (const auto & cL : (*cylinderLayers)) @@ -67,7 +67,7 @@ const std::vector< const Trk::Layer* > Trk::LayerProvider::centralLayers() const } /** LayerBuilder interface method - returning the layers at negative side */ -const std::vector< const Trk::Layer* > Trk::LayerProvider::positiveLayers() const +const std::vector<Trk::Layer*> Trk::LayerProvider::positiveLayers() const { // if any cache is there it has to be returned if (!m_layerCache.empty()) return m_layerCache; @@ -76,12 +76,12 @@ const std::vector< const Trk::Layer* > Trk::LayerProvider::positiveLayers() cons } /** LayerBuilder interface method - returning the layers at negative side */ -const std::vector< const Trk::Layer* > Trk::LayerProvider::discLayers(int posneg) const +const std::vector<Trk::Layer*> Trk::LayerProvider::discLayers(int posneg) const { // get the disc layers - std::vector < const Trk::Layer* > dLayers; + std::vector <Trk::Layer*> dLayers; // retrieving the cylinder layers from the layer builder - const std::vector< const Trk::DiscLayer* >* discLayers = m_layerBuilder->discLayers(); + const std::vector<Trk::DiscLayer*>* discLayers = m_layerBuilder->discLayers(); // loop and fill either cache or dLayers if (discLayers){ // loop over and push into the return/cache vector