From 14330bf46c3b02315d0c532267052b5a5f381c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 21:02:32 +0200 Subject: [PATCH 1/5] Remove std namespace from CCDBDownloader.h --- CCDB/include/CCDB/CCDBDownloader.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/CCDB/include/CCDB/CCDBDownloader.h b/CCDB/include/CCDB/CCDBDownloader.h index ff1d97d68802d..031f656452fe8 100644 --- a/CCDB/include/CCDB/CCDBDownloader.h +++ b/CCDB/include/CCDB/CCDBDownloader.h @@ -29,8 +29,6 @@ typedef struct uv_signal_s uv_signal_t; typedef struct uv_async_s uv_async_t; typedef struct uv_handle_s uv_handle_t; -using namespace std; - namespace o2::ccdb { From dd331712f6eaed73040817ae324785c146fa1442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 21:15:21 +0200 Subject: [PATCH 2/5] Remove std namespace from DataBlockBase.h --- Detectors/FIT/raw/include/FITRaw/DataBlockBase.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Detectors/FIT/raw/include/FITRaw/DataBlockBase.h b/Detectors/FIT/raw/include/FITRaw/DataBlockBase.h index 1e8827b90c2a3..1c95f354c6292 100644 --- a/Detectors/FIT/raw/include/FITRaw/DataBlockBase.h +++ b/Detectors/FIT/raw/include/FITRaw/DataBlockBase.h @@ -58,8 +58,6 @@ namespace o2 namespace fit { -using namespace std; - static constexpr size_t SIZE_WORD = 16; static constexpr size_t SIZE_WORD_GBT = 10; // should be changed to gloabal variable static constexpr size_t SIZE_MAX_PAGE = 8192; // should be changed to gloabal variable From 7404d8f2ac18e0a88e106f457a95dee9ccbac296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 23:21:13 +0200 Subject: [PATCH 3/5] Remove math namespace from AnalysisDataModel.h --- .../include/Framework/AnalysisDataModel.h | 22 +++++++++---------- .../mctracks_to_aod_simple_task.cxx | 1 + 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 1c1871608391e..b8c5da0c3b238 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -21,8 +21,6 @@ #include "CommonConstants/ZDCConstants.h" #include "SimulationDataFormat/MCGenProperties.h" -using namespace o2::constants::math; - namespace o2 { namespace aod @@ -122,13 +120,13 @@ DECLARE_SOA_COLUMN(Snp, snp, float); //! DECLARE_SOA_COLUMN(Tgl, tgl, float); //! DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float); //! (sign of charge)/Pt in c/GeV. Use pt() and sign() instead DECLARE_SOA_EXPRESSION_COLUMN(Phi, phi, float, //! Phi of the track, in radians within [0, 2pi) - ifnode(nasin(aod::track::snp) + aod::track::alpha < 0.0f, nasin(aod::track::snp) + aod::track::alpha + TwoPI, - ifnode(nasin(aod::track::snp) + aod::track::alpha >= TwoPI, nasin(aod::track::snp) + aod::track::alpha - TwoPI, + ifnode(nasin(aod::track::snp) + aod::track::alpha < 0.0f, nasin(aod::track::snp) + aod::track::alpha + o2::constants::math::TwoPI, + ifnode(nasin(aod::track::snp) + aod::track::alpha >= o2::constants::math::TwoPI, nasin(aod::track::snp) + aod::track::alpha - o2::constants::math::TwoPI, nasin(aod::track::snp) + aod::track::alpha))); DECLARE_SOA_EXPRESSION_COLUMN(Eta, eta, float, //! Pseudorapidity - -1.f * nlog(ntan(PIQuarter - 0.5f * natan(aod::track::tgl)))); + -1.f * nlog(ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl)))); DECLARE_SOA_EXPRESSION_COLUMN(Pt, pt, float, //! Transverse momentum of the track in GeV/c - ifnode(nabs(aod::track::signed1Pt) <= Almost0, VeryBig, nabs(1.f / aod::track::signed1Pt))); + ifnode(nabs(aod::track::signed1Pt) <= o2::constants::math::Almost0, o2::constants::math::VeryBig, nabs(1.f / aod::track::signed1Pt))); DECLARE_SOA_DYNAMIC_COLUMN(IsWithinBeamPipe, isWithinBeamPipe, //! Is the track within the beam pipe (= successfully propagated to a collision vertex) [](float x) -> bool { return (std::fabs(x) < o2::constants::geom::XBeamPipeOuterRef); }); DECLARE_SOA_DYNAMIC_COLUMN(Sign, sign, //! Charge: positive: 1, negative: -1 @@ -156,18 +154,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! Momentum in z-direction in GeV/c }); DECLARE_SOA_EXPRESSION_COLUMN(P, p, float, //! Momentum in Gev/c - ifnode(nabs(aod::track::signed1Pt) <= Almost0, VeryBig, 0.5f * (ntan(PIQuarter - 0.5f * natan(aod::track::tgl)) + 1.f / ntan(PIQuarter - 0.5f * natan(aod::track::tgl))) / nabs(aod::track::signed1Pt))); + ifnode(nabs(aod::track::signed1Pt) <= o2::constants::math::Almost0, o2::constants::math::VeryBig, 0.5f * (ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl)) + 1.f / ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl))) / nabs(aod::track::signed1Pt))); DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy, //! Track energy, computed under the mass assumption given as input [](float signed1Pt, float tgl, float mass) -> float { const auto pt = 1.f / std::abs(signed1Pt); - const auto p = 0.5f * (tan(PIQuarter - 0.5f * atan(tgl)) + 1.f / tan(PIQuarter - 0.5f * atan(tgl))) * pt; + const auto p = 0.5f * (tan(o2::constants::math::PIQuarter - 0.5f * atan(tgl)) + 1.f / tan(o2::constants::math::PIQuarter - 0.5f * atan(tgl))) * pt; return sqrt(p * p + mass * mass); }); DECLARE_SOA_DYNAMIC_COLUMN(Rapidity, rapidity, //! Track rapidity, computed under the mass assumption given as input [](float signed1Pt, float tgl, float mass) -> float { const auto pt = 1.f / std::abs(signed1Pt); const auto pz = pt * tgl; - const auto p = 0.5f * (tan(PIQuarter - 0.5f * atan(tgl)) + 1.f / tan(PIQuarter - 0.5f * atan(tgl))) * pt; + const auto p = 0.5f * (tan(o2::constants::math::PIQuarter - 0.5f * atan(tgl)) + 1.f / tan(o2::constants::math::PIQuarter - 0.5f * atan(tgl))) * pt; const auto energy = sqrt(p * p + mass * mass); return 0.5f * log((energy + pz) / (energy - pz)); }); @@ -458,11 +456,11 @@ DECLARE_SOA_COLUMN(TrackTimeRes, trackTimeRes, float); DECLARE_SOA_DYNAMIC_COLUMN(Sign, sign, //! Sign of the track eletric charge [](float signed1Pt) -> short { return (signed1Pt > 0) ? 1 : -1; }); DECLARE_SOA_EXPRESSION_COLUMN(Eta, eta, float, //! - -1.f * nlog(ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)))); + -1.f * nlog(ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)))); DECLARE_SOA_EXPRESSION_COLUMN(Pt, pt, float, //! ifnode(nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0, o2::constants::math::VeryBig, nabs(1.f / aod::fwdtrack::signed1Pt))); DECLARE_SOA_EXPRESSION_COLUMN(P, p, float, //! - ifnode((nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0) || (nabs(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) < o2::constants::math::Almost0), o2::constants::math::VeryBig, 0.5f * (ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) + 1.f / ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))) / nabs(aod::fwdtrack::signed1Pt))); + ifnode((nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0) || (nabs(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) < o2::constants::math::Almost0), o2::constants::math::VeryBig, 0.5f * (ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) + 1.f / ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))) / nabs(aod::fwdtrack::signed1Pt))); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! [](float pt, float phi) -> float { return pt * std::cos(phi); @@ -1360,7 +1358,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if par [](uint8_t flags) -> bool { return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); DECLARE_SOA_EXPRESSION_COLUMN(Phi, phi, float, //! Phi in the range [0, 2pi) - PI + natan2(-1.0f * aod::mcparticle::py, -1.0f * aod::mcparticle::px)); + o2::constants::math::PI + natan2(-1.0f * aod::mcparticle::py, -1.0f * aod::mcparticle::px)); DECLARE_SOA_EXPRESSION_COLUMN(Eta, eta, float, //! Pseudorapidity, conditionally defined to avoid FPEs ifnode((nsqrt(aod::mcparticle::px * aod::mcparticle::px + aod::mcparticle::py * aod::mcparticle::py + diff --git a/run/SimExamples/McTracksToAOD/mctracks_to_aod_simple_task.cxx b/run/SimExamples/McTracksToAOD/mctracks_to_aod_simple_task.cxx index 8c897712d50bf..e670b25befb40 100644 --- a/run/SimExamples/McTracksToAOD/mctracks_to_aod_simple_task.cxx +++ b/run/SimExamples/McTracksToAOD/mctracks_to_aod_simple_task.cxx @@ -16,6 +16,7 @@ using namespace o2; using namespace o2::framework; +using namespace o2::constants::math; struct AodConsumerTestTask { From 0d3322a9cd322307571aa71d971259de2dc4b535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 4 Sep 2023 12:24:21 +0200 Subject: [PATCH 4/5] Clean TPCSimulation/Digitizer.h --- Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h b/Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h index 436fabfc9d620..359dc5d64b72d 100644 --- a/Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h +++ b/Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h @@ -22,8 +22,6 @@ #include -using std::vector; - class TTree; class TH3; From f6776a13ba6d097c325fc69122be2d31651e4982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 4 Sep 2023 12:38:31 +0200 Subject: [PATCH 5/5] Clean SACDecoder.h --- Detectors/TPC/calibration/include/TPCCalibration/SACDecoder.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Detectors/TPC/calibration/include/TPCCalibration/SACDecoder.h b/Detectors/TPC/calibration/include/TPCCalibration/SACDecoder.h index bf8c3bf9e83bf..d16efc8995e8d 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/SACDecoder.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/SACDecoder.h @@ -31,7 +31,6 @@ #include "DataFormatsTPC/SAC.h" using o2::constants::lhc::LHCBunchSpacingMUS; -using std::size_t; namespace o2::tpc::sac {