feat: example misalignment specification for trackers#1074
Conversation
There was a problem hiding this comment.
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_alignmentXML describing sample rigid-body translation/rotation deltas per silicon tracker DetElement. - Adds a compact XML intended to be passed via
--compactFileto 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.
| 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> |
There was a problem hiding this comment.
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).
| 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"/> |
| 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> |
There was a problem hiding this comment.
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.
| 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"/> |
|
|
||
| <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> |
There was a problem hiding this comment.
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.
| <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> |
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?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.