3 added + 3 removed, total 6 files
hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -N TestProposalJlabCoordTrackReconSteering.java
--- TestProposalJlabCoordTrackReconSteering.java 29 Jul 2011 00:16:31 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,247 +0,0 @@
-package org.lcsim.hps.recon.tracking;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.Track;
-import org.lcsim.event.TrackerHit;
-import org.lcsim.geometry.Detector;
-import org.lcsim.hps.event.HPSTransformations;
-import org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver;
-import org.lcsim.recon.tracking.digitization.sisim.config.SimTrackerHitReadoutDriver;
-import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
-import org.lcsim.recon.tracking.seedtracker.SeedTracker;
-import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
-import org.lcsim.util.Driver;
-
-/**
- * Top-level 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. 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 we get this from the Detector object's BoxDipole instead???
- private final double bfield = 0.5;
-
- // Default name of SimTrackerHit input collection.
- private String simTrackerHitCollectionName = "TrackerHits";
-
- // Default tracking strategy path.
- private String strategyResource = "HPS-Test-1pt3.xml";
-
- // Name of Seedtracker's output collection.
- private final String trackCollectionName = "MatchedTracks";
-
- // Name of Seedtracker's HelicalTrackHit input collection.
- private final String stInputCollectionName = "RotatedHelicalTrackHits";
-
- // Name of HelicalTrackHitDriver's output hit collection.
- private final String hthOutputCollectionName = "HelicalTrackHits";
-
- /**
- * Empty no-arg ctor for XML config.
- * All config is performed in {@link #detectorChanged(Detector)}
- * via a call to {@link #setup()}.
- */
- public TestProposalJlabCoordTrackReconSteering()
- {}
-
- /**
- * Set the tracking strategy resource.
- * @param strategyResource The absolute path to the strategy resource.
- */
- public void setStrategyResource(String strategyResource)
- {
- this.strategyResource = strategyResource;
- }
-
- /**
- * Set the SimTrackerHit collection to be used for tracking.
- * @param simTrackerHitCollectionName The name of the SimTrackerHit collection in the event.
- */
- public void setSimTrackerHitCollectionName(String simTrackerHitCollectionName)
- {
- this.simTrackerHitCollectionName = simTrackerHitCollectionName;
- }
-
- /**
- * This is used to setup the Drivers after XML config.
- */
- public void detectorChanged(Detector detector)
- {
- setup();
- super.detectorChanged(detector);
- }
-
- /**
- * Call super for child processing at start of data.
- */
- public void startOfData()
- {
- super.startOfData();
- }
-
- /**
- * Setup all the child Drivers necessary for track reconstruction.
- */
- private void setup()
- {
- //
- // 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();
- int[] p1 = {1, 2};
- int[] p2 = {3, 4};
- int[] p3 = {5, 6};
- int[] p4 = {7, 8};
- int[] p5 = {9, 10};
- pairs.add(p1);
- pairs.add(p2);
- pairs.add(p3);
- pairs.add(p4);
- pairs.add(p5);
-
- // Setup the Driver.
- HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
- hthdriver.addCollection(thd.getStripHits1DName());
- hthdriver.OutputCollection(hthOutputCollectionName);
- hthdriver.HitRelationName("HelicalTrackHitRelations");
- hthdriver.MCRelationName("HelicalTrackMCRelations");
- for (int[] pair : pairs)
- {
- hthdriver.setStereoPair("Tracker", pair[0], pair[1]);
- }
- hthdriver.setMaxSeperation(10.01);
- hthdriver.setTolerance(0.01);
- hthdriver.setTransformToTracking(true);
- add(hthdriver);
-
- //
- // 5) Driver to run Seedtracker.
- //
- if (!strategyResource.startsWith("/"))
- strategyResource = "/" + strategyResource;
- List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
- this.getClass().getResourceAsStream(strategyResource));
- SeedTracker stFinal = new SeedTracker(sFinallist);
- HPSTransformations hpstrans = new HPSTransformations();
- stFinal.setMaterialManagerTransform(hpstrans.getTransform());
- stFinal.setInputCollectionName(stInputCollectionName);
- stFinal.setTrkCollectionName(trackCollectionName);
- stFinal.setBField(bfield);
- 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 run the reconstruction and print debug information.
- */
- public void process(EventHeader event)
- {
- // This runs the track reconstruction.
- super.process(event);
-
- // Check for digi hits.
- List<TrackerHit> digi = event.get(TrackerHit.class, "TrackerHits");
- if (digi.size() == 0)
- {
- System.out.println("WARNING: The sisim TrackerHit collection is empty!");
- }
- else
- {
- System.out.println("The sisim TrackerHit collection has " + digi.size() + " hits.");
- }
-
- // Check for HelicalTrackHits.
- List<TrackerHit> hth = event.get(TrackerHit.class, hthOutputCollectionName);
- if (hth.size() == 0)
- {
- System.out.println("WARNING: The HelicalTrackHit collection " + hthOutputCollectionName + " is empty!");
- }
- else
- {
- System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits.");
- }
-
- // Check for Tracks.
- List<Track> tracks = event.get(Track.class, trackCollectionName);
- if (tracks.size() == 0)
- {
- System.out.println("WARNING: The Track collection " + trackCollectionName + " is empty!");
- }
- else
- {
- System.out.println("The Track collection " + trackCollectionName + " has " + tracks.size() + " tracks.");
- }
- // Print out track info.
- for (Track track : tracks)
- {
- System.out.println(track.toString());
- }
- }
-}
\ No newline at end of file
hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -N TestProposalTrackRecon.java
--- TestProposalTrackRecon.java 1 Jun 2011 17:05:31 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,64 +0,0 @@
-package org.lcsim.hps.recon.tracking;
-
-import java.util.List;
-
-import org.lcsim.event.EventHeader;
-import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
-import org.lcsim.recon.tracking.seedtracker.SeedTracker;
-import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
-import org.lcsim.util.Driver;
-
-/**
- * Driver to perform hit digitization and track reconstruction for the HPS Test Proposal detector.
- * Based on simplification of MultiTrackReco from Matt Graham.
- *
- * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: TestProposalTrackRecon.java,v 1.4 2011/06/01 17:05:31 jeremy Exp $
- */
-public class TestProposalTrackRecon extends Driver
-{
- public TestProposalTrackRecon(double bField, String strategyResource, List<int[]> stereoPairs)
- {
- // Make digi hits.
- HPSTrackerHitDriver thd = new HPSTrackerHitDriver();
- add(thd);
-
- // Make axial hits.
- HPSHelicalTrackHitDriver hitdriver = new HPSHelicalTrackHitDriver();
- hitdriver.addCollection(((HPSTrackerHitDriver) thd).getStripHits1DName());
- hitdriver.OutputCollection("AxialTrackHits");
- hitdriver.HitRelationName("AxialTrackHitRelations");
- hitdriver.MCRelationName("AxialTrackMCRelations");
- add(hitdriver);
-
- // Make helical hits which seedtracker expects.
- HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
- hthdriver.addCollection(((HPSTrackerHitDriver) thd).getStripHits1DName());
- hthdriver.OutputCollection("HelicalTrackHits");
- hthdriver.HitRelationName("HelicalTrackHitRelations");
- hthdriver.MCRelationName("HelicalTrackMCRelations");
- for (int[] pair : stereoPairs)
- {
- hthdriver.setStereoPair("Tracker", pair[0], pair[1]);
- }
- hthdriver.setMaxSeperation(10.01);
- hthdriver.setTolerance(0.01);
- add(hthdriver);
-
- // Setup seedtracker.
- List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
- this.getClass().getResourceAsStream(strategyResource));
- SeedTracker stFinal = new SeedTracker(sFinallist);
- stFinal.setInputCollectionName("HelicalTrackHits");
- stFinal.setTrkCollectionName("MatchedTracks");
- stFinal.setBField(bField);
- stFinal.setSectorParams(false);
- stFinal.setTimingPlots(true);
- add(stFinal);
- }
-
- public void process(EventHeader event)
- {
- super.process(event);
- }
-}
\ No newline at end of file
hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -N TestProposalTrackReconSteeringDriver.java
--- TestProposalTrackReconSteeringDriver.java 1 Jun 2011 17:05:31 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,55 +0,0 @@
-package org.lcsim.hps.recon.tracking;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lcsim.event.EventHeader;
-import org.lcsim.util.Driver;
-
-/**
- * Simple top level steering driver to perform tracking recon in HPS Test Proposal detector.
- * Based on HeavyPhotonLLDriver by Matt Graham.
- *
- * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: TestProposalTrackReconSteeringDriver.java,v 1.4 2011/06/01 17:05:31 jeremy Exp $
- */
-public final class TestProposalTrackReconSteeringDriver extends Driver
-{
- // FIXME: This should come from Detector.
- double bfield = 0.5;
-
- // Strategy file for tracking that lives in hps-java resources dir.
- // FIXME: Make the strategy settable from steering file.
- String strategyResource = "/HPS-Test-1pt3.xml";
-
- public TestProposalTrackReconSteeringDriver()
- {
- // Setup layer pairings.
- List<int[]> pairs = new ArrayList();
- int[] p1 = {1, 2};
- int[] p2 = {3, 4};
- int[] p3 = {5, 6};
- int[] p4 = {7, 8};
- int[] p5 = {9, 10};
- pairs.add(p1);
- pairs.add(p2);
- pairs.add(p3);
- pairs.add(p4);
- pairs.add(p5);
-
- // Add Driver to setup sensors.
- add(new MakeSensorsDriver());
-
- // Add track recon Driver.
- TestProposalTrackRecon trd = new TestProposalTrackRecon(
- bfield,
- strategyResource,
- pairs);
- add(trd);
- }
-
- public void process(EventHeader event)
- {
- super.process(event);
- }
-}
\ No newline at end of file
hps-java/sandbox
diff -N TestProposalJlabCoordTrackReconSteering.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestProposalJlabCoordTrackReconSteering.java 29 Apr 2012 22:54:57 -0000 1.1
@@ -0,0 +1,247 @@
+package org.lcsim.hps.recon.tracking;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.Track;
+import org.lcsim.event.TrackerHit;
+import org.lcsim.geometry.Detector;
+import org.lcsim.hps.event.HPSTransformations;
+import org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver;
+import org.lcsim.recon.tracking.digitization.sisim.config.SimTrackerHitReadoutDriver;
+import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
+import org.lcsim.recon.tracking.seedtracker.SeedTracker;
+import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
+import org.lcsim.util.Driver;
+
+/**
+ * Top-level 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. 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 we get this from the Detector object's BoxDipole instead???
+ private final double bfield = 0.5;
+
+ // Default name of SimTrackerHit input collection.
+ private String simTrackerHitCollectionName = "TrackerHits";
+
+ // Default tracking strategy path.
+ private String strategyResource = "HPS-Test-1pt3.xml";
+
+ // Name of Seedtracker's output collection.
+ private final String trackCollectionName = "MatchedTracks";
+
+ // Name of Seedtracker's HelicalTrackHit input collection.
+ private final String stInputCollectionName = "RotatedHelicalTrackHits";
+
+ // Name of HelicalTrackHitDriver's output hit collection.
+ private final String hthOutputCollectionName = "HelicalTrackHits";
+
+ /**
+ * Empty no-arg ctor for XML config.
+ * All config is performed in {@link #detectorChanged(Detector)}
+ * via a call to {@link #setup()}.
+ */
+ public TestProposalJlabCoordTrackReconSteering()
+ {}
+
+ /**
+ * Set the tracking strategy resource.
+ * @param strategyResource The absolute path to the strategy resource.
+ */
+ public void setStrategyResource(String strategyResource)
+ {
+ this.strategyResource = strategyResource;
+ }
+
+ /**
+ * Set the SimTrackerHit collection to be used for tracking.
+ * @param simTrackerHitCollectionName The name of the SimTrackerHit collection in the event.
+ */
+ public void setSimTrackerHitCollectionName(String simTrackerHitCollectionName)
+ {
+ this.simTrackerHitCollectionName = simTrackerHitCollectionName;
+ }
+
+ /**
+ * This is used to setup the Drivers after XML config.
+ */
+ public void detectorChanged(Detector detector)
+ {
+ setup();
+ super.detectorChanged(detector);
+ }
+
+ /**
+ * Call super for child processing at start of data.
+ */
+ public void startOfData()
+ {
+ super.startOfData();
+ }
+
+ /**
+ * Setup all the child Drivers necessary for track reconstruction.
+ */
+ private void setup()
+ {
+ //
+ // 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();
+ int[] p1 = {1, 2};
+ int[] p2 = {3, 4};
+ int[] p3 = {5, 6};
+ int[] p4 = {7, 8};
+ int[] p5 = {9, 10};
+ pairs.add(p1);
+ pairs.add(p2);
+ pairs.add(p3);
+ pairs.add(p4);
+ pairs.add(p5);
+
+ // Setup the Driver.
+ HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
+ hthdriver.addCollection(thd.getStripHits1DName());
+ hthdriver.OutputCollection(hthOutputCollectionName);
+ hthdriver.HitRelationName("HelicalTrackHitRelations");
+ hthdriver.MCRelationName("HelicalTrackMCRelations");
+ for (int[] pair : pairs)
+ {
+ hthdriver.setStereoPair("Tracker", pair[0], pair[1]);
+ }
+ hthdriver.setMaxSeperation(10.01);
+ hthdriver.setTolerance(0.01);
+ hthdriver.setTransformToTracking(true);
+ add(hthdriver);
+
+ //
+ // 5) Driver to run Seedtracker.
+ //
+ if (!strategyResource.startsWith("/"))
+ strategyResource = "/" + strategyResource;
+ List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
+ this.getClass().getResourceAsStream(strategyResource));
+ SeedTracker stFinal = new SeedTracker(sFinallist);
+ HPSTransformations hpstrans = new HPSTransformations();
+ stFinal.setMaterialManagerTransform(hpstrans.getTransform());
+ stFinal.setInputCollectionName(stInputCollectionName);
+ stFinal.setTrkCollectionName(trackCollectionName);
+ stFinal.setBField(bfield);
+ 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 run the reconstruction and print debug information.
+ */
+ public void process(EventHeader event)
+ {
+ // This runs the track reconstruction.
+ super.process(event);
+
+ // Check for digi hits.
+ List<TrackerHit> digi = event.get(TrackerHit.class, "TrackerHits");
+ if (digi.size() == 0)
+ {
+ System.out.println("WARNING: The sisim TrackerHit collection is empty!");
+ }
+ else
+ {
+ System.out.println("The sisim TrackerHit collection has " + digi.size() + " hits.");
+ }
+
+ // Check for HelicalTrackHits.
+ List<TrackerHit> hth = event.get(TrackerHit.class, hthOutputCollectionName);
+ if (hth.size() == 0)
+ {
+ System.out.println("WARNING: The HelicalTrackHit collection " + hthOutputCollectionName + " is empty!");
+ }
+ else
+ {
+ System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits.");
+ }
+
+ // Check for Tracks.
+ List<Track> tracks = event.get(Track.class, trackCollectionName);
+ if (tracks.size() == 0)
+ {
+ System.out.println("WARNING: The Track collection " + trackCollectionName + " is empty!");
+ }
+ else
+ {
+ System.out.println("The Track collection " + trackCollectionName + " has " + tracks.size() + " tracks.");
+ }
+ // Print out track info.
+ for (Track track : tracks)
+ {
+ System.out.println(track.toString());
+ }
+ }
+}
\ No newline at end of file
hps-java/sandbox
diff -N TestProposalTrackRecon.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestProposalTrackRecon.java 29 Apr 2012 22:54:57 -0000 1.1
@@ -0,0 +1,64 @@
+package org.lcsim.hps.recon.tracking;
+
+import java.util.List;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
+import org.lcsim.recon.tracking.seedtracker.SeedTracker;
+import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
+import org.lcsim.util.Driver;
+
+/**
+ * Driver to perform hit digitization and track reconstruction for the HPS Test Proposal detector.
+ * Based on simplification of MultiTrackReco from Matt Graham.
+ *
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @version $Id: TestProposalTrackRecon.java,v 1.1 2012/04/29 22:54:57 jeremy Exp $
+ */
+public class TestProposalTrackRecon extends Driver
+{
+ public TestProposalTrackRecon(double bField, String strategyResource, List<int[]> stereoPairs)
+ {
+ // Make digi hits.
+ HPSTrackerHitDriver thd = new HPSTrackerHitDriver();
+ add(thd);
+
+ // Make axial hits.
+ HPSHelicalTrackHitDriver hitdriver = new HPSHelicalTrackHitDriver();
+ hitdriver.addCollection(((HPSTrackerHitDriver) thd).getStripHits1DName());
+ hitdriver.OutputCollection("AxialTrackHits");
+ hitdriver.HitRelationName("AxialTrackHitRelations");
+ hitdriver.MCRelationName("AxialTrackMCRelations");
+ add(hitdriver);
+
+ // Make helical hits which seedtracker expects.
+ HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
+ hthdriver.addCollection(((HPSTrackerHitDriver) thd).getStripHits1DName());
+ hthdriver.OutputCollection("HelicalTrackHits");
+ hthdriver.HitRelationName("HelicalTrackHitRelations");
+ hthdriver.MCRelationName("HelicalTrackMCRelations");
+ for (int[] pair : stereoPairs)
+ {
+ hthdriver.setStereoPair("Tracker", pair[0], pair[1]);
+ }
+ hthdriver.setMaxSeperation(10.01);
+ hthdriver.setTolerance(0.01);
+ add(hthdriver);
+
+ // Setup seedtracker.
+ List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
+ this.getClass().getResourceAsStream(strategyResource));
+ SeedTracker stFinal = new SeedTracker(sFinallist);
+ stFinal.setInputCollectionName("HelicalTrackHits");
+ stFinal.setTrkCollectionName("MatchedTracks");
+ stFinal.setBField(bField);
+ stFinal.setSectorParams(false);
+ stFinal.setTimingPlots(true);
+ add(stFinal);
+ }
+
+ public void process(EventHeader event)
+ {
+ super.process(event);
+ }
+}
\ No newline at end of file
hps-java/sandbox
diff -N TestProposalTrackReconSteeringDriver.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestProposalTrackReconSteeringDriver.java 29 Apr 2012 22:54:57 -0000 1.1
@@ -0,0 +1,55 @@
+package org.lcsim.hps.recon.tracking;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+
+/**
+ * Simple top level steering driver to perform tracking recon in HPS Test Proposal detector.
+ * Based on HeavyPhotonLLDriver by Matt Graham.
+ *
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @version $Id: TestProposalTrackReconSteeringDriver.java,v 1.1 2012/04/29 22:54:57 jeremy Exp $
+ */
+public final class TestProposalTrackReconSteeringDriver extends Driver
+{
+ // FIXME: This should come from Detector.
+ double bfield = 0.5;
+
+ // Strategy file for tracking that lives in hps-java resources dir.
+ // FIXME: Make the strategy settable from steering file.
+ String strategyResource = "/HPS-Test-1pt3.xml";
+
+ public TestProposalTrackReconSteeringDriver()
+ {
+ // Setup layer pairings.
+ List<int[]> pairs = new ArrayList();
+ int[] p1 = {1, 2};
+ int[] p2 = {3, 4};
+ int[] p3 = {5, 6};
+ int[] p4 = {7, 8};
+ int[] p5 = {9, 10};
+ pairs.add(p1);
+ pairs.add(p2);
+ pairs.add(p3);
+ pairs.add(p4);
+ pairs.add(p5);
+
+ // Add Driver to setup sensors.
+ add(new MakeSensorsDriver());
+
+ // Add track recon Driver.
+ TestProposalTrackRecon trd = new TestProposalTrackRecon(
+ bfield,
+ strategyResource,
+ pairs);
+ add(trd);
+ }
+
+ public void process(EventHeader event)
+ {
+ super.process(event);
+ }
+}
\ No newline at end of file
CVSspam 0.2.12