diff --git a/Alignment/include/ActsAlignment/Kernel/Alignment.ipp b/Alignment/include/ActsAlignment/Kernel/Alignment.ipp index 4b00839f747..bed84a1afaa 100644 --- a/Alignment/include/ActsAlignment/Kernel/Alignment.ipp +++ b/Alignment/include/ActsAlignment/Kernel/Alignment.ipp @@ -124,9 +124,11 @@ void ActsAlignment::Alignment::calculateAlignmentParameters( } alignResult.chi2 += alignState.chi2; alignResult.measurementDim += alignState.measurementDim; - sumChi2ONdf += alignState.chi2 / alignState.measurementDim; + sumChi2ONdf += + alignState.chi2 / static_cast(alignState.measurementDim); } - alignResult.averageChi2ONdf = sumChi2ONdf / alignResult.numTracks; + alignResult.averageChi2ONdf = + sumChi2ONdf / static_cast(alignResult.numTracks); // Get the inverse of chi2 second derivative matrix (we need this to // calculate the covariance of the alignment parameters) diff --git a/Core/include/Acts/EventData/SpacePointColumnProxy2.hpp b/Core/include/Acts/EventData/SpacePointColumnProxy2.hpp index 0daa67735a5..122c1f4ff6a 100644 --- a/Core/include/Acts/EventData/SpacePointColumnProxy2.hpp +++ b/Core/include/Acts/EventData/SpacePointColumnProxy2.hpp @@ -59,7 +59,9 @@ class SpacePointColumnProxy { /// Returns the number of entries in the space point column. /// @return The size of the space point column. - std::uint32_t size() const noexcept { return column().size(); } + std::uint32_t size() const noexcept { + return static_cast(column().size()); + } /// Returns a const proxy of the space point column. /// @return A const proxy of the space point column. diff --git a/Core/include/Acts/EventData/TrackContainer.hpp b/Core/include/Acts/EventData/TrackContainer.hpp index 31ec1a25e30..6751ec94e2d 100644 --- a/Core/include/Acts/EventData/TrackContainer.hpp +++ b/Core/include/Acts/EventData/TrackContainer.hpp @@ -340,7 +340,9 @@ class TrackContainer { /// Get the size (number of tracks) of the track container /// @return the sixe - constexpr IndexType size() const { return m_container->size_impl(); } + constexpr IndexType size() const { + return static_cast(m_container->size_impl()); + } /// Clear the content of the track container /// @note Only available if the track container is not read-only diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index 8c72262262e..80bb80d52c3 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -285,7 +285,8 @@ class TrackProxy return 0; } auto tsRange = trackStatesReversed(); - return std::distance(tsRange.begin(), tsRange.end()); + return static_cast( + std::distance(tsRange.begin(), tsRange.end())); } /// Return the index of this track in the track container diff --git a/Core/include/Acts/Geometry/SurfaceArrayCreator.hpp b/Core/include/Acts/Geometry/SurfaceArrayCreator.hpp index b310e8c2d6f..70021bd7b2b 100644 --- a/Core/include/Acts/Geometry/SurfaceArrayCreator.hpp +++ b/Core/include/Acts/Geometry/SurfaceArrayCreator.hpp @@ -96,7 +96,7 @@ class SurfaceArrayCreator { std::size_t getBin(AxisScalar x) const { if (binEdges.empty()) { // equidistant - AxisScalar w = (max - min) / nBins; + AxisScalar w = (max - min) / static_cast(nBins); return static_cast(std::floor((x - min) / w)); } else { // variable diff --git a/Core/include/Acts/Propagator/DirectNavigator.hpp b/Core/include/Acts/Propagator/DirectNavigator.hpp index fb4b2d9a000..0f8734a1e7e 100644 --- a/Core/include/Acts/Propagator/DirectNavigator.hpp +++ b/Core/include/Acts/Propagator/DirectNavigator.hpp @@ -127,7 +127,7 @@ class DirectNavigator { /// @return Number of surfaces left to process in the propagation direction int remainingSurfaces() const { if (direction == Direction::Forward()) { - return options.externalSurfaces.size() - surfaceIndex; + return static_cast(options.externalSurfaces.size()) - surfaceIndex; } return surfaceIndex + 1; } @@ -251,8 +251,8 @@ class DirectNavigator { if (found != state.options.externalSurfaces.end()) { // The index should be the index before the start surface, depending on // the direction - state.surfaceIndex = - std::distance(state.options.externalSurfaces.begin(), found); + state.surfaceIndex = static_cast( + std::distance(state.options.externalSurfaces.begin(), found)); state.surfaceIndex += state.direction == Direction::Backward() ? 1 : -1; } else { ACTS_DEBUG( diff --git a/Core/include/Acts/Propagator/MaterialInteractor.hpp b/Core/include/Acts/Propagator/MaterialInteractor.hpp index 1682b94f68a..2414277f31e 100644 --- a/Core/include/Acts/Propagator/MaterialInteractor.hpp +++ b/Core/include/Acts/Propagator/MaterialInteractor.hpp @@ -246,7 +246,7 @@ struct MaterialInteractor { result.materialInteractions.back().deltaP = momentum - result.materialInteractions.back().direction.norm(); result.materialInteractions.back().materialSlab.scaleThickness( - shift.norm()); + static_cast(shift.norm())); result.materialInteractions.back().updatedVolumeStep = true; result.materialInX0 += result.materialInteractions.back().materialSlab.thicknessInX0(); diff --git a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp index 25c71a15494..75cd9840a8c 100644 --- a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp +++ b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp @@ -140,7 +140,7 @@ PointwiseMaterialEffects computeMaterialEffects(const propagator_state_t& state, bool energyLoss) { const bool covTransport = state.stepping.covTransport; const Vector3 direction = stepper.direction(state.stepping); - const float qOverP = stepper.qOverP(state.stepping); + const auto qOverP = static_cast(stepper.qOverP(state.stepping)); const ParticleHypothesis& particleHypothesis = stepper.particleHypothesis(state.stepping); @@ -179,7 +179,7 @@ PointwiseMaterialEffects performMaterialInteraction( const Vector3 position = stepper.position(state.stepping); const double time = stepper.time(state.stepping); const Vector3 direction = stepper.direction(state.stepping); - const float qOverP = stepper.qOverP(state.stepping); + const double qOverP = stepper.qOverP(state.stepping); const double momentum = stepper.absoluteMomentum(state.stepping); // in forward(backward) propagation, energy decreases(increases) and diff --git a/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp b/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp index d5cbdbbe0d4..bf9678c42da 100644 --- a/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp +++ b/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp @@ -64,10 +64,12 @@ struct VolumeMaterialInteraction { pos(stepper.position(state.stepping)), time(stepper.time(state.stepping)), dir(stepper.direction(state.stepping)), - qOverP(stepper.qOverP(state.stepping)), - absQ(stepper.particleHypothesis(state.stepping).absoluteCharge()), - momentum(stepper.absoluteMomentum(state.stepping)), - mass(stepper.particleHypothesis(state.stepping).mass()), + qOverP(static_cast(stepper.qOverP(state.stepping))), + absQ(static_cast( + stepper.particleHypothesis(state.stepping).absoluteCharge())), + momentum(static_cast(stepper.absoluteMomentum(state.stepping))), + mass(static_cast( + stepper.particleHypothesis(state.stepping).mass())), absPdg(stepper.particleHypothesis(state.stepping).absolutePdg()), performCovarianceTransport(state.stepping.covTransport), navDir(state.options.direction) {} diff --git a/Core/include/Acts/Seeding/HoughTransformUtils.hpp b/Core/include/Acts/Seeding/HoughTransformUtils.hpp index 0ee0a71a352..f6c1e86a9dc 100644 --- a/Core/include/Acts/Seeding/HoughTransformUtils.hpp +++ b/Core/include/Acts/Seeding/HoughTransformUtils.hpp @@ -73,7 +73,7 @@ inline int binIndex(double min, double max, unsigned nSteps, double val) { /// left to the caller inline double lowerBinEdge(double min, double max, unsigned nSteps, std::size_t binIndex) { - return min + (max - min) * binIndex / nSteps; + return min + (max - min) * static_cast(binIndex) / nSteps; } // Returns the lower bound of the bin specified by step /// @param min: Start of axis range @@ -85,7 +85,8 @@ inline double lowerBinEdge(double min, double max, unsigned nSteps, /// left to the caller inline double binCenter(double min, double max, unsigned nSteps, std::size_t binIndex) { - return min + (max - min) * 0.5 * (2 * binIndex + 1) / nSteps; + return min + + (max - min) * 0.5 * (2 * static_cast(binIndex) + 1) / nSteps; } /// @brief data class for the information to store for each diff --git a/Core/include/Acts/Seeding/HoughTransformUtils.ipp b/Core/include/Acts/Seeding/HoughTransformUtils.ipp index 17ac4152194..619e79e3f92 100644 --- a/Core/include/Acts/Seeding/HoughTransformUtils.ipp +++ b/Core/include/Acts/Seeding/HoughTransformUtils.ipp @@ -23,15 +23,16 @@ void Acts::HoughTransformUtils::HoughPlane::fill( // loop over all bins in the first coordinate to populate the line for (std::size_t xBin = 0; xBin < m_cfg.nBinsX; xBin++) { // get the x-coordinate for the given bin - auto x = binCenter(axisRanges.xMin, axisRanges.xMax, m_cfg.nBinsX, xBin); + auto x = binCenter(axisRanges.xMin, axisRanges.xMax, + static_cast(m_cfg.nBinsX), xBin); // now evaluate the line equation provided by the user CoordType y = linePar(x, measurement); CoordType dy = widthPar(x, measurement); // translate the y-coordinate range to a bin range - int yBinDown = - binIndex(axisRanges.yMin, axisRanges.yMax, m_cfg.nBinsY, y - dy); - int yBinUp = - binIndex(axisRanges.yMin, axisRanges.yMax, m_cfg.nBinsY, y + dy); + int yBinDown = binIndex(axisRanges.yMin, axisRanges.yMax, + static_cast(m_cfg.nBinsY), y - dy); + int yBinUp = binIndex(axisRanges.yMin, axisRanges.yMax, + static_cast(m_cfg.nBinsY), y + dy); // now we can loop over the bin range to fill the corresponding cells for (int yBin = yBinDown; yBin <= yBinUp; ++yBin) { // skip 'out of bounds' cases @@ -104,8 +105,8 @@ template Acts::HoughTransformUtils::HoughPlane::HoughPlane( const HoughPlaneConfig& cfg) : m_cfg(cfg), - m_houghHist(Axis(0, m_cfg.nBinsX, m_cfg.nBinsX), - Axis(0, m_cfg.nBinsY, m_cfg.nBinsY)) { + m_houghHist(Axis(0., static_cast(m_cfg.nBinsX), m_cfg.nBinsX), + Axis(0., static_cast(m_cfg.nBinsY), m_cfg.nBinsY)) { // instantiate our histogram. // m_houghHist = HoughHist(Axis(0, m_cfg.nBinsX, m_cfg.nBinsX), Axis(0, // m_cfg.nBinsY, m_cfg.nBinsY)); @@ -119,7 +120,8 @@ void Acts::HoughTransformUtils::HoughPlane::fillBin( m_touchedBins.insert(globalBin({binX, binY})); // add content to the cell - m_houghHist.atLocalBins({binX, binY}).fill(identifier, layer, w); + m_houghHist.atLocalBins({binX, binY}) + .fill(identifier, layer, static_cast(w)); // and update our cached maxima YieldType layers = nLayers(binX, binY); YieldType hits = nHits(binX, binY); @@ -307,10 +309,10 @@ Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax< // CALL AXIS BINS HERE std::array xy = plane.axisBins(cand); // translate to parameter space for overlap veto - CoordType xCand = - binCenter(ranges.xMin, ranges.xMax, plane.nBinsX(), xy[0]); - CoordType yCand = - binCenter(ranges.yMin, ranges.yMax, plane.nBinsY(), xy[1]); + CoordType xCand = binCenter(ranges.xMin, ranges.xMax, + static_cast(plane.nBinsX()), xy[0]); + CoordType yCand = binCenter(ranges.yMin, ranges.yMax, + static_cast(plane.nBinsY()), xy[1]); // check if we are too close to a previously found maximum bool goodSpacing = true; for (auto& found : maxima) { @@ -354,10 +356,10 @@ Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax< auto hidIds = plane.hitIds(xBin, yBin); allHits.insert(allHits.end(), std::make_move_iterator(hidIds.begin()), std::make_move_iterator(hidIds.end())); - CoordType xHit = - binCenter(ranges.xMin, ranges.xMax, plane.nBinsX(), xBin); - CoordType yHit = - binCenter(ranges.yMin, ranges.yMax, plane.nBinsY(), yBin); + CoordType xHit = binCenter(ranges.xMin, ranges.xMax, + static_cast(plane.nBinsX()), xBin); + CoordType yHit = binCenter(ranges.yMin, ranges.yMax, + static_cast(plane.nBinsY()), yBin); YieldType nHits = plane.nHits(xBin, yBin); max_x += xHit * nHits; max_y += yHit * nHits; @@ -485,8 +487,8 @@ slidingWindowRecenter( y <= ycenter + config.yRecenterSize; ++y) { const YieldType numOfHits = plane.nHits(x, y); if (numOfHits >= maxValue) { - xw += x * numOfHits; - yw += y * numOfHits; + xw += static_cast(x) * numOfHits; + yw += static_cast(y) * numOfHits; tot += numOfHits; } } diff --git a/Core/include/Acts/Seeding2/BroadTripletSeedFilter.hpp b/Core/include/Acts/Seeding2/BroadTripletSeedFilter.hpp index b6c952bdb3a..987347b29a1 100644 --- a/Core/include/Acts/Seeding2/BroadTripletSeedFilter.hpp +++ b/Core/include/Acts/Seeding2/BroadTripletSeedFilter.hpp @@ -67,10 +67,11 @@ class BroadTripletSeedFilter final : public ITripletSeedFilter { struct Config { /// Allowed difference in curvature (inverted seed radii) between two /// compatible seeds - float deltaInvHelixDiameter = 0.00003 * (1 / UnitConstants::mm); + float deltaInvHelixDiameter = + static_cast(0.00003 / UnitConstants::mm); /// Minimum distance between compatible outer space-points to be considered. /// This is used to avoid counting space-points from the same layer - float deltaRMin = 5 * UnitConstants::mm; + float deltaRMin = static_cast(5 * UnitConstants::mm); /// Seed weight/score is increased by this value if a compatible seed has /// been found. This is the c1 factor in the seed score calculation (w = c1 /// * Nt - c2 * d0 - c3 * z0) diff --git a/Core/include/Acts/Seeding2/CylindricalSpacePointGrid2.hpp b/Core/include/Acts/Seeding2/CylindricalSpacePointGrid2.hpp index 6643caf1a62..ea12edce688 100644 --- a/Core/include/Acts/Seeding2/CylindricalSpacePointGrid2.hpp +++ b/Core/include/Acts/Seeding2/CylindricalSpacePointGrid2.hpp @@ -53,23 +53,23 @@ class CylindricalSpacePointGrid2 { /// distance from x=y=0 (i.e. in r) /// WARNING: if rMin is smaller than impactMax, the bin size will be 2*pi, /// which will make seeding very slow! - float rMin = 0 * UnitConstants::mm; + float rMin = static_cast(0 * UnitConstants::mm); /// maximum extension of sensitive detector layer relevant for seeding as /// distance from x=y=0 (i.e. in r) - float rMax = 600 * UnitConstants::mm; + float rMax = static_cast(600 * UnitConstants::mm); /// minimum extension of sensitive detector layer relevant for seeding in /// negative direction in z - float zMin = -2800 * UnitConstants::mm; + float zMin = static_cast(-2800 * UnitConstants::mm); /// maximum extension of sensitive detector layer relevant for seeding in /// positive direction in z - float zMax = 2800 * UnitConstants::mm; + float zMax = static_cast(2800 * UnitConstants::mm); /// maximum distance in r from middle space point to bottom or top /// space point - float deltaRMax = 270 * UnitConstants::mm; + float deltaRMax = static_cast(270 * UnitConstants::mm); /// maximum forward direction expressed as cot(theta) - float cotThetaMax = 10.01788; // equivalent to eta = 3 (pseudorapidity) + float cotThetaMax = 10.01788f; // equivalent to eta = 3 (pseudorapidity) /// maximum impact parameter in mm - float impactMax = 0 * UnitConstants::mm; + float impactMax = static_cast(0 * UnitConstants::mm); /// minimum phi value for phiAxis construction float phiMin = -std::numbers::pi_v; /// maximum phi value for phiAxis construction diff --git a/Core/include/Acts/Seeding2/CylindricalSpacePointKDTree.hpp b/Core/include/Acts/Seeding2/CylindricalSpacePointKDTree.hpp index 1599871e4d8..ffdef8d221f 100644 --- a/Core/include/Acts/Seeding2/CylindricalSpacePointKDTree.hpp +++ b/Core/include/Acts/Seeding2/CylindricalSpacePointKDTree.hpp @@ -45,22 +45,22 @@ class CylindricalSpacePointKDTree { struct Options { /// maximum extension of sensitive detector layer relevant for seeding as /// distance from x=y=0 (i.e. in r) - float rMax = 600 * UnitConstants::mm; + float rMax = static_cast(600 * UnitConstants::mm); /// minimum extension of sensitive detector layer relevant for seeding in /// negative direction in z - float zMin = -2800 * UnitConstants::mm; + float zMin = static_cast(-2800 * UnitConstants::mm); /// maximum extension of sensitive detector layer relevant for seeding in /// positive direction in z - float zMax = 2800 * UnitConstants::mm; + float zMax = static_cast(2800 * UnitConstants::mm); /// minimum phi value for phiAxis construction float phiMin = -std::numbers::pi_v; /// maximum phi value for phiAxis construction float phiMax = std::numbers::pi_v; /// Minimum radial distance between two doublet components - float deltaRMin = 5 * UnitConstants::mm; + float deltaRMin = static_cast(5 * UnitConstants::mm); /// Maximum radial distance between two doublet components - float deltaRMax = 270 * UnitConstants::mm; + float deltaRMax = static_cast(270 * UnitConstants::mm); /// Minimal z distance between two doublet components float deltaZMin = -std::numeric_limits::infinity(); @@ -69,13 +69,13 @@ class CylindricalSpacePointKDTree { /// Limiting location of collision region in z-axis used to check if doublet /// origin is within reasonable bounds - float collisionRegionMin = -150 * UnitConstants::mm; + float collisionRegionMin = static_cast(-150 * UnitConstants::mm); /// Maximum location of collision region in z-axis - float collisionRegionMax = +150 * UnitConstants::mm; + float collisionRegionMax = static_cast(150 * UnitConstants::mm); /// Maximum allowed cotTheta between two space-points in doublet, used to /// check if forward angle is within bounds - float cotThetaMax = 10.01788; // equivalent to eta = 3 (pseudorapidity) + float cotThetaMax = 10.01788f; // equivalent to eta = 3 (pseudorapidity) /// Shrink the phi range of middle space-point (analogous to phi bin size in /// grid from default seeding + number of phi bins used in search) diff --git a/Core/include/Acts/Seeding2/DoubletSeedFinder.hpp b/Core/include/Acts/Seeding2/DoubletSeedFinder.hpp index b6d1ff0b802..b2c59dfcf80 100644 --- a/Core/include/Acts/Seeding2/DoubletSeedFinder.hpp +++ b/Core/include/Acts/Seeding2/DoubletSeedFinder.hpp @@ -294,9 +294,9 @@ class DoubletSeedFinder { Direction candidateDirection = Direction::Forward(); /// Minimum radial distance between two doublet components - float deltaRMin = 5 * UnitConstants::mm; + float deltaRMin = static_cast(5 * UnitConstants::mm); /// Maximum radial distance between two doublet components - float deltaRMax = 270 * UnitConstants::mm; + float deltaRMax = static_cast(270 * UnitConstants::mm); /// Minimal z distance between two doublet components float deltaZMin = -std::numeric_limits::infinity(); @@ -304,7 +304,7 @@ class DoubletSeedFinder { float deltaZMax = std::numeric_limits::infinity(); /// Maximum value of impact parameter estimation of the seed candidates - float impactMax = 20 * UnitConstants::mm; + float impactMax = static_cast(20 * UnitConstants::mm); /// Enable cut on the compatibility between interaction point and doublet, /// this is an useful approximation to speed up the seeding @@ -312,23 +312,23 @@ class DoubletSeedFinder { /// Limiting location of collision region in z-axis used to check if doublet /// origin is within reasonable bounds - float collisionRegionMin = -150 * UnitConstants::mm; + float collisionRegionMin = static_cast(-150 * UnitConstants::mm); /// Maximum collision region boundary in z-axis for doublet origin checks - float collisionRegionMax = +150 * UnitConstants::mm; + float collisionRegionMax = static_cast(150 * UnitConstants::mm); /// Maximum allowed cotTheta between two space-points in doublet, used to /// check if forward angle is within bounds - float cotThetaMax = 10.01788; // equivalent to eta = 3 (pseudorapidity) + float cotThetaMax = 10.01788f; // equivalent to eta = 3 (pseudorapidity) /// Minimum transverse momentum (pT) used to check the r-z slope /// compatibility of triplets with maximum multiple scattering effect /// (produced by the minimum allowed pT particle) + a certain uncertainty /// term. Check the documentation for more information /// https://acts.readthedocs.io/en/latest/core/reconstruction/pattern_recognition/seeding.html - float minPt = 400 * UnitConstants::MeV; + float minPt = static_cast(400 * UnitConstants::MeV); /// Parameter which can loosen the tolerance of the track seed to form a /// helix. This is useful for e.g. misaligned seeding. - float helixCutTolerance = 1; + float helixCutTolerance = 1.f; /// Type alias for delegate to apply experiment specific cuts during doublet /// finding diff --git a/Core/include/Acts/Seeding2/GbtsGeometry.hpp b/Core/include/Acts/Seeding2/GbtsGeometry.hpp index cfc38652c2e..c9dd4e9d3bd 100644 --- a/Core/include/Acts/Seeding2/GbtsGeometry.hpp +++ b/Core/include/Acts/Seeding2/GbtsGeometry.hpp @@ -51,7 +51,9 @@ class GbtsLayer final { /// Get number of bins /// @return Number of bins - std::int32_t numOfBins() const { return m_bins.size(); } + std::int32_t numOfBins() const { + return static_cast(m_bins.size()); + } /// Get bins /// @return Vector of bin indices @@ -128,7 +130,9 @@ class GbtsGeometry final { /// Get number of layers /// @return Number of layers - std::uint32_t numLayers() const { return m_layers.size(); } + std::uint32_t numLayers() const { + return static_cast(m_layers.size()); + } /// Get bin groups /// @return Bin groups vector diff --git a/Core/include/Acts/Seeding2/GbtsTrackingFilter.hpp b/Core/include/Acts/Seeding2/GbtsTrackingFilter.hpp index 8ccffe99b1a..af13661d2b9 100644 --- a/Core/include/Acts/Seeding2/GbtsTrackingFilter.hpp +++ b/Core/include/Acts/Seeding2/GbtsTrackingFilter.hpp @@ -65,24 +65,24 @@ class GbtsTrackingFilter final { /// Configuration for the tracking filter. struct Config { /// Multiple scattering sigma (for 900 MeV track at eta=0). - float sigmaMS = 0.016; + float sigmaMS = 0.016f; /// Radiation length fraction per layer (2.5% per layer). - float radLen = 0.025; + float radLen = 0.025f; /// Measurement uncertainty in x direction. - float sigmaX = 0.08; + float sigmaX = 0.08f; /// Measurement uncertainty in y direction. - float sigmaY = 0.25; + float sigmaY = 0.25f; /// Measurement weight in x direction. - float weightX = 0.5; + float weightX = 0.5f; /// Measurement weight in y direction. - float weightY = 0.5; + float weightY = 0.5f; /// Maximum delta chi2 in x direction. - float maxDChi2X = 5.0; + float maxDChi2X = 5.0f; /// Maximum delta chi2 in y direction. - float maxDChi2Y = 6.0; + float maxDChi2Y = 6.0f; /// Chi2 penalty for adding a hit. float addHit = 14.0; diff --git a/Core/include/Acts/Seeding2/GraphBasedTrackSeeder.hpp b/Core/include/Acts/Seeding2/GraphBasedTrackSeeder.hpp index 4edba30d9b5..4d89ba702fe 100644 --- a/Core/include/Acts/Seeding2/GraphBasedTrackSeeder.hpp +++ b/Core/include/Acts/Seeding2/GraphBasedTrackSeeder.hpp @@ -52,7 +52,7 @@ class GraphBasedTrackSeeder { /// Use legacy tuning parameters. bool useOldTunings = false; /// Tau ratio cut threshold. - float tauRatioCut = 0.007; + float tauRatioCut = 0.007f; /// Tau ratio precut threshold. float tauRatioPrecut = 0.009f; /// Eta bin width override (0 uses default from connection file). @@ -63,7 +63,7 @@ class GraphBasedTrackSeeder { /// Maximum number of phi slices. float nMaxPhiSlice = 53; // used to calculate phi slices /// Minimum transverse momentum. - float minPt = 1.0f * UnitConstants::GeV; + float minPt = static_cast(UnitConstants::GeV); // graph building options /// Transverse momentum coefficient (~0.3*B/2 - assumes nominal field of @@ -76,17 +76,17 @@ class GraphBasedTrackSeeder { /// Maximum number of Gbts edges/doublets. std::uint32_t nMaxEdges = 2000000; /// Minimum delta radius between layers. - float minDeltaRadius = 2.0; + float minDeltaRadius = 2.0f; // Seed extraction options /// Minimum eta for edge masking. - float edgeMaskMinEta = 1.5; + float edgeMaskMinEta = 1.5f; /// Threshold for hit sharing between seeds. - float hitShareThreshold = 0.49; + float hitShareThreshold = 0.49f; // GbtsDataStorage options /// Maximum endcap cluster width. - float maxEndcapClusterWidth = 0.35; + float maxEndcapClusterWidth = 0.35f; }; /// Derived configuration struct that contains calculated parameters based on diff --git a/Core/include/Acts/Seeding2/TripletSeedFinder.hpp b/Core/include/Acts/Seeding2/TripletSeedFinder.hpp index 22f340a9aed..ddb1a902e02 100644 --- a/Core/include/Acts/Seeding2/TripletSeedFinder.hpp +++ b/Core/include/Acts/Seeding2/TripletSeedFinder.hpp @@ -148,24 +148,24 @@ class TripletSeedFinder { /// (produced by the minimum allowed pT particle) + a certain uncertainty /// term. Check the documentation for more information /// https://acts.readthedocs.io/en/latest/core/reconstruction/pattern_recognition/seeding.html - float minPt = 400 * UnitConstants::MeV; + float minPt = static_cast(400 * UnitConstants::MeV); /// Number of sigmas of scattering angle to be considered in the minimum pT /// scattering term - float sigmaScattering = 5; + float sigmaScattering = 5.f; /// Term that accounts for the thickness of scattering medium in radiation /// lengths in the Lynch & Dahl correction to the Highland equation default /// is 5% - float radLengthPerSeed = 0.05; + float radLengthPerSeed = 0.05f; /// Maximum value of impact parameter estimation of the seed candidates - float impactMax = 20 * UnitConstants::mm; + float impactMax = static_cast(20 * UnitConstants::mm); /// Parameter which can loosen the tolerance of the track seed to form a /// helix. This is useful for e.g. misaligned seeding. - float helixCutTolerance = 1; + float helixCutTolerance = 1.f; /// Tolerance parameter used to check the compatibility of space-point /// coordinates in xyz. This is only used in a detector specific check for /// strip modules - float toleranceParam = 1.1 * UnitConstants::mm; + float toleranceParam = static_cast(1.1 * UnitConstants::mm); }; /// Derived configuration for the triplet seed finder using a magnetic field. diff --git a/Core/include/Acts/Seeding2/detail/CandidatesForMiddleSp2.hpp b/Core/include/Acts/Seeding2/detail/CandidatesForMiddleSp2.hpp index 614e2fe8827..5d8b56e652c 100644 --- a/Core/include/Acts/Seeding2/detail/CandidatesForMiddleSp2.hpp +++ b/Core/include/Acts/Seeding2/detail/CandidatesForMiddleSp2.hpp @@ -53,7 +53,7 @@ class CandidatesForMiddleSp2 { /// @param nHigh Maximum number of candidates in the high-quality collection CandidatesForMiddleSp2(Size nLow, Size nHigh); - Size size() const { return m_storage.size(); } + Size size() const { return static_cast(m_storage.size()); } /// @brief Clear the internal storage void clear(); diff --git a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp index ca2922c325e..c3cce0cea41 100644 --- a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp @@ -39,7 +39,8 @@ struct FacesHelper { std::iota(face.begin(), face.end(), 0); faces.push_back(face); /// Triangular mesh construction - unsigned int anker = centerLast ? vertices.size() - 1 : 0; + unsigned int anker = + centerLast ? static_cast(vertices.size() - 1) : 0; for (unsigned int it = 2 - offset; it < vertices.size() - offset; ++it) { triangularMesh.push_back({anker, it - 1, it}); } @@ -64,7 +65,8 @@ struct FacesHelper { const std::vector& vertices) { FaceVector faces; FaceVector triangularMesh; - std::size_t nqfaces = static_cast(0.5 * vertices.size()); + auto nqfaces = + static_cast(0.5 * static_cast(vertices.size())); for (std::size_t iface = 0; iface < nqfaces - 1; ++iface) { std::size_t p2 = (iface + 1 == nqfaces) ? 0 : iface + 1; std::vector face = {iface, p2, p2 + nqfaces, diff --git a/Core/include/Acts/TrackFinding/MeasurementSelector.ipp b/Core/include/Acts/TrackFinding/MeasurementSelector.ipp index 607baaab431..e011567c74b 100644 --- a/Core/include/Acts/TrackFinding/MeasurementSelector.ipp +++ b/Core/include/Acts/TrackFinding/MeasurementSelector.ipp @@ -68,7 +68,7 @@ MeasurementSelector::select( trackState.effectiveCalibratedCovariance().data(), trackState.predicted(), trackState.predictedCovariance(), trackState.projectorSubspaceIndices(), trackState.calibratedSize()); - trackState.chi2() = chi2; + trackState.chi2() = static_cast(chi2); if (chi2 < minChi2) { minChi2 = chi2; diff --git a/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp b/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp index 90d77ca2161..b6a9ce622db 100644 --- a/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp +++ b/Core/include/Acts/TrackFinding/TrackParamsLookupAccumulator.hpp @@ -82,8 +82,10 @@ class TrackParamsLookupAccumulator { auto res = TrackParameters::create( gctx, track.referenceSurface().getSharedPtr(), - track.fourPosition(gctx) / count, track.momentum().normalized(), - count * track.charge() / track.momentum().norm(), + track.fourPosition(gctx) / static_cast(count), + track.momentum().normalized(), + static_cast(count) * track.charge() / + track.momentum().norm(), track.covariance(), track.particleHypothesis()); if (!res.ok()) { @@ -91,10 +93,12 @@ class TrackParamsLookupAccumulator { } return res.value(); } else { - return TrackParameters(track.fourPosition() / count, - track.momentum().normalized(), - count * track.charge() / track.momentum().norm(), - track.covariance(), track.particleHypothesis()); + return TrackParameters( + track.fourPosition() / static_cast(count), + track.momentum().normalized(), + static_cast(count) * track.charge() / + track.momentum().norm(), + track.covariance(), track.particleHypothesis()); } }; diff --git a/Core/include/Acts/TrackFitting/GainMatrixSmoother.hpp b/Core/include/Acts/TrackFitting/GainMatrixSmoother.hpp index 9bae5051fba..c449a696dcc 100644 --- a/Core/include/Acts/TrackFitting/GainMatrixSmoother.hpp +++ b/Core/include/Acts/TrackFitting/GainMatrixSmoother.hpp @@ -50,7 +50,8 @@ class GainMatrixSmoother { // For the last state: smoothed is filtered - also: switch to next ACTS_VERBOSE("Getting previous track state"); - auto prev_ts = trajectory.getTrackState(entryIndex); + auto prev_ts = trajectory.getTrackState( + static_cast(entryIndex)); prev_ts.shareFrom(TrackStatePropMask::Filtered, TrackStatePropMask::Smoothed); diff --git a/Core/include/Acts/TrackFitting/GainMatrixUpdater.hpp b/Core/include/Acts/TrackFitting/GainMatrixUpdater.hpp index 5fbe7b5f092..ab7d16151a4 100644 --- a/Core/include/Acts/TrackFitting/GainMatrixUpdater.hpp +++ b/Core/include/Acts/TrackFitting/GainMatrixUpdater.hpp @@ -58,7 +58,7 @@ class GainMatrixUpdater { const auto [chi2, error] = visitMeasurement(AnyMutableTrackStateProxy{trackState}, logger); - trackState.chi2() = chi2; + trackState.chi2() = static_cast(chi2); return error ? Result::failure(error) : Result::success(); } diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 6b4d01f2220..cc1bdbeba52 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -199,13 +199,13 @@ struct Gx2FitterResult { /// This corresponds to the last measurement state in the multitrajectory. /// Since this KF only stores one trajectory, it is unambiguous. /// Acts::TrackTraits::kInvalid is the start of a trajectory. - std::size_t lastMeasurementIndex = Acts::kTrackIndexInvalid; + TrackIndexType lastMeasurementIndex = Acts::kTrackIndexInvalid; /// This is the index of the 'tip' of the states stored in multitrajectory. /// This corresponds to the last state in the multitrajectory. /// Since this KF only stores one trajectory, it is unambiguous. /// Acts::TrackTraits::kInvalid is the start of a trajectory. - std::size_t lastTrackIndex = Acts::kTrackIndexInvalid; + TrackIndexType lastTrackIndex = Acts::kTrackIndexInvalid; /// The optional Parameters at the provided surface std::optional fittedParameters; @@ -866,7 +866,7 @@ class Gx2Fitter { const auto& particle = parametersWithHypothesis->particleHypothesis(); - const double sigma = + const auto sigma = static_cast(Acts::computeMultipleScatteringTheta0( slab, particle.absolutePdg(), particle.mass(), static_cast( @@ -972,8 +972,9 @@ class Gx2Fitter { // We count the processed measurement ++result.processedMeasurements; - result.lastMeasurementIndex = currentTrackIndex; - result.lastTrackIndex = currentTrackIndex; + result.lastMeasurementIndex = + static_cast(currentTrackIndex); + result.lastTrackIndex = static_cast(currentTrackIndex); // TODO check for outlier first // We count the state with measurement @@ -1071,7 +1072,7 @@ class Gx2Fitter { result.missedActiveSurfaces.push_back(surface); } - result.lastTrackIndex = currentTrackIndex; + result.lastTrackIndex = static_cast(currentTrackIndex); ++result.processedStates; @@ -1147,7 +1148,7 @@ class Gx2Fitter { result.missedActiveSurfaces.push_back(surface); } - result.lastTrackIndex = currentTrackIndex; + result.lastTrackIndex = static_cast(currentTrackIndex); ++result.processedStates; @@ -1654,7 +1655,7 @@ class Gx2Fitter { // Set the chi2sum for the track summary manually, since we don't calculate // it for each state - track.chi2() = chi2sum; + track.chi2() = static_cast(chi2sum); // Return the converted Track return track; diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index 6453060bdf1..ad69c49ae96 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -12,6 +12,7 @@ #include "Acts/EventData/MultiTrajectory.hpp" #include "Acts/EventData/MultiTrajectoryHelpers.hpp" #include "Acts/EventData/SourceLink.hpp" +#include "Acts/EventData/Types.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp" #include "Acts/Geometry/GeometryContext.hpp" @@ -195,13 +196,13 @@ struct KalmanFitterResult { /// This corresponds to the last measurement state in the multitrajectory. /// Since this KF only stores one trajectory, it is unambiguous. /// TrackTraits::kInvalid is the start of a trajectory. - std::size_t lastMeasurementIndex = kTrackIndexInvalid; + TrackIndexType lastMeasurementIndex = kTrackIndexInvalid; /// This is the index of the 'tip' of the states stored in multitrajectory. /// This corresponds to the last state in the multitrajectory. /// Since this KF only stores one trajectory, it is unambiguous. /// TrackTraits::kInvalid is the start of a trajectory. - std::size_t lastTrackIndex = kTrackIndexInvalid; + TrackIndexType lastTrackIndex = kTrackIndexInvalid; /// The optional Parameters at the provided surface std::optional fittedParameters; diff --git a/Core/include/Acts/TrackFitting/MbfSmoother.hpp b/Core/include/Acts/TrackFitting/MbfSmoother.hpp index 18dadd10634..abb95a24a4f 100644 --- a/Core/include/Acts/TrackFitting/MbfSmoother.hpp +++ b/Core/include/Acts/TrackFitting/MbfSmoother.hpp @@ -54,7 +54,8 @@ class MbfSmoother { using TrackStateProxy = typename traj_t::TrackStateProxy; - TrackStateProxy startTs = trajectory.getTrackState(entryIndex); + TrackStateProxy startTs = trajectory.getTrackState( + static_cast(entryIndex)); // Notation consistent with the Wikipedia article // https://en.wikipedia.org/wiki/Kalman_filter diff --git a/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp b/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp index 8c42a690994..811c0bd601e 100644 --- a/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp +++ b/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp @@ -381,7 +381,7 @@ void convoluteComponents( // Store average material seen by the components // Should not be too broadly distributed - sumPathXOverX0 += pathXOverX0 / tmpStates.tips.size(); + sumPathXOverX0 += pathXOverX0 / static_cast(tmpStates.tips.size()); } /// Apply the multiple scattering to the state diff --git a/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp b/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp index a8d343a3b2b..d295614040e 100644 --- a/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp +++ b/Core/include/Acts/TrackFitting/detail/KalmanGlobalCovariance.hpp @@ -36,13 +36,14 @@ globalTrackParametersCovariance(const traj_t& multiTraj, const std::size_t& entryIndex) { using CovMatrix = BoundMatrix; using GainMatrix = BoundMatrix; + using Index = typename traj_t::IndexType; // The last smoothed state index std::size_t lastSmoothedIndex = kTrackIndexInvalid; // The total number of smoothed states std::size_t nSmoothedStates = 0; // Visit all the states - multiTraj.visitBackwards(entryIndex, [&](const auto& ts) { + multiTraj.visitBackwards(static_cast(entryIndex), [&](const auto& ts) { if (ts.hasSmoothed()) { if (lastSmoothedIndex == kTrackIndexInvalid) { lastSmoothedIndex = ts.index(); @@ -61,37 +62,40 @@ globalTrackParametersCovariance(const traj_t& multiTraj, // Visit the smoothed states to calculate the full global track parameters // covariance std::size_t nProcessed = 0; - auto prev_ts = multiTraj.getTrackState(lastSmoothedIndex); - multiTraj.visitBackwards(lastSmoothedIndex, [&](const auto& ts) { - const std::size_t iRow = - fullGlobalTrackParamsCov.rows() - eBoundSize * (nProcessed + 1); - // Fill the covariance of this state - fullGlobalTrackParamsCov.block(iRow, iRow) = - ts.smoothedCovariance(); - // Fill the correlation between this state (indexed by i-1) and - // beforehand smoothed states (indexed by j): C^n_{i-1, j}= G_{i-1} * - // C^n_{i, j} for i <= j - if (nProcessed > 0) { - // Calculate the gain matrix - GainMatrix G = ts.filteredCovariance() * prev_ts.jacobian().transpose() * - prev_ts.predictedCovariance().inverse(); - // Loop over the beforehand smoothed states - for (std::size_t iProcessed = 1; iProcessed <= nProcessed; iProcessed++) { - const std::size_t iCol = iRow + eBoundSize * iProcessed; - CovMatrix prev_correlation = - fullGlobalTrackParamsCov.block( - iRow + eBoundSize, iCol); - CovMatrix correlation = G * prev_correlation; - fullGlobalTrackParamsCov.block(iRow, iCol) = - correlation; - fullGlobalTrackParamsCov.block(iCol, iRow) = - correlation.transpose(); - } - } - stateRowIndices.emplace(ts.index(), iRow); - nProcessed++; - prev_ts = ts; - }); + auto prev_ts = multiTraj.getTrackState(static_cast(lastSmoothedIndex)); + multiTraj.visitBackwards( + static_cast(lastSmoothedIndex), [&](const auto& ts) { + const std::size_t iRow = + fullGlobalTrackParamsCov.rows() - eBoundSize * (nProcessed + 1); + // Fill the covariance of this state + fullGlobalTrackParamsCov.block(iRow, iRow) = + ts.smoothedCovariance(); + // Fill the correlation between this state (indexed by i-1) and + // beforehand smoothed states (indexed by j): C^n_{i-1, j}= G_{i-1} * + // C^n_{i, j} for i <= j + if (nProcessed > 0) { + // Calculate the gain matrix + GainMatrix G = ts.filteredCovariance() * + prev_ts.jacobian().transpose() * + prev_ts.predictedCovariance().inverse(); + // Loop over the beforehand smoothed states + for (std::size_t iProcessed = 1; iProcessed <= nProcessed; + iProcessed++) { + const std::size_t iCol = iRow + eBoundSize * iProcessed; + CovMatrix prev_correlation = + fullGlobalTrackParamsCov.block( + iRow + eBoundSize, iCol); + CovMatrix correlation = G * prev_correlation; + fullGlobalTrackParamsCov.block(iRow, iCol) = + correlation; + fullGlobalTrackParamsCov.block(iCol, iRow) = + correlation.transpose(); + } + } + stateRowIndices.emplace(ts.index(), iRow); + nProcessed++; + prev_ts = ts; + }); return {fullGlobalTrackParamsCov, stateRowIndices}; } diff --git a/Core/include/Acts/TrackFitting/detail/VoidFitterComponents.hpp b/Core/include/Acts/TrackFitting/detail/VoidFitterComponents.hpp index c350992cfa9..dc0d86cb156 100644 --- a/Core/include/Acts/TrackFitting/detail/VoidFitterComponents.hpp +++ b/Core/include/Acts/TrackFitting/detail/VoidFitterComponents.hpp @@ -39,10 +39,11 @@ template Result voidFitterSmoother(const GeometryContext& /*gctx*/, traj_t& trackStates, std::size_t entry, const Logger& /*logger*/) { - trackStates.applyBackwards(entry, [](auto trackState) { - trackState.smoothed() = trackState.filtered(); - trackState.smoothedCovariance() = trackState.filteredCovariance(); - }); + trackStates.applyBackwards( + static_cast(entry), [](auto trackState) { + trackState.smoothed() = trackState.filtered(); + trackState.smoothedCovariance() = trackState.filteredCovariance(); + }); return Result::success(); } diff --git a/Core/include/Acts/Utilities/Axis.hpp b/Core/include/Acts/Utilities/Axis.hpp index 1f0a7fb733c..e4711823889 100644 --- a/Core/include/Acts/Utilities/Axis.hpp +++ b/Core/include/Acts/Utilities/Axis.hpp @@ -142,7 +142,7 @@ class Axis : public IAxis { Axis(double xmin, double xmax, std::size_t nBins) : m_min(xmin), m_max(xmax), - m_width((xmax - xmin) / nBins), + m_width((xmax - xmin) / static_cast(nBins)), m_bins(nBins) {} /// Constructor with a tag for the boundary type @@ -208,10 +208,10 @@ class Axis : public IAxis { requires(bdt == AxisBoundaryType::Open) { constexpr int min = 0; - const int max = getNBins() + 1; - const int itmin = std::clamp(static_cast(idx + sizes.first), min, max); + const int max = static_cast(getNBins()) + 1; + const int itmin = std::clamp(static_cast(idx) + sizes.first, min, max); const int itmax = - std::clamp(static_cast(idx + sizes.second), min, max); + std::clamp(static_cast(idx) + sizes.second, min, max); return NeighborHoodIndices(itmin, itmax + 1); } @@ -233,7 +233,7 @@ class Axis : public IAxis { return NeighborHoodIndices(); } constexpr int min = 1; - const int max = getNBins(); + const auto max = static_cast(getNBins()); const int itmin = std::clamp(static_cast(idx) + sizes.first, min, max); const int itmax = std::clamp(static_cast(idx) + sizes.second, min, max); @@ -262,12 +262,12 @@ class Axis : public IAxis { // Handle corner case where user requests more neighbours than the number // of bins on the axis. All bins are returned in this case. - const int max = getNBins(); + const auto max = static_cast(getNBins()); sizes.first = std::clamp(sizes.first, -max, max); sizes.second = std::clamp(sizes.second, -max, max); if (std::abs(sizes.first - sizes.second) >= max) { - sizes.first = 1 - idx; - sizes.second = max - idx; + sizes.first = 1 - static_cast(idx); + sizes.second = max - static_cast(idx); } // If the entire index range is not covered, we must wrap the range of @@ -277,8 +277,8 @@ class Axis : public IAxis { // Before wraparound - [ XXXXX]XXX // After wraparound - [ XXXX XXXX ] // - const int itmin = idx + sizes.first; - const int itmax = idx + sizes.second; + const int itmin = static_cast(idx) + sizes.first; + const int itmax = static_cast(idx) + sizes.second; const std::size_t itfirst = wrapBin(itmin); const std::size_t itlast = wrapBin(itmax); if (itfirst <= itlast) { @@ -321,7 +321,7 @@ class Axis : public IAxis { std::size_t wrapBin(int bin) const requires(bdt == AxisBoundaryType::Closed) { - const int w = getNBins(); + const auto w = static_cast(getNBins()); return 1 + (w + ((bin - 1) % w)) % w; // return int(bin<1)*w - int(bin>w)*w + bin; } @@ -357,7 +357,7 @@ class Axis : public IAxis { /// @note Bin intervals have a closed lower bound, i.e. the lower boundary /// belongs to the bin with the given bin index. double getBinLowerBound(std::size_t bin) const { - return getMin() + (bin - 1) * getBinWidth(); + return getMin() + static_cast(bin - 1) * getBinWidth(); } /// @brief get upper bound of bin @@ -371,7 +371,7 @@ class Axis : public IAxis { /// @note Bin intervals have an open upper bound, i.e. the upper boundary /// does @b not belong to the bin with the given bin index. double getBinUpperBound(std::size_t bin) const { - return getMin() + bin * getBinWidth(); + return getMin() + static_cast(bin) * getBinWidth(); } /// @brief get bin center @@ -382,7 +382,7 @@ class Axis : public IAxis { /// @pre @c bin must be a valid bin index (excluding under-/overflow bins), /// i.e. \f$1 \le \text{bin} \le \text{nBins}\f$ double getBinCenter(std::size_t bin) const { - return getMin() + (bin - 0.5) * getBinWidth(); + return getMin() + (static_cast(bin) - 0.5) * getBinWidth(); } /// @brief get maximum of binning range @@ -524,7 +524,7 @@ class Axis : public IAxis { requires(bdt == AxisBoundaryType::Open) { constexpr int min = 0; - const int max = getNBins() + 1; + const int max = static_cast(getNBins()) + 1; const int itmin = std::max(min, static_cast(idx) + sizes.first); const int itmax = std::min(max, static_cast(idx) + sizes.second); return NeighborHoodIndices(itmin, itmax + 1); @@ -548,7 +548,7 @@ class Axis : public IAxis { return NeighborHoodIndices(); } constexpr int min = 1; - const int max = getNBins(); + const auto max = static_cast(getNBins()); const int itmin = std::max(min, static_cast(idx) + sizes.first); const int itmax = std::min(max, static_cast(idx) + sizes.second); return NeighborHoodIndices(itmin, itmax + 1); @@ -576,12 +576,12 @@ class Axis : public IAxis { // Handle corner case where user requests more neighbours than the number // of bins on the axis. All bins are returned in this case - const int max = getNBins(); + const auto max = static_cast(getNBins()); sizes.first = std::clamp(sizes.first, -max, max); sizes.second = std::clamp(sizes.second, -max, max); if (std::abs(sizes.first - sizes.second) >= max) { - sizes.first = 1 - idx; - sizes.second = max - idx; + sizes.first = 1 - static_cast(idx); + sizes.second = max - static_cast(idx); } // If the entire index range is not covered, we must wrap the range of @@ -591,8 +591,8 @@ class Axis : public IAxis { // Before wraparound - [ XXXXX]XXX // After wraparound - [ XXXX XXXX ] // - const int itmin = idx + sizes.first; - const int itmax = idx + sizes.second; + const int itmin = static_cast(idx) + sizes.first; + const int itmax = static_cast(idx) + sizes.second; const std::size_t itfirst = wrapBin(itmin); const std::size_t itlast = wrapBin(itmax); if (itfirst <= itlast) { @@ -635,7 +635,7 @@ class Axis : public IAxis { std::size_t wrapBin(int bin) const requires(bdt == AxisBoundaryType::Closed) { - const int w = getNBins(); + const auto w = static_cast(getNBins()); return 1 + (w + ((bin - 1) % w)) % w; // return int(bin<1)*w - int(bin>w)*w + bin; } @@ -653,7 +653,7 @@ class Axis : public IAxis { std::size_t getBin(double x) const final { const auto it = std::upper_bound(std::begin(m_binEdges), std::end(m_binEdges), x); - return wrapBin(std::distance(std::begin(m_binEdges), it)); + return wrapBin(static_cast(std::distance(std::begin(m_binEdges), it))); } /// @brief get bin width diff --git a/Core/include/Acts/Utilities/BinAdjustment.hpp b/Core/include/Acts/Utilities/BinAdjustment.hpp index 86b11398fbb..ccb84fbbf30 100644 --- a/Core/include/Acts/Utilities/BinAdjustment.hpp +++ b/Core/include/Acts/Utilities/BinAdjustment.hpp @@ -58,11 +58,11 @@ static inline BinUtility adjustBinUtility(const BinUtility& bu, float min = 0., max = 0.; // Perform the value adjustment if (bval == AxisDirection::AxisPhi) { - min = minPhi; - max = maxPhi; + min = static_cast(minPhi); + max = static_cast(maxPhi); } else { - min = minR; - max = maxR; + min = static_cast(minR); + max = static_cast(maxR); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); @@ -110,14 +110,14 @@ static inline BinUtility adjustBinUtility(const BinUtility& bu, float min = 0., max = 0.; // Perform the value adjustment if (bval == AxisDirection::AxisPhi) { - min = minPhi; - max = maxPhi; + min = static_cast(minPhi); + max = static_cast(maxPhi); } else if (bval == AxisDirection::AxisRPhi) { - min = cR * minPhi; - max = cR * maxPhi; + min = static_cast(cR * minPhi); + max = static_cast(cR * maxPhi); } else { - min = -cHz; - max = cHz; + min = static_cast(-cHz); + max = static_cast(cHz); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); @@ -162,11 +162,11 @@ static inline BinUtility adjustBinUtility(const BinUtility& bu, float min = 0., max = 0.; // Perform the value adjustment if (bval == AxisDirection::AxisX) { - min = minX; - max = maxX; + min = static_cast(minX); + max = static_cast(maxX); } else { - min = minY; - max = maxY; + min = static_cast(minY); + max = static_cast(maxY); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); @@ -212,11 +212,11 @@ static inline BinUtility adjustBinUtility(const BinUtility& bu, float min = 0., max = 0.; // Perform the value adjustment if (bval == AxisDirection::AxisX) { - min = -1 * halfX; - max = halfX; + min = static_cast(-halfX); + max = static_cast(halfX); } else { - min = -1 * halfY; - max = halfY; + min = static_cast(-halfY); + max = static_cast(halfY); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); diff --git a/Core/include/Acts/Utilities/BinAdjustmentVolume.hpp b/Core/include/Acts/Utilities/BinAdjustmentVolume.hpp index ebf8b2c261b..f811db36e47 100644 --- a/Core/include/Acts/Utilities/BinAdjustmentVolume.hpp +++ b/Core/include/Acts/Utilities/BinAdjustmentVolume.hpp @@ -59,14 +59,14 @@ BinUtility adjustBinUtility(const BinUtility& bu, float max = 0; // Perform the value adjustment if (bval == AxisDirection::AxisPhi) { - min = minPhi; - max = maxPhi; + min = static_cast(minPhi); + max = static_cast(maxPhi); } else if (bval == AxisDirection::AxisR) { - min = minR; - max = maxR; + min = static_cast(minR); + max = static_cast(maxR); } else if (bval == AxisDirection::AxisZ) { - min = minZ; - max = maxZ; + min = static_cast(minZ); + max = static_cast(maxZ); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); @@ -116,14 +116,14 @@ BinUtility adjustBinUtility(const BinUtility& bu, float max = 0; // Perform the value adjustment if (bval == AxisDirection::AxisPhi) { - min = minPhi; - max = maxPhi; + min = static_cast(minPhi); + max = static_cast(maxPhi); } else if (bval == AxisDirection::AxisR) { - min = minR; - max = maxR; + min = static_cast(minR); + max = static_cast(maxR); } else if (bval == AxisDirection::AxisZ) { - min = minZ; - max = maxZ; + min = static_cast(minZ); + max = static_cast(maxZ); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); @@ -171,14 +171,14 @@ BinUtility adjustBinUtility(const BinUtility& bu, float max = 0; // Perform the value adjustment if (bval == AxisDirection::AxisX) { - min = minX; - max = maxX; + min = static_cast(minX); + max = static_cast(maxX); } else if (bval == AxisDirection::AxisY) { - min = minY; - max = maxY; + min = static_cast(minY); + max = static_cast(maxY); } else if (bval == AxisDirection::AxisZ) { - min = minZ; - max = maxZ; + min = static_cast(minZ); + max = static_cast(maxZ); } // Create the updated BinningData BinningData uBinData(bd.option, bval, bd.bins(), min, max); diff --git a/Core/include/Acts/Utilities/BinningData.hpp b/Core/include/Acts/Utilities/BinningData.hpp index 2b44daf3a14..ccc91ca1db8 100644 --- a/Core/include/Acts/Utilities/BinningData.hpp +++ b/Core/include/Acts/Utilities/BinningData.hpp @@ -96,7 +96,7 @@ class BinningData { binvalue(bValue), min(bMin), max(bMax), - step((bMax - bMin) / bBins), + step((bMax - bMin) / static_cast(bBins)), zdim(bBins == 1 ? true : false), subBinningData(std::move(sBinData)), subBinningAdditive(sBinAdditive), @@ -109,7 +109,7 @@ class BinningData { // fill the boundary vector for fast access to center & boundaries m_boundaries.reserve(m_bins + 1); for (std::size_t ib = 0; ib < m_bins + 1; ++ib) { - m_boundaries.push_back(min + ib * step); + m_boundaries.push_back(min + static_cast(ib) * step); } // the binning data has sub structure - multiplicative or additive checkSubStructure(); @@ -274,10 +274,10 @@ class BinningData { binvalue == AxisDirection::AxisRPhi || binvalue == AxisDirection::AxisX || binvalue == AxisDirection::AxisTheta) { - return lposition[0]; + return static_cast(lposition[0]); } - return lposition[1]; + return static_cast(lposition[1]); } /// Take the right float value @@ -292,19 +292,19 @@ class BinningData { // ordered after occurrence if (binvalue == AxisDirection::AxisR || binvalue == AxisDirection::AxisTheta) { - return (perp(position)); + return static_cast(perp(position)); } if (binvalue == AxisDirection::AxisRPhi) { - return (perp(position) * phi(position)); + return static_cast(perp(position) * phi(position)); } if (binvalue == AxisDirection::AxisEta) { - return (eta(position)); + return static_cast(eta(position)); } if (toUnderlying(binvalue) < 3) { return static_cast(position[toUnderlying(binvalue)]); } // phi gauging - return phi(position); + return static_cast(phi(position)); } /// Get the center value of a bin @@ -417,8 +417,8 @@ class BinningData { return masterbin + subBinningData->search(value); } // gauge the value to the subBinData - float gvalue = - value - masterbin * (subBinningData->max - subBinningData->min); + float gvalue = value - static_cast(masterbin) * + (subBinningData->max - subBinningData->min); // now go / additive or multiplicative std::size_t subbin = subBinningData->search(gvalue); // now return @@ -451,11 +451,11 @@ class BinningData { /// @return the center value of the bin is given float centerValue(std::size_t bin) const { if (zdim) { - return 0.5 * (min + max); + return 0.5f * (min + max); } float bmin = m_boundaries[bin]; float bmax = bin < m_boundaries.size() ? m_boundaries[bin + 1] : max; - return 0.5 * (bmin + bmax); + return 0.5f * (bmin + bmax); } private: @@ -506,7 +506,7 @@ class BinningData { // create the boundary vector m_totalBoundaries.push_back(min); for (std::size_t ib = 0; ib < m_bins; ++ib) { - float offset = ib * step; + float offset = static_cast(ib) * step; for (std::size_t isb = 1; isb < subBinBoundaries.size(); ++isb) { m_totalBoundaries.push_back(offset + subBinBoundaries[isb]); } @@ -523,7 +523,7 @@ class BinningData { const BinningData& bData) { // vanilla - int bin = static_cast((value - bData.min) / bData.step); + auto bin = static_cast((value - bData.min) / bData.step); // special treatment of the 0 bin for closed if (bData.option == closed) { if (value < bData.min) { diff --git a/Core/include/Acts/Utilities/MathHelpers.hpp b/Core/include/Acts/Utilities/MathHelpers.hpp index b6f1efd5e5e..83df1ad9bad 100644 --- a/Core/include/Acts/Utilities/MathHelpers.hpp +++ b/Core/include/Acts/Utilities/MathHelpers.hpp @@ -176,7 +176,8 @@ constexpr auto cathetusSquare(T hypotenuse, Args... args) { template constexpr auto fastCathetus(T hypotenuse, Args... args) { const auto hypotArgs = fastHypot(args...); - return std::sqrt((hypotenuse - hypotArgs) * (hypotenuse + hypotArgs)); + const auto h = static_cast(hypotenuse); + return std::sqrt((h - hypotArgs) * (h + hypotArgs)); } /// Slow but more accurate cathetus calculation for multiple arguments diff --git a/Core/include/Acts/Utilities/detail/Polynomials.hpp b/Core/include/Acts/Utilities/detail/Polynomials.hpp index 1b0e18960b2..717b4d4e165 100644 --- a/Core/include/Acts/Utilities/detail/Polynomials.hpp +++ b/Core/include/Acts/Utilities/detail/Polynomials.hpp @@ -29,7 +29,7 @@ constexpr std::array derivativeCoefficients( } std::array newCoeffs{filledArray(0.)}; for (std::size_t i = 0; i < N - D; ++i) { - newCoeffs[i] = product(i + 1ul, i + D) * coeffs[i + D]; + newCoeffs[i] = static_cast(product(i + 1ul, i + D)) * coeffs[i + D]; } return newCoeffs; } diff --git a/Core/include/Acts/Vertexing/GaussianGridTrackDensity.hpp b/Core/include/Acts/Vertexing/GaussianGridTrackDensity.hpp index fc314f56f70..8a71e0f6480 100644 --- a/Core/include/Acts/Vertexing/GaussianGridTrackDensity.hpp +++ b/Core/include/Acts/Vertexing/GaussianGridTrackDensity.hpp @@ -45,7 +45,7 @@ class GaussianGridTrackDensity { : mainGridSize(mainGridSize_), trkGridSize(trkGridSize_), zMinMax(zMinMax_) { - binSize = 2. * zMinMax / mainGridSize; + binSize = 2.f * zMinMax / static_cast(mainGridSize); if (trkGridSize % 2 == 0) { throw std::runtime_error( @@ -76,7 +76,7 @@ class GaussianGridTrackDensity { /// Maximum relative density deviation from main maximum to consider /// secondary maxima for the highest-sum approach - float maxRelativeDensityDev = 0.01; + float maxRelativeDensityDev = 0.01f; }; /// Constructor with configuration diff --git a/Core/include/Acts/Visualization/EventDataView3D.hpp b/Core/include/Acts/Visualization/EventDataView3D.hpp index 399ef5c05d7..c1f384bd1c8 100644 --- a/Core/include/Acts/Visualization/EventDataView3D.hpp +++ b/Core/include/Acts/Visualization/EventDataView3D.hpp @@ -86,7 +86,7 @@ struct EventDataView3D { ellipse.reserve(lseg); double thetaStep = 2 * std::numbers::pi / lseg; for (std::size_t it = 0; it < lseg; ++it) { - double phi = -std::numbers::pi + it * thetaStep; + double phi = -std::numbers::pi + static_cast(it) * thetaStep; double cphi = std::cos(phi); double sphi = std::sin(phi); double x = lposition.x() + (l1sq * ctheta * cphi - l2sq * stheta * sphi); diff --git a/Core/include/Acts/Visualization/Interpolation3D.hpp b/Core/include/Acts/Visualization/Interpolation3D.hpp index ecd1cc9589a..d43b2a02f54 100644 --- a/Core/include/Acts/Visualization/Interpolation3D.hpp +++ b/Core/include/Acts/Visualization/Interpolation3D.hpp @@ -69,9 +69,9 @@ trajectory_type spline(const trajectory_type& inputsRaw, std::size_t nPoints, // MARK: fpeMaskEnd(FLTDIV) // MARK: fpeMaskEnd(FLTINV) - double step = 1. / (nPoints - 1); + double step = 1. / (static_cast(nPoints) - 1.); for (std::size_t i = 0; i < nPoints; ++i) { - double t = i * step; + double t = static_cast(i) * step; InputVectorType point; point[0] = spline3D(t)[0]; point[1] = spline3D(t)[1]; diff --git a/Core/src/AmbiguityResolution/GreedyAmbiguityResolution.cpp b/Core/src/AmbiguityResolution/GreedyAmbiguityResolution.cpp index 85809639fac..b1396792a97 100644 --- a/Core/src/AmbiguityResolution/GreedyAmbiguityResolution.cpp +++ b/Core/src/AmbiguityResolution/GreedyAmbiguityResolution.cpp @@ -44,8 +44,8 @@ void GreedyAmbiguityResolution::resolve(State& state) const { auto trackComperator = [&state](std::size_t a, std::size_t b) { /// Helper to calculate the relative amount of shared measurements. auto relativeSharedMeasurements = [&state](std::size_t i) { - return 1.0 * state.sharedMeasurementsPerTrack[i] / - state.measurementsPerTrack[i].size(); + return static_cast(state.sharedMeasurementsPerTrack[i]) / + static_cast(state.measurementsPerTrack[i].size()); }; if (relativeSharedMeasurements(a) != relativeSharedMeasurements(b)) { diff --git a/Core/src/Definitions/ParticleData.cpp b/Core/src/Definitions/ParticleData.cpp index 505ae70a697..9c466c598bf 100644 --- a/Core/src/Definitions/ParticleData.cpp +++ b/Core/src/Definitions/ParticleData.cpp @@ -164,24 +164,30 @@ float Acts::calculateNucleusMass(Acts::PdgParticle pdg) { int Z = std::abs(ZandA.first); int A = ZandA.second; - float a_Vol = 15.260f * Acts::UnitConstants::MeV; - float a_Surf = 16.267f * Acts::UnitConstants::MeV; - float a_Col = 0.689f * Acts::UnitConstants::MeV; - float a_Sym = 22.209f * Acts::UnitConstants::MeV; - float a_Pair = - (1 - 2 * (Z % 2)) * (1 - A % 2) * 10.076f * Acts::UnitConstants::MeV; - - float massP = 0.938272f * Acts::UnitConstants::GeV; - float massN = 0.939565f * Acts::UnitConstants::GeV; + auto a_Vol = static_cast(15.260 * Acts::UnitConstants::MeV); + auto a_Surf = static_cast(16.267 * Acts::UnitConstants::MeV); + auto a_Col = static_cast(0.689 * Acts::UnitConstants::MeV); + auto a_Sym = static_cast(22.209 * Acts::UnitConstants::MeV); + auto a_Pair = static_cast((1 - 2 * (Z % 2)) * (1 - A % 2) * 10.076 * + Acts::UnitConstants::MeV); + auto massP = static_cast(0.938272 * Acts::UnitConstants::GeV); + auto massN = static_cast(0.939565 * Acts::UnitConstants::GeV); float bindEnergy = 0.f; - bindEnergy += a_Vol * A; - bindEnergy -= a_Surf * std::pow(A, 2. / 3.); - bindEnergy -= a_Col * Z * (Z - 1) * std::pow(A, -1. / 3.); - bindEnergy -= a_Sym * std::pow(A - 2 * Z, 2.) / A; - bindEnergy -= a_Pair * std::pow(A, -1. / 2.); + bindEnergy += a_Vol * static_cast(A); + bindEnergy -= + static_cast(a_Surf * std::pow(static_cast(A), 2. / 3.)); + bindEnergy -= static_cast(static_cast(a_Col) * + static_cast(Z * (Z - 1)) * + std::pow(static_cast(A), -1. / 3.)); + bindEnergy -= + static_cast(a_Sym * std::pow(static_cast(A - 2 * Z), 2.) / + static_cast(A)); + bindEnergy -= + static_cast(a_Pair * std::pow(static_cast(A), -1. / 2.)); - return massP * Z + massN * (A - Z) - bindEnergy; + return massP * static_cast(Z) + massN * static_cast(A - Z) - + bindEnergy; } std::optional Acts::findName(Acts::PdgParticle pdg) { diff --git a/Core/src/EventData/SeedContainer2.cpp b/Core/src/EventData/SeedContainer2.cpp index 1f65c159591..b2aee54eea7 100644 --- a/Core/src/EventData/SeedContainer2.cpp +++ b/Core/src/EventData/SeedContainer2.cpp @@ -34,7 +34,8 @@ void SeedContainer2::reserve(Index size, float averageSpacePoints) noexcept { m_spacePointCounts.reserve(size); m_qualities.reserve(size); m_vertexZs.reserve(size); - m_spacePoints.reserve(static_cast(size * averageSpacePoints)); + m_spacePoints.reserve( + static_cast(static_cast(size) * averageSpacePoints)); } void SeedContainer2::clear() noexcept { diff --git a/Core/src/EventData/SpacePointContainer2.cpp b/Core/src/EventData/SpacePointContainer2.cpp index b8a8d20827e..0fff0787c77 100644 --- a/Core/src/EventData/SpacePointContainer2.cpp +++ b/Core/src/EventData/SpacePointContainer2.cpp @@ -143,8 +143,8 @@ void SpacePointContainer2::moveColumns(SpacePointContainer2 &other) noexcept { void SpacePointContainer2::reserve(std::uint32_t size, float averageSourceLinks) noexcept { if (hasColumns(SpacePointColumns::SourceLinks)) { - m_sourceLinks.reserve( - static_cast(size * averageSourceLinks)); + m_sourceLinks.reserve(static_cast(static_cast(size) * + averageSourceLinks)); } for (const auto &[name, column] : m_allColumns) { diff --git a/Core/src/EventData/VectorMultiTrajectory.cpp b/Core/src/EventData/VectorMultiTrajectory.cpp index 43aa85aac59..602b4c4ad4a 100644 --- a/Core/src/EventData/VectorMultiTrajectory.cpp +++ b/Core/src/EventData/VectorMultiTrajectory.cpp @@ -29,7 +29,7 @@ auto VectorMultiTrajectory::addTrackState_impl(TrackStatePropMask mask, m_index.emplace_back(); IndexData& p = m_index.back(); - IndexType index = static_cast(m_index.size() - 1); + auto index = static_cast(m_index.size() - 1); m_previous.emplace_back(iprevious); m_next.emplace_back(kInvalid); @@ -248,10 +248,11 @@ void detail_vmt::VectorMultiTrajectoryBase::Statistics::toStream( const auto& type_axis = axis::get>(h.axis(1)); auto p = [&](const auto& key, const auto v, std::string_view suffix = "") { + const auto ndc = static_cast(n); if constexpr (std::is_same_v, double>) { - os << std::format("{:>20}: {:8.2f}{}", key, v / n, suffix) << std::endl; + os << std::format("{:>20}: {:8.2f}{}", key, v / ndc, suffix) << std::endl; } else { - os << std::format("{:>20}: {:8.2f}{}", key, static_cast(v) / n, + os << std::format("{:>20}: {:8.2f}{}", key, static_cast(v) / ndc, suffix) << std::endl; } diff --git a/Core/src/EventData/VectorTrackContainer.cpp b/Core/src/EventData/VectorTrackContainer.cpp index 5be40fae6c8..3a3f8e29f58 100644 --- a/Core/src/EventData/VectorTrackContainer.cpp +++ b/Core/src/EventData/VectorTrackContainer.cpp @@ -66,7 +66,7 @@ VectorTrackContainer::IndexType VectorTrackContainer::addTrack_impl() { assert(checkConsistency()); - return m_tipIndex.size() - 1; + return static_cast(m_tipIndex.size() - 1); } void VectorTrackContainer::removeTrack_impl(IndexType itrack) { diff --git a/Core/src/Geometry/CuboidVolumeBuilder.cpp b/Core/src/Geometry/CuboidVolumeBuilder.cpp index 7420aa0608b..758774cb4ad 100644 --- a/Core/src/Geometry/CuboidVolumeBuilder.cpp +++ b/Core/src/Geometry/CuboidVolumeBuilder.cpp @@ -76,7 +76,7 @@ std::shared_ptr CuboidVolumeBuilder::buildLayer( centroid += surface->localToGlobalTransform(gctx).translation(); } - centroid /= cfg.surfaces.size(); + centroid /= static_cast(cfg.surfaces.size()); // In the case the layer configuration doesn't define the rotation of the // layer use the orientation of the first surface to define the layer rotation @@ -241,11 +241,11 @@ MutableTrackingVolumePtr CuboidVolumeBuilder::trackingVolume( // Set bin boundaries along binning std::vector binBoundaries; - binBoundaries.push_back(volumes[0]->center(gctx).x() - - m_cfg.volumeCfg[0].length.x() * 0.5); + binBoundaries.push_back(static_cast( + volumes[0]->center(gctx).x() - m_cfg.volumeCfg[0].length.x() * 0.5)); for (std::size_t i = 0; i < volumes.size(); i++) { - binBoundaries.push_back(volumes[i]->center(gctx).x() + - m_cfg.volumeCfg[i].length.x() * 0.5); + binBoundaries.push_back(static_cast( + volumes[i]->center(gctx).x() + m_cfg.volumeCfg[i].length.x() * 0.5)); } // Build binning diff --git a/Core/src/Geometry/CylinderVolumeBuilder.cpp b/Core/src/Geometry/CylinderVolumeBuilder.cpp index 67e7fbf68eb..f3d72abb665 100644 --- a/Core/src/Geometry/CylinderVolumeBuilder.cpp +++ b/Core/src/Geometry/CylinderVolumeBuilder.cpp @@ -356,8 +356,8 @@ std::shared_ptr CylinderVolumeBuilder::trackingVolume( return (test > vrr.first && test < vrr.second); }); if (ringVolume != volumeRminRmax.end()) { - unsigned int ringBin = - std::distance(volumeRminRmax.begin(), ringVolume); + auto ringBin = static_cast( + std::distance(volumeRminRmax.begin(), ringVolume)); ringLayers[ringBin].push_back(elay); } } diff --git a/Core/src/Geometry/CylinderVolumeHelper.cpp b/Core/src/Geometry/CylinderVolumeHelper.cpp index cf26af560e0..bc06e81f684 100644 --- a/Core/src/Geometry/CylinderVolumeHelper.cpp +++ b/Core/src/Geometry/CylinderVolumeHelper.cpp @@ -949,7 +949,8 @@ std::shared_ptr CylinderVolumeHelper::createCylinderLayer( const Transform3 transform(Translation3(0., 0., z)); // z-binning - BinUtility layerBinUtility(binsZ, z - halflengthZ, z + halflengthZ, open, + BinUtility layerBinUtility(binsZ, static_cast(z - halflengthZ), + static_cast(z + halflengthZ), open, AxisDirection::AxisZ); if (binsPhi == 1) { // the BinUtility for the material @@ -959,9 +960,10 @@ std::shared_ptr CylinderVolumeHelper::createCylinderLayer( } else { // break the phi symmetry // update the BinUtility: local position on Cylinder is rPhi, z - BinUtility layerBinUtilityPhiZ(binsPhi, -r * std::numbers::pi, - r * std::numbers::pi, closed, - AxisDirection::AxisPhi); + BinUtility layerBinUtilityPhiZ(binsPhi, + static_cast(-r * std::numbers::pi), + static_cast(r * std::numbers::pi), + closed, AxisDirection::AxisPhi); layerBinUtilityPhiZ += layerBinUtility; // ---------------------> create material for the layer surface ACTS_VERBOSE(" -> Preparing the binned material with " @@ -986,7 +988,9 @@ std::shared_ptr CylinderVolumeHelper::createDiscLayer( const Transform3 transform(Translation3(0., 0., z)); // R is the primary binning for the material - BinUtility materialBinUtility(binsR, rMin, rMax, open, AxisDirection::AxisR); + BinUtility materialBinUtility(binsR, static_cast(rMin), + static_cast(rMax), open, + AxisDirection::AxisR); if (binsPhi == 1) { ACTS_VERBOSE(" -> Preparing the binned material with " << binsR << " bins in R. "); diff --git a/Core/src/Geometry/LayerArrayCreator.cpp b/Core/src/Geometry/LayerArrayCreator.cpp index b312d41d3b3..5edca9045f9 100644 --- a/Core/src/Geometry/LayerArrayCreator.cpp +++ b/Core/src/Geometry/LayerArrayCreator.cpp @@ -72,7 +72,7 @@ std::unique_ptr LayerArrayCreator::layerArray( case arbitrary: { std::vector boundaries; // initial step - boundaries.push_back(min); + boundaries.push_back(static_cast(min)); double layerValue = 0.; double layerThickness = 0.; std::shared_ptr navLayer = nullptr; @@ -83,8 +83,10 @@ std::unique_ptr LayerArrayCreator::layerArray( layerThickness = layIter->layerThickness(); layerValue = layIter->referencePositionValue(gctx, aDir); // register the new boundaries in the step vector - boundaries.push_back(layerValue - 0.5 * layerThickness); - boundaries.push_back(layerValue + 0.5 * layerThickness); + boundaries.push_back( + static_cast(layerValue - 0.5 * layerThickness)); + boundaries.push_back( + static_cast(layerValue + 0.5 * layerThickness)); // calculate the layer value for the offset double navigationValue = 0.5 * ((layerValue - 0.5 * layerThickness) + boundaries.at(boundaries.size() - 3)); @@ -151,7 +153,7 @@ std::unique_ptr LayerArrayCreator::layerArray( navLayer, navLayer->referencePosition(gctx, aDir))); } // now close the boundaries - boundaries.push_back(max); + boundaries.push_back(static_cast(max)); // some screen output ACTS_VERBOSE(layerOrderVector.size() << " Layers (material + navigation) built. "); diff --git a/Core/src/Seeding2/BroadTripletSeedFilter.cpp b/Core/src/Seeding2/BroadTripletSeedFilter.cpp index 58ab99f2b4b..506305606ea 100644 --- a/Core/src/Seeding2/BroadTripletSeedFilter.cpp +++ b/Core/src/Seeding2/BroadTripletSeedFilter.cpp @@ -150,7 +150,7 @@ void BroadTripletSeedFilter::filterTripletTopCandidates( // vector containing the radius of all compatible seeds cache().compatibleSeedR.reserve(config().compatSeedLimit); - const auto getTopR = [&](ConstSpacePointProxy2 spT) { + const auto getTopR = [&](ConstSpacePointProxy2 spT) -> float { if (config().useDeltaRinsteadOfTopRadius) { return fastHypot(spT.zr()[1] - spM.zr()[1], spT.zr()[0] - spM.zr()[0]); }