lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.10 -r1.11
--- MCFastTracking.java 15 Jul 2006 09:35:58 -0000 1.10
+++ MCFastTracking.java 26 Apr 2007 21:20:21 -0000 1.11
@@ -1,7 +1,7 @@
package org.lcsim.mc.fast.tracking;
/**
- * $Id: MCFastTracking.java,v 1.10 2006/07/15 09:35:58 jstrube Exp $
+ * $Id: MCFastTracking.java,v 1.11 2007/04/26 21:20:21 cassell Exp $
*/
import hep.physics.particle.Particle;
import java.io.IOException;
@@ -14,6 +14,7 @@
import org.lcsim.conditions.ConditionsSet;
import org.lcsim.event.EventHeader;
import org.lcsim.event.Track;
+import org.lcsim.event.MCParticle;
import org.lcsim.util.Driver;
@@ -27,6 +28,8 @@
private boolean beamSpotConstraint;
private boolean simple;
private final static double[] IP = { 0, 0, 0 };
+ private boolean defaultMC = true;
+ private String fsname;
public MCFastTracking()
{
@@ -69,9 +72,25 @@
throw new RuntimeException("Error reading track resolution tables",x);
}
}
+ public void setFSList(String fslist)
+ {
+ fsname = fslist;
+ }
protected void process(EventHeader event)
{
+ if(defaultMC)
+ {
+ fsname = "MCParticles";
+ }
+ else
+ {
+ if(!event.hasCollection(MCParticle.class,fsname))
+ {
+ System.err.println("Collection "+fsname+" not found. Default Final State particles being used");
+ fsname = "MCParticles";
+ }
+ }
if (parm == null)
{
ConditionsSet conditions = getConditionsManager().getConditions("TrackParameters");
@@ -90,14 +109,17 @@
boolean hist = getHistogramLevel() > 0;
List trackList = new ArrayList();
- for (Iterator i = event.getMCParticles().iterator(); i.hasNext();)
+ for (Iterator i = event.get(MCParticle.class,fsname).iterator(); i.hasNext();)
{
Particle p = (Particle) i.next();
// filter for FINAL_STATE
- if (p.getGeneratorStatus() != Particle.FINAL_STATE)
+ if(defaultMC)
{
- continue;
+ if (p.getGeneratorStatus() != Particle.FINAL_STATE)
+ {
+ continue;
+ }
}
double pCharge = p.getCharge();
if (pCharge == 0 || Double.isNaN(pCharge) || pCharge == Double.NEGATIVE_INFINITY || pCharge == Double.POSITIVE_INFINITY)