Skip to content
Open
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
6 changes: 4 additions & 2 deletions Alignment/include/ActsAlignment/Kernel/Alignment.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ void ActsAlignment::Alignment<fitter_t>::calculateAlignmentParameters(
}
alignResult.chi2 += alignState.chi2;
alignResult.measurementDim += alignState.measurementDim;
sumChi2ONdf += alignState.chi2 / alignState.measurementDim;
sumChi2ONdf +=
alignState.chi2 / static_cast<double>(alignState.measurementDim);
}
alignResult.averageChi2ONdf = sumChi2ONdf / alignResult.numTracks;
alignResult.averageChi2ONdf =
sumChi2ONdf / static_cast<double>(alignResult.numTracks);

// Get the inverse of chi2 second derivative matrix (we need this to
// calculate the covariance of the alignment parameters)
Expand Down
4 changes: 3 additions & 1 deletion Core/include/Acts/EventData/SpacePointColumnProxy2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::uint32_t>(column().size());
}

/// Returns a const proxy of the space point column.
/// @return A const proxy of the space point column.
Expand Down
4 changes: 3 additions & 1 deletion Core/include/Acts/EventData/TrackContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IndexType>(m_container->size_impl());
}

/// Clear the content of the track container
/// @note Only available if the track container is not read-only
Expand Down
3 changes: 2 additions & 1 deletion Core/include/Acts/EventData/TrackProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ class TrackProxy
return 0;
}
auto tsRange = trackStatesReversed();
return std::distance(tsRange.begin(), tsRange.end());
return static_cast<unsigned int>(
std::distance(tsRange.begin(), tsRange.end()));
}

/// Return the index of this track in the track container
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Geometry/SurfaceArrayCreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<AxisScalar>(nBins);
return static_cast<std::size_t>(std::floor((x - min) / w));
} else {
// variable
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Propagator/DirectNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(options.externalSurfaces.size()) - surfaceIndex;
}
return surfaceIndex + 1;
}
Expand Down Expand Up @@ -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<int>(
std::distance(state.options.externalSurfaces.begin(), found));
state.surfaceIndex += state.direction == Direction::Backward() ? 1 : -1;
} else {
ACTS_DEBUG(
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/MaterialInteractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(shift.norm()));
result.materialInteractions.back().updatedVolumeStep = true;
result.materialInX0 +=
result.materialInteractions.back().materialSlab.thicknessInX0();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(stepper.qOverP(state.stepping));
const ParticleHypothesis& particleHypothesis =
stepper.particleHypothesis(state.stepping);

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(stepper.qOverP(state.stepping))),
absQ(static_cast<float>(
stepper.particleHypothesis(state.stepping).absoluteCharge())),
momentum(static_cast<float>(stepper.absoluteMomentum(state.stepping))),
mass(static_cast<float>(
stepper.particleHypothesis(state.stepping).mass())),
absPdg(stepper.particleHypothesis(state.stepping).absolutePdg()),
performCovarianceTransport(state.stepping.covTransport),
navDir(state.options.direction) {}
Expand Down
5 changes: 3 additions & 2 deletions Core/include/Acts/Seeding/HoughTransformUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(binIndex) / nSteps;
}
// Returns the lower bound of the bin specified by step
/// @param min: Start of axis range
Expand All @@ -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<double>(binIndex) + 1) / nSteps;
}

/// @brief data class for the information to store for each
Expand Down
38 changes: 20 additions & 18 deletions Core/include/Acts/Seeding/HoughTransformUtils.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ void Acts::HoughTransformUtils::HoughPlane<identifier_t>::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<unsigned>(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<unsigned>(m_cfg.nBinsY), y - dy);
int yBinUp = binIndex(axisRanges.yMin, axisRanges.yMax,
static_cast<unsigned>(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
Expand Down Expand Up @@ -104,8 +105,8 @@ template <class identifier_t>
Acts::HoughTransformUtils::HoughPlane<identifier_t>::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<double>(m_cfg.nBinsX), m_cfg.nBinsX),
Axis(0., static_cast<double>(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));
Expand All @@ -119,7 +120,8 @@ void Acts::HoughTransformUtils::HoughPlane<identifier_t>::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<YieldType>(w));
// and update our cached maxima
YieldType layers = nLayers(binX, binY);
YieldType hits = nHits(binX, binY);
Expand Down Expand Up @@ -307,10 +309,10 @@ Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax<
// CALL AXIS BINS HERE
std::array<std::size_t, 2> 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<unsigned>(plane.nBinsX()), xy[0]);
CoordType yCand = binCenter(ranges.yMin, ranges.yMax,
static_cast<unsigned>(plane.nBinsY()), xy[1]);
// check if we are too close to a previously found maximum
bool goodSpacing = true;
for (auto& found : maxima) {
Expand Down Expand Up @@ -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<unsigned>(plane.nBinsX()), xBin);
CoordType yHit = binCenter(ranges.yMin, ranges.yMax,
static_cast<unsigned>(plane.nBinsY()), yBin);
YieldType nHits = plane.nHits(xBin, yBin);
max_x += xHit * nHits;
max_y += yHit * nHits;
Expand Down Expand Up @@ -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<YieldType>(x) * numOfHits;
yw += static_cast<YieldType>(y) * numOfHits;
tot += numOfHits;
}
}
Expand Down
5 changes: 3 additions & 2 deletions Core/include/Acts/Seeding2/BroadTripletSeedFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(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<float>(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)
Expand Down
14 changes: 7 additions & 7 deletions Core/include/Acts/Seeding2/CylindricalSpacePointGrid2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(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<float>(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<float>(-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<float>(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<float>(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<float>(0 * UnitConstants::mm);
/// minimum phi value for phiAxis construction
float phiMin = -std::numbers::pi_v<float>;
/// maximum phi value for phiAxis construction
Expand Down
16 changes: 8 additions & 8 deletions Core/include/Acts/Seeding2/CylindricalSpacePointKDTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(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<float>(-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<float>(2800 * UnitConstants::mm);
/// minimum phi value for phiAxis construction
float phiMin = -std::numbers::pi_v<float>;
/// maximum phi value for phiAxis construction
float phiMax = std::numbers::pi_v<float>;

/// Minimum radial distance between two doublet components
float deltaRMin = 5 * UnitConstants::mm;
float deltaRMin = static_cast<float>(5 * UnitConstants::mm);
/// Maximum radial distance between two doublet components
float deltaRMax = 270 * UnitConstants::mm;
float deltaRMax = static_cast<float>(270 * UnitConstants::mm);

/// Minimal z distance between two doublet components
float deltaZMin = -std::numeric_limits<float>::infinity();
Expand All @@ -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<float>(-150 * UnitConstants::mm);
/// Maximum location of collision region in z-axis
float collisionRegionMax = +150 * UnitConstants::mm;
float collisionRegionMax = static_cast<float>(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)
Expand Down
16 changes: 8 additions & 8 deletions Core/include/Acts/Seeding2/DoubletSeedFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,41 +294,41 @@ class DoubletSeedFinder {
Direction candidateDirection = Direction::Forward();

/// Minimum radial distance between two doublet components
float deltaRMin = 5 * UnitConstants::mm;
float deltaRMin = static_cast<float>(5 * UnitConstants::mm);
/// Maximum radial distance between two doublet components
float deltaRMax = 270 * UnitConstants::mm;
float deltaRMax = static_cast<float>(270 * UnitConstants::mm);

/// Minimal z distance between two doublet components
float deltaZMin = -std::numeric_limits<float>::infinity();
/// Maximum z distance between two doublet components
float deltaZMax = std::numeric_limits<float>::infinity();

/// Maximum value of impact parameter estimation of the seed candidates
float impactMax = 20 * UnitConstants::mm;
float impactMax = static_cast<float>(20 * UnitConstants::mm);

/// Enable cut on the compatibility between interaction point and doublet,
/// this is an useful approximation to speed up the seeding
bool interactionPointCut = false;

/// 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<float>(-150 * UnitConstants::mm);
/// Maximum collision region boundary in z-axis for doublet origin checks
float collisionRegionMax = +150 * UnitConstants::mm;
float collisionRegionMax = static_cast<float>(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<float>(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
Expand Down
8 changes: 6 additions & 2 deletions Core/include/Acts/Seeding2/GbtsGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::int32_t>(m_bins.size());
}

/// Get bins
/// @return Vector of bin indices
Expand Down Expand Up @@ -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<std::uint32_t>(m_layers.size());
}

/// Get bin groups
/// @return Bin groups vector
Expand Down
Loading
Loading