Skip to content

Commit

Permalink
format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Feb 2, 2024
1 parent 3f0d8f2 commit 428592a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 107 deletions.
54 changes: 21 additions & 33 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::find(

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::doSeeding(
const std::vector<InputTrack>& trackVector,
Vertex& currentConstraint,
const std::vector<InputTrack>& trackVector, Vertex& currentConstraint,
const VertexingOptions<InputTrack_t>& vertexingOptions,
SeedFinderState_t& seedFinderState,
const std::vector<InputTrack>& removedSeedTracks) const
-> Result<Vertex> {
const std::vector<InputTrack>& removedSeedTracks) const -> Result<Vertex> {
VertexingOptions<InputTrack_t> seedOptions = vertexingOptions;
seedOptions.constraint = currentConstraint;

Expand Down Expand Up @@ -234,8 +232,8 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::getIPSignificance(
template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::
addCompatibleTracksToVertex(
const std::vector<InputTrack>& tracks,
Vertex& vtx, FitterState_t& fitterState,
const std::vector<InputTrack>& tracks, Vertex& vtx,
FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const
-> Result<void> {
for (const auto& trk : tracks) {
Expand Down Expand Up @@ -267,10 +265,8 @@ template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::
canRecoverFromNoCompatibleTracks(
const std::vector<InputTrack>& allTracks,
const std::vector<InputTrack>& seedTracks,
Vertex& vtx,
const Vertex& currentConstraint,
FitterState_t& fitterState,
const std::vector<InputTrack>& seedTracks, Vertex& vtx,
const Vertex& currentConstraint, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const
-> Result<bool> {
// Recover from cases where no compatible tracks to vertex
Expand Down Expand Up @@ -325,10 +321,8 @@ template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::
canPrepareVertexForFit(
const std::vector<InputTrack>& allTracks,
const std::vector<InputTrack>& seedTracks,
Vertex& vtx,
const Vertex& currentConstraint,
FitterState_t& fitterState,
const std::vector<InputTrack>& seedTracks, Vertex& vtx,
const Vertex& currentConstraint, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const
-> Result<bool> {
// Add vertex info to fitter state
Expand All @@ -355,10 +349,10 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::
checkVertexAndCompatibleTracks(
Vertex& vtx,
const std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState, bool useVertexConstraintInFit) const
checkVertexAndCompatibleTracks(Vertex& vtx,
const std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState,
bool useVertexConstraintInFit) const
-> std::pair<int, bool> {
bool isGoodVertex = false;
int nCompatibleTracks = 0;
Expand Down Expand Up @@ -422,11 +416,10 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::
removeTrackIfIncompatible(
Vertex& vtx, std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState,
std::vector<InputTrack>& removedSeedTracks,
const GeometryContext& geoCtx) const -> bool {
removeTrackIfIncompatible(Vertex& vtx, std::vector<InputTrack>& seedTracks,
FitterState_t& fitterState,
std::vector<InputTrack>& removedSeedTracks,
const GeometryContext& geoCtx) const -> bool {
// Try to find the track with highest compatibility
double maxCompatibility = 0;

Expand Down Expand Up @@ -480,8 +473,7 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::keepNewVertex(
Vertex& vtx,
const std::vector<Vertex*>& allVertices,
Vertex& vtx, const std::vector<Vertex*>& allVertices,
FitterState_t& fitterState) const -> bool {
double contamination = 0.;
double contaminationNum = 0;
Expand Down Expand Up @@ -509,8 +501,7 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::keepNewVertex(

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::isMergedVertex(
const Vertex& vtx,
const std::vector<Vertex*>& allVertices) const -> bool {
const Vertex& vtx, const std::vector<Vertex*>& allVertices) const -> bool {
const Vector4& candidatePos = vtx.fullPosition();
const SquareMatrix4& candidateCov = vtx.fullCovariance();

Expand Down Expand Up @@ -564,10 +555,8 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::isMergedVertex(

template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::deleteLastVertex(
Vertex& vtx,
std::vector<std::unique_ptr<Vertex>>& allVertices,
std::vector<Vertex*>& allVerticesPtr,
FitterState_t& fitterState,
Vertex& vtx, std::vector<std::unique_ptr<Vertex>>& allVertices,
std::vector<Vertex*>& allVerticesPtr, FitterState_t& fitterState,
const VertexingOptions<InputTrack_t>& vertexingOptions) const
-> Result<void> {
allVertices.pop_back();
Expand Down Expand Up @@ -609,8 +598,7 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::deleteLastVertex(
template <typename vfitter_t, typename sfinder_t>
auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::getVertexOutputList(
const std::vector<Vertex*>& allVerticesPtr,
FitterState_t& fitterState) const
-> Acts::Result<std::vector<Vertex>> {
FitterState_t& fitterState) const -> Acts::Result<std::vector<Vertex>> {
std::vector<Vertex> outputVec;
for (auto vtx : allVerticesPtr) {
auto& outVtx = *vtx;
Expand Down
9 changes: 3 additions & 6 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::fit(
// Check if we use the constraint during the vertex fit
if (state.vtxInfoMap[vtx].constraint.fullCovariance() !=
SquareMatrix4::Zero()) {
const Acts::Vertex& constraint =
state.vtxInfoMap[vtx].constraint;
const Acts::Vertex& constraint = state.vtxInfoMap[vtx].constraint;
vtx->setFullPosition(constraint.fullPosition());
vtx->setFitQuality(constraint.fitQuality());
vtx->setFullCovariance(constraint.fullCovariance());
Expand Down Expand Up @@ -120,8 +119,7 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::fit(
template <typename input_track_t, typename linearizer_t>
Acts::Result<void>
Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::addVtxToFit(
State& state, Vertex& newVertex,
const linearizer_t& linearizer,
State& state, Vertex& newVertex, const linearizer_t& linearizer,
const VertexingOptions<input_track_t>& vertexingOptions) const {
if (state.vtxInfoMap[&newVertex].trackLinks.empty()) {
ACTS_ERROR(
Expand Down Expand Up @@ -195,8 +193,7 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::addVtxToFit(

template <typename input_track_t, typename linearizer_t>
bool Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::
isAlreadyInList(Vertex* vtx,
const std::vector<Vertex*>& vertices) const {
isAlreadyInList(Vertex* vtx, const std::vector<Vertex*>& vertices) const {
return std::find(vertices.begin(), vertices.end(), vtx) != vertices.end();
}

Expand Down
9 changes: 3 additions & 6 deletions Core/include/Acts/Vertexing/ImpactPointEstimator.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ template <typename input_track_t, typename propagator_t,
typename propagator_options_t>
Acts::Result<Acts::ImpactParametersAndSigma>
Acts::ImpactPointEstimator<input_track_t, propagator_t, propagator_options_t>::
getImpactParameters(const BoundTrackParameters& track,
const Vertex& vtx,
getImpactParameters(const BoundTrackParameters& track, const Vertex& vtx,
const GeometryContext& gctx,
const Acts::MagneticFieldContext& mctx,
bool calculateTimeIP) const {
Expand Down Expand Up @@ -463,8 +462,7 @@ template <typename input_track_t, typename propagator_t,
typename propagator_options_t>
Acts::Result<std::pair<double, double>>
Acts::ImpactPointEstimator<input_track_t, propagator_t, propagator_options_t>::
getLifetimeSignOfTrack(const BoundTrackParameters& track,
const Vertex& vtx,
getLifetimeSignOfTrack(const BoundTrackParameters& track, const Vertex& vtx,
const Acts::Vector3& direction,
const GeometryContext& gctx,
const MagneticFieldContext& mctx) const {
Expand Down Expand Up @@ -508,8 +506,7 @@ template <typename input_track_t, typename propagator_t,
Acts::Result<double>
Acts::ImpactPointEstimator<input_track_t, propagator_t, propagator_options_t>::
get3DLifetimeSignOfTrack(const BoundTrackParameters& track,
const Vertex& vtx,
const Acts::Vector3& direction,
const Vertex& vtx, const Acts::Vector3& direction,
const GeometryContext& gctx,
const MagneticFieldContext& mctx) const {
const std::shared_ptr<PerigeeSurface> perigeeSurface =
Expand Down
9 changes: 3 additions & 6 deletions Core/include/Acts/Vertexing/IterativeVertexFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ Acts::IterativeVertexFinder<vfitter_t, sfinder_t>::removeUsedCompatibleTracks(
template <typename vfitter_t, typename sfinder_t>
Acts::Result<void>
Acts::IterativeVertexFinder<vfitter_t, sfinder_t>::fillTracksToFit(
const std::vector<InputTrack>& seedTracks,
const Vertex& seedVertex,
const std::vector<InputTrack>& seedTracks, const Vertex& seedVertex,
std::vector<InputTrack>& tracksToFitOut,
std::vector<InputTrack>& tracksToFitSplitVertexOut,
const VertexingOptions<InputTrack_t>& vertexingOptions,
Expand Down Expand Up @@ -421,10 +420,8 @@ Acts::IterativeVertexFinder<vfitter_t, sfinder_t>::fillTracksToFit(
template <typename vfitter_t, typename sfinder_t>
Acts::Result<bool>
Acts::IterativeVertexFinder<vfitter_t, sfinder_t>::reassignTracksToNewVertex(
std::vector<Vertex>& vertexCollection,
Vertex& currentVertex,
std::vector<InputTrack>& tracksToFit,
std::vector<InputTrack>& seedTracks,
std::vector<Vertex>& vertexCollection, Vertex& currentVertex,
std::vector<InputTrack>& tracksToFit, std::vector<InputTrack>& seedTracks,
const std::vector<InputTrack>& /* origTracks */,
const VertexingOptions<InputTrack_t>& vertexingOptions,
State& state) const {
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Vertexing/KalmanVertexUpdater.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <algorithm>

template <typename input_track_t, unsigned int nDimVertex>
void Acts::KalmanVertexUpdater::updateVertexWithTrack(
Vertex& vtx, TrackAtVertex& trk) {
void Acts::KalmanVertexUpdater::updateVertexWithTrack(Vertex& vtx,
TrackAtVertex& trk) {
std::pair<double, double> fitQuality = vtx.fitQuality();
detail::updateVertexWithTrack(vtx.fullPosition(), vtx.fullCovariance(),
fitQuality, trk, 1, nDimVertex);
Expand Down
80 changes: 26 additions & 54 deletions Core/include/Acts/Vertexing/Vertex.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,130 +6,102 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

inline
Acts::Vertex::Vertex(const Vector3& position) {
inline Acts::Vertex::Vertex(const Vector3& position) {
m_position[ePos0] = position[ePos0];
m_position[ePos1] = position[ePos1];
m_position[ePos2] = position[ePos2];
}

inline
Acts::Vertex::Vertex(const Vector4& position)
: m_position(position) {}
inline Acts::Vertex::Vertex(const Vector4& position) : m_position(position) {}

inline
Acts::Vertex::Vertex(const Vector3& position,
const SquareMatrix3& covariance,
std::vector<TrackAtVertex> tracks)
inline Acts::Vertex::Vertex(const Vector3& position,
const SquareMatrix3& covariance,
std::vector<TrackAtVertex> tracks)
: m_tracksAtVertex(std::move(tracks)) {
m_position[ePos0] = position[ePos0];
m_position[ePos1] = position[ePos1];
m_position[ePos2] = position[ePos2];
m_covariance.block<3, 3>(ePos0, ePos0) = covariance;
}

inline
Acts::Vertex::Vertex(const Vector4& position,
const SquareMatrix4& covariance,
std::vector<TrackAtVertex> tracks)
inline Acts::Vertex::Vertex(const Vector4& position,
const SquareMatrix4& covariance,
std::vector<TrackAtVertex> tracks)
: m_position(position),
m_covariance(covariance),
m_tracksAtVertex(std::move(tracks)) {}

inline
Acts::Vector3 Acts::Vertex::position() const {
inline Acts::Vector3 Acts::Vertex::position() const {
return VectorHelpers::position(m_position);
}

inline
Acts::ActsScalar Acts::Vertex::time() const {
inline Acts::ActsScalar Acts::Vertex::time() const {
return m_position[eTime];
}

inline
const Acts::Vector4& Acts::Vertex::fullPosition() const {
inline const Acts::Vector4& Acts::Vertex::fullPosition() const {
return m_position;
}

inline
Acts::Vector4& Acts::Vertex::fullPosition() {
inline Acts::Vector4& Acts::Vertex::fullPosition() {
return m_position;
}

inline
Acts::SquareMatrix3 Acts::Vertex::covariance() const {
inline Acts::SquareMatrix3 Acts::Vertex::covariance() const {
return m_covariance.block<3, 3>(ePos0, ePos0);
}

inline
const Acts::SquareMatrix4& Acts::Vertex::fullCovariance() const {
inline const Acts::SquareMatrix4& Acts::Vertex::fullCovariance() const {
return m_covariance;
}

inline
Acts::SquareMatrix4& Acts::Vertex::fullCovariance() {
inline Acts::SquareMatrix4& Acts::Vertex::fullCovariance() {
return m_covariance;
}

inline
const std::vector<Acts::TrackAtVertex>& Acts::Vertex::tracks()
const {
inline const std::vector<Acts::TrackAtVertex>& Acts::Vertex::tracks() const {
return m_tracksAtVertex;
}

inline
std::pair<double, double> Acts::Vertex::fitQuality() const {
inline std::pair<double, double> Acts::Vertex::fitQuality() const {
return std::pair<double, double>(m_chiSquared, m_numberDoF);
}

inline
void Acts::Vertex::setPosition(const Vector3& position,
ActsScalar time) {
inline void Acts::Vertex::setPosition(const Vector3& position,
ActsScalar time) {
m_position[ePos0] = position[ePos0];
m_position[ePos1] = position[ePos1];
m_position[ePos2] = position[ePos2];
m_position[eTime] = time;
}

inline
void Acts::Vertex::setFullPosition(const Vector4& fullPosition) {
inline void Acts::Vertex::setFullPosition(const Vector4& fullPosition) {
m_position = fullPosition;
}

inline
void Acts::Vertex::setTime(ActsScalar time) {
inline void Acts::Vertex::setTime(ActsScalar time) {
m_position[eTime] = time;
}

inline
void Acts::Vertex::setCovariance(
const SquareMatrix3& covariance) {
inline void Acts::Vertex::setCovariance(const SquareMatrix3& covariance) {
m_covariance.setZero();
m_covariance.block<3, 3>(ePos0, ePos0) = covariance;
}

inline
void Acts::Vertex::setFullCovariance(
const SquareMatrix4& covariance) {
inline void Acts::Vertex::setFullCovariance(const SquareMatrix4& covariance) {
m_covariance = covariance;
}

inline
void Acts::Vertex::setTracksAtVertex(
std::vector<TrackAtVertex> tracks) {
inline void Acts::Vertex::setTracksAtVertex(std::vector<TrackAtVertex> tracks) {
m_tracksAtVertex = std::move(tracks);
}

inline
void Acts::Vertex::setFitQuality(double chiSquared,
double numberDoF) {
inline void Acts::Vertex::setFitQuality(double chiSquared, double numberDoF) {
m_chiSquared = chiSquared;
m_numberDoF = numberDoF;
}

inline
void Acts::Vertex::setFitQuality(
std::pair<double, double> fitQuality) {
inline void Acts::Vertex::setFitQuality(std::pair<double, double> fitQuality) {
m_chiSquared = fitQuality.first;
m_numberDoF = fitQuality.second;
}

0 comments on commit 428592a

Please sign in to comment.