Skip to content
Snippets Groups Projects
Commit c3c71774 authored by Carlo Varni's avatar Carlo Varni Committed by Adam Edward Barton
Browse files

Bump ACTS to v34.0.0

Bump ACTS to v34.0.0
parent c3fac209
No related branches found
No related tags found
No related merge requests found
Showing
with 209 additions and 103 deletions
......@@ -12,7 +12,7 @@ ATLAS_BUILDTYPE="RelWithDebInfo"
ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=104
-DLCG_VERSION_POSTFIX="d_ATLAS_13"
-DATLAS_GAUDI_SOURCE="URL;https://gitlab.cern.ch/atlas/Gaudi/-/archive/v38r0.001/Gaudi-v38r0.001.tar.gz;URL_MD5;36f071bb81c0a85331c047107f829537"
-DATLAS_ACTS_SOURCE="URL;https://github.com/acts-project/acts/archive/refs/tags/v33.0.0.tar.gz;URL_HASH;SHA256=7fa226e59890d0693311fba3119fd4806458850c8741dc7970d50e0cfabb5889"
-DATLAS_ACTS_SOURCE="URL;https://github.com/acts-project/acts/archive/refs/tags/v34.0.0.tar.gz;URL_HASH;SHA256=e1d861920603894040c00a21c2b8fcfcbf89d2c55fd02cd6d750dbccefc58d69"
-DATLAS_GEOMODEL_SOURCE="URL;https://gitlab.cern.ch/GeoModelDev/GeoModel/-/archive/5.4.0/GeoModel-5.4.0.tar.bz2;URL_MD5;c06fe74de34e6f89e527d83b366f7e03"
-DATLAS_GEOMODEL_PATCH=""
-DATLAS_GEOMODEL_FORCEDOWNLOAD_MESSAGE="Forcing_the_re-download_of_GeoModel_(2024.01.27.)")
......
......@@ -16,31 +16,31 @@ ActsTrackFindingAlg INFO statistic
|-----------------------------------|------------|------------|------------|
| Input seeds | 123544 | 24791 | 148335 |
| No track parameters | 0 | 0 | 0 |
| Used seeds | 70454 | 14842 | 85296 |
| Used seeds | 70454 | 14841 | 85295 |
| Cannot find track | 7643 | 28 | 7671 |
| Duplicate seeds | 53090 | 9949 | 63039 |
| CKF tracks | 62435 | 12281 | 74716 |
| Duplicate seeds | 53090 | 9950 | 63040 |
| CKF tracks | 62435 | 12280 | 74715 |
| Rejected refined parameters | 376 | 2533 | 2909 |
| selected tracks | 14672 | 1405 | 16077 |
| Stopped tracks reaching max holes | 7643 | 28 | 7671 |
| Seeds with more than one branch | 0 | 0 | 0 |
| Tracks failing second CKF | 50377 | 456 | 50833 |
| Tracks failing second CKF | 50376 | 456 | 50832 |
|-----------------------------------|------------|------------|------------|
ActsTrackFindingAlg INFO Ratios
|------------------------------------------|------------|------------|------------|
| | PPP | SSS | ALL |
|------------------------------------------|------------|------------|------------|
| failed / seeds | 0.0618646 | 0.00112944 | 0.051714 |
| duplication / seeds | 0.429725 | 0.401315 | 0.424977 |
| duplication / seeds | 0.429725 | 0.401355 | 0.424984 |
| Rejected refined params / seeds | 0.00304345 | 0.102174 | 0.019611 |
| selected / CKF tracks | 0.234996 | 0.114404 | 0.215175 |
| selected tracks / used seeds | 0.208249 | 0.0946638 | 0.188485 |
| selected / CKF tracks | 0.234996 | 0.114414 | 0.215178 |
| selected tracks / used seeds | 0.208249 | 0.0946702 | 0.188487 |
| branched tracks / used seeds | 0 | 0 | 0 |
| no 2nd CKF / CKF tracks | 0.806871 | 0.0371305 | 0.68035 |
| no 2nd CKF / CKF tracks | 0.806855 | 0.0371336 | 0.680345 |
|------------------------------------------|------------|------------|------------|
| selected / CKF tracks 0.0- 0.5 | 0.241226 | 0.0175953 | 0.187123 |
| 0.5- 1.0 | 0.187037 | 0.0497954 | 0.162152 |
| 1.0- 1.5 | 0.0962974 | 0.0598802 | 0.0934014 |
| 1.0- 1.5 | 0.0962974 | 0.0599315 | 0.0934077 |
| 1.5- 2.0 | 0.118186 | 0.0905505 | 0.110949 |
| 2.0- 2.5 | 0.250079 | 0.27071 | 0.254663 |
| 2.5- 3.0 | 0.395963 | 1 | 0.396057 |
......
......@@ -103,6 +103,15 @@ class MutableMultiTrajectory final
ActsTrk::IndexType addTrackState_impl(Acts::TrackStatePropMask mask,
ActsTrk::IndexType iprevious);
/**
* @brief Add state components for the given mask
*
* @param istate - state index
* @param mask - bitmask deciding which backends are extended
*/
void addTrackStateComponents_impl(ActsTrk::IndexType istate,
Acts::TrackStatePropMask mask);
/**
* @brief Access component by key
*
......
......@@ -150,6 +150,71 @@ ActsTrk::IndexType ActsTrk::MutableMultiTrajectory::addTrackState_impl(
}
void ActsTrk::MutableMultiTrajectory::addTrackStateComponents_impl(
ActsTrk::IndexType istate,
Acts::TrackStatePropMask mask) {
using namespace Acts::HashedStringLiteral;
INSPECTCALL( this << " " << mask << " " << m_trackStatesAux->size() << " " << previous);
assert(m_trackStatesAux && "Missing Track States backend");
constexpr size_t NDim = 6; // TODO take this from somewhere
// set kInvalid
using Acts::MultiTrajectoryTraits::kInvalid;
using namespace Acts;
auto addParam = [this]() -> ActsTrk::IndexType {
stepResize(m_trackParametersAux.get(), m_trackParametersSize, 60);
// TODO ask AK if this resize could be method of aux container
m_trackParametersAux->params[m_trackParametersSize].resize(NDim);
m_trackParametersAux->covMatrix[m_trackParametersSize].resize(NDim*NDim);
m_trackParametersSize++;
return m_trackParametersSize-1;
};
auto addJacobian = [this]() -> ActsTrk::IndexType {
stepResize(m_trackJacobiansAux.get(), m_trackJacobiansSize);
m_trackJacobiansAux->jac[m_trackJacobiansSize].resize(NDim*NDim);
m_trackJacobiansSize++;
return m_trackJacobiansSize-1;
};
auto addMeasurement = [this]() -> ActsTrk::IndexType {
stepResize(m_trackMeasurementsAux.get(), m_trackMeasurementsSize );
m_trackMeasurementsAux->meas[m_trackMeasurementsSize].resize(NDim);
m_trackMeasurementsAux->covMatrix[m_trackMeasurementsSize].resize(NDim*NDim);
m_trackMeasurementsSize++;
return m_trackMeasurementsSize-1;
};
if ((m_trackStatesAux->predicted[istate] == kInvalid) &&
ACTS_CHECK_BIT(mask, TrackStatePropMask::Predicted)) {
m_trackStatesAux->predicted[istate] = addParam();
}
if ((m_trackStatesAux->filtered[istate] == kInvalid) &&
ACTS_CHECK_BIT(mask, TrackStatePropMask::Filtered)) {
m_trackStatesAux->filtered[istate] = addParam();
}
if ((m_trackStatesAux->smoothed[istate] == kInvalid) &&
ACTS_CHECK_BIT(mask, TrackStatePropMask::Smoothed)) {
m_trackStatesAux->smoothed[istate] = addParam();
}
if ((m_trackStatesAux->jacobian[istate] == kInvalid) &&
ACTS_CHECK_BIT(mask, TrackStatePropMask::Jacobian)) {
m_trackStatesAux->jacobian[istate] = addJacobian();
}
if ((m_trackStatesAux->calibrated[istate] == kInvalid) &&
ACTS_CHECK_BIT(mask, TrackStatePropMask::Calibrated)) {
m_trackStatesAux->calibrated[istate] = addMeasurement();
m_calibratedSourceLinks.emplace_back(std::nullopt);
m_trackStatesAux->measDim[istate] = m_trackMeasurementsAux->meas[m_trackStatesAux->calibrated[istate]].size();
}
}
void ActsTrk::MutableMultiTrajectory::shareFrom_impl(
ActsTrk::IndexType iself,
......
......@@ -11,6 +11,7 @@
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/SourceLink.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Surfaces/PlaneSurface.hpp"
#include "Acts/Utilities/Helpers.hpp"
#include "ActsEvent/MultiTrajectory.h"
#include "CommonHelpers/GenerateParameters.hpp"
......
......@@ -28,8 +28,7 @@
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/VectorTrackContainer.hpp"
#include "Acts/EventData/detail/TransformationBoundToFree.hpp"
#include "Acts/EventData/detail/TransformationFreeToBound.hpp"
#include "Acts/EventData/TransformationHelpers.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Propagator/detail/JacobianEngine.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
......@@ -290,16 +289,14 @@ ActsTrk::ActsToTrkConverterTool::actsTrackParametersToTrkParameters(
auto helperSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(
planeSurface->transform());
auto boundToFreeJacobian =
actsSurface.boundToFreeJacobian(gctx, actsParameter.parameters());
auto covpc = actsParameter.covariance().value();
Acts::FreeVector freePars =
Acts::detail::transformBoundToFreeParameters(
Acts::transformBoundToFreeParameters(
actsSurface, gctx, actsParameter.parameters());
Acts::BoundVector targetPars =
Acts::detail::transformFreeToBoundParameters(freePars,
Acts::transformFreeToBoundParameters(freePars,
*helperSurface, gctx)
.value();
......@@ -308,6 +305,10 @@ ActsTrk::ActsToTrkConverterTool::actsTrackParametersToTrkParameters(
Acts::FreeVector freeToPathDerivatives = Acts::FreeVector::Zero();
freeToPathDerivatives.head<3>() = freePars.segment<3>(Acts::eFreeDir0);
auto boundToFreeJacobian = actsSurface.boundToFreeJacobian(
gctx, freePars.segment<3>(Acts::eFreePos0),
freePars.segment<3>(Acts::eFreeDir0));
Acts::BoundMatrix boundToBoundJac = Acts::detail::boundToBoundTransportJacobian(
gctx, freePars, boundToFreeJacobian, freeTransportJacobian,
freeToPathDerivatives, *helperSurface);
......@@ -536,7 +537,6 @@ void ActsTrk::ActsToTrkConverterTool::actsTrackParameterPositionCheck(
static void ActsTrk::ActsMeasurementCheck(
const Acts::GeometryContext &gctx, const Trk::MeasurementBase &measurement,
const Acts::Surface &surface, const Acts::BoundVector &loc) {
const Trk::Surface &surf = measurement.associatedSurface();
// only check Annulus for the moment
if (surf.bounds().type() != Trk::SurfaceBounds::Annulus) {
......@@ -570,7 +570,11 @@ static void ActsTrk::ActsMeasurementCheck(
locxypar[3] = M_PI_2;
locxypar[4] = 1;
locxypar[5] = 1;
auto boundToFree = planeSurface->boundToFreeJacobian(gctx, locxypar);
Acts::FreeVector globalxypar = Acts::transformBoundToFreeParameters(
*planeSurface, gctx, locxypar);
auto boundToFree = planeSurface->boundToFreeJacobian(
gctx, globalxypar.segment<3>(Acts::eFreePos0),
globalxypar.segment<3>(Acts::eFreeDir0));
Acts::ActsSquareMatrix<2> xyToXyzJac = boundToFree.topLeftCorner<2, 2>();
Acts::BoundVector locpcpar;
......@@ -579,8 +583,12 @@ static void ActsTrk::ActsMeasurementCheck(
locpcpar[3] = M_PI_2;
locpcpar[4] = 1;
locpcpar[5] = 1;
boundToFree = surface.boundToFreeJacobian(gctx, locpcpar);
Acts::FreeVector globalpcpar = Acts::transformBoundToFreeParameters(
surface, gctx, locpcpar);
boundToFree = surface.boundToFreeJacobian(
gctx, globalpcpar.segment<3>(Acts::eFreePos0),
globalpcpar.segment<3>(Acts::eFreeDir0));
Acts::ActsSquareMatrix<2> pcToXyzJac = boundToFree.topLeftCorner<2, 2>();
Acts::ActsSquareMatrix<2> xyzToPcJac = pcToXyzJac.inverse();
......
......@@ -98,7 +98,7 @@ namespace ActsTrk
std::vector<std::unique_ptr<const Acts::BoundTrackParameters>> actsSmoothedParam;
tracks.trackStateContainer().visitBackwards(
lastMeasurementIndex,
[this, &tgContext, &finalTrajectory, &actsSmoothedParam, &numberOfDeadPixel, &numberOfDeadSCT, &hypothesis](const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) -> void
[this, &tgContext, &track, &finalTrajectory, &actsSmoothedParam, &numberOfDeadPixel, &numberOfDeadSCT, &hypothesis](const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) -> void
{
// First only consider states with an associated detector element
if (!state.hasReferenceSurface() || !state.referenceSurface().associatedDetectorElement())
......@@ -113,10 +113,7 @@ namespace ActsTrk
// State is a hole (no associated measurement), use predicted parameters
if (flag.test(Acts::TrackStateFlag::HoleFlag))
{
const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
state.predicted(),
state.predictedCovariance(),
hypothesis);
const Acts::BoundTrackParameters actsParam = track.createParametersFromState(state);
parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsParam, tgContext);
auto boundaryCheck = m_boundaryCheckTool->boundaryCheck(*parm);
......@@ -148,20 +145,14 @@ namespace ActsTrk
// The state was tagged as an outlier or (TODO!) was missed in the reverse filtering, use filtered parameters
else if (flag.test(Acts::TrackStateFlag::OutlierFlag))
{
const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
state.filtered(),
state.filteredCovariance(),
hypothesis);
const Acts::BoundTrackParameters actsParam = track.createParametersFromState(state);
parm = m_ATLASConverterTool->actsTrackParametersToTrkParameters(actsParam, tgContext);
typePattern.set(Trk::TrackStateOnSurface::Outlier);
}
// The state is a measurement state, use smoothed parameters
else
{
const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
state.smoothed(),
state.smoothedCovariance(),
hypothesis);
const Acts::BoundTrackParameters actsParam = track.createParametersFromState(state);
// is it really necessary to keep our own copy of all the smoothed parameters?
actsSmoothedParam.push_back(std::make_unique<const Acts::BoundTrackParameters>(Acts::BoundTrackParameters(actsParam)));
......
......@@ -17,7 +17,6 @@
// ACTS
#include "Acts/Geometry/Volume.hpp"
#include "Acts/Geometry/AbstractVolume.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
class CaloDetDescrManager;
......@@ -45,16 +44,16 @@ public:
private:
Acts::AbstractVolume
Acts::Volume
build_endcap(double z, double dz, double eta, double deta, double phi, double dphi) const;
Acts::AbstractVolume
Acts::Volume
build_barrel(double r, double dr, double eta, double deta, double phi, double dphi) const;
Acts::AbstractVolume
Acts::Volume
build_box(double x, double dx, double y, double dy, double z, double dz) const;
std::vector<std::unique_ptr<Acts::AbstractVolume>>
std::vector<std::unique_ptr<Acts::Volume>>
cellFactory() const;
std::shared_ptr<Acts::CutoutCylinderVolumeBounds>
......
......@@ -61,7 +61,7 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
// generate the calo cell volume description
std::vector<std::unique_ptr<Acts::AbstractVolume>> cells;
std::vector<std::unique_ptr<Acts::Volume>> cells;
cells = cellFactory();
ATH_MSG_VERBOSE("Collected " << cells.size() << " calo cells");
......@@ -86,8 +86,8 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
// build a BVH octree for the bounding boxes
// but only AFTER we've built the calo volume bounds
Box* top;
top = Acts::make_octree(boxStore, prims, 1, 0.1);
// Box* top;
// top = Acts::make_octree(boxStore, prims, 1, 0.1);
// Create Tracking Volume that coutains the Calo
// This needs to own the Abstract Volumes (cells), but we
......@@ -101,14 +101,17 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
cellVols.push_back(std::move(up));
}
std::shared_ptr<Acts::TrackingVolume> calo
= Acts::TrackingVolume::create(Acts::Transform3::Identity(),
caloVolBounds,
std::move(boxStore),
std::move(cellVols),
top,
nullptr, // no material for now
"Calo");
// This was removed in https://github.com/acts-project/acts/pull/3029
// To be reimplemented using new geometry model instead of explicit TrackingVolume content
throw std::runtime_error{"Calo building for ACTS currently disabled"};
std::shared_ptr<Acts::TrackingVolume> calo;
// = Acts::TrackingVolume::create(Acts::Transform3::Identity(),
// caloVolBounds,
// std::move(boxStore),
// std::move(cellVols),
// top,
// nullptr, // no material for now
// "Calo");
// We need to interglue all the volumes together
std::shared_ptr<Acts::TrackingVolume> mutInsideVolume
......@@ -278,10 +281,10 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
caloRMin, caloRMax, (caloDZ1 - caloDZ2) / 2.);
// they share the same bounds and tvol array
auto posContainer = Acts::TrackingVolume::create(posTrf, posNegCylBounds, tVolArrPosNeg);
auto posContainer = std::make_shared<Acts::TrackingVolume>(posTrf, posNegCylBounds, tVolArrPosNeg);
ATH_MSG_VERBOSE("Built positive container " << *posContainer);
ATH_MSG_VERBOSE(" - containing: " << calo->volumeName());
auto negContainer = Acts::TrackingVolume::create(negTrf, posNegCylBounds, tVolArrPosNeg);
auto negContainer = std::make_shared<Acts::TrackingVolume>(negTrf, posNegCylBounds, tVolArrPosNeg);
ATH_MSG_VERBOSE("Built negative container " << *negContainer);
ATH_MSG_VERBOSE(" - containing: " << calo->volumeName());
......@@ -303,7 +306,7 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
tVolOrderedCtr, std::move(binUtilityCtr));
auto ctrContainer = Acts::TrackingVolume::create(Acts::Transform3::Identity(),
auto ctrContainer = std::make_shared<Acts::TrackingVolume>(Acts::Transform3::Identity(),
std::make_shared<Acts::CylinderVolumeBounds>(
caloRMin, caloRMax, caloDZ2),
tVolArrCtr);
......@@ -314,7 +317,7 @@ ActsCaloTrackingVolumeBuilder::trackingVolume(
// and now combine those together into another one
Acts::TrackingVolumeArrayCreator tvac{Acts::TrackingVolumeArrayCreator::Config{}};
auto mainContainer = Acts::TrackingVolume::create(Acts::Transform3::Identity(),
auto mainContainer = std::make_shared<Acts::TrackingVolume>(Acts::Transform3::Identity(),
std::make_shared<Acts::CylinderVolumeBounds>(
caloRMin, caloRMax, caloDZ1),
tvac.trackingVolumeArray(gctx, {negContainer, ctrContainer, posContainer},
......@@ -487,7 +490,7 @@ namespace {
}
}
Acts::AbstractVolume
Acts::Volume
ActsCaloTrackingVolumeBuilder::build_endcap(double z,
double dz,
double eta,
......@@ -551,13 +554,13 @@ ActsCaloTrackingVolumeBuilder::build_endcap(double z,
auto cubo = std::make_shared<Acts::GenericCuboidVolumeBounds>(
std::array<Acts::Vector3, 8>({{p1, p2, p3, p4, p5, p6, p7, p8}}));
Acts::AbstractVolume vol(globalToLocal, std::move(cubo));
Acts::Volume vol(globalToLocal, std::move(cubo));
return vol;
}
Acts::AbstractVolume
Acts::Volume
ActsCaloTrackingVolumeBuilder::build_barrel(double r,
double dr,
double eta,
......@@ -623,12 +626,12 @@ ActsCaloTrackingVolumeBuilder::build_barrel(double r,
auto cubo = std::make_shared<Acts::GenericCuboidVolumeBounds>(
std::array<Acts::Vector3, 8>({{p1, p2, p3, p4, p5, p6, p7, p8}}));
Acts::AbstractVolume vol(globalToLocal, std::move(cubo));
Acts::Volume vol(globalToLocal, std::move(cubo));
return vol;
}
Acts::AbstractVolume
Acts::Volume
ActsCaloTrackingVolumeBuilder::build_box(double x, double dx, double y, double dy, double z, double dz) const
{
// std::cout << "build box" << std::endl;
......@@ -670,12 +673,12 @@ ActsCaloTrackingVolumeBuilder::build_box(double x, double dx, double y, double d
auto cubo = std::make_shared<Acts::GenericCuboidVolumeBounds>(
std::array<Acts::Vector3, 8>({{p1, p2, p3, p4, p5, p6, p7, p8}}));
Acts::AbstractVolume vol(globalToLocal, std::move(cubo));
Acts::Volume vol(globalToLocal, std::move(cubo));
return vol;
}
std::vector<std::unique_ptr<Acts::AbstractVolume>>
std::vector<std::unique_ptr<Acts::Volume>>
ActsCaloTrackingVolumeBuilder::cellFactory() const
{
//Acts::ply_helper<double> ply_lar;
......@@ -688,7 +691,7 @@ ActsCaloTrackingVolumeBuilder::cellFactory() const
float scale;
// storage of cells we will produce
std::vector<std::unique_ptr<Acts::AbstractVolume>> cells;
std::vector<std::unique_ptr<Acts::Volume>> cells;
cells.reserve(m_caloMgr->element_size()); // about 180k
for(auto it = m_caloMgr->element_begin();it < m_caloMgr->element_end();++it) {
......@@ -735,7 +738,7 @@ ActsCaloTrackingVolumeBuilder::cellFactory() const
case 11:
case 17:
dz *= scale;
cells.push_back(std::make_unique<Acts::AbstractVolume>(
cells.push_back(std::make_unique<Acts::Volume>(
build_endcap(z, dz, eta_raw, deta, phi_raw, dphi)));
break;
case 0:
......@@ -751,7 +754,7 @@ ActsCaloTrackingVolumeBuilder::cellFactory() const
case 19:
case 20:
dr *= scale;
cells.push_back(std::make_unique<Acts::AbstractVolume>(
cells.push_back(std::make_unique<Acts::Volume>(
build_barrel(r, dr, eta_raw, deta, phi_raw, dphi)));
break;
case 21:
......@@ -761,7 +764,7 @@ ActsCaloTrackingVolumeBuilder::cellFactory() const
dx *= scale;
dy *= scale;
// dz *= scale;
cells.push_back(std::make_unique<Acts::AbstractVolume>(
cells.push_back(std::make_unique<Acts::Volume>(
build_box(x, dx, y, dy, z, dz)));
break;
default:
......
......@@ -21,7 +21,7 @@ if "__main__" == __name__:
flags.Detector.GeometryID = True
flags.Detector.GeometryPixel = True
flags.Detector.GeometrySCT = True
flags.Detector.GeometryCalo = True
flags.Detector.GeometryCalo = False
flags.Detector.GeometryMuon = False
flags.Detector.GeometryTRT = True
flags.Acts.TrackingGeometry.MaterialSource = "None"
......@@ -54,9 +54,10 @@ if "__main__" == __name__:
# Service will have removed TRT and Calo
# We want them enabled for testing
# Temporarily disabling Calo though
tgSvc.BuildSubDetectors += [
"TRT",
"Calo"
"TRT"
#"Calo"
]
# needed to construct the calo geometry in ACTS
......
......@@ -63,12 +63,13 @@ namespace ActsTrk {
const Acts::ParticleHypothesis &particle_hypothesis)
{
if (param.covariance().has_value()) {
Acts::Vector3 direction(param.direction());
Acts::BoundMatrix b2c;
Acts::FreeVector freeParams = Acts::transformBoundToFreeParameters(
param.referenceSurface(), tgContext, param.parameters());
Acts::Vector3 position = freeParams.segment<3>(Acts::eFreePos0);
Acts::Vector3 direction = freeParams.segment<3>(Acts::eFreeDir0);
Acts::BoundMatrix b2c;
Acts::detail::boundToCurvilinearTransportJacobian(direction, // magnFieldVect.normalized(),
param.referenceSurface().boundToFreeJacobian(tgContext,
param.parameters()),
param.referenceSurface().boundToFreeJacobian(tgContext, position, direction),
Acts::FreeMatrix::Identity(),
computeFreeToPathDerivatives(direction,
param.parameters()[Acts::eBoundQOverP],
......
......@@ -27,6 +27,7 @@
#include "Acts/TrackFinding/MeasurementSelector.hpp"
#include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
#include "Acts/Utilities/TrackHelpers.hpp"
// ACTS glue
#include "ActsEvent/TrackContainer.h"
......@@ -142,6 +143,9 @@ namespace ActsTrk
Navigator navigator(cfg, logger().cloneWithSuffix("Navigator"));
Propagator propagator(std::move(stepper), std::move(navigator), logger().cloneWithSuffix("Prop"));
// Using the CKF propagator as extrapolator
Extrapolator extrapolator = propagator;
std::vector<double> etaBins;
// m_etaBins (from flags.Tracking.ActiveConfig.etaBins) includes a dummy first and last bin, which we ignore
if (m_etaBins.size() > 2)
......@@ -154,6 +158,7 @@ namespace ActsTrk
measurementSelectorCuts.numMeasurementsCutOff = m_numMeasurementsCutOff;
Acts::MeasurementSelector::Config measurementSelectorCfg{{Acts::GeometryIdentifier(), std::move(measurementSelectorCuts)}};
Acts::MeasurementSelector measurementSelector(measurementSelectorCfg);
std::vector<double> absEtaEdges;
absEtaEdges.reserve(etaBins.size() + 2);
......@@ -202,7 +207,7 @@ namespace ActsTrk
ATH_MSG_INFO(trackSelectorCfg);
m_trackFinder.reset(new CKF_pimpl{CKF_config{{std::move(propagator), logger().cloneWithSuffix("CKF")}, measurementSelectorCfg, {}, {}, {}, trackSelectorCfg}});
m_trackFinder.reset(new CKF_pimpl{CKF_config{std::move(extrapolator), {std::move(propagator), logger().cloneWithSuffix("CKF")}, measurementSelector, {}, {}, {}, trackSelectorCfg}});
trackFinder().pOptions.maxSteps = m_maxPropagationStep;
trackFinder().pSecondOptions.maxSteps = m_maxPropagationStep;
......@@ -210,7 +215,6 @@ namespace ActsTrk
trackFinder().pSecondOptions.direction = trackFinder().pOptions.direction.invert();
trackFinder().ckfExtensions.updater.connect<&gainMatrixUpdate>();
trackFinder().ckfExtensions.smoother.connect<&gainMatrixSmoother>();
trackFinder().ckfExtensions.measurementSelector.connect<&Acts::MeasurementSelector::select<ActsTrk::MutableTrackStateBackend>>(&trackFinder().measurementSelector);
initStatTables();
......@@ -464,11 +468,8 @@ namespace ActsTrk
trackFinder().ckfExtensions,
trackFinder().pOptions,
&(*pSurface));
options.smoothing = true;
std::optional<TrackFinderOptions> secondOptions;
if (m_doTwoWay) {
options.smoothingTargetSurfaceStrategy = Acts::CombinatorialKalmanFilterTargetSurfaceStrategy::first;
secondOptions.emplace(tgContext,
mfContext,
calContext,
......@@ -476,9 +477,7 @@ namespace ActsTrk
trackFinder().ckfExtensions,
trackFinder().pSecondOptions,
&(*pSurface));
secondOptions->filterTargetSurface = pSurface.get();
secondOptions->smoothing = true;
secondOptions->smoothingTargetSurfaceStrategy = Acts::CombinatorialKalmanFilterTargetSurfaceStrategy::last;
secondOptions->targetSurface = pSurface.get();
}
ActsTrk::MutableTrackContainer tracksContainerTemp;
......@@ -503,6 +502,13 @@ namespace ActsTrk
if (m_doTwoWay)
secondOptions->extensions.branchStopper.connect<&CkfBranchStopper::stopBranch>(&ckfBranchStopper);
Acts::PropagatorOptions<Acts::ActionList<Acts::MaterialInteractor>,
Acts::AbortList<Acts::EndOfWorldReached>>
extrapolationOptions(tgContext, mfContext);
Acts::TrackExtrapolationStrategy extrapolationStrategy =
Acts::TrackExtrapolationStrategy::firstOrLast;
// Perform the track finding for all initial parameters
ATH_MSG_DEBUG("Invoke track finding with " << estimatedTrackParameters.size() << ' ' << seedType << " seeds.");
......@@ -628,6 +634,14 @@ namespace ActsTrk
for (auto &firstTrack : tracksForSeed) {
std::size_t nsecond = 0;
auto smoothingResult = Acts::smoothTrack(tgContext, firstTrack, logger());
if (!smoothingResult.ok()) {
ATH_MSG_DEBUG("Smoothing for seed "
<< iseed << " and first track " << firstTrack.index()
<< " failed with error " << smoothingResult.error());
continue;
}
if (m_doTwoWay) {
std::optional<ActsTrk::MutableMultiTrajectory::TrackStateProxy> firstState;
for (auto st : firstTrack.trackStatesReversed()) {
......@@ -668,7 +682,25 @@ namespace ActsTrk
Acts::calculateTrackQuantities(secondTrack);
auto extrapolationResult = Acts::extrapolateTrackToReferenceSurface(
secondTrack, *pSurface, trackFinder().extrapolator, extrapolationOptions,
extrapolationStrategy, logger());
if (!extrapolationResult.ok()) {
ATH_MSG_WARNING("Extrapolation for seed "
<< iseed << " and second track " << secondTrack.index()
<< " failed with error " << extrapolationResult.error());
// restore first track
(*firstFirstState).previous() = Acts::kTrackIndexInvalid;
continue;
}
addTrack(secondTrack);
// restore first track
(*firstFirstState).previous() = Acts::kTrackIndexInvalid;
++nsecond;
}
}
......@@ -679,6 +711,17 @@ namespace ActsTrk
ATH_MSG_DEBUG("No viable result from second track finding for " << seedType << " seed " << iseed << " track " << nfirst);
++event_stat[category_i][kNoSecond];
}
auto extrapolationResult = Acts::extrapolateTrackToReferenceSurface(
firstTrack, *pSurface, trackFinder().extrapolator, extrapolationOptions,
extrapolationStrategy, logger());
if (!extrapolationResult.ok()) {
ATH_MSG_WARNING("Extrapolation for seed "
<< iseed << " and first " << firstTrack.index()
<< " failed with error " << extrapolationResult.error());
continue;
}
addTrack(firstTrack);
}
nfirst++;
......
......@@ -51,16 +51,6 @@ namespace
return updater.template operator()<ActsTrk::MutableTrackStateBackend>(gctx, trackState, direction, logger);
}
static Acts::Result<void>
gainMatrixSmoother(const Acts::GeometryContext &gctx,
ActsTrk::MutableTrackStateBackend &trajectory,
size_t entryIndex,
const Acts::Logger &logger)
{
Acts::GainMatrixSmoother smoother;
return smoother.template operator()<ActsTrk::MutableTrackStateBackend>(gctx, trajectory, entryIndex, logger);
}
// Helper class to describe ranges of measurements
// the range provides the measurement collection index and element index range (begin, end)
struct MeasurementRange : public std::pair<unsigned int, unsigned int>
......@@ -217,6 +207,7 @@ namespace
using Stepper = Acts::EigenStepper<>;
using Navigator = Acts::Navigator;
using Propagator = Acts::Propagator<Stepper, Navigator>;
using Extrapolator = Propagator;
using CKF = Acts::CombinatorialKalmanFilter<Propagator, ActsTrk::MutableTrackStateBackend>;
// Small holder class to keep CKF and related objects.
......@@ -225,6 +216,8 @@ namespace
// ActsTrk::TrackFindingAlg::CKF_pimpl inherits from CKF_config to prevent -Wsubobject-linkage warning.
struct CKF_config
{
// Extrapolator
Extrapolator extrapolator;
// CKF algorithm
CKF ckf;
// CKF configuration
......
......@@ -16,7 +16,7 @@
#include "Acts/Surfaces/AnnulusBounds.hpp"
#include "Acts/Surfaces/SurfaceBounds.hpp"
#include "Acts/Surfaces/DiscSurface.hpp"
#include "Acts/EventData/detail/TransformationBoundToFree.hpp"
#include "Acts/EventData/TransformationHelpers.hpp"
#include "ActsEvent/TrackContainer.h"
......@@ -396,7 +396,7 @@ namespace ActsTrk
static void printParameters(const Acts::Surface &surface, const Acts::GeometryContext &tgContext, const Acts::BoundVector &bound)
{
auto p = Acts::detail::transformBoundToFreeParameters(surface, tgContext, bound);
auto p = Acts::transformBoundToFreeParameters(surface, tgContext, bound);
std::cout << std::fixed
<< std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc0] << ' '
<< std::setw(10) << std::setprecision(4) << bound[Acts::eBoundLoc1] << ' '
......
......@@ -417,12 +417,7 @@ namespace ActsTrk
// for(ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType idx : tmp_param_state_idx) {
ActsTrk::TrackStateBackend::ConstTrackStateProxy
state = tracksContainer->trackStateContainer().getTrackState(*idx_iter);
auto flag = state.typeFlags();
const Acts::BoundTrackParameters
actsParam(state.referenceSurface().getSharedPtr(),
!flag.test(Acts::TrackStateFlag::OutlierFlag) ? state.smoothed() : state.filtered(),
!flag.test(Acts::TrackStateFlag::OutlierFlag) ? state.smoothedCovariance() : state.filteredCovariance(),
hypothesis);
const Acts::BoundTrackParameters actsParam = track.createParametersFromState(state);
Acts::Vector3 position = actsParam.position(gctx.context());
Acts::Vector3 momentum = actsParam.momentum();
......@@ -506,10 +501,7 @@ namespace ActsTrk
Acts::BoundTrackParameters TrackToTrackParticleCnvAlg::parametersAtBeamLine(const EventContext &ctx,
const typename ActsTrk::TrackContainer::ConstTrackProxy &track,
const Acts::PerigeeSurface &perigee_surface) const {
Acts::BoundTrackParameters trackParam(track.referenceSurface().getSharedPtr(),
track.parameters(),
track.covariance(),
track.particleHypothesis());
Acts::BoundTrackParameters trackParam = track.createParametersAtReference();
std::optional<const Acts::BoundTrackParameters>
perigeeParam = m_extrapolationTool->propagate(ctx,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment