Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove using namespace std; #2631

Merged
merged 6 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <sstream>
#include <vector>

using namespace std;

template class Acts::TrigFTF_GNN_Layer<ActsExamples::SimSpacePoint>;
template class Acts::TrigFTF_GNN_Geometry<ActsExamples::SimSpacePoint>;
template class Acts::TrigFTF_GNN_Node<ActsExamples::SimSpacePoint>;
Expand Down Expand Up @@ -137,7 +135,7 @@ ActsExamples::ProcessCode ActsExamples::SeedingFTFAlgorithm::execute(

std::map<std::pair<int, int>, std::pair<int, int>>
ActsExamples::SeedingFTFAlgorithm::Make_ACTS_FTF_Map() const {
map<std::pair<int, int>, std::pair<int, int>> ACTS_FTF;
std::map<std::pair<int, int>, std::pair<int, int>> ACTS_FTF;
std::ifstream data(
m_cfg.layerMappingFile); // 0 in this file refers to no FTF ID
std::string line;
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions Examples/Scripts/compareRootFiles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ using IndexSwapper = std::function<void(std::size_t, std::size_t)>;
// 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) {
Expand Down
1 change: 0 additions & 1 deletion Tests/UnitTests/Plugins/DD4hep/DD4hepTestsHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <DD4hep/Objects.h>
#include <XML/Utilities.h>

using namespace std;
using namespace dd4hep;

namespace Acts {
Expand Down
5 changes: 2 additions & 3 deletions Tests/UnitTests/Plugins/DD4hep/LayerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "DD4hepTestsHelper.hpp"

using namespace std;
using namespace dd4hep;

/// @brief Helper method to add a layer to the detector
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
17 changes: 8 additions & 9 deletions Tests/UnitTests/Plugins/DD4hep/PrimitivesFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "DD4hepTestsHelper.hpp"

using namespace std;
using namespace dd4hep;

/// Standard create_cylinder(...) create a simple cylinder
Expand All @@ -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));
Expand All @@ -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<double>(x_det_tubs, "phimin", 0.);
double phiMax = Acts::getAttrValueOr<double>(x_det_tubs, "phimax", 360.);
Tube tubeShape(shapeName, x_det_tubs.rmin(), x_det_tubs.rmax(),
Expand Down Expand Up @@ -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));
Expand All @@ -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<double>(x_det_tubs, "phimin", 0.);
double phiMax = Acts::getAttrValueOr<double>(x_det_tubs, "phimax", 360.);

Expand Down Expand Up @@ -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));
Expand All @@ -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());

Expand Down Expand Up @@ -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));
Expand All @@ -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(),
Expand Down