diff --git a/Core/include/Acts/Utilities/AnnealingUtility.hpp b/Core/include/Acts/Utilities/AnnealingUtility.hpp index df620871507b522080c90d3f5ebe7b08e200b26a..92b2119fc32d457420a5fce5df760ba934168665 100644 --- a/Core/include/Acts/Utilities/AnnealingUtility.hpp +++ b/Core/include/Acts/Utilities/AnnealingUtility.hpp @@ -19,10 +19,10 @@ class AnnealingUtility { /// Resetting the state is done by just creating a new instance struct State { // Points to current temperature value in m_cfg.setOfTemperatures - unsigned int currentTemperatureIndex = 0; + unsigned int currentTemperatureIndex{0}; // Checks if equilibrium is reached - bool equilibriumReached = false; + bool equilibriumReached{false}; }; /// @brief The configuration struct diff --git a/Core/include/Acts/Vertexing/AMVFInfo.hpp b/Core/include/Acts/Vertexing/AMVFInfo.hpp index 8174a09dba79814929c0aacf15178cb2a7ee7817..f796f45076aab979c4bc07a253df607b5b44664f 100644 --- a/Core/include/Acts/Vertexing/AMVFInfo.hpp +++ b/Core/include/Acts/Vertexing/AMVFInfo.hpp @@ -39,7 +39,7 @@ struct VertexInfo { Acts::SpacePointVector seedPosition{Acts::SpacePointVector::Zero()}; // Needs relinearization bool - bool relinearize; + bool relinearize = true; // Vector of all track currently held by vertex std::vector<const input_track_t*> trackLinks; diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp index 2f6b90fa4db6ff740ab50aac2aafbbf3fc87ae8c..4cdfd4732cc87604b715b27cbf74d683bcc952a3 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp @@ -63,7 +63,8 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::fitImpl( // in previous iteration afterwards currentVtxInfo.oldPosition = currentVtx->fullPosition(); - auto dist = currentVtxInfo.oldPosition - currentVtxInfo.linPoint; + SpacePointVector dist = + currentVtxInfo.oldPosition - currentVtxInfo.linPoint; double perpDist = std::sqrt(dist[0] * dist[0] + dist[1] * dist[1]); // Determine if relinearization is needed if (perpDist > m_cfg.maxDistToLinPoint) { @@ -75,24 +76,21 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::fitImpl( // Determine if constraint vertex exist if (state.vtxInfoMap[currentVtx].constraintVertex.fullCovariance() != SpacePointSymMatrix::Zero()) { - currentVtx->setPosition(state.vtxInfoMap[currentVtx] - .constraintVertex.fullPosition() - .template head<3>()); + currentVtx->setFullPosition( + state.vtxInfoMap[currentVtx].constraintVertex.fullPosition()); currentVtx->setFitQuality( state.vtxInfoMap[currentVtx].constraintVertex.fitQuality()); - currentVtx->setCovariance(state.vtxInfoMap[currentVtx] - .constraintVertex.fullCovariance() - .template block<3, 3>(0, 0)); + currentVtx->setFullCovariance( + state.vtxInfoMap[currentVtx].constraintVertex.fullCovariance()); } else if (currentVtx->fullCovariance() == SpacePointSymMatrix::Zero()) { return VertexingError::NoCovariance; } - auto weight = + double weight = 1. / m_cfg.annealingTool.getWeight(state.annealingState, 1.); - auto covAnn = currentVtx->fullCovariance() * weight; - currentVtx->setCovariance(covAnn.template block<3, 3>(0, 0)); + currentVtx->setFullCovariance(currentVtx->fullCovariance() * weight); // Set vertexCompatibility for all TrackAtVertex objects // at current vertex @@ -216,7 +214,7 @@ Acts::Result<void> Acts:: return res.error(); } // Set ip3dParams for current trackAtVertex - currentVtxInfo.ip3dParams.insert(std::make_pair(trk, *(res.value()))); + currentVtxInfo.ip3dParams.emplace(trk, *(res.value())); } return {}; } @@ -244,9 +242,7 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>:: return res.error(); } // Set ip3dParams for current trackAtVertex - auto value = std::move(res.value()); - - currentVtxInfo.ip3dParams.insert(std::make_pair(trk, *value)); + currentVtxInfo.ip3dParams.emplace(trk, *(res.value())); } // Set compatibility with current vertex auto compRes = m_cfg.ipEst.getVertexCompatibility( diff --git a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp index c898142c2ab3b6a0cd79fe7efb465721d8fe9cb5..2e28a2c3fee0293595f464af68aac0a8c365c1d8 100644 --- a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp +++ b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp @@ -27,16 +27,16 @@ void Acts::KalmanVertexTrackUpdater::update(const GeometryContext& gctx, } // Retrieve linTrack information - const auto& posJac = linTrack.positionJacobian.block<5, 3>(0, 0); - const auto& momJac = linTrack.momentumJacobian.block<5, 3>(0, 0); - const auto& trkParams = linTrack.parametersAtPCA.head<5>(); - const auto& trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); + const auto posJac = linTrack.positionJacobian.block<5, 3>(0, 0); + const auto momJac = linTrack.momentumJacobian.block<5, 3>(0, 0); + const auto trkParams = linTrack.parametersAtPCA.head<5>(); + const auto trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); // Calculate S matrix ActsSymMatrixD<3> sMat = (momJac.transpose() * (trkParamWeight * momJac)).inverse(); - const auto& residual = linTrack.constantTerm.head<5>(); + const auto residual = linTrack.constantTerm.head<5>(); // Refit track momentum Vector3D newTrkMomentum = sMat * momJac.transpose() * trkParamWeight * @@ -94,7 +94,7 @@ void Acts::KalmanVertexTrackUpdater::update(const GeometryContext& gctx, SpacePointSymMatrix vtxFullCov(SpacePointSymMatrix::Zero()); vtxFullCov.block<3, 3>(0, 0) = vtxCov; - const auto& fullPerTrackCov = detail::createFullTrackCovariance( + const auto fullPerTrackCov = detail::createFullTrackCovariance( sMat, newFullTrkCov, vtxFullWeight, vtxFullCov, newTrkParams); // Create new refitted parameters diff --git a/Core/include/Acts/Vertexing/KalmanVertexUpdater.hpp b/Core/include/Acts/Vertexing/KalmanVertexUpdater.hpp index e682b5e6ac3d756d2cf4589152b9b242fca2a028..ebcef8cc598121919c133607d47363175a24f7d8 100644 --- a/Core/include/Acts/Vertexing/KalmanVertexUpdater.hpp +++ b/Core/include/Acts/Vertexing/KalmanVertexUpdater.hpp @@ -28,7 +28,6 @@ struct MatrixCache { ActsSymMatrixD<3> newVertexCov = ActsSymMatrixD<3>::Zero(); ActsSymMatrixD<3> newVertexWeight = ActsSymMatrixD<3>::Zero(); ActsSymMatrixD<3> oldVertexWeight = ActsSymMatrixD<3>::Zero(); - ActsSymMatrixD<5> trkParamWeight = ActsSymMatrixD<5>::Zero(); ActsSymMatrixD<3> momWeightInv = ActsSymMatrixD<3>::Zero(); }; diff --git a/Core/include/Acts/Vertexing/KalmanVertexUpdater.ipp b/Core/include/Acts/Vertexing/KalmanVertexUpdater.ipp index aac2e850800cd9cf0e887739d9adf3fb93d00e9f..4bfc4341da54df7c8331e76c80edc9fecb4ba755 100644 --- a/Core/include/Acts/Vertexing/KalmanVertexUpdater.ipp +++ b/Core/include/Acts/Vertexing/KalmanVertexUpdater.ipp @@ -66,12 +66,12 @@ void Acts::KalmanVertexUpdater::updatePosition( MatrixCache& matrixCache) { // Retrieve linTrack information // TODO: To make 4-D compatible, remove block<> and head<> statements - const auto& posJac = linTrack.positionJacobian.block<5, 3>(0, 0); - const auto& momJac = + const auto posJac = linTrack.positionJacobian.block<5, 3>(0, 0); + const auto momJac = linTrack.momentumJacobian.block<5, 3>(0, 0); // B_k in comments below - const auto& trkParams = linTrack.parametersAtPCA.head<5>(); - const auto& constTerm = linTrack.constantTerm.head<5>(); - const auto& trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); + const auto trkParams = linTrack.parametersAtPCA.head<5>(); + const auto constTerm = linTrack.constantTerm.head<5>(); + const auto trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); // Vertex to be updated const auto& oldVtxPos = vtx.position(); @@ -86,6 +86,7 @@ void Acts::KalmanVertexUpdater::updatePosition( trkParamWeight * (momJac * (matrixCache.momWeightInv * momJac.transpose())) * trkParamWeight.transpose(); + // New vertex cov matrix matrixCache.newVertexWeight = matrixCache.oldVertexWeight + @@ -102,7 +103,7 @@ void Acts::KalmanVertexUpdater::updatePosition( template <typename input_track_t> double Acts::KalmanVertexUpdater::detail::vertexPositionChi2( const Vertex<input_track_t>& oldVtx, const MatrixCache& matrixCache) { - auto posDiff = matrixCache.newVertexPos - oldVtx.position(); + Vector3D posDiff = matrixCache.newVertexPos - oldVtx.position(); // Calculate and return corresponding chi2 return posDiff.transpose() * (matrixCache.oldVertexWeight * posDiff); @@ -112,13 +113,13 @@ template <typename input_track_t> double Acts::KalmanVertexUpdater::detail::trackParametersChi2( const LinearizedTrack& linTrack, const MatrixCache& matrixCache) { // Track properties - const auto& posJac = linTrack.positionJacobian.block<5, 3>(0, 0); - const auto& momJac = linTrack.momentumJacobian.block<5, 3>(0, 0); - const auto& trkParams = linTrack.parametersAtPCA.head<5>(); - const auto& constTerm = linTrack.constantTerm.head<5>(); - const auto& trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); + const auto posJac = linTrack.positionJacobian.block<5, 3>(0, 0); + const auto momJac = linTrack.momentumJacobian.block<5, 3>(0, 0); + const auto trkParams = linTrack.parametersAtPCA.head<5>(); + const auto constTerm = linTrack.constantTerm.head<5>(); + const auto trkParamWeight = linTrack.weightAtPCA.block<5, 5>(0, 0); - const auto& jacVtx = posJac * matrixCache.newVertexPos; + const auto jacVtx = posJac * matrixCache.newVertexPos; // Refitted track momentum Vector3D newTrackMomentum = matrixCache.momWeightInv * momJac.transpose() * diff --git a/Core/include/Acts/Vertexing/TrackAtVertex.hpp b/Core/include/Acts/Vertexing/TrackAtVertex.hpp index 689e52a2c2a78d3a84df120b455c0d09840b950e..b404c54c855a3bceb3491655736461593724b29d 100644 --- a/Core/include/Acts/Vertexing/TrackAtVertex.hpp +++ b/Core/include/Acts/Vertexing/TrackAtVertex.hpp @@ -61,20 +61,20 @@ struct TrackAtVertex { const input_track_t* originalParams; /// Chi2 of track - double chi2Track; + double chi2Track = 0; /// Number degrees of freedom /// Note: Can be different from integer value /// since annealing can result in effective /// non-interger values - double ndf; + double ndf = 0; /// Value of the compatibility of the track to the actual vertex, based /// on the estimation of the 3d distance between the track and the vertex - double vertexCompatibility; + double vertexCompatibility = 0; /// Weight of track in fit - double trackWeight; + double trackWeight = 0; /// The linearized state of the track at vertex LinearizedTrack linearizedState; diff --git a/Core/include/Acts/Vertexing/Vertex.hpp b/Core/include/Acts/Vertexing/Vertex.hpp index 45549e63cbbbcb9d1c8f51ff57764ee0d973b9d5..fcb4c24fd3e5d30a6e8eebe837b41fa3fed7b25a 100644 --- a/Core/include/Acts/Vertexing/Vertex.hpp +++ b/Core/include/Acts/Vertexing/Vertex.hpp @@ -41,7 +41,7 @@ class Vertex { /// @param covariance Position covariance matrix /// @param tracks Vector of tracks associated with the vertex Vertex(const Vector3D& position, const ActsSymMatrixD<3>& covariance, - std::vector<TrackAtVertex<input_track_t>>& tracks); + const std::vector<TrackAtVertex<input_track_t>>& tracks); /// @brief Vertex constructor /// @@ -50,7 +50,7 @@ class Vertex { /// @param tracks Vector of tracks associated with the vertex Vertex(const SpacePointVector& position, const SpacePointSymMatrix& covariance, - std::vector<TrackAtVertex<input_track_t>>& tracks); + const std::vector<TrackAtVertex<input_track_t>>& tracks); /// @return Returns 3-position Vector3D position() const; @@ -114,8 +114,8 @@ class Vertex { SpacePointVector m_position = SpacePointVector::Zero(); SpacePointSymMatrix m_covariance = SpacePointSymMatrix::Zero(); std::vector<TrackAtVertex<input_track_t>> m_tracksAtVertex; - double m_chiSquared = std::numeric_limits<double>::max(); // chi2 of the fit - double m_numberDoF = 0.; // number of degrees of freedom + double m_chiSquared = 1e9; // chi2 of the fit + double m_numberDoF = 0.; // number of degrees of freedom }; } // namespace Acts diff --git a/Core/include/Acts/Vertexing/Vertex.ipp b/Core/include/Acts/Vertexing/Vertex.ipp index 61c0fe08cf02fd1461c9816269c6cb2a7f5ce0d9..12ac7106f55ddd060eeae025877d35a8bf495c24 100644 --- a/Core/include/Acts/Vertexing/Vertex.ipp +++ b/Core/include/Acts/Vertexing/Vertex.ipp @@ -24,8 +24,8 @@ Acts::Vertex<input_track_t>::Vertex(const SpacePointVector& position) template <typename input_track_t> Acts::Vertex<input_track_t>::Vertex( const Vector3D& position, const ActsSymMatrixD<3>& covariance, - std::vector<TrackAtVertex<input_track_t>>& tracks) - : m_tracksAtVertex(std::move(tracks)) { + const std::vector<TrackAtVertex<input_track_t>>& tracks) + : m_tracksAtVertex(tracks) { m_position.setZero(); VectorHelpers::position(m_position) = position; m_covariance.setZero(); @@ -35,10 +35,10 @@ Acts::Vertex<input_track_t>::Vertex( template <typename input_track_t> Acts::Vertex<input_track_t>::Vertex( const SpacePointVector& position, const SpacePointSymMatrix& covariance, - std::vector<TrackAtVertex<input_track_t>>& tracks) + const std::vector<TrackAtVertex<input_track_t>>& tracks) : m_position(position), m_covariance(covariance), - m_tracksAtVertex(std::move(tracks)) {} + m_tracksAtVertex(tracks) {} template <typename input_track_t> Acts::Vector3D Acts::Vertex<input_track_t>::position() const { @@ -81,6 +81,7 @@ std::pair<double, double> Acts::Vertex<input_track_t>::fitQuality() const { template <typename input_track_t> void Acts::Vertex<input_track_t>::setPosition(const Vector3D& position, ParValue_t time) { + m_position.setZero(); VectorHelpers::position(m_position) = position; VectorHelpers::time(m_position) = time; } @@ -99,6 +100,7 @@ void Acts::Vertex<input_track_t>::setTime(ParValue_t time) { template <typename input_track_t> void Acts::Vertex<input_track_t>::setCovariance( const ActsSymMatrixD<3>& covariance) { + m_covariance.setZero(); m_covariance.block<3, 3>(0, 0) = covariance; } @@ -111,7 +113,7 @@ void Acts::Vertex<input_track_t>::setFullCovariance( template <typename input_track_t> void Acts::Vertex<input_track_t>::setTracksAtVertex( const std::vector<TrackAtVertex<input_track_t>>& tracks) { - m_tracksAtVertex = std::move(tracks); + m_tracksAtVertex = tracks; } template <typename input_track_t> diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp index a89f326fcc5e32e0910318a800f80a8a981d71c4..71bbdb19c5112aef7ea53eeecf94d813d1f18925 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp @@ -182,20 +182,22 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test) { iTrack++) { // Index of current vertex int vtxIdx = (int)(iTrack / nTracksPerVtx); - state.vtxInfoMap[&vtxList[vtxIdx]].trackLinks.push_back(&allTracks[iTrack]); + state.vtxInfoMap[&(vtxList[vtxIdx])].trackLinks.push_back( + &(allTracks[iTrack])); state.tracksAtVerticesMap.insert( - std::make_pair(std::make_pair(&allTracks[iTrack], &vtxList[vtxIdx]), + std::make_pair(std::make_pair(&(allTracks[iTrack]), &(vtxList[vtxIdx])), TrackAtVertex<BoundParameters>(1., allTracks[iTrack], - &allTracks[iTrack]))); + &(allTracks[iTrack])))); // Use first track also for second vertex to let vtx1 and vtx2 // share this track if (iTrack == 0) { - state.vtxInfoMap[&vtxList[1]].trackLinks.push_back(&allTracks[iTrack]); + state.vtxInfoMap[&(vtxList.at(1))].trackLinks.push_back( + &(allTracks[iTrack])); state.tracksAtVerticesMap.insert( - std::make_pair(std::make_pair(&allTracks[iTrack], &vtxList[1]), + std::make_pair(std::make_pair(&(allTracks[iTrack]), &(vtxList.at(1))), TrackAtVertex<BoundParameters>(1., allTracks[iTrack], - &allTracks[iTrack]))); + &(allTracks[iTrack])))); } } @@ -229,8 +231,8 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test) { // list in order to be able to compare later std::vector<Vertex<BoundParameters>> seedListCopy = vtxList; - auto res1 = fitter.addVtxToFit(state, vtxList[0], linearizer, fitterOptions); - + auto res1 = + fitter.addVtxToFit(state, vtxList.at(0), linearizer, fitterOptions); if (debugMode) { std::cout << "Tracks linked to each vertex AFTER fit: " << std::endl; int c = 0; @@ -259,47 +261,51 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test) { if (debugMode) { std::cout << "Vertex positions after fit of vertex 1 and 2:" << std::endl; - std::cout << "Vtx 1, seed position:\n " << seedListCopy[0].fullPosition() - << "\nFitted position:\n " << vtxList[0].fullPosition() + std::cout << "Vtx 1, seed position:\n " << seedListCopy.at(0).fullPosition() + << "\nFitted position:\n " << vtxList.at(0).fullPosition() << std::endl; - std::cout << "Vtx 2, seed position:\n " << seedListCopy[1].fullPosition() - << "\nFitted position:\n " << vtxList[1].fullPosition() + std::cout << "Vtx 2, seed position:\n " << seedListCopy.at(1).fullPosition() + << "\nFitted position:\n " << vtxList.at(1).fullPosition() << std::endl; - std::cout << "Vtx 3, seed position:\n " << seedListCopy[2].fullPosition() - << "\nFitted position:\n " << vtxList[2].fullPosition() + std::cout << "Vtx 3, seed position:\n " << seedListCopy.at(2).fullPosition() + << "\nFitted position:\n " << vtxList.at(2).fullPosition() << std::endl; } // After fit of first vertex, only first and second vertex seed // should have been modified while third vertex should remain untouched - BOOST_CHECK_NE(vtxList[0].fullPosition(), seedListCopy[0].fullPosition()); - BOOST_CHECK_NE(vtxList[1].fullPosition(), seedListCopy[1].fullPosition()); - BOOST_CHECK_EQUAL(vtxList[2].fullPosition(), seedListCopy[2].fullPosition()); - - CHECK_CLOSE_ABS(vtxList[0].fullPosition(), seedListCopy[0].fullPosition(), - 1_mm); - CHECK_CLOSE_ABS(vtxList[1].fullPosition(), seedListCopy[1].fullPosition(), - 1_mm); - - auto res2 = fitter.addVtxToFit(state, vtxList[2], linearizer, fitterOptions); - + BOOST_CHECK_NE(vtxList.at(0).fullPosition(), + seedListCopy.at(0).fullPosition()); + BOOST_CHECK_NE(vtxList.at(1).fullPosition(), + seedListCopy.at(1).fullPosition()); + BOOST_CHECK_EQUAL(vtxList.at(2).fullPosition(), + seedListCopy.at(2).fullPosition()); + + CHECK_CLOSE_ABS(vtxList.at(0).fullPosition(), + seedListCopy.at(0).fullPosition(), 1_mm); + CHECK_CLOSE_ABS(vtxList.at(1).fullPosition(), + seedListCopy.at(1).fullPosition(), 1_mm); + + auto res2 = + fitter.addVtxToFit(state, vtxList.at(2), linearizer, fitterOptions); BOOST_CHECK(res2.ok()); // Now also the third vertex should have been modified and fitted - BOOST_CHECK_NE(vtxList[2].fullPosition(), seedListCopy[2].fullPosition()); - CHECK_CLOSE_ABS(vtxList[2].fullPosition(), seedListCopy[2].fullPosition(), - 1_mm); + BOOST_CHECK_NE(vtxList.at(2).fullPosition(), + seedListCopy.at(2).fullPosition()); + CHECK_CLOSE_ABS(vtxList.at(2).fullPosition(), + seedListCopy.at(2).fullPosition(), 1_mm); if (debugMode) { std::cout << "Vertex positions after fit of vertex 3:" << std::endl; - std::cout << "Vtx 1, seed position:\n " << seedListCopy[0].fullPosition() - << "\nFitted position:\n " << vtxList[0].fullPosition() + std::cout << "Vtx 1, seed position:\n " << seedListCopy.at(0).fullPosition() + << "\nFitted position:\n " << vtxList.at(0).fullPosition() << std::endl; - std::cout << "Vtx 2, seed position:\n " << seedListCopy[1].fullPosition() - << "\nFitted position:\n " << vtxList[1].fullPosition() + std::cout << "Vtx 2, seed position:\n " << seedListCopy.at(1).fullPosition() + << "\nFitted position:\n " << vtxList.at(1).fullPosition() << std::endl; - std::cout << "Vtx 3, seed position:\n " << seedListCopy[2].fullPosition() - << "\nFitted position:\n " << vtxList[2].fullPosition() + std::cout << "Vtx 3, seed position:\n " << seedListCopy.at(2).fullPosition() + << "\nFitted position:\n " << vtxList.at(2).fullPosition() << std::endl; } } @@ -482,15 +488,15 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_fitter_test_athena) { // Fit vertices fitter.fit(state, vtxList, linearizer, fitterOptions); - auto vtx1Pos = state.vertexCollection[0]->position(); - auto vtx1Cov = state.vertexCollection[0]->covariance(); - // auto vtx1Trks = state.vertexCollection[0]->tracks(); - auto vtx1FQ = state.vertexCollection[0]->fitQuality(); + auto vtx1Pos = state.vertexCollection.at(0)->position(); + auto vtx1Cov = state.vertexCollection.at(0)->covariance(); + // auto vtx1Trks = state.vertexCollection.at(0)->tracks(); + auto vtx1FQ = state.vertexCollection.at(0)->fitQuality(); - auto vtx2Pos = state.vertexCollection[1]->position(); - auto vtx2Cov = state.vertexCollection[1]->covariance(); - // auto vtx2Trks = state.vertexCollection[1]->tracks(); - auto vtx2FQ = state.vertexCollection[1]->fitQuality(); + auto vtx2Pos = state.vertexCollection.at(1)->position(); + auto vtx2Cov = state.vertexCollection.at(1)->covariance(); + // auto vtx2Trks = state.vertexCollection.at(1)->tracks(); + auto vtx2FQ = state.vertexCollection.at(1)->fitQuality(); if (debugMode) { // Vertex 1