Skip to content

Commit

Permalink
merge branch main in
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-russo committed Oct 25, 2023
2 parents 7781aa4 + b4be75f commit 09f4d8e
Show file tree
Hide file tree
Showing 54 changed files with 1,123 additions and 424 deletions.
6 changes: 3 additions & 3 deletions CI/physmon/fpe_masks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"Fatras/include/ActsFatras/Physics/ElectroMagnetic/BetheHeitler.hpp:66":
FLTUND: 1
"Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp:177":
FLTUND: 1
"Core/include/Acts/TrackFitting/detail/GsfUtils.hpp:197":
FLTUND: 1
FLTUND: 1
"Core/include/Acts/TrackFitting/detail/GsfUtils.hpp:201":
FLTUND: 1
"Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp:120":
FLTUND: 1
Binary file modified CI/physmon/reference/performance_ambi_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_gsf.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_truth_tracking.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_ttbar_hist.root
Binary file not shown.
6 changes: 6 additions & 0 deletions CI/physmon/workflows/physmon_track_finding_ttbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(235, 236),
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(235, 236),
Expand Down
4 changes: 2 additions & 2 deletions CI/physmon/workflows/physmon_truth_tracking_gsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500,
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Expand All @@ -23,8 +23,8 @@
tp = Path(temp)
runTruthTrackingGsf(
setup.trackingGeometry,
setup.digiConfig,
setup.field,
setup.digiConfig,
outputDir=tp,
s=s,
)
Expand Down
2 changes: 1 addition & 1 deletion CI/physmon/workflows/physmon_truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
runTruthTrackingKalman(
setup.trackingGeometry,
setup.field,
digiConfigFile=setup.digiConfig,
setup.digiConfig,
outputDir=tp,
s=s,
)
Expand Down
24 changes: 24 additions & 0 deletions Core/include/Acts/Detector/Blueprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
namespace Acts {
namespace Experimental {

class IGeometryIdGenerator;
class IInternalStructureBuilder;
class IRootVolumeFinderBuilder;

/// A Blueprint is an instruction tree that allows you to defina a tree sequence
/// of volume building using the provided tools.
Expand Down Expand Up @@ -87,6 +89,12 @@ struct Node final {
std::vector<std::unique_ptr<Node>> children = {};
/// Branch definition binning
std::vector<BinningValue> binning = {};

/// Builders and helper tools that can be attached
std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
nullptr;
/// Geometry id generator
std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
/// Internal structure builder - for leaf nodes
std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr;

Expand Down Expand Up @@ -144,6 +152,22 @@ struct Node final {
ss << name << " -> " << name + "_int"
<< ";" << '\n';
}

if (geoIdGenerator != nullptr) {
ss << name + "_geoID"
<< " [shape=\"note\";style=\"filled\";fillcolor=\"azure\"];" << '\n';
ss << name << " -> " << name + "_geoID"
<< ";" << '\n';
}

if (rootVolumeFinderBuilder != nullptr) {
ss << name + "_roots"
<< " [shape=\"Msquare\";style=\"filled\";fillcolor=\"darkkhaki\"];"
<< '\n';
ss << name << " -> " << name + "_roots"
<< ";" << '\n';
}

if (isRoot()) {
ss << "}" << '\n';
}
Expand Down
28 changes: 26 additions & 2 deletions Core/include/Acts/Detector/CylindricalContainerBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma once

#include "Acts/Detector/Blueprint.hpp"
#include "Acts/Detector/DetectorComponents.hpp"
#include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
Expand All @@ -30,6 +31,10 @@ class IGeometryIdGenerator;
/// and allows for DetectorVolume attachment in z/r/phi, such as wrapping
/// of bevelled cylinder objects in z/r
///
/// There exists an option to create this container builder (recursively)
/// from a blueprint tree, which attempts to fill in the gap volumes
/// accordingly.
///
/// @note the builder expects a fully consistent set of sub volume builders
/// that will be executed in a chain
///
Expand All @@ -45,7 +50,8 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
/// Binning prescription of attachment
std::vector<BinningValue> binning = {};
/// The root volume finder
std::shared_ptr<IRootVolumeFinderBuilder> rootVolumeFinderBuilder = nullptr;
std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
nullptr;
/// The geometry id generator
std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
/// An eventual reverse geometry id generation
Expand All @@ -54,7 +60,7 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
std::string auxiliary = "";
};

/// Constructor with configuration arguments
/// Constructor with configuration struct
///
/// @param cfg is the configuration struct
/// @param logger logging instance for screen output
Expand All @@ -63,6 +69,24 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
std::unique_ptr<const Logger> logger =
getDefaultLogger("CylindricalContainerBuilder", Logging::INFO));

/// Constructor from blueprint and logging level
///
/// It will create recursively the builders of sub volumes
///
/// @param bpNode is the entry blue print node
/// @param logLevel is the logging output level for the builder tools
///
/// @note no checking is being done on consistency of the blueprint,
/// it is assumed it has passed first through gap filling via the
/// blueprint helper.
///
/// @note that the naming of the builders is taken from the bluprint nodes
///
/// @return a cylindrical container builder representing this blueprint
CylindricalContainerBuilder(
const Acts::Experimental::Blueprint::Node& bpNode,
Acts::Logging::Level logLevel = Acts::Logging::INFO);

/// The final implementation of the cylindrical container builder
///
/// @param gctx The geometry context for this call
Expand Down
2 changes: 0 additions & 2 deletions Core/include/Acts/Detector/DetectorVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#include "Acts/Detector/DetectorComponents.hpp"
#include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
#include "Acts/Detector/interface/IExternalStructureBuilder.hpp"
#include "Acts/Detector/interface/IInternalStructureBuilder.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/Logger.hpp"

Expand Down
8 changes: 6 additions & 2 deletions Core/include/Acts/EventData/GenericBoundTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma once

#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/EventData/detail/PrintParameters.hpp"
#include "Acts/EventData/detail/TransformationFreeToBound.hpp"
#include "Acts/Surfaces/Surface.hpp"
Expand Down Expand Up @@ -82,16 +83,19 @@ class GenericBoundTrackParameters {
/// @param qOverP Charge over momentum
/// @param cov Bound parameters covariance matrix
/// @param particleHypothesis Particle hypothesis
/// @param tolerance Tolerance used for globalToLocal
///
/// @note The returned result indicates whether the free parameters could
/// successfully be converted to on-surface parameters.
static Result<GenericBoundTrackParameters> create(
std::shared_ptr<const Surface> surface, const GeometryContext& geoCtx,
const Vector4& pos4, const Vector3& dir, Scalar qOverP,
std::optional<CovarianceMatrix> cov,
ParticleHypothesis particleHypothesis) {
ParticleHypothesis particleHypothesis,
ActsScalar tolerance = s_onSurfaceTolerance) {
Result<BoundVector> bound = detail::transformFreeToBoundParameters(
pos4.segment<3>(ePos0), pos4[eTime], dir, qOverP, *surface, geoCtx);
pos4.segment<3>(ePos0), pos4[eTime], dir, qOverP, *surface, geoCtx,
tolerance);

if (!bound.ok()) {
return bound.error();
Expand Down
16 changes: 15 additions & 1 deletion Core/include/Acts/EventData/TrackProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,19 +673,33 @@ class TrackProxy {
/// "innermost" track state
/// @note This is dangerous with branching track state sequences, as it will break them
/// @note This also automatically forward-links the track!
/// @param invertJacobians Whether to invert the Jacobians of the track states
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void reverseTrackStates() {
void reverseTrackStates(bool invertJacobians = false) {
IndexType current = tipIndex();
IndexType next = kInvalid;
IndexType prev = kInvalid;

stemIndex() = tipIndex();

// @TODO: Maybe refactor to not need this variable if invertJacobians == false
BoundMatrix nextJacobian;

while (current != kInvalid) {
auto ts = m_container->trackStateContainer().getTrackState(current);
prev = ts.previous();
ts.template component<IndexType>(hashString("next")) = prev;
ts.previous() = next;
if (invertJacobians) {
if (next != kInvalid) {
BoundMatrix curJacobian = ts.jacobian();
ts.jacobian() = nextJacobian.inverse();
nextJacobian = curJacobian;
} else {
nextJacobian = ts.jacobian();
ts.jacobian().setZero();
}
}
next = current;
tipIndex() = current;
current = prev;
Expand Down
25 changes: 14 additions & 11 deletions Core/include/Acts/Vertexing/AMVFInfo.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2019 CERN for the benefit of the Acts project
// Copyright (C) 2019-2023 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -21,31 +21,34 @@ template <typename input_track_t>
struct VertexInfo {
VertexInfo() = default;

VertexInfo(const Acts::Vertex<input_track_t>& vtx, const Acts::Vector4& pos)
: constraintVertex(vtx),
VertexInfo(const Acts::Vertex<input_track_t>& constr,
const Acts::Vector4& pos)
: constraint(constr),
linPoint(pos),
oldPosition(pos),
seedPosition(pos) {}

// The constraint vertex
Acts::Vertex<input_track_t> constraintVertex;
// Vertex constraint
Acts::Vertex<input_track_t> constraint;

// The linearization point
// Point where all associated tracks are linearized
Acts::Vector4 linPoint{Acts::Vector4::Zero()};

// Old position from last iteration
// Vertex position from the last iteration of the fit
Acts::Vector4 oldPosition{Acts::Vector4::Zero()};

// The seed position
// The seed position (i.e., the first estimate for the vertex position as
// obtained by the vertex seed finder)
Acts::Vector4 seedPosition{Acts::Vector4::Zero()};

// Needs relinearization bool
// If set to true, the associated tracks need to be relinearized at a more
// recent vertex position
bool relinearize = true;

// Vector of all track currently held by vertex
// Vector of all tracks that are currently assigned to vertex
std::vector<const input_track_t*> trackLinks;

std::map<const input_track_t*, const BoundTrackParameters> ip3dParams;
std::map<const input_track_t*, const BoundTrackParameters> impactParams3D;
};

} // namespace Acts
Loading

0 comments on commit 09f4d8e

Please sign in to comment.