hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -u -r1.7 -r1.8
--- TrackerReconDriver.java 23 Jan 2012 23:13:07 -0000 1.7
+++ TrackerReconDriver.java 26 Jan 2012 19:15:23 -0000 1.8
@@ -23,11 +23,11 @@
* It is intended to work with the {@link TrackerDigiDriver} digitization Driver.
*
* @author jeremym
- * @version $Id: TrackerReconDriver.java,v 1.7 2012/01/23 23:13:07 jeremy Exp $
+ * @version $Id: TrackerReconDriver.java,v 1.8 2012/01/26 19:15:23 jeremy Exp $
*/
public final class TrackerReconDriver extends Driver
{
- // Debug flag
+ // Debug flag.
private final static boolean DEBUG = false;
// Tracks found across all events.
@@ -101,13 +101,7 @@
{
this.helicalTrackMCRelationsCollectionName = helicalTrackMCRelationsCollectionName;
}
-
- // FIXME This set method should go away eventually. Field should be read from Detector in detectorChanged method.
- //public void setBField(double bfield)
- //{
- // this.bfield = bfield;
- //}
-
+
public void setInputHitCollectionName(String inputHitCollectionName)
{
this.stInputCollectionName = inputHitCollectionName;
@@ -155,15 +149,15 @@
// Cache Detector object.
this.detector = detector;
- // Get B-field Y component with flipped sign.
+ // Get B-field Y with no sign. Seed Tracker doesn't like signed B-field components.
// FIXME Is this always right?
- this.bfield = -(detector.getFieldMap().getField(new BasicHep3Vector(0,0,0))).y();
+ this.bfield = Math.abs((detector.getFieldMap().getField(new BasicHep3Vector(0,0,0)).y()));
if (DEBUG)
System.out.println("Set B-field to " + this.bfield);
initialize();
- super.detectorChanged(detector);
+ super.detectorChanged(detector);
}
/**
@@ -174,9 +168,9 @@
//
// 1) Driver to create HelicalTrackHits expected by Seedtracker.
//
- // TODO Make this its own separate Driver??? (Matt)
+ // TODO Make this step its own separate Driver??? (Matt)
- // Setup default stereo pairings which should work for even number of modules.
+ // Setup default stereo pairings, which should work for even number of modules.
List<SiTrackerModule> modules = detector.getDetectorElement().findDescendants(SiTrackerModule.class);
if (modules.size() == 0)
throw new RuntimeException("No SiTrackerModules found in detector.");
@@ -248,7 +242,7 @@
// This call runs the track reconstruction using the sub-Drivers.
super.process(event);
- // Debug prints.
+ // Debug printouts.
if (DEBUG)
{
// Check for HelicalTrackHits.
@@ -256,7 +250,7 @@
System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits.");
// Check for Tracks.
- List<Track> tracks = event.get(Track.class, trackCollectionName);
+ List<Track> tracks = event.get(Track.class, trackCollectionName);
System.out.println("The Track collection " + trackCollectionName + " has " + tracks.size() + " tracks.");
// Print out track info.
@@ -275,7 +269,10 @@
public void endOfData()
{
- System.out.println("-------------------------------------------");
- System.out.println(this.getName() + " found " + ntracks + " tracks in " + nevents + " events which is " + ((double)ntracks/(double)nevents) + " tracks per event.");
+ if (DEBUG)
+ {
+ System.out.println("-------------------------------------------");
+ System.out.println(this.getName() + " found " + ntracks + " tracks in " + nevents + " events which is " + ((double)ntracks/(double)nevents) + " tracks per event.");
+ }
}
}
\ No newline at end of file