Skip to content

feat: example misalignment specification for trackers#1074

Open
wdconinc wants to merge 1 commit into
mainfrom
misaligned-tracker
Open

feat: example misalignment specification for trackers#1074
wdconinc wants to merge 1 commit into
mainfrom
misaligned-tracker

Conversation

@wdconinc

@wdconinc wdconinc commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce?

This PR adds an example misalignment specification for the silicon trackers. It doesn't represent any real misalignments, of course, but in some sense it represents the rotation and translation matrices, and the pivot definition (not included) that we can then subsequently try to deduce from tracking performance in millepede.

These are detector-level misalignments, but it should be clear from this how to define LAS-level misalignments as well.

Once we get further along (i.e. 2030s) we can put the plugin definitions into teach relevant geometry definition file, and keep the global_alignment files named in parallel. That would likely have better cohesion but would enable misalignment for all runs, not just those where we add the extra compact file to the compactFile arguments.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue: misaligned tracking simulations)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

Copilot AI review requested due to automatic review settings April 8, 2026 03:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an example detector-level misalignment specification for the silicon tracking detectors and a compact “glue” file intended to apply those deltas in ddsim runs.

Changes:

  • Introduces a global_alignment XML describing sample rigid-body translation/rotation deltas per silicon tracker DetElement.
  • Adds a compact XML intended to be passed via --compactFile to load/apply the misalignment file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
calibrations/alignment/silicon_misalignment.xml Defines example per-layer alignment deltas (translations/rotations) for silicon tracker DetElements.
calibrations/alignment/silicon_misalignment_compact.xml Provides a compact file intended to load/apply the misalignment deltas when appended to ddsim --compactFile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +30
The <plugins><include></include></plugins> mechanism causes DD4hep to call
fromXML() on the referenced file. Because that file has a <global_alignment/>
root element, DD4hep dispatches it to the DDAlign global_alignment_XML_reader
plugin, which auto-installs the GlobalAlignmentCache and applies the deltas
to the in-memory TGeo geometry before Geant4 geometry construction begins.

To revert to nominal geometry, simply omit this file from --compactFile.
</comment>

<plugins>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>
</plugins>

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this repository, <plugins> blocks consistently contain <plugin ...> elements (e.g. compact/tracking/silicon_disks.xml:414-439), while <include ref="..."/> is used as a direct child of <lccdd> (e.g. compact/ecal/bic_default.xml:20). Placing <include ref="silicon_misalignment.xml"/> inside <plugins> here is likely ignored by the compact parser, so the misalignment XML may never be loaded. Move the <include> to be a direct child of <lccdd> (or, if DD4hep truly requires a plugin hook for this, use an explicit <plugin ...> invocation that is known to work in this codebase).

Suggested change
The <plugins><include></include></plugins> mechanism causes DD4hep to call
fromXML() on the referenced file. Because that file has a <global_alignment/>
root element, DD4hep dispatches it to the DDAlign global_alignment_XML_reader
plugin, which auto-installs the GlobalAlignmentCache and applies the deltas
to the in-memory TGeo geometry before Geant4 geometry construction begins.
To revert to nominal geometry, simply omit this file from --compactFile.
</comment>
<plugins>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>
</plugins>
The direct <include ref="..."/> entry causes DD4hep to call fromXML() on
the referenced file. Because that file has a <global_alignment/> root
element, DD4hep dispatches it to the DDAlign global_alignment_XML_reader
plugin, which auto-installs the GlobalAlignmentCache and applies the deltas
to the in-memory TGeo geometry before Geant4 geometry construction begins.
To revert to nominal geometry, simply omit this file from --compactFile.
</comment>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +30
The <plugins><include></include></plugins> mechanism causes DD4hep to call
fromXML() on the referenced file. Because that file has a <global_alignment/>
root element, DD4hep dispatches it to the DDAlign global_alignment_XML_reader
plugin, which auto-installs the GlobalAlignmentCache and applies the deltas
to the in-memory TGeo geometry before Geant4 geometry construction begins.

To revert to nominal geometry, simply omit this file from --compactFile.
</comment>

<plugins>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>
</plugins>

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanatory comment describes a <plugins><include></include></plugins> loading mechanism and dispatch to global_alignment_XML_reader. Since the repo’s established pattern is to use <include ref="..."/> at the <lccdd> top level (and <plugins> for <plugin> elements), this description is likely inaccurate/misleading and should be updated to match the actual mechanism used after the file is corrected.

Suggested change
The <plugins><include></include></plugins> mechanism causes DD4hep to call
fromXML() on the referenced file. Because that file has a <global_alignment/>
root element, DD4hep dispatches it to the DDAlign global_alignment_XML_reader
plugin, which auto-installs the GlobalAlignmentCache and applies the deltas
to the in-memory TGeo geometry before Geant4 geometry construction begins.
To revert to nominal geometry, simply omit this file from --compactFile.
</comment>
<plugins>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>
</plugins>
This compact file uses a top-level <include ref="silicon_misalignment.xml"/>
to load the DDAlign global_alignment XML alongside the main geometry.
DD4hep then processes that included file according to its root element,
allowing the alignment deltas to be applied to the in-memory TGeo geometry
before Geant4 geometry construction begins.
To revert to nominal geometry, simply omit this file from --compactFile.
</comment>
<!-- Load the misalignment deltas from the DDAlign global_alignment XML. -->
<include ref="silicon_misalignment.xml"/>

Copilot uses AI. Check for mistakes.

<comment>Inner Tracker Endcap +z (InnerTrackerEndcapP, layer 1)</comment>
<detelement path="/world/InnerSiTrackerSubAssembly/InnerTrackerEndcapP/InnerTrackerEndcapP_layer1_P">
<comment>80 um axial (z) shift; 0.1 mrad tilt about x, 0.05 mrad about y</comment>

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detelement comment says this is an “80 um axial (z) shift”, but the corresponding <position> also applies a 50 um x-shift (x="0.050*mm"). Either update the comment to mention the x-shift as well, or adjust the values so the comment matches the configured delta.

Suggested change
<comment>80 um axial (z) shift; 0.1 mrad tilt about x, 0.05 mrad about y</comment>
<comment>50 um shift in x, 80 um axial (z) shift; 0.1 mrad tilt about x, 0.05 mrad about y</comment>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants