Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN | |||
TrackerHitUtils.java | +25 | -19 | 1.1 -> 1.2 |
Added checks for cases with empty sim hits.
diff -u -r1.1 -r1.2 --- TrackerHitUtils.java 28 Sep 2012 22:06:00 -0000 1.1 +++ TrackerHitUtils.java 29 Sep 2012 00:24:15 -0000 1.2 @@ -192,10 +192,15 @@
// List<SimTrackerHit> simhits = new ArrayList<SimTrackerHit>();
-
+ + if(layerToSimTrackerHit.get(strip.layer()) == null) { + System.out.println(this.getClass().getSimpleName() + ": WARNING there is a strip in layer " + strip.layer() + " but no SimTrackerHits"); + return simhits; + } +
// If there is only a single SimTrackerHit on a layer and it's in the same volume as the // strip hit then they likely match to each other
- if(layerToSimTrackerHit.get(strip.layer()) != null && layerToSimTrackerHit.get(strip.layer()).size() == 1){
+ if(layerToSimTrackerHit.get(strip.layer()).size() == 1){
Hep3Vector simTrackerHitPosition = layerToSimTrackerHit.get(strip.layer()).get(0).getPositionVec(); if(Math.signum(simTrackerHitPosition.y()) == Math.signum(stripPosition.z())){ simhits.add(layerToSimTrackerHit.get(strip.layer()).get(0));
@@ -209,7 +214,7 @@
} } else if(layerToSimTrackerHit.get(strip.layer()).size() > 1){
- System.out.println(this.getClass().getSimpleName() + ": WARNING Layer with multiple hits found.");
+ if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": found " + layerToSimTrackerHit.get(strip.layer()).size() + " SimTrackerHits to match to strip in layer " + strip.layer());
//System.exit(1); double deltaZ = Double.MAX_VALUE; SimTrackerHit simTrackerHitMatch = null;
@@ -232,20 +237,21 @@
return simhits; }
- public List<SiTrackerHit> stripClusterToSiHits(HelicalTrackStrip strip, List<SiTrackerHit> siTrackerHits, boolean stripsInTrackingFrame) - { - - //Should be a one to one match with a strip! - Hep3Vector stripPosition = this.getClusterPosition(strip,stripsInTrackingFrame); - if(_DEBUG) System.out.println("Strip position " + stripPosition.toString() + " ( " + strip.origin().toString() + ")"); - - for(SiTrackerHit siTrackerHit : siTrackerHits){ - SiTrackerHitStrip1D h = (SiTrackerHitStrip1D) siTrackerHit; - if(_DEBUG) System.out.println("SiTrackerHit origin position " + h.getPositionAsVector().toString()); - } - - List<SiTrackerHit> hits = new ArrayList<SiTrackerHit>(); - return hits; - - }
+// public List<SiTrackerHit> stripClusterToSiHits(HelicalTrackStrip strip, List<SiTrackerHit> siTrackerHits, boolean stripsInTrackingFrame) +// { +// +// //Should be a one to one match with a strip! +// Hep3Vector stripPosition = this.getClusterPosition(strip,stripsInTrackingFrame); +// if(_DEBUG) System.out.println("Strip position " + stripPosition.toString() + " ( " + strip.origin().toString() + ")"); +// +// for(SiTrackerHit siTrackerHit : siTrackerHits){ +// SiTrackerHitStrip1D h = (SiTrackerHitStrip1D) siTrackerHit; +// if(_DEBUG) System.out.println("SiTrackerHit origin position " + h.getPositionAsVector().toString()); +// +// } +// +// List<SiTrackerHit> hits = new ArrayList<SiTrackerHit>(); +// return hits; +// +// }
}
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1