Skip to content

Commit

Permalink
Merge branch 'main' into rm-scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger authored Nov 24, 2024
2 parents cb206c1 + f17f640 commit a9a26da
Show file tree
Hide file tree
Showing 99 changed files with 731 additions and 620 deletions.
66 changes: 33 additions & 33 deletions Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ struct VolumeConfig {
/// Adapt to the dimensions of another config in Z
/// it will take the maximum/minimum values and just overwrite them
///
/// @param [in] lConfig is the config to which it should be adapded
/// @param [in] lConfig is the config to which it should be adapted
void adaptZ(const VolumeConfig& lConfig) {
if (lConfig) {
if (lConfig.present) {
zMin = std::min(zMin, lConfig.zMin);
zMax = std::max(zMax, lConfig.zMax);
}
Expand All @@ -76,9 +76,9 @@ struct VolumeConfig {
/// Adapt to the dimensions of another config in R
/// it will take the maximum/minimum values and just overwrite them
///
/// @param [in] lConfig is the config to which it should be adapded
/// @param [in] lConfig is the config to which it should be adapted
void adaptR(const VolumeConfig& lConfig) {
if (lConfig) {
if (lConfig.present) {
rMin = std::min(rMin, lConfig.rMin);
rMax = std::max(rMax, lConfig.rMax);
}
Expand All @@ -87,7 +87,7 @@ struct VolumeConfig {
/// Adapt to the dimensions of another config
/// it will take the maximum/minimum values and just overwrite them
///
/// @param [in] lConfig is the config to which it should be adapded
/// @param [in] lConfig is the config to which it should be adapted
void adapt(const VolumeConfig& lConfig) {
adaptZ(lConfig);
adaptR(lConfig);
Expand Down Expand Up @@ -184,9 +184,6 @@ struct VolumeConfig {
sl << rMin << ", " << rMax << " / " << zMin << ", " << zMax;
return sl.str();
}

/// Conversion operator to bool
operator bool() const { return present; }
};

/// @brief The WrappingSetup that is happening here
Expand Down Expand Up @@ -222,39 +219,40 @@ struct WrappingConfig {
containerVolumeConfig.present = true;
std::string wConditionAddon = "";
// if we have more than one config present
if ((nVolumeConfig && cVolumeConfig) || (cVolumeConfig && pVolumeConfig) ||
(nVolumeConfig && pVolumeConfig)) {
if ((nVolumeConfig.present && cVolumeConfig.present) ||
(cVolumeConfig.present && pVolumeConfig.present) ||
(nVolumeConfig.present && pVolumeConfig.present)) {
wCondition = Wrapping;
wConditionScreen = "grouped to ";
}
// adapt the new volume config to the existing configs
if (nVolumeConfig) {
if (nVolumeConfig.present) {
containerVolumeConfig.adapt(nVolumeConfig);
wConditionScreen += "[n]";
}
if (cVolumeConfig) {
if (cVolumeConfig.present) {
containerVolumeConfig.adapt(cVolumeConfig);
wConditionScreen += "[c]";
}
if (pVolumeConfig) {
if (pVolumeConfig.present) {
containerVolumeConfig.adapt(pVolumeConfig);
wConditionScreen += "[p]";
}
// adapt the external one
if (externalVolumeConfig) {
if (externalVolumeConfig.present) {
containerVolumeConfig.adapt(externalVolumeConfig);
}
// attach the volume configs
if (nVolumeConfig && cVolumeConfig) {
if (nVolumeConfig.present && cVolumeConfig.present) {
nVolumeConfig.midPointAttachZ(cVolumeConfig);
}
if (cVolumeConfig && pVolumeConfig) {
if (cVolumeConfig.present && pVolumeConfig.present) {
cVolumeConfig.midPointAttachZ(pVolumeConfig);
}
// adapt r afterwards
// - easy if no existing volume
// - possible if no central volume
if (!existingVolumeConfig || !cVolumeConfig) {
if (!existingVolumeConfig.present || !cVolumeConfig.present) {
nVolumeConfig.adaptR(containerVolumeConfig);
cVolumeConfig.adaptR(containerVolumeConfig);
pVolumeConfig.adaptR(containerVolumeConfig);
Expand All @@ -265,17 +263,19 @@ struct WrappingConfig {
void wrapInsertAttach() {
// action is only needed if an existing volume
// is present
if (existingVolumeConfig) {
if (existingVolumeConfig.present) {
// 0 - simple attachment case
if (!cVolumeConfig) {
if (!cVolumeConfig.present) {
// check if it can be easily attached
if (nVolumeConfig && nVolumeConfig.zMax < existingVolumeConfig.zMin) {
if (nVolumeConfig.present &&
nVolumeConfig.zMax < existingVolumeConfig.zMin) {
nVolumeConfig.attachZ(existingVolumeConfig);
// will attach the new volume(s)
wCondition = Attaching;
wConditionScreen = "[n attached]";
}
if (pVolumeConfig && pVolumeConfig.zMin > existingVolumeConfig.zMax) {
if (pVolumeConfig.present &&
pVolumeConfig.zMin > existingVolumeConfig.zMax) {
pVolumeConfig.attachZ(existingVolumeConfig);
// will attach the new volume(s)
wCondition = Attaching;
Expand Down Expand Up @@ -385,9 +385,9 @@ struct WrappingConfig {
fGapVolumeConfig.zMax = existingVolumeConfig.zMin;
} else {
// adapt lower z boundary
if (nVolumeConfig) {
if (nVolumeConfig.present) {
nVolumeConfig.zMin = existingVolumeConfig.zMin;
} else if (cVolumeConfig) {
} else if (cVolumeConfig.present) {
cVolumeConfig.zMin = existingVolumeConfig.zMin;
}
}
Expand All @@ -399,9 +399,9 @@ struct WrappingConfig {
sGapVolumeConfig.zMax = referenceVolume.zMax;
} else {
// adapt higher z boundary
if (pVolumeConfig) {
if (pVolumeConfig.present) {
pVolumeConfig.zMax = existingVolumeConfig.zMax;
} else if (cVolumeConfig) {
} else if (cVolumeConfig.present) {
cVolumeConfig.zMax = existingVolumeConfig.zMax;
}
}
Expand All @@ -414,31 +414,31 @@ struct WrappingConfig {
std::string toString() const {
// for screen output
std::stringstream sl;
if (containerVolumeConfig) {
if (containerVolumeConfig.present) {
sl << "New container built with configuration: "
<< containerVolumeConfig.toString() << '\n';
}
// go through the new ones first
if (nVolumeConfig) {
if (nVolumeConfig.present) {
sl << " - n: Negative Endcap, current configuration: "
<< nVolumeConfig.toString() << '\n';
}
if (cVolumeConfig) {
if (cVolumeConfig.present) {
sl << " - c: Barrel, current configuration: "
<< cVolumeConfig.toString() << '\n';
}
if (pVolumeConfig) {
if (pVolumeConfig.present) {
sl << " - p: Negative Endcap, current configuration: "
<< pVolumeConfig.toString() << '\n';
}
if (existingVolumeConfig) {
if (existingVolumeConfig.present) {
sl << "Existing volume with configuration: "
<< existingVolumeConfig.toString() << '\n';
if (fGapVolumeConfig) {
if (fGapVolumeConfig.present) {
sl << " - g1: First gap volume, configuration : "
<< fGapVolumeConfig.toString() << '\n';
}
if (sGapVolumeConfig) {
if (sGapVolumeConfig.present) {
sl << " - g2: Second gap volume, configuration : "
<< sGapVolumeConfig.toString() << '\n';
}
Expand All @@ -452,7 +452,7 @@ struct WrappingConfig {

/// @class CylinderVolumeBuilder
///
/// A volume builder to be used for building a concentrical cylindrical volumes
/// A volume builder to be used for building concentric cylinder volumes
/// - a) configured volume
/// - b) wrapping around a cylindrical/disk layer config
///
Expand Down
8 changes: 6 additions & 2 deletions Core/include/Acts/Navigation/DetectorNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Navigation/NavigationState.hpp"
#include "Acts/Propagator/NavigatorOptions.hpp"
#include "Acts/Propagator/NavigatorStatistics.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down Expand Up @@ -68,6 +69,9 @@ class DetectorNavigator {
bool targetReached = false;
/// Navigation state : a break has been detected
bool navigationBreak = false;

/// Navigation statistics
NavigatorStatistics statistics;
};

/// Constructor with configuration object
Expand Down Expand Up @@ -219,7 +223,7 @@ class DetectorNavigator {
ACTS_VERBOSE(volInfo(state) << posInfo(state, stepper)
<< "surface status is " << surfaceStatus);

if (surfaceStatus == Intersection3D::Status::reachable) {
if (surfaceStatus == IntersectionStatus::reachable) {
ACTS_VERBOSE(volInfo(state)
<< posInfo(state, stepper) << "surface "
<< surface.center(state.geoContext).transpose()
Expand Down Expand Up @@ -288,7 +292,7 @@ class DetectorNavigator {
state.options.surfaceTolerance, logger());

// Check if we are at a surface
if (surfaceStatus == Intersection3D::Status::onSurface) {
if (surfaceStatus == IntersectionStatus::onSurface) {
ACTS_VERBOSE(volInfo(state)
<< posInfo(state, stepper) << "landed on surface");

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Navigation/NavigationStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#pragma once

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Utilities/Intersection.hpp"

#include <span>
#include <tuple>
#include <vector>

namespace Acts {
Expand Down
6 changes: 5 additions & 1 deletion Core/include/Acts/Propagator/AtlasStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "Acts/MagneticField/MagneticFieldProvider.hpp"
#include "Acts/Propagator/ConstrainedStep.hpp"
#include "Acts/Propagator/StepperOptions.hpp"
#include "Acts/Propagator/StepperStatistics.hpp"
#include "Acts/Propagator/detail/SteppingHelper.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Intersection.hpp"
Expand Down Expand Up @@ -305,6 +306,9 @@ class AtlasStepper {
/// buffer & formatting for consistent output
std::size_t debugPfxWidth = 30;
std::size_t debugMsgWidth = 50;

/// The statistics of the stepper
StepperStatistics statistics;
};

explicit AtlasStepper(std::shared_ptr<const MagneticFieldProvider> bField)
Expand Down Expand Up @@ -415,7 +419,7 @@ class AtlasStepper {
/// @param [in] boundaryTolerance The boundary check for this status update
/// @param [in] surfaceTolerance Surface tolerance used for intersection
/// @param [in] logger Logger instance to use
Intersection3D::Status updateSurfaceStatus(
IntersectionStatus updateSurfaceStatus(
State& state, const Surface& surface, std::uint8_t index,
Direction navDir, const BoundaryTolerance& boundaryTolerance,
ActsScalar surfaceTolerance = s_onSurfaceTolerance,
Expand Down
16 changes: 9 additions & 7 deletions Core/include/Acts/Propagator/DirectNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
#pragma once

#include "Acts/Definitions/Direction.hpp"
#include "Acts/Geometry/BoundarySurfaceT.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Propagator/ConstrainedStep.hpp"
#include "Acts/Propagator/NavigatorOptions.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Propagator/NavigatorStatistics.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <algorithm>
#include <iterator>
#include <limits>
#include <memory>
#include <vector>
Expand Down Expand Up @@ -75,6 +74,9 @@ class DirectNavigator {
/// Navigation state - external interface: a break has been detected
bool navigationBreak = false;

/// Navigation statistics
NavigatorStatistics statistics;

const Surface* navSurface() const {
return options.surfaces.at(surfaceIndex);
}
Expand Down Expand Up @@ -255,7 +257,7 @@ class DirectNavigator {
state.stepping, surface, index, state.options.direction,
BoundaryTolerance::Infinite(), state.options.surfaceTolerance,
*m_logger);
if (surfaceStatus == Intersection3D::Status::unreachable) {
if (surfaceStatus == IntersectionStatus::unreachable) {
ACTS_VERBOSE(
"Surface not reachable anymore, switching to next one in "
"sequence");
Expand Down Expand Up @@ -309,7 +311,7 @@ class DirectNavigator {
state.stepping, surface, index, state.options.direction,
BoundaryTolerance::Infinite(), state.options.surfaceTolerance,
*m_logger);
if (surfaceStatus == Intersection3D::Status::onSurface) {
if (surfaceStatus == IntersectionStatus::onSurface) {
// Set the current surface
state.navigation.currentSurface = state.navigation.navSurface();
ACTS_VERBOSE("Current surface set to "
Expand All @@ -322,7 +324,7 @@ class DirectNavigator {
.at(state.navigation.surfaceIndex)
->geometryId());
}
} else if (surfaceStatus == Intersection3D::Status::reachable) {
} else if (surfaceStatus == IntersectionStatus::reachable) {
ACTS_VERBOSE("Next surface reachable at distance "
<< stepper.outputStepSize(state.stepping));
}
Expand Down
7 changes: 5 additions & 2 deletions Core/include/Acts/Propagator/EigenStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
Expand All @@ -23,6 +22,7 @@
#include "Acts/Propagator/EigenStepperDefaultExtension.hpp"
#include "Acts/Propagator/PropagatorTraits.hpp"
#include "Acts/Propagator/StepperOptions.hpp"
#include "Acts/Propagator/StepperStatistics.hpp"
#include "Acts/Propagator/detail/SteppingHelper.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Result.hpp"
Expand Down Expand Up @@ -164,6 +164,9 @@ class EigenStepper {
/// k_i elements of the momenta
std::array<double, 4> kQoP{};
} stepData;

/// Statistics of the stepper
StepperStatistics statistics;
};

/// Constructor requires knowledge of the detector's magnetic field
Expand Down Expand Up @@ -267,7 +270,7 @@ class EigenStepper {
/// @param [in] boundaryTolerance The boundary check for this status update
/// @param [in] surfaceTolerance Surface tolerance used for intersection
/// @param [in] logger A @c Logger instance
Intersection3D::Status updateSurfaceStatus(
IntersectionStatus updateSurfaceStatus(
State& state, const Surface& surface, std::uint8_t index,
Direction navDir, const BoundaryTolerance& boundaryTolerance,
ActsScalar surfaceTolerance = s_onSurfaceTolerance,
Expand Down
Loading

0 comments on commit a9a26da

Please sign in to comment.