hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -u -r1.1 -r1.2
--- TestProposalJlabCoordTrackReconSteering.java 28 Jul 2011 23:34:24 -0000 1.1
+++ TestProposalJlabCoordTrackReconSteering.java 29 Jul 2011 00:16:31 -0000 1.2
@@ -16,21 +16,49 @@
import org.lcsim.util.Driver;
/**
- * Driver for track reconstruction and analysis of HPS Test Proposal detector
- * in the JLAB coordinate system. It starts with a collection of SimTrackerHits
- * and produces Tracks, as well as intermediate collections of hit objects.
+ * Top-level Driver for track reconstruction and analysis of HPS Test Proposal detector
+ * in the JLAB coordinate system.
*
- * This class is basically a stripped down and refactored version of Matt Graham's
- * {@link org.lcsim.hps.users.mgraham.jlabrotation.HeavyPhotonLLDriver}.
+ * It starts with a collection of SimTrackerHits and produces Tracks, as well as intermediate
+ * collections. It should work on the detector <b>HPS-Test-JLAB-v2pt1</b> from hps-detectors.
*
- * It should work on the detector <b>HPS-Test-JLAB-v2pt1</b> from hps-detectors.
+ * This is basically a refactored version of Matt Graham's
+ * {@link org.lcsim.hps.users.mgraham.jlabrotation.HeavyPhotonLLDriver} that can
+ * be configured using LCSim XML. Matt's Driver does not allow runtime config.
+ *
+ * The current parameters that can be set in LCSim XML are the following:
+ *
+ * <ul>
+ * <ul><b>simTrackerHitCollectionName</b> - name of input SimTrackerHit collection
+ * <li><b>strategyResource</b> - full path to the Seedtracker strategy file in hps-java
+ * </ul>
+ *
+ * In order, this Driver adds the following child Drivers:
+ *
+ * <ol>
+ * <li>{@link SiTrackerSpectrometerSensorSetup} - config sensor parameters</li>
+ * <li>{@link SimTrackerHitReadoutDriver} - attach hits to sensors</li>
+ * <li>{@link HPSTrackerHitDriver} - run sisim to create TrackerHits</li>
+ * <li>{@link HPSHelicalTrackHitDriver} - make HelicalTrackHits for seedtracker</li>
+ * <li>{@link SeedTracker} - run Seedtracker to create Tracks
+ * <li>{@link ReadoutCleanupDriver} - clear sensors of hits for next event</li>
+ * </ol>
+ *
+ * The Driver prints warning messages if the TrackerHit, HelicalTrack, or Track collections
+ * are empty. The first two should never be empty if the reconstruction worked correctly.
+ * The Track collection may be empty.
*
* @author jeremym
* @author mgraham - original Driver skeleton
*/
+// FIXME: There may be some duplication of readout setting and clearing from sub-drivers.
+// Need to double-check that this doesn't cause errors and remove duplication if possible.
+// TODO: Check that the reconstruction is finding tracks when it should. It seems that it only finds
+// tracks in signal events about 20% of the time.
public final class TestProposalJlabCoordTrackReconSteering extends Driver
{
- // FIXME: Hard-coded B-field value. Can get this from Detector object instead???
+ // FIXME: Hard-coded B-field value.
+ // Can we get this from the Detector object's BoxDipole instead???
private final double bfield = 0.5;
// Default name of SimTrackerHit input collection.
@@ -39,13 +67,13 @@
// Default tracking strategy path.
private String strategyResource = "HPS-Test-1pt3.xml";
- // Name of output Track collection from Seedtracker.
+ // Name of Seedtracker's output collection.
private final String trackCollectionName = "MatchedTracks";
- // Name of HelicalTrackHit input collection to Seedtracker.
+ // Name of Seedtracker's HelicalTrackHit input collection.
private final String stInputCollectionName = "RotatedHelicalTrackHits";
- // Name of the output collection from HelicalTrackHit Driver.
+ // Name of HelicalTrackHitDriver's output hit collection.
private final String hthOutputCollectionName = "HelicalTrackHits";
/**
@@ -84,7 +112,7 @@
}
/**
- * Call super for child processing.
+ * Call super for child processing at start of data.
*/
public void startOfData()
{
@@ -92,23 +120,31 @@
}
/**
- * Setup all the Drivers necessary for track reconstruction.
+ * Setup all the child Drivers necessary for track reconstruction.
*/
private void setup()
{
- // 1) Detector setup Driver.
+ //
+ // 1) Detector setup Driver. This runs once at the start of the event.
+ //
add(new SiTrackerSpectrometerSensorSetup("Tracker"));
+ //
// 2) Readout Driver to link sensors and hits.
+ //
List<String> tkrColl = new ArrayList<String>();
tkrColl.add(simTrackerHitCollectionName);
add(new SimTrackerHitReadoutDriver(tkrColl));
+ //
// 3) Digitization wrapper.
+ //
HPSTrackerHitDriver thd = new HPSTrackerHitDriver();
add(thd);
+ //
// 4) Driver to create HelicalTrackHits expected by Seedtracker.
+ //
// Setup adjacent layer pairings.
List<int[]> pairs = new ArrayList();
@@ -123,7 +159,7 @@
pairs.add(p4);
pairs.add(p5);
- // Setup the hit Driver.
+ // Setup the Driver.
HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
hthdriver.addCollection(thd.getStripHits1DName());
hthdriver.OutputCollection(hthOutputCollectionName);
@@ -138,7 +174,9 @@
hthdriver.setTransformToTracking(true);
add(hthdriver);
+ //
// 5) Driver to run Seedtracker.
+ //
if (!strategyResource.startsWith("/"))
strategyResource = "/" + strategyResource;
List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
@@ -152,19 +190,20 @@
stFinal.setSectorParams(false);
add(stFinal);
+ //
// 6) Cleanup the readouts for next event.
+ //
List<String> readoutCleanup = new ArrayList<String>();
readoutCleanup.add(this.simTrackerHitCollectionName);
add(new ReadoutCleanupDriver(readoutCleanup));
}
- /**
- * This method is used to print debug information about collections after the Tracks are created
- * by the child Drivers.
+ /**
+ * This method is used to run the reconstruction and print debug information.
*/
public void process(EventHeader event)
{
- // This call will run the track reconstruction.
+ // This runs the track reconstruction.
super.process(event);
// Check for digi hits.