From 78de1094faff64f0656694af16c4ca0def2d72c7 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 4 Nov 2023 18:23:59 +0100 Subject: [PATCH 1/5] SeedingFTFAlgorithm --- .../Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp index 96b1db5ab45..f4f0aacd8f2 100644 --- a/Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp @@ -24,8 +24,6 @@ #include #include -using namespace std; - template class Acts::TrigFTF_GNN_Layer; template class Acts::TrigFTF_GNN_Geometry; template class Acts::TrigFTF_GNN_Node; @@ -137,7 +135,7 @@ ActsExamples::ProcessCode ActsExamples::SeedingFTFAlgorithm::execute( std::map, std::pair> ActsExamples::SeedingFTFAlgorithm::Make_ACTS_FTF_Map() const { - map, std::pair> ACTS_FTF; + std::map, std::pair> ACTS_FTF; std::ifstream data( m_cfg.layerMappingFile); // 0 in this file refers to no FTF ID std::string line; @@ -355,9 +353,9 @@ ActsExamples::SeedingFTFAlgorithm::LayerNumbering() const { } if (m_cfg.fill_module_csv) { - fstream fout; + std::fstream fout; fout.open("ACTS_modules.csv", - ios::out | ios::app); // add to file each time + std::ios::out | std::ios::app); // add to file each time // print to csv for each module, no repeats so dont need to make // map for averaging fout << ACTS_vol_id << ", " // vol From ee45ddfc67fa3445cbd2f342b3a101ba0767ea67 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 4 Nov 2023 18:43:03 +0100 Subject: [PATCH 2/5] PrimitivesFactory --- .../Plugins/DD4hep/PrimitivesFactory.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Tests/UnitTests/Plugins/DD4hep/PrimitivesFactory.cpp b/Tests/UnitTests/Plugins/DD4hep/PrimitivesFactory.cpp index 369668a0d3c..44eaee325dc 100644 --- a/Tests/UnitTests/Plugins/DD4hep/PrimitivesFactory.cpp +++ b/Tests/UnitTests/Plugins/DD4hep/PrimitivesFactory.cpp @@ -14,7 +14,6 @@ #include "DD4hepTestsHelper.hpp" -using namespace std; using namespace dd4hep; /// Standard create_cylinder(...) create a simple cylinder @@ -27,7 +26,7 @@ using namespace dd4hep; static Ref_t create_cylinder(Detector &dd, xml_h xml, SensitiveDetector /*sens*/) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // Make Volume xml_comp_t x_det_tubs = x_det.child(_U(tubs)); @@ -36,7 +35,7 @@ static Ref_t create_cylinder(Detector &dd, xml_h xml, DetElement cylinderElement(detName, x_det.id()); dd4hep::xml::setDetectorTypeFlag(xml, cylinderElement); - string shapeName = x_det_tubs.nameStr(); + std::string shapeName = x_det_tubs.nameStr(); double phiMin = Acts::getAttrValueOr(x_det_tubs, "phimin", 0.); double phiMax = Acts::getAttrValueOr(x_det_tubs, "phimax", 360.); Tube tubeShape(shapeName, x_det_tubs.rmin(), x_det_tubs.rmax(), @@ -66,7 +65,7 @@ DECLARE_DETELEMENT(Cylinder, create_cylinder) /// @return a reference counted DetElement static Ref_t create_disc(Detector &dd, xml_h xml, SensitiveDetector /*sens*/) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // Make Volume xml_comp_t x_det_tubs = x_det.child(_U(tubs)); @@ -75,7 +74,7 @@ static Ref_t create_disc(Detector &dd, xml_h xml, SensitiveDetector /*sens*/) { DetElement discElement(detName, x_det.id()); dd4hep::xml::setDetectorTypeFlag(xml, discElement); - string shapeName = x_det_tubs.nameStr(); + std::string shapeName = x_det_tubs.nameStr(); double phiMin = Acts::getAttrValueOr(x_det_tubs, "phimin", 0.); double phiMax = Acts::getAttrValueOr(x_det_tubs, "phimax", 360.); @@ -108,7 +107,7 @@ DECLARE_DETELEMENT(Disc, create_disc) static Ref_t create_rectangle(Detector &dd, xml_h xml, SensitiveDetector /*sens*/) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // Make Volume xml_comp_t x_det_box = x_det.child(_U(box)); @@ -117,7 +116,7 @@ static Ref_t create_rectangle(Detector &dd, xml_h xml, DetElement rectElement(detName, x_det.id()); dd4hep::xml::setDetectorTypeFlag(xml, rectElement); - string shapeName = x_det_box.nameStr(); + std::string shapeName = x_det_box.nameStr(); Box rectShape(shapeName, 0.5 * x_det_box.dx(), 0.5 * x_det_box.dy(), 0.5 * x_det_box.dz()); @@ -147,7 +146,7 @@ DECLARE_DETELEMENT(Rectangle, create_rectangle) static Ref_t create_trapezoid(Detector &dd, xml_h xml, SensitiveDetector /*sens*/) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // Make Volume xml_comp_t x_det_trap = x_det.child(_U(trap)); @@ -156,7 +155,7 @@ static Ref_t create_trapezoid(Detector &dd, xml_h xml, DetElement trapElement(detName, x_det.id()); dd4hep::xml::setDetectorTypeFlag(xml, trapElement); - string shapeName = x_det_trap.nameStr(); + std::string shapeName = x_det_trap.nameStr(); // Due to convention this causes an axis flip on x Trapezoid trapShape(x_det_trap.x1(), x_det_trap.x2(), 0.5 * x_det_trap.dz(), From 21375ac0d140aa0ee8a9fc0693632aaa2c197ed4 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 4 Nov 2023 18:51:35 +0100 Subject: [PATCH 3/5] CompareRootFiles --- Examples/Scripts/compareRootFiles.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Examples/Scripts/compareRootFiles.hpp b/Examples/Scripts/compareRootFiles.hpp index 7ccb1a1398e..d22853fec92 100644 --- a/Examples/Scripts/compareRootFiles.hpp +++ b/Examples/Scripts/compareRootFiles.hpp @@ -155,10 +155,9 @@ using IndexSwapper = std::function; // and in-place, which makes it a good choice for smaller inputs void selectionSort(const std::size_t firstIndex, const std::size_t lastIndex, const IndexComparator& compare, const IndexSwapper& swap) { - using namespace std; - for (size_t targetIndex = firstIndex; targetIndex < lastIndex; + for (std::size_t targetIndex = firstIndex; targetIndex < lastIndex; ++targetIndex) { - size_t minIndex = targetIndex; + std::size_t minIndex = targetIndex; for (std::size_t readIndex = targetIndex + 1; readIndex <= lastIndex; ++readIndex) { if (compare(readIndex, minIndex) == Ordering::SMALLER) { From 830d4079144a4a0780a25191c0c1b62d13edc33e Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 4 Nov 2023 18:55:18 +0100 Subject: [PATCH 4/5] DD4hepTestHelpers --- Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp b/Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp index ef0e5d81fee..07f8bc6890f 100644 --- a/Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp +++ b/Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp @@ -17,7 +17,6 @@ #include #include -using namespace std; using namespace dd4hep; namespace Acts { From 558914c2013c2ad75983a4977d6264e82c9143df Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 4 Nov 2023 18:55:39 +0100 Subject: [PATCH 5/5] Layerfactory --- Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp b/Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp index 58ef3635b15..3dd408430d7 100644 --- a/Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp +++ b/Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp @@ -18,7 +18,6 @@ #include "DD4hepTestsHelper.hpp" -using namespace std; using namespace dd4hep; /// @brief Helper method to add a layer to the detector @@ -274,7 +273,7 @@ DetElement addDiscLayer(Detector &dd, Assembly &dAssembly, static Ref_t create_barrel_detector(Detector &dd, xml_h xml, SensitiveDetector sens) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // create the master detector element DetElement detectorElement(detName, x_det.id()); @@ -322,7 +321,7 @@ DECLARE_DETELEMENT(BarrelDetector, create_barrel_detector) static Ref_t create_endcap_detector(Detector &dd, xml_h xml, SensitiveDetector sens) { xml_det_t x_det = xml; - string detName = x_det.nameStr(); + std::string detName = x_det.nameStr(); // create the master detector element DetElement detectorElement(detName, x_det.id());