Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the Hit Reconstruction Optimizations Rory has worked on #1043

Merged
merged 20 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
rodwyer100 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.hps.recon.filtering;

import org.lcsim.event.EventHeader;
import org.lcsim.event.GenericObject;
import org.lcsim.util.Driver;
import org.hps.record.epics.EpicsData;
import org.hps.record.scalers.ScalerData;
import org.hps.record.triggerbank.AbstractIntData;
import org.hps.record.triggerbank.TSData2019;

/**
* Keep pulser triggered events. Also keep EPICS events, and Scaler events. Drop all other events.
*/
public class UnbiasedTriggerFilterDriver extends Driver {

public void process(EventHeader event) {

// 1. keep all events with EPICS data (could also use event tag = 31):
if (EpicsData.read(event) != null)
return;

// 2. keep all events with Scaler data:
if (ScalerData.read(event) != null)
return;

// 3. drop event if it doesn't have a TriggerBank
if (!event.hasCollection(GenericObject.class, "TSBank"))
throw new Driver.NextEventException();

// 4. keep event if it was from a Pulser trigger:
for (GenericObject gob : event.get(GenericObject.class, "TSBank")) {
if (!(AbstractIntData.getTag(gob) == TSData2019.BANK_TAG))
continue;
TSData2019 tsd = new TSData2019(gob);
if (tsd.isPulserTrigger() || tsd.isFaradayCupTrigger())
return;
}

// 5. Else, drop event:
throw new Driver.NextEventException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?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 running 2019 Reconstruction on readout data (LCIO or EVIO)
created: 9/24/19
@author Norman Graf <[email protected]>
@author PF <[email protected]>
-->
<execute>
<!-- Enable the following if re-processing lcio files -->
<!-- <driver name="PreCleanupDriver"/> -->
<!-- Event Reconstruction -->
<!-- Skip events with known bad conditions -->
<!-- Not yet defined for 2019 data -->
<!-- <driver name="EventFlagFilter"/> -->
<!--RF driver-->
<driver name="RfFitter"/>
<!-- Ecal reconstruction drivers -->
<driver name="EcalRunningPedestal"/>
<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="TrackerHitDriver"/>

<!--
<driver name="HelicalTrackHitDriver"/>
-->

<driver name="KalmanPatRecDriver"/>
<driver name="ReconParticleDriver_Kalman" />
<driver name="SVTHitEfficiency"/>
<!--<driver name="LCIOWriter"/>-->
<!-- Toggle between saving in aida or root format -->
<driver name="AidaSaveDriver"/>
<driver name="CleanupDriver"/>
</execute>
<drivers>
<driver name="SVTHitEfficiency" type="org.hps.recon.tracking.kalman.SvtHitEfficiencyKalman"/>
<driver name="HodoRunningPedestal" type="org.hps.recon.ecal.HodoRunningPedestalDriver"/>
<driver name="HodoRawConverter" type="org.hps.recon.ecal.HodoRawConverterDriver"/>

<driver name="RfFitter" type="org.hps.evio.RfFitterDriver"/>

<!-- Ecal reconstruction drivers -->
<driver name="EcalRunningPedestal" type="org.hps.recon.ecal.EcalRunningPedestalDriver">
<logLevel>CONFIG</logLevel>
</driver>
<driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverter2Driver">
<!-- ecalCollectionName>EcalCalHits</ecalCollectionName -->
<!-- fixShapeParameter>true</fixShapeParameter -->
<!-- globalFixedPulseWidth>2.4</globalFixedPulseWidth -->
</driver>
<driver name="EcalTimeCorrection" type="org.hps.recon.ecal.EcalTimeCorrectionDriver"/>
<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">
<fitAlgorithm>Pileup</fitAlgorithm>
<useTimestamps>false</useTimestamps>
<correctTimeOffset>true</correctTimeOffset>
<correctT0Shift>false</correctT0Shift>
<useTruthTime>false</useTruthTime>
<subtractTOF>true</subtractTOF>
<subtractTriggerTime>true</subtractTriggerTime>
<correctChanT0>false</correctChanT0>
<debug>false</debug>
</driver>

<driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
<neighborDeltaT>8.0</neighborDeltaT>
<saveMonsterEvents>true</saveMonsterEvents>
<thresholdMonsterEvents>200</thresholdMonsterEvents>
<debug>false</debug>
</driver>

<driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
<debug>false</debug>
<clusterTimeCut>40.0</clusterTimeCut>
<clusterAmplitudeCut>400.0</clusterAmplitudeCut>
<maxDt>20.0</maxDt>
<saveAxialHits>false</saveAxialHits>
</driver>

<driver name="KalmanPatRecDriver" type="org.hps.recon.tracking.kalman.KalmanPatRecDriver">
<doDebugPlots>false</doDebugPlots>
<!-- <siHitsLimit>50</siHitsLimit> -->
<seedCompThr>0.05</seedCompThr>
<verbose>false</verbose>
<minHits>9</minHits>
</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>
<includeUnmatchedTracksInFSP>true</includeUnmatchedTracksInFSP>
<useInternalVertexXYPositions>false</useInternalVertexXYPositions>
<requireClustersForV0>false</requireClustersForV0>
<beamPositionX>0.180</beamPositionX>
<beamSigmaX>0.05</beamSigmaX>
<beamPositionY>0.04</beamPositionY>
<beamSigmaY>0.020</beamSigmaY>
<beamPositionZ>-7.5</beamPositionZ>
<maxElectronP>10.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>
<makeMollerCols>false</makeMollerCols>
</driver>

<driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver"/>

<driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
<outputFilePath>${outputFile}.slcio</outputFilePath>
</driver>
<driver name="AidaSaveDriver" type="org.lcsim.job.AidaSaveDriver">
<outputFileName>${outputFile}.root</outputFileName>
</driver>

</drivers>
</lcsim>

Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?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 running 2019 Reconstruction on readout data (LCIO or EVIO)
created: 9/24/19
@author Norman Graf <[email protected]>
@author PF <[email protected]>
-->
<execute>
<!-- Enable the following if re-processing lcio files -->
<!-- <driver name="PreCleanupDriver"/> -->
<!-- Event Reconstruction -->
<!-- Skip events with known bad conditions -->
<!-- Not yet defined for 2019 data -->
<!-- <driver name="EventFlagFilter"/> -->
<!--RF driver-->
<driver name="RfFitter"/>
<!-- Ecal reconstruction drivers -->
<driver name="EcalRunningPedestal"/>
<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="TrackerHitDriver"/>

<!--
<driver name="HelicalTrackHitDriver"/>
-->

<driver name="KalmanPatRecDriver"/>
<driver name="ReconParticleDriver_Kalman" />
<driver name="SVTHitEfficiency"/>
<driver name="LCIOWriter"/>
<!-- Toggle between saving in aida or root format -->
<driver name="AidaSaveDriver"/>
<driver name="CleanupDriver"/>
</execute>
<drivers>
<driver name="SVTHitEfficiency" type="org.hps.recon.tracking.kalman.SvtHitEfficiencyKalman"/>
<driver name="HodoRunningPedestal" type="org.hps.recon.ecal.HodoRunningPedestalDriver"/>
<driver name="HodoRawConverter" type="org.hps.recon.ecal.HodoRawConverterDriver"/>

<driver name="RfFitter" type="org.hps.evio.RfFitterDriver"/>

<!-- Ecal reconstruction drivers -->
<driver name="EcalRunningPedestal" type="org.hps.recon.ecal.EcalRunningPedestalDriver">
<logLevel>CONFIG</logLevel>
</driver>
<driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverter2Driver">
<!-- ecalCollectionName>EcalCalHits</ecalCollectionName -->
<!-- fixShapeParameter>true</fixShapeParameter -->
<!-- globalFixedPulseWidth>2.4</globalFixedPulseWidth -->
</driver>
<driver name="EcalTimeCorrection" type="org.hps.recon.ecal.EcalTimeCorrectionDriver"/>
<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>false</useTimestamps>
<correctTimeOffset>true</correctTimeOffset>
<correctT0Shift>false</correctT0Shift>
<useTruthTime>false</useTruthTime>
<subtractTOF>true</subtractTOF>
<subtractTriggerTime>true</subtractTriggerTime>
<correctChanT0>false</correctChanT0>
<debug>false</debug>
</driver>

<driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
<neighborDeltaT>8.0</neighborDeltaT>
<saveMonsterEvents>true</saveMonsterEvents>
<thresholdMonsterEvents>200</thresholdMonsterEvents>
<debug>false</debug>
</driver>

<driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
<debug>false</debug>
<clusterTimeCut>40.0</clusterTimeCut>
<clusterAmplitudeCut>400.0</clusterAmplitudeCut>
<maxDt>20.0</maxDt>
<saveAxialHits>false</saveAxialHits>
</driver>

<driver name="KalmanPatRecDriver" type="org.hps.recon.tracking.kalman.KalmanPatRecDriver">
<doDebugPlots>false</doDebugPlots>
<!-- <siHitsLimit>50</siHitsLimit> -->
<seedCompThr>0.05</seedCompThr>
<verbose>false</verbose>
<minHits>9</minHits>
</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>
<includeUnmatchedTracksInFSP>true</includeUnmatchedTracksInFSP>
<useInternalVertexXYPositions>false</useInternalVertexXYPositions>
<requireClustersForV0>false</requireClustersForV0>
<beamPositionX>0.180</beamPositionX>
<beamSigmaX>0.05</beamSigmaX>
<beamPositionY>0.04</beamPositionY>
<beamSigmaY>0.020</beamSigmaY>
<beamPositionZ>-7.5</beamPositionZ>
<maxElectronP>10.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>
<makeMollerCols>false</makeMollerCols>
</driver>

<driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver"/>

<driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
<outputFilePath>cake.slcio</outputFilePath>
</driver>
<driver name="AidaSaveDriver" type="org.lcsim.job.AidaSaveDriver">
<outputFileName>cake_svtEfficiency.root</outputFileName>
</driver>

</drivers>
</lcsim>
Loading
Loading