Skip to content

TC refitting - #1183

Closed
mgignac wants to merge 4 commits into
JeffersonLab:masterfrom
mgignac:mgignac-tc-refit
Closed

mgignac wants to merge 4 commits into
JeffersonLab:masterfrom
mgignac:mgignac-tc-refit

Conversation

@mgignac

@mgignac mgignac commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

This adds an opt-in refitTargetConstrained flag to HpsReconParticleDriver (default off, so existing behavior is unchanged), which refits target-constrained vertices after shifting the tracks to the first-pass vertex, as is already done for unconstrained and beamspot-constrained fits. BilliorVertexer.makeRk now adds the reference position back to the vertex in target-constraint mode, so the refit pins to the correct absolute target position. In 2021 prompt A′ MC, the refit removes the ~2% narrowing of the opening angle and the matching low mass bias in target-constrained vertices (about −2.4 MeV at 180 MeV). The PR also adds a steering setter for the longitudinal target-constraint width, plus a run-14272 MC steering file that fixes the beam position at (0, 0,−1.1) mm and turns the refit on.

UNCONSTRAINED and BS_CONSTRAINED vertices are refit after shifting the
tracks to the first-pass vertex, because the Billior fit linearizes the
trajectories about the reference point. TARGET_CONSTRAINED vertices were
only fit once, linearized about (0,0,0).

- HpsReconParticleDriver: add refitTargetConstrained (default false, so
  existing behaviour is unchanged) and include TARGET_CONSTRAINED in the
  refit branch of fitVertex() when it is set.
- BilliorVertexer.makeRk: in target-constraint mode, add the reference
  position back to the vertex before comparing with the absolute target
  position. This is a no-op when the reference is the origin (the
  first pass), and is needed for the refit to pin to the right point.

In 2021 prompt A' MC this removes the ~2% narrowing of the opening angle
and the matching low mass bias of the target-constrained vertex.
Variant of PhysicsRun2021MCRecon_KF_WithSpacing_pass5_physics_HitSmear_HitKill_14272.lcsim:
- beam position fixed at (x, y, z) = (0, 0, -1.1) mm (HPS frame) for
  KalmanPatRecDriver and ReconParticleDriver_Kalman, instead of being
  read from the conditions database, so it matches the MC beam;
- refitTargetConstrained enabled.
…BeamSigmaZ

beamSize[0] (tracking-frame X = detector Z) is the longitudinal width used as the target-constraint vertex covariance. Previously only sigmaX/sigmaY had setters and beamSize[0] stayed hard-wired to 1 um, over-constraining the target-constrained vertex Z and skewing post-fit track momenta. Exposes it as the <beamSigmaZ> steering knob.
rk.setElement(0, 0, _beamPosition[0] - Vx);
rk.setElement(1, 0, _beamPosition[1] - Vy);
rk.setElement(2, 0, _beamPosition[2] - Vz);
// The vertex position is relative to the reference position, so add it back

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.

I wonder if this is the whole fix? Maybe the referencePosition isn't (0,0,0), which is presumed in the previous?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I did try without the refit and only this change, but the bias was still there. Without the refit it wasnt to pull it to ~0.5mm ... between target generation point and (0,0,0)

BilliorTrack(Track) takes the parameters of the first track state, which
are defined about that state's reference point. For Kalman tracks this is
the beam spot (e.g. z = -1.1 mm), but the first-pass vertex fit assumed
the origin. The vertex position was therefore relative to the beam spot,
and the target constraint pulled it to twice the target z, closing the
e+e- opening angle by ~2% and biasing the target-constrained mass low.

- HpsReconParticleDriver: add useTrackReferencePoint (default true). In
  fitVertex(), set the vertexer reference position to the reference point
  of the first track state before the first fit, and warn if the electron
  and positron reference points differ. Set false to reproduce the
  original behaviour.

With this, target-constrained vertices no longer need refitTargetConstrained.
Unconstrained and beamspot-constrained vertices are refit about the
first-pass vertex as before, so their output is essentially unchanged.
@mgignac mgignac closed this Oct 6, 2026
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