lcsim/src/org/lcsim/event/util
diff -N MCPClassifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ MCPClassifier.java 5 Aug 2005 21:55:25 -0000 1.1
@@ -0,0 +1,55 @@
+package org.lcsim.event.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.lcsim.event.MCParticle;
+
+
+/**
+ * MCPClassifier has a single method getClassification(MCParticle) which
+ * returns a string classifying the MCParticle parameter. String values
+ * are:
+ * GeneratorInt -> Generator particle the simulator never saw
+ * GeneratorPre -> Generator particle passed to the simulator along with a
+ * predecay, and the simulator generated the decay products.
+ * GeneratorFS -> Generator final state particle: either FinalState in the
+ * input file, or intermediate passed to the Simulator with a
+ * predecay that never happened.
+ * Backscatter -> Simulator particle produced as a result of backscatter from
+ * a non-tracking region.
+ * VNEOP -> Simulator particle produced without destroying parent.
+ * IntOrDecay -> Simulator particle produced as a result of an interaction or
+ * decay in a tracking region.
+ *
+ */
+
+public class MCPClassifier
+{
+
+ public String getClassification(MCParticle p)
+ {
+ if(p.getGeneratorStatus() > 0)
+ {
+ boolean hasGeneratorDaughters = false;
+ List<MCParticle> daughters = p.getDaughters();
+ for(MCParticle d : daughters)
+ {
+ if(d.getGeneratorStatus() > 0)hasGeneratorDaughters = true;
+ }
+ if(!hasGeneratorDaughters)return "GeneratorFS";
+ if(p.getSimulatorStatus().isDecayedInTracker() |
+ p.getSimulatorStatus().isDecayedInCalorimeter())return "GeneratorPre";
+ return "GeneratorInt";
+ }
+ else
+ {
+ if(p.getSimulatorStatus().isBackscatter())return "Backscatter";
+ if(p.getSimulatorStatus().vertexIsNotEndpointOfParent())return "VNEOP";
+ return "IntOrDecay";
+ }
+
+ }
+
+}