hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -u -r1.5 -r1.6
--- HelicalTrackHitDriver.java 22 Aug 2013 00:29:16 -0000 1.5
+++ HelicalTrackHitDriver.java 10 Oct 2013 01:21:32 -0000 1.6
@@ -17,6 +17,9 @@
import org.lcsim.event.LCRelation;
import org.lcsim.event.MCParticle;
import org.lcsim.event.RawTrackerHit;
+import org.lcsim.event.RelationalTable;
+import org.lcsim.event.SimTrackerHit;
+import org.lcsim.event.base.BaseRelationalTable;
import org.lcsim.fit.helicaltrack.HelicalTrackCross;
import org.lcsim.fit.helicaltrack.HelicalTrackHit;
import org.lcsim.fit.helicaltrack.HelicalTrackStrip;
@@ -33,7 +36,7 @@
* @author Mathew Graham <[log in to unmask]>
* @author Per Hansson <[log in to unmask]>
* @author Omar Moreno <[log in to unmask]>
- * @version $Id: HelicalTrackHitDriver.java,v 1.5 2013/08/22 00:29:16 phansson Exp $
+ * @version $Id: HelicalTrackHitDriver.java,v 1.6 2013/10/10 01:21:32 meeg Exp $
*/
public class HelicalTrackHitDriver extends org.lcsim.fit.helicaltrack.HelicalTrackHitDriver {
@@ -42,7 +45,6 @@
private boolean _debug = false;
private double _clusterTimeCut = -99; // if negative, don't cut..otherwise, dt cut time in ns
private String _subdetectorName = "Tracker";
- private String _clusterCollectionName = "StripClusterer_SiTrackerHitStrip1D";
private Map<String, String> _stereomap = new HashMap<String, String>();
private List<String> _colnames = new ArrayList<String>();
@@ -152,6 +154,16 @@
// Create an LCRelation from a HelicalTrackHit to an MC particle used to create it
List<LCRelation> mcrelations = new ArrayList<LCRelation>();
+ RelationalTable hittomc = new BaseRelationalTable(RelationalTable.Mode.ONE_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+ if (event.hasCollection(LCRelation.class, "SVTTrueHitRelations")) {
+ List<LCRelation> trueHitRelations = event.get(LCRelation.class, "SVTTrueHitRelations");
+ for (LCRelation relation : trueHitRelations) {
+ if (relation != null && relation.getFrom() != null && relation.getTo() != null) {
+ hittomc.add(relation.getFrom(), relation.getTo());
+ }
+ }
+ }
+
if(LayerGeometryType.Common==_layerGeometryType) {
for (String _colname : this._colnames) {
@@ -186,6 +198,11 @@
// Create a HelicalTrackStrip for this hit
HelicalTrackStrip strip = makeDigiStrip(h);
+ for (RawTrackerHit rth : h.getRawHits()) {
+ for (Object simHit : hittomc.allFrom(rth)) {
+ strip.addMCParticle(((SimTrackerHit) simHit).getMCParticle());
+ }
+ }
// Get the list of strips for this layer - create a new list if one doesn't already exist
List<HelicalTrackStrip> lyrhits = striplistmap.get(id);
@@ -324,7 +341,12 @@
// Create a HelicalTrackStrip for this hit
HelicalTrackStrip strip = makeDigiStrip(h);
-
+ for (RawTrackerHit rth : h.getRawHits()) {
+ for (Object simHit : hittomc.allFrom(rth)) {
+ strip.addMCParticle(((SimTrackerHit) simHit).getMCParticle());
+ }
+ }
+
if ((_clusterTimeCut > 0 && Math.abs(h.getTime()) < _clusterTimeCut)||_clusterTimeCut<0) {
// Add the strip to the list of strips on this sensor
hitsOnSensor.add(strip);