Skip to content

Commit

Permalink
Merge branch 'main' into surface-concept
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 21, 2023
2 parents 723df2a + 3d1dc45 commit dc26178
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct Gx2FitterOptions {
/// @param freeToBoundCorrection_ Correction for non-linearity effect during transform from free to bound
/// @param nUpdateMax_ Max number of iterations for updating the parameters
/// @param zeroField_ Disables the QoP fit in case of missing B-field
/// @param relChi2changeCutOff_ Check for convergence (abort condition)
/// @param relChi2changeCutOff_ Check for convergence (abort condition). Set to 0 to skip.
Gx2FitterOptions(const GeometryContext& gctx,
const MagneticFieldContext& mctx,
std::reference_wrapper<const CalibrationContext> cctx,
Expand Down
2 changes: 2 additions & 0 deletions Core/include/Acts/Vertexing/FullBilloirVertexFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class FullBilloirVertexFitter {
/// @brief Constructor used if input_track_t type == BoundTrackParameters
///
/// @param cfg Configuration object
/// @param logger Logging instance
template <
typename T = input_track_t,
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value, int> = 0>
Expand All @@ -85,6 +86,7 @@ class FullBilloirVertexFitter {
/// @param cfg Configuration object
/// @param func Function extracting BoundTrackParameters from input_track_t
/// object
/// @param logger Logging instance
FullBilloirVertexFitter(
const Config& cfg,
std::function<BoundTrackParameters(input_track_t)> func,
Expand Down
1 change: 1 addition & 0 deletions Core/include/Acts/Vertexing/ImpactPointEstimator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class ImpactPointEstimator {
/// @brief Constructor
///
/// @param cfg Configuration object
/// @param logger Logging instance
ImpactPointEstimator(const Config& cfg,
std::unique_ptr<const Logger> logger = getDefaultLogger(
"ImpactPointEstimator", Logging::INFO))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,18 @@ std::shared_ptr<TrackFitterFunction> makeGsfFitterFunction(
/// @param multipleScattering bool
/// @param energyLoss bool
/// @param freeToBoundCorrection bool
/// @param nUpdateMax max number of iterations during the fit
/// @param zerofield Disables the QoP fit in case of missing B-field.
/// @param relChi2changeCutOff Check for convergence (abort condition). Set to 0 to skip.
/// @param logger a logger instance
std::shared_ptr<TrackFitterFunction> makeGlobalChiSquareFitterFunction(
std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
bool multipleScattering = true, bool energyLoss = true,
Acts::FreeToBoundCorrection freeToBoundCorrection =
Acts::FreeToBoundCorrection(),
std::size_t nUpdateMax = 5, bool zeroField = false,
double relChi2changeCutOff = 1e-7,
const Acts::Logger& logger = *Acts::getDefaultLogger("Gx2f",
Acts::Logging::INFO));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ struct GlobalChiSquareFitterFunctionImpl final : public TrackFitterFunction {
bool multipleScattering = false;
bool energyLoss = false;
Acts::FreeToBoundCorrection freeToBoundCorrection;
std::size_t nUpdateMax = 5;
bool zeroField = false;
double relChi2changeCutOff = 1e-7;

IndexSourceLink::SurfaceAccessor m_slSurfaceAccessor;

Expand All @@ -91,7 +94,8 @@ struct GlobalChiSquareFitterFunctionImpl final : public TrackFitterFunction {
const Acts::Experimental::Gx2FitterOptions gx2fOptions(
options.geoContext, options.magFieldContext, options.calibrationContext,
extensions, options.propOptions, &(*options.referenceSurface),
multipleScattering, energyLoss, freeToBoundCorrection, 5);
multipleScattering, energyLoss, freeToBoundCorrection, nUpdateMax,
zeroField, relChi2changeCutOff);

return gx2fOptions;
}
Expand Down Expand Up @@ -127,8 +131,8 @@ ActsExamples::makeGlobalChiSquareFitterFunction(
std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
bool multipleScattering, bool energyLoss,
Acts::FreeToBoundCorrection freeToBoundCorrection,
const Acts::Logger& logger) {
Acts::FreeToBoundCorrection freeToBoundCorrection, std::size_t nUpdateMax,
bool zeroField, double relChi2changeCutOff, const Acts::Logger& logger) {
// Stepper should be copied into the fitters
const Stepper stepper(std::move(magneticField));

Expand Down Expand Up @@ -157,6 +161,9 @@ ActsExamples::makeGlobalChiSquareFitterFunction(
fitterFunction->multipleScattering = multipleScattering;
fitterFunction->energyLoss = energyLoss;
fitterFunction->freeToBoundCorrection = freeToBoundCorrection;
fitterFunction->nUpdateMax = nUpdateMax;
fitterFunction->zeroField = zeroField;
fitterFunction->relChi2changeCutOff = relChi2changeCutOff;

return fitterFunction;
}
7 changes: 6 additions & 1 deletion Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,10 +1113,12 @@ def addGx2fTracks(
s: acts.examples.Sequencer,
trackingGeometry: acts.TrackingGeometry,
field: acts.MagneticFieldProvider,
# directNavigation: bool = False,
inputProtoTracks: str = "truth_particle_tracks",
multipleScattering: bool = False,
energyLoss: bool = False,
nUpdateMax: int = 5,
zeroField: bool = False,
relChi2changeCutOff: float = 1e-7,
clusters: str = None,
calibrator: acts.examples.MeasurementCalibrator = acts.examples.makePassThroughCalibrator(),
logLevel: Optional[acts.logging.Level] = None,
Expand All @@ -1127,6 +1129,9 @@ def addGx2fTracks(
"multipleScattering": multipleScattering,
"energyLoss": energyLoss,
"freeToBoundCorrection": acts.examples.FreeToBoundCorrection(False),
"nUpdateMax": nUpdateMax,
"zeroField": zeroField,
"relChi2changeCutOff": relChi2changeCutOff,
"level": customLogLevel(),
}

Expand Down
10 changes: 5 additions & 5 deletions Examples/Python/src/TrackFitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ void addTrackFitting(Context& ctx) {
std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
bool multipleScattering, bool energyLoss,
Acts::FreeToBoundCorrection freeToBoundCorrection,
std::size_t nUpdateMax, bool zeroField, double relChi2changeCutOff,
Logging::Level level) {
return ActsExamples::makeGlobalChiSquareFitterFunction(
trackingGeometry, magneticField, multipleScattering, energyLoss,
freeToBoundCorrection, *Acts::getDefaultLogger("Gx2f", level));
freeToBoundCorrection, nUpdateMax, zeroField, relChi2changeCutOff,
*Acts::getDefaultLogger("Gx2f", level));
},
py::arg("trackingGeometry"), py::arg("magneticField"),
py::arg("multipleScattering"), py::arg("energyLoss"),
py::arg("freeToBoundCorrection"), py::arg("level"));

// TODO add other important parameters like nUpdates
// TODO add also in trackfitterfunction
py::arg("freeToBoundCorrection"), py::arg("nUpdateMax"),
py::arg("zeroField"), py::arg("relChi2changeCutOff"), py::arg("level"));
}

{
Expand Down
7 changes: 4 additions & 3 deletions Examples/Scripts/Python/truth_tracking_gx2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ def runTruthTrackingGx2f(
s,
trackingGeometry,
field,
# directNavigation,
nUpdateMax=17,
relChi2changeCutOff=1e-7,
)

# Output
s.addWriter(
acts.examples.RootTrajectoryStatesWriter(
acts.examples.RootTrackStatesWriter(
level=acts.logging.INFO,
inputTracks="tracks",
inputParticles="truth_seeds_selected",
Expand All @@ -112,7 +113,7 @@ def runTruthTrackingGx2f(
)

s.addWriter(
acts.examples.RootTrajectorySummaryWriter(
acts.examples.RootTrackSummaryWriter(
level=acts.logging.INFO,
inputTracks="tracks",
inputParticles="truth_seeds_selected",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ inline BinningValue stringToBinningValue(const std::string &binningString) {
/// e.g. "r,z" -> {binR, binZ}
///
/// @param binningString
/// @param del the delimiter for the splitting
///
/// @return a vector of binninng values
inline std::vector<BinningValue> stringToBinningValues(
Expand Down

0 comments on commit dc26178

Please sign in to comment.