Commit in lcsim/src/org/lcsim/recon/cheater on MAIN
ReconCheater.java+35-141.3 -> 1.4
Update.

lcsim/src/org/lcsim/recon/cheater
ReconCheater.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- ReconCheater.java	27 Sep 2005 00:00:29 -0000	1.3
+++ ReconCheater.java	28 Sep 2005 00:35:51 -0000	1.4
@@ -48,9 +48,9 @@
 
 /** ... */
 public class ReconCheater extends Driver
-//				  implements ConditionsListener
+				  implements ConditionsListener
 {
-    // CheatingTables Cheating;
+    CheatingTable Cheating;
 
     boolean useFullTruth = false; // Use primary MCParticles.
     boolean useTruth = false;     // Use MCParticles energies.
@@ -89,10 +89,23 @@
 	CheatClusterDriver clusterFinder = new CheatClusterDriver();
 	add(clusterFinder);
 
-	if (useFullTruth) useTruth = true;
 	df.setMaximumFractionDigits(3);	
     }
 
+
+    void init()
+    {
+	useFullTruth = Cheating.useFullTruth();
+	useTruth = Cheating.useTruth();
+	if (useFullTruth) useTruth = true;
+
+	useECalParameterization = Cheating.useECalParameterization();
+	useHCalParameterization = Cheating.useHCalParameterization();
+	useReconPhotons = Cheating.useReconPhotons();
+	useReconNeutralHadrons = Cheating.useReconNeutralHadrons();
+	allowNuclearInteractions = Cheating.allowNuclearInteractions();
+    }
+
     protected int nEvt = 0;
     boolean first = true, firstEvents = true;
     boolean hist;
@@ -106,13 +119,14 @@
 
         hist = getHistogramLevel() > 0;
 	if (hist) System.err.println(" ReconCheater: hist = "+hist);
-     /*
+
         if (Cheating == null) {
            ConditionsSet conditions = getConditionsManager().getConditions("Cheating");
            conditions.addConditionsListener(this);
-           Cheating = new CheatingTables(conditions);
+           Cheating = new CheatingTable(conditions);
+	   init();
         }
-     */
+
 	// Get MCParticle mapping from event.
 	map = getMCParticleMapping(event);
 
@@ -125,13 +139,14 @@
 	first = false;
 	if (nEvt>=3) firstEvents = false;
     }
- /*
+
     public void conditionsChanged(ConditionsEvent event)
     {
         ConditionsSet conditions = getConditionsManager().getConditions("Cheating");
-        Cheating = new CheatingTables(conditions);
+        Cheating = new CheatingTable(conditions);
+	init();
     }
- */
+
 
     Map<MCParticle,CheatTrack> charged = null;    // Tracks from MCParticles
     Map<MCParticle,CheatCluster> neutrals = null; // and clusters.
@@ -374,7 +389,6 @@
 	//   Add neutral particles that were found in ClusterCheater list.
 	for (MCParticle mcp : neutrals.keySet()) {
 	    CheatCluster cluster = neutrals.get(mcp);
-	    double e = mcp.getEnergy(); if (e<=mcp.getType().getMass()) continue;
 	    if (useFullTruth) particles.add(new CheatReconstructedParticle(mcp));
 	    else particles.add(new CheatReconstructedParticle(cluster,getMeasuredEnergy(cluster),(Particle)mcp));
 	}
@@ -383,12 +397,13 @@
 	if (useFullTruth) {
 	    //   Add interacting charged particles.
 	    for (MCParticle mcp : chargedList) {
+		if (getStatusCode(mcp).equals("GEN_PREDECAY")) continue;
 		particles.add(new CheatReconstructedParticle(mcp));
 		finalEnergy += mcp.getEnergy();
 	    }
 	    //   Add interacting neutral particles.
 	    for (MCParticle mcp : neutralList) {
-		double e = mcp.getEnergy(); if (e<=mcp.getType().getMass()) continue;
+		if (getStatusCode(mcp).equals("GEN_PREDECAY")) continue;
 		particles.add(new CheatReconstructedParticle(mcp));
 		finalEnergy += mcp.getEnergy();
 	    }
@@ -396,6 +411,7 @@
 	else {
 	    //   Add interacting parents.
 	    for (MCParticle mcp : parents) {
+		if (getStatusCode(mcp).equals("GEN_PREDECAY")) continue;
 		particles.add(new CheatReconstructedParticle(mcp));
 		finalEnergy += mcp.getEnergy();
 		if (firstEvents)
@@ -405,13 +421,14 @@
 	    //   Add extra tracks.
 	    for (CheatTrack track : extraTrackList) {
 		MCParticle mcp = track.getMCParticle();
+		if (getStatusCode(mcp).equals("GEN_PREDECAY")) continue;
 		particles.add(new CheatReconstructedParticle(track,(Particle)mcp));
 		finalEnergy += mcp.getEnergy();
 	    }
 	    //   Add extra clusters.
 	    for (CheatCluster cluster : extraClusterList) {
 		MCParticle mcp = cluster.getMCParticle();
-		double e = mcp.getEnergy(); if (e<=mcp.getType().getMass()) continue;
+		if (getStatusCode(mcp).equals("GEN_PREDECAY")) continue;
 		particles.add(new CheatReconstructedParticle(cluster,getMeasuredEnergy(cluster),(Particle)mcp));
 		finalEnergy += mcp.getEnergy();
 	    }
@@ -426,7 +443,10 @@
 	if (firstEvents) System.out.println(text); //if (first) System.err.println(text);
 
 	// Total energy
-	if (firstEvents) System.out.println("    Total event energy = "+df.format(finalEnergy)+".\n");
+	if (firstEvents) {
+	    text = "    Total event energy = "+df.format(finalEnergy);
+	    System.out.println(text+".\n"); //System.err.println(text);
+	}
 
 	if (hist) analyzeReconstructedParticles(particles);
 
@@ -541,6 +561,7 @@
 
 	    String statusCode = ""+getStatusCode(mcp);
 	    boolean finalState = statusCode.equals("GEN_FINAL_STATE");
+	    boolean decay = statusCode.equals("GEN_PREDECAY");
 
 	    //if (finalState) {
 		int PDGID = particle.getPDGID();
@@ -570,7 +591,7 @@
 		boolean gluon = PDGID==21;
 		boolean unknown = PDGID==0 || PDGID==92;
 
-	    if (finalState && !neutrino && !(quark||gluon||unknown)) {
+	    if ((finalState || decay) && !neutrino && !(quark||gluon||unknown)) {
 		NMCParticles++;
 	        Hep3Vector PV = particle.getMomentum();
 		double Pt = Math.sqrt(PV.x()*PV.x()+PV.y()*PV.y());
CVSspam 0.2.8