Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/docs/pages/alignment_structure_frames.md is written in an unsupported language. File is not indexed.

0001 @page alignment_structure_frames Frames for alignable structures
0002 
0003 # Frames for alignable structures
0004 
0005 `ActsAlignment::AlignableStructure` groups surfaces and defines which rigid-body
0006 degrees of freedom may float. To use the composite Jacobians from
0007 @ref alignment_composite_jacobians, it also needs an explicit frame: an origin
0008 for the rotation pivot and an orientation for its local axes.
0009 
0010 ## Frame conventions
0011 
0012 `localToGlobalTransform(gctx)` returns the structure-to-global rigid transform.
0013 Its translation is the pivot in global coordinates; its rotation maps the
0014 structure's local axes to global axes. Structure corrections and surface
0015 alignment parameters both use local translations and local rotations, each in
0016 their own frame. `Acts::detail::compositeToComponentJacobian` maps structure
0017 corrections to the member surface's local parameters, including the rotation
0018 lever arm.
0019 
0020 Every frame returned by `localToGlobalTransform(gctx)` maps structure-local
0021 coordinates to global coordinates, including for child structures. This return
0022 convention does not require applications to store or define geometry in global
0023 coordinates. An application can express a child relative to its parent and
0024 compose the transforms in the child's callable:
0025 
0026 ```cpp
0027 const Acts::Transform3 childToGlobal = parentToGlobal * childToParent;
0028 ```
0029 
0030 Both transforms must describe the geometry for the same `GeometryContext`.
0031 The relative transform can also be recovered as
0032 `parentToGlobal.inverse() * childToGlobal`. This allows parent-relative geometry
0033 descriptions and reuse of symmetric layouts while retaining a common global
0034 representation for the derivative calculations. Alignment corrections still
0035 use each structure's own local axes.
0036 
0037 `addChild()` declares membership; it does not perform this composition or move
0038 surfaces. Automatic composition through the hierarchy, coordinated updates of
0039 member surfaces, and hierarchy constraints are not implemented by this frame
0040 API. The user chooses the pivot explicitly; it is not computed from a centroid
0041 or inferred from a geometry identifier.
0042 
0043 ## Context-independent and contextual frames
0044 
0045 A context-independent frame is copied into the structure at construction:
0046 
0047 ```cpp
0048 ActsAlignment::AlignableStructure structure(id, structureToGlobal);
0049 ```
0050 
0051 It returns the same frame for every context. This fixes the frame returned by
0052 `localToGlobalTransform()`, not the alignment degrees of freedom, which are
0053 controlled by `alignmentMask()`. The overload is useful for an explicitly
0054 chosen pivot and orientation in derivative calculations or tests, and as an
0055 initial linearisation frame for the planned structure solver. A fixed global
0056 reference frame is one possible use, but is not required.
0057 
0058 The stored frame does not follow later changes to the supplied transform or to
0059 member surfaces. A solver using it as an initial frame must maintain subsequent
0060 frame updates separately. The planned working-state mechanism is described
0061 below; the frame API does not yet implement iterative structure alignment.
0062 
0063 For a context-dependent frame, supply a callable instead. For example, an
0064 application can put its own structure transforms in a geometry-context payload:
0065 
0066 ```cpp
0067 struct StructureFrames {
0068   std::unordered_map<Acts::GeometryIdentifier, Acts::Transform3> transforms;
0069 };
0070 
0071 ActsAlignment::AlignableStructure structure(
0072     id, [id](const Acts::GeometryContext& gctx) -> Acts::Transform3 {
0073       return gctx.get<StructureFrames>().transforms.at(id);
0074     });
0075 ```
0076 
0077 The provider must return a rigid transform consistent with the member surfaces
0078 evaluated in the same context. It is called on every query and must be safe for
0079 concurrent reads. The structure owns the callable, but captured references and
0080 external conditions data remain the application's lifetime responsibility.
0081 Returned transforms are values, so callers cannot modify the provider's state
0082 through a returned reference.
0083 
0084 An iterative solver must apply a correction consistently to the structure frame
0085 and to all member surfaces before the next linearisation. The frame provider is
0086 a read interface; it does not implement these updates or mutate nominal geometry.
0087 Contextual conditions storage remains outside the Alignment library.
0088 
0089 For the planned iterative solver, providers seed working frames once per
0090 alignment call. The solver will update those working frames together with the
0091 member transforms; it must not reset them by rereading a fixed initial provider
0092 at each iteration. Final frames must be made available to seed a later alignment
0093 call. This working-state and update mechanism is not implemented by the frame
0094 API.
0095 
0096 ## Metadata-only structures and Python
0097 
0098 The existing constructor `AlignableStructure(id)` remains available for hierarchy
0099 declarations. Such a structure has `hasTransform() == false`, and querying its
0100 frame throws `std::logic_error`. There is no implicit identity frame. An empty
0101 callable is rejected with `std::invalid_argument` at construction or by
0102 `setTransform()`. A rejected replacement preserves the existing provider.
0103 
0104 A frame can also be attached after declaring the hierarchy, or replaced during
0105 configuration, using either overload:
0106 
0107 ```cpp
0108 ActsAlignment::AlignableStructure structure(id);
0109 structure.setTransform(structureToGlobal);
0110 structure.setTransform(frameProvider);
0111 ```
0112 
0113 The transform overload stores a copy; the callable overload owns the provider.
0114 Neither overload moves member surfaces. Callers must ensure there are no
0115 concurrent readers or writers while replacing a provider. Ordinary IOV changes
0116 should use `GeometryContext` with the installed provider. Replacing the frame
0117 alone does not apply a coordinated alignment correction to the member surfaces.
0118 
0119 Python exposes the same choices:
0120 
0121 ```python
0122 from acts.examples.alignment import AlignableStructure
0123 
0124 fixed = AlignableStructure(id, transform=structure_to_global)
0125 contextual = AlignableStructure(id, transformProvider=frame_provider)
0126 assert fixed.hasTransform
0127 frame = contextual.localToGlobalTransform(gctx)
0128 
0129 late_bound = AlignableStructure(id)
0130 late_bound.setTransform(transform=structure_to_global)
0131 late_bound.setTransform(transformProvider=frame_provider)
0132 ```
0133 
0134 ## Structure derivatives
0135 
0136 With a structure frame, `ActsAlignment::detail::alignmentToBoundDerivative`
0137 differentiates the track's bound parameters with respect to translations along
0138 and rotations about the structure's local axes. Use a frame consistent with the
0139 member surface in the same `GeometryContext`, including when the frame comes from
0140 the current iteration of a fit. This example uses the immediate owner from a
0141 validated `AlignmentHierarchy`:
0142 
0143 ```cpp
0144 const auto* owner = hierarchy.structureFor(surface);
0145 if (owner != nullptr) {
0146   const Acts::Transform3 currentFrame = owner->localToGlobalTransform(gctx);
0147   const auto derivative = ActsAlignment::detail::alignmentToBoundDerivative(
0148       gctx, surface, position, direction, pathDerivative,
0149       owner->alignmentMask(), &currentFrame);
0150   // For measurement minus prediction, the residual derivative is
0151   // -H * derivative, where H projects into measurement coordinates.
0152 }
0153 ```
0154 
0155 The helper multiplies the unmasked surface derivative by
0156 `compositeToComponentJacobian(currentFrame, surfaceTransform)` and then masks
0157 columns in structure coordinates. Masking surface columns before the conversion
0158 could discard contributions from those surface axes to an active structure
0159 parameter. Without a structure frame, the helper differentiates
0160 with respect to local surface translations and rotations and applies the mask
0161 in the surface frame.
0162 
0163 This helper does not activate structure solving. The native solver still uses
0164 module indexing and calls it without a structure frame. Shared parameter
0165 indexing, structure accumulation, and rigid member updates remain follow-up
0166 work.