diff --git a/Base/Vector/RotMatrix.cpp b/Base/Vector/RotMatrix.cpp index 62dc72df36741b2b5cc5bced377cc63689e8fe9a..ebe5c471523cf80c695f76f339a0ad9b76c7e6fe 100644 --- a/Base/Vector/RotMatrix.cpp +++ b/Base/Vector/RotMatrix.cpp @@ -50,7 +50,7 @@ RotMatrix RotMatrix::EulerZXZ(double alpha, double beta, double gamma) return zrot * xrot * zrot2; } -std::array<double,3> RotMatrix::zxzEulerAngles() const +std::array<double, 3> RotMatrix::zxzEulerAngles() const { double m00 = (-1 + 2 * x * x + 2 * s * s); double m02 = 2 * (x * z + y * s); @@ -130,11 +130,11 @@ bool RotMatrix::isZRotation() const std::optional<double> RotMatrix::angleAroundCoordAxis(int iAxis) const { - if (iAxis==0 && isXRotation()) + if (iAxis == 0 && isXRotation()) return 2 * atan2(x, s); - if (iAxis==1 && isYRotation()) + if (iAxis == 1 && isYRotation()) return 2 * atan2(y, s); - if (iAxis==2 && isZRotation()) + if (iAxis == 2 && isZRotation()) return 2 * atan2(z, s); return {}; } diff --git a/Base/Vector/RotMatrix.h b/Base/Vector/RotMatrix.h index 6d8289684b32ba8467374517a3052fc6530bed7c..99152d8ae83e7cd41ba16854efbbf2d4b26cf7cd 100644 --- a/Base/Vector/RotMatrix.h +++ b/Base/Vector/RotMatrix.h @@ -15,8 +15,8 @@ #ifndef BORNAGAIN_BASE_VECTOR_ROTMATRIX_H #define BORNAGAIN_BASE_VECTOR_ROTMATRIX_H -#include <heinz/Vectors3D.h> #include <array> +#include <heinz/Vectors3D.h> #include <optional> //! Rotation matrix in three dimensions. @@ -42,7 +42,7 @@ public: static RotMatrix EulerZXZ(double alpha, double beta, double gamma); //! Calculates the Euler angles corresponding to the rotation - std::array<double,3> zxzEulerAngles() const; + std::array<double, 3> zxzEulerAngles() const; //! Returns the inverse transformation. RotMatrix getInverse() const; diff --git a/Device/Detector/IDetector.cpp b/Device/Detector/IDetector.cpp index 81007289f58cfc84e39502d83c6456f2f4c5275d..fb10a00ed7d67af6ac3dee96267473ceb190c43f 100644 --- a/Device/Detector/IDetector.cpp +++ b/Device/Detector/IDetector.cpp @@ -328,7 +328,7 @@ IDetector::RoiOfAxis::RoiOfAxis(const IAxis& axis, double _lower, double _upper) /* -- from IDetector2D -- */ void IDetector::setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, - double y_min, double y_max) + double y_min, double y_max) { clear(); addDetAxis(FixedBinAxis(axisName(0), n_x, x_min, x_max)); diff --git a/Sim/Export/SampleToPython.cpp b/Sim/Export/SampleToPython.cpp index 3947633e652762fbb40b9a29fb194f00d26bc4fb..410fdc359fbb8b2694bb8130c37622166eb2f4d0 100644 --- a/Sim/Export/SampleToPython.cpp +++ b/Sim/Export/SampleToPython.cpp @@ -39,7 +39,7 @@ using Py::Fmt::indent; -static const std::map<int, char> axisChar {{0,'X'}, {1,'Y'}, {2,'Z'}}; +static const std::map<int, char> axisChar{{0, 'X'}, {1, 'Y'}, {2, 'Z'}}; namespace { @@ -52,7 +52,7 @@ void setRotationInformation(const IParticle* particle, std::string name, std::os if (matrix.isIdentity()) return; // Rotation around coordinate axis? - for (int iAxis = 0; iAxis<3; ++iAxis) { + for (int iAxis = 0; iAxis < 3; ++iAxis) { std::optional<double> angle = matrix.angleAroundCoordAxis(iAxis); if (angle) { result << indent() << name << "_rotation = ba.Rotation" << axisChar.at(iAxis) << "(" @@ -64,8 +64,7 @@ void setRotationInformation(const IParticle* particle, std::string name, std::os // Generic rotation. auto angles = matrix.zxzEulerAngles(); result << indent() << name << "_rotation = ba.RotationEuler(" - << Py::Fmt::printDegrees(angles[0]) << ", " - << Py::Fmt::printDegrees(angles[1]) << ", " + << Py::Fmt::printDegrees(angles[0]) << ", " << Py::Fmt::printDegrees(angles[1]) << ", " << Py::Fmt::printDegrees(angles[2]) << ")\n"; result << indent() << name << ".setRotation(" << name << "_rotation)\n"; } diff --git a/Sim/Simulation/ISimulation2D.cpp b/Sim/Simulation/ISimulation2D.cpp index eab1461313467053dc951c59d559965d218fc0fc..5ca22bb53a5286d9cb0fd80911fce2c901bd73a4 100644 --- a/Sim/Simulation/ISimulation2D.cpp +++ b/Sim/Simulation/ISimulation2D.cpp @@ -16,8 +16,8 @@ #include "Base/Util/Assert.h" #include "Device/Beam/Beam.h" #include "Device/Detector/DetectorContext.h" -#include "Device/Detector/SphericalDetector.h" #include "Device/Detector/IDetector.h" +#include "Device/Detector/SphericalDetector.h" #include "Resample/Element/DiffuseElement.h" #include "Sim/Background/IBackground.h" #include "Sim/Computation/DWBAComputation.h" diff --git a/Tests/Functional/Suite/MakeSimulations.cpp b/Tests/Functional/Suite/MakeSimulations.cpp index 95da6cd24629993f9d2f4d005727667129927db5..dc42369ef46a305b84e36b53d747eeec1fc4cd0f 100644 --- a/Tests/Functional/Suite/MakeSimulations.cpp +++ b/Tests/Functional/Suite/MakeSimulations.cpp @@ -217,8 +217,8 @@ test::makeSimulation::RectDetectorGeneric(const MultiLayer& sample) { Beam beam(1.0, 1 * angstrom, Direction(0.2 * deg, 0)); RectangularDetector detector(rdet_nbinsx, rdet_width, rdet_nbinsy, rdet_height); - detector.setDetectorPosition( - R3(rdet_distance, 10.0, 5.0), rdet_width / 2., 1.0, R3(0.1, -1.0, 0.2)); + detector.setDetectorPosition(R3(rdet_distance, 10.0, 5.0), rdet_width / 2., 1.0, + R3(0.1, -1.0, 0.2)); return std::make_unique<ScatteringSimulation>(beam, sample, detector); } @@ -338,8 +338,8 @@ std::unique_ptr<OffspecSimulation> test::makeSimulation::MiniOffspec(const Multi const double phi_min(-0.1 * deg); const double phi_max(0.1 * deg); - result->detector().setDetectorParameters( - n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max); + result->detector().setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, + alpha_max); const int n_scan_points(n_alpha); const double alpha_i_min(alpha_min);