Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AlignmentAlgorithmFunction.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AlignmentAlgorithmFunction.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
20 
21 namespace {
22 
23 using Updater = Acts::GainMatrixUpdater;
24 using Smoother = Acts::GainMatrixSmoother;
28 using Alignment = ActsAlignment::Alignment<Fitter>;
29 
30 struct AlignmentFunctionImpl
32  Alignment align;
33 
34  AlignmentFunctionImpl(Alignment&& a) : align(std::move(a)) {}
35 
37  const std::vector<std::vector<ActsExamples::IndexSourceLink>>&
38  sourceLinks,
39  const ActsExamples::TrackParametersContainer& initialParameters,
42  const override {
43  return align.align(sourceLinks, initialParameters, options);
44  };
45 };
46 } // namespace
47 
48 std::shared_ptr<ActsExamples::AlignmentAlgorithm::AlignmentFunction>
50  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
51  std::shared_ptr<const Acts::MagneticFieldProvider> magneticField) {
52  Stepper stepper(std::move(magneticField));
53  Acts::Navigator::Config cfg{std::move(trackingGeometry)};
54  cfg.resolvePassive = false;
55  cfg.resolveMaterial = true;
56  cfg.resolveSensitive = true;
58  Propagator propagator(std::move(stepper), std::move(navigator));
59  Fitter trackFitter(std::move(propagator));
60  Alignment alignment(std::move(trackFitter));
61 
62  // build the alignment functions. owns the alignment object.
63  return std::make_shared<AlignmentFunctionImpl>(std::move(alignment));
64 }