Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ public class HpsReconParticleDriver extends ReconParticleDriver {
private double[] beamPositionToUse = new double[3];
private boolean requireClustersForV0 = true;

/**
* Whether the first-pass vertex fit uses the reference point of the
* input track states. Kalman perigee states are defined about the beam
* spot (e.g. z = -1.1 mm), not the origin; without this the fitter
* assumes the origin, which biases target-constrained fits (the vertex
* is pulled to twice the target z and the opening angle closes by ~2%).
* On by default; set false to reproduce the original (pass5 and earlier)
* behaviour.
*/
private boolean useTrackReferencePoint = true;

/**
* Represents a type of constraint for vertex fitting.
*
Expand Down Expand Up @@ -283,6 +294,17 @@ public void setStoreCovTrkMomList(boolean b) {
public void setRequireClustersForV0(boolean b) {
this.requireClustersForV0 = b;
}

/**
* Set whether the first-pass vertex fit is done about the reference
* point of the input track states instead of the origin (default true).
* Set false only to reproduce the original behaviour.
*
* @param b True to use the track state reference point
*/
public void setUseTrackReferencePoint(boolean b) {
this.useTrackReferencePoint = b;
}

public void setUnconstrainedMollerCandidatesColName(String s)
{
Expand Down Expand Up @@ -545,6 +567,22 @@ private BilliorVertex fitVertex(Constraint constraint, ReconstructedParticle ele
break;
}

// The Billior tracks carry the parameters of the first track state,
// which are defined about that state's reference point (tracking
// frame). Fit about the same point so that the vertex position and
// the beam/target constraints are computed in absolute coordinates.
if (useTrackReferencePoint) {
double[] eleRef = electron.getTracks().get(0).getTrackStates().get(0).getReferencePoint();
double[] posRef = positron.getTracks().get(0).getTrackStates().get(0).getReferencePoint();
if (Math.abs(eleRef[0] - posRef[0]) > 1e-6 || Math.abs(eleRef[1] - posRef[1]) > 1e-6
|| Math.abs(eleRef[2] - posRef[2]) > 1e-6) {
LOGGER.warning(String.format("Electron and positron track reference points differ: "
+ "(%f, %f, %f) vs (%f, %f, %f); using the electron's.",
eleRef[0], eleRef[1], eleRef[2], posRef[0], posRef[1], posRef[2]));
}
vtxFitter.setReferencePosition(eleRef);
}

// Add the electron and positron tracks to a track list for
// the vertex fitter.
List<BilliorTrack> billiorTracks = new ArrayList<BilliorTrack>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ public void setBeamSigmaY(double sigmaY) {
beamSize[2] = sigmaY; // The beamsize array is in the tracking frame HPS Y => TRACK Z
}

/**
* Sets the beam size sigma in the z-direction.
*
* @param sigmaZ - The standard deviation of the beam width in the
* z-direction (beam/target longitudinal spread).
*/
public void setBeamSigmaZ(double sigmaZ) {
beamSize[0] = sigmaZ; // The beamsize array is in the tracking frame HPS Z => TRACK X
}

/**
* Sets the beam position in the z-direction in mm.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,12 @@ private BasicMatrix makeRk(double Vx, double Vy, double Vz, double pxtot, double
rk.setElement(1, 0, _beamPosition[1] - ((Vy + _referencePosition[1]) - pytot / pxtot * (Vx - _beamPosition[0] + _referencePosition[0])));
rk.setElement(2, 0, _beamPosition[2] - ((Vz + _referencePosition[2]) - pztot / pxtot * (Vx - _beamPosition[0] + _referencePosition[0])));
} else {
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 (the reference
// point of the input track states, or the previous vertex for a refit), so add
// it back before comparing with the (absolute) target position.
rk.setElement(0, 0, _beamPosition[0] - (Vx + _referencePosition[0]));
rk.setElement(1, 0, _beamPosition[1] - (Vy + _referencePosition[1]));
rk.setElement(2, 0, _beamPosition[2] - (Vz + _referencePosition[2]));
}
if (_debug)
System.out.println("makeRk::rk = (" + rk.e(0, 0) + ", " + rk.e(1, 0) + ", " + rk.e(2, 0) + ")");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8"?>
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
<!--
Steering file for pass-5 2021 reconstruction on MC readout data
created: 12/18/2025
@author Matthew Gignac <mgignac@slac.stanford.edu>, Sarah Gaiser <sgaiser@slac.stanford.edu>

Fixed-beam-position variant of
PhysicsRun2021MCRecon_KF_WithSpacing_pass5_physics_HitSmear_HitKill_14272.lcsim.
The beam position is NOT read from the conditions database (which puts the
target-constrained vertex at x = +0.091, y = -0.021 mm while the MC beam is
at x = y = 0); it is fixed from this file instead:
[ Z, X, Y ] = [ -1.1, 0.0, 0.0 ] mm (HPS frame), sigmas unchanged
(x 0.055, y 0.045, z = code default 0.001 mm).
Only these drivers differ from the original:
KalmanPatRecDriver: useBeamPositionConditions false, beamPositionX/Y 0.0
ReconParticleDriver_Kalman: useBeamPositionConditions false, beamPositionX/Y 0.0,
deprecated useInternalVertexXYPositions removed
(it is an alias that also sets useBeamPositionConditions)
The longitudinal width of the target constraint can optionally be set with
<beamSigmaZ> (mm) in ReconParticleDriver_Kalman; it is left at the code default.
-->
<execute>

<driver name="EventMarkerDriver"/>

<!-- Ecal reconstruction drivers -->
<driver name="EcalRawConverter" />
<driver name="EcalTimeCorrection"/>
<driver name="ReconClusterer" />
<driver name="CopyCluster" />

<!-- Hodoscope drivers -->
<driver name="HodoRunningPedestal"/>
<driver name="HodoRawConverter"/>

<!-- SVT reconstruction drivers -->
<driver name="RawTrackerHitSensorSetup"/>
<driver name="RawTrackerHitFitterDriver" />
<driver name="RawHitTimeSmearer"/>
<driver name="TrackerHitDriver"/>
<driver name="StripHitKiller"/>


<driver name="StripHitNHitsSmearer"/>


<driver name="KalmanPatRecDriver"/>
<driver name="TrackTimeSmearer"/>
<driver name="TrackTruthMatching_KF"/>
<driver name="ReconParticleDriver_Kalman" />



<!-- Event filtering -->
<driver name="LCIOWriter"/>
<driver name="AidaSaveDriver"/>
<driver name="CleanupDriver"/>

</execute>
<drivers>
<driver name="SVTHitEfficiency" type="org.hps.recon.tracking.kalman.SvtHitEfficiencyKalman">
<maxLayer>14</maxLayer>
<useTrkTimeCut>false</useTrkTimeCut>
<!--<trkTimeCut>10.0</trkTimeCut> -->
<!-- <trkTimeMean>15.0</trkTimeMean> -->
<debug>false</debug>
</driver>
<driver name="StripHitKiller" type="org.hps.recon.tracking.StripHitKiller">
<ratioFiles>pass5v9run14272_L1b_axial_hole.txt pass5v9run14272_L1b_stereo_hole.txt pass5v9run14272_L1t_axial_hole.txt pass5v9run14272_L1t_stereo_hole.txt pass5v9run14272_L2b_axial_hole.txt pass5v9run14272_L2b_stereo_hole.txt pass5v9run14272_L2t_axial_hole.txt pass5v9run14272_L2t_stereo_hole.txt</ratioFiles>
<debug>false</debug>
</driver>
<driver name="RawHitTimeSmearer" type="org.hps.recon.tracking.RawHitTimeSmearer">
<smearTimeFile>timeSmearing-2nsL4L7-4nsL1L3.txt</smearTimeFile>
<debug>false</debug>
</driver>
<driver name="TrackTimeSmearer" type="org.hps.recon.tracking.TrackTimeSmearer">
<debug>false</debug>
<smearBottom>0.8</smearBottom>
<smearTop>0.8</smearTop>
</driver>
<driver name="StripHitNHitsSmearer" type="org.hps.recon.tracking.StripHitNHitsSmearer">
<smearPositionFile>posSmearing_pass5_v9.txt</smearPositionFile>
<debug>false</debug>
</driver>
<driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
<eventInterval>1000</eventInterval>
</driver>
<driver name="HodoRunningPedestal" type="org.hps.recon.ecal.HodoRunningPedestalDriver">
<inputCollectionName>HodoscopeReadoutHits</inputCollectionName>
<logLevel>CONFIG</logLevel>
<isMC>true</isMC>
</driver>
<driver name="HodoRawConverter" type="org.hps.recon.ecal.HodoRawConverterDriver">
<inputCollectionName>HodoscopeReadoutHits</inputCollectionName>
<tETAllChannels>8</tETAllChannels>
<logLevel>CONFIG</logLevel>
<isMC>true</isMC>
</driver>

<!-- Ecal reconstruction drivers -->
<driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverter2Driver">
</driver>
<driver name="EcalTimeCorrection" type="org.hps.recon.ecal.EcalTimeCorrectionDriver">
<additionalShift>13.3</additionalShift>
</driver>
<driver name="ReconClusterer" type="org.hps.recon.ecal.cluster.ReconClusterDriver">
<logLevel>WARNING</logLevel>
<outputClusterCollectionName>EcalClusters</outputClusterCollectionName>
</driver>
<driver name="CopyCluster" type="org.hps.recon.ecal.cluster.CopyClusterCollectionDriver">
<inputCollectionName>EcalClusters</inputCollectionName>
<outputCollectionName>EcalClustersCorr</outputCollectionName>
</driver>
<!-- SVT reconstruction drivers -->
<driver name="RawTrackerHitSensorSetup" type="org.lcsim.recon.tracking.digitization.sisim.config.RawTrackerHitSensorSetup">
<readoutCollections>SVTRawTrackerHits</readoutCollections>
</driver>
<driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver">
<chiSqrThresh>.5</chiSqrThresh>
<doOldDT>1</doOldDT>
<fitAlgorithm>Pileup</fitAlgorithm>
<fitTimeMinimizer>Migrad</fitTimeMinimizer>
<useTimestamps>true</useTimestamps>
<tsCorrectionScale>165</tsCorrectionScale>
<correctTimeOffset>true</correctTimeOffset>
<correctT0Shift>true</correctT0Shift>
<useTruthTime>false</useTruthTime>
<subtractTOF>true</subtractTOF>
<subtractTriggerTime>false</subtractTriggerTime>
<correctChanT0>false</correctChanT0>
<isMC>true</isMC>
<debug>false</debug>
</driver>
<driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
<neighborDeltaT>24.0</neighborDeltaT>
<neighborDeltaTSigma>3.0</neighborDeltaTSigma>
<saveMonsterEvents>false</saveMonsterEvents>
<thresholdMonsterEvents>400</thresholdMonsterEvents>
<clusterSeedThreshold>4.0</clusterSeedThreshold>
<doTimeError>1.0</doTimeError>
<clusterNeighborThreshold>3.0</clusterNeighborThreshold>
<clusterThreshold>3.0</clusterThreshold>
<doDeadFix>true</doDeadFix>
<doVSplit>true</doVSplit>
<debug>false</debug>
</driver>
<driver name="KalmanPatRecDriver" type="org.hps.recon.tracking.kalman.KalmanPatRecDriver">
<addResiduals>true</addResiduals>
<addKinks>true</addKinks>
<numPatRecIteration> 2 </numPatRecIteration>
<numKalmanIteration> 1 </numKalmanIteration>
<maxPtInverse> 8.881915381218574 </maxPtInverse>
<maxD0> 39.249197341740356 </maxD0>
<maxZ0> 8.37847994612359 </maxZ0>
<maxChi2> 11.546843987796496 </maxChi2>
<minHitsTopIter1> 9 </minHitsTopIter1>
<minHitsBotIter1> 9 </minHitsBotIter1>
<minHitsTopIter2> 8 </minHitsTopIter2>
<minHitsBotIter2> 8 </minHitsBotIter2>
<minStereo> 3 </minStereo>
<maxSharedHits> 2 </maxSharedHits>
<maxTimeRange> 40.0 </maxTimeRange>
<maxTanLambda> 5.0 </maxTanLambda>
<maxChi2Inc> 12.320066328390354 </maxChi2Inc>
<minChi2IncBad> 9.206482863412027 </minChi2IncBad>
<maxChi2IncShare> 5.862027198856136 </maxChi2IncShare>
<mxChi2Vtx> 5.508828061070076 </mxChi2Vtx>
<numEvtPlots> 5 </numEvtPlots>
<doDebugPlots> false </doDebugPlots>
<siHitsLimit> 400 </siHitsLimit>
<seedCompThr> 0.3473319986601534 </seedCompThr>
<useBeamPositionConditions>false</useBeamPositionConditions>
<beamPositionX>0.0</beamPositionX>
<beamPositionY>0.0</beamPositionY>
<beamSigmaX>0.055</beamSigmaX>
<beamSigmaY>0.045</beamSigmaY>
<useFixedVertexZPosition>true</useFixedVertexZPosition>
<beamPositionZ>-1.1</beamPositionZ>
<lowPhThresh> 7.197594353612735 </lowPhThresh>
<verbose> false </verbose>
</driver>
<driver name="TrackTruthMatching_KF" type="org.hps.analysis.MC.TrackToMCParticleRelationsDriver">
<trackCollectionName>KalmanFullTracks</trackCollectionName>
<kalmanTracks>true</kalmanTracks>
<debug>false</debug>
</driver>
<driver name="ReconParticleDriver_Kalman" type="org.hps.recon.particle.HpsReconParticleDriver" >
<ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName>
<trackCollectionNames>KalmanFullTracks</trackCollectionNames>
<matcherTrackCollectionName>KalmanFullTracks</matcherTrackCollectionName>
<trackClusterMatcherAlgo>TrackClusterMatcherMinDistance</trackClusterMatcherAlgo>
<unconstrainedV0CandidatesColName>UnconstrainedV0Candidates_KF</unconstrainedV0CandidatesColName>
<unconstrainedV0VerticesColName>UnconstrainedV0Vertices_KF</unconstrainedV0VerticesColName>
<beamConV0CandidatesColName>BeamspotConstrainedV0Candidates_KF</beamConV0CandidatesColName>
<beamConV0VerticesColName>BeamspotConstrainedV0Vertices_KF</beamConV0VerticesColName>
<targetConV0CandidatesColName>TargetConstrainedV0Candidates_KF</targetConV0CandidatesColName>
<targetConV0VerticesColName>TargetConstrainedV0Vertices_KF</targetConV0VerticesColName>
<finalStateParticlesColName>FinalStateParticles_KF</finalStateParticlesColName>
<otherElectronsColName>OtherElectrons_KF</otherElectronsColName>
<includeUnmatchedTracksInFSP>true</includeUnmatchedTracksInFSP>
<useBeamPositionConditions>false</useBeamPositionConditions>
<requireClustersForV0>false</requireClustersForV0>
<beamPositionX>0.0</beamPositionX>
<beamPositionY>0.0</beamPositionY>
<beamSigmaX>0.055</beamSigmaX>
<beamSigmaY>0.045</beamSigmaY>
<beamPositionZ>-1.1</beamPositionZ>
<maxElectronP>7.0</maxElectronP>
<maxVertexP>7.0</maxVertexP>
<minVertexChisqProb>0.0</minVertexChisqProb>
<maxVertexClusterDt>40.0</maxVertexClusterDt>
<maxMatchDt>40</maxMatchDt>
<trackClusterTimeOffset>40</trackClusterTimeOffset>
<useCorrectedClusterPositionsForMatching>false</useCorrectedClusterPositionsForMatching>
<applyClusterCorrections>true</applyClusterCorrections>
<useTrackPositionForClusterCorrection>true</useTrackPositionForClusterCorrection>
<debug>false</debug>
<isMC>true</isMC>
<makeMollerCols>true</makeMollerCols>
<unconstrainedMollerCandidatesColName>UnconstrainedMollerCandidates_KF</unconstrainedMollerCandidatesColName>
<unconstrainedMollerVerticesColName>UnconstrainedMollerVertices_KF</unconstrainedMollerVerticesColName>
<beamConMollerCandidatesColName>BeamspotConstrainedMollerCandidates_KF</beamConMollerCandidatesColName>
<beamConMollerVerticesColName>BeamspotConstrainedMollerVertices_KF</beamConMollerVerticesColName>
<targetConMollerCandidatesColName>TargetConstrainedMollerCandidates_KF</targetConMollerCandidatesColName>
<targetConMollerVerticesColName>TargetConstrainedMollerVertices_KF</targetConMollerVerticesColName>
</driver>
<driver name="AidaSaveDriver" type="org.lcsim.job.AidaSaveDriver">
<outputFileName>${outputFile}_hit_eff.root</outputFileName>
</driver>
<driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
<outputFilePath>${outputFile}.slcio</outputFilePath>
</driver>
<driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver"/>

</drivers>
</lcsim>

Loading
Loading