Print

Print


Commit in SlicDiagnostics/codeRC on MAIN
BugCutSnippet.java+34added 1.1
TestStatuses.java+44-211.1 -> 1.2
+78-21
1 added + 1 modified, total 2 files


SlicDiagnostics/codeRC
BugCutSnippet.java added at 1.1
diff -N BugCutSnippet.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ BugCutSnippet.java	5 Jan 2007 01:29:39 -0000	1.1
@@ -0,0 +1,34 @@
+   protected void process(EventHeader event)
+   {
+//
+//   First cut out the events with known G4/SLIC problems
+//
+      List<MCParticle> particles = event.get(MCParticle.class,event.MC_PARTICLES);
+      boolean proceed = true;
+      for(MCParticle p : particles)
+      {
+         int pid = Math.abs(p.getPDGID());
+         if(p.getGeneratorStatus() != 3)
+         {
+            try
+            {
+               Hep3Vector ep = p.getEndPoint();
+            }
+            catch(RuntimeException x)
+            {
+               proceed = false;
+            }
+            if(!p.getSimulatorStatus().isBackscatter())
+            {
+               Hep3Vector vtx = p.getOrigin();
+               double vr = Math.sqrt(vtx.x()*vtx.x()+vtx.y()*vtx.y());
+               double vz = Math.abs(vtx.z());
+               if( (vr > EMminR)||(vz > EMminZ))proceed = false;
+            }
+         }
+      }
+      if(!proceed)
+      {
+         return;
+      }
+   }

SlicDiagnostics/codeRC
TestStatuses.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TestStatuses.java	9 Feb 2006 01:17:11 -0000	1.1
+++ TestStatuses.java	5 Jan 2007 01:29:39 -0000	1.2
@@ -1,17 +1,14 @@
-import java.util.*;
-import hep.aida.*;
-import org.lcsim.event.MCParticle;
-import org.lcsim.event.Cluster;
+package org.lcsim.slic.diagnostics.mcparticle;
+
+import hep.physics.vec.Hep3Vector;
+
+import java.util.List;
+
 import org.lcsim.event.EventHeader;
+import org.lcsim.event.MCParticle;
 import org.lcsim.event.util.MCParticleClassifier;
-import org.lcsim.recon.cluster.cheat.*;
-import org.lcsim.recon.cluster.util.*;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
-import org.lcsim.event.CalorimeterHit;
-import org.lcsim.event.SimCalorimeterHit;
-import org.lcsim.geometry.IDDecoder;
-import hep.physics.vec.*;
 
 /**
  * Test classifier
@@ -20,32 +17,58 @@
 {
    MCParticleClassifier classifier;   
    private AIDA aida = AIDA.defaultInstance();
+   int ievt;
    public TestStatuses()
    {
+      ievt = 0;
    }
    protected void process(EventHeader event)
    {
+       //System.out.println("hello how are u");
        List<List<MCParticle>> collections = event.get(MCParticle.class);
        for (List<MCParticle> collection : collections)
        {
           int ip = 0;
           for(MCParticle p : collection)
           {
-             int simstat = p.getSimulatorStatus().getValue();
-             int[] nibb = new int[8];
-             nibb[0] = simstat%16;
-             for(int i=1;i<8;i++)
+             if(p.getGeneratorStatus() != 3)
              {
-                simstat /= 16;
-                nibb[i] = simstat%16;
+                try
+                {
+                   Hep3Vector ep = p.getEndPoint();
+                }
+                catch(RuntimeException x)
+                {
+                   System.out.println("Event "+ievt+" particle "+ip+" has no endpoint");
+                   System.out.println(p.getType().getName()+": E = "+p.getEnergy());
+                }
+
+                if(!p.getSimulatorStatus().isBackscatter())
+                {
+                   Hep3Vector vtx = p.getOrigin();
+                   double vr = Math.sqrt(vtx.x()*vtx.x()+vtx.y()*vtx.y());
+                   double vz = Math.abs(vtx.z());
+                   if( (vr > 1265)||(vz > 1679))
+                   {
+                      System.out.println("Event "+ievt+" particle "+ip+" has vertex out of tracking region: "+vr+", "+vz);
+                      System.out.println(p.getType().getName()+": E = "+p.getEnergy());
+                   
+                      System.out.println("    DiT = "+p.getSimulatorStatus().isDecayedInTracker()+": DiC = "+
+                      p.getSimulatorStatus().isDecayedInCalorimeter()+": Left = "+p.getSimulatorStatus().hasLeftDetector()+": Stopped = " +
+                      p.getSimulatorStatus().isStopped()+":VNEOP = "+p.getSimulatorStatus().vertexIsNotEndpointOfParent());
+                   }
+                }
              }
-             System.out.println(ip+": "+p.getPDGID()+"Gen status  "+p.getGeneratorStatus()+": Simulator status "+
-              nibb[7]+" "+nibb[6]+" "+nibb[5]+" "+nibb[4]+" "+nibb[3]+" "+nibb[2]+" "+nibb[1]+" "+nibb[0]);
-             System.out.println("    DiT = "+p.getSimulatorStatus().isDecayedInTracker()+": DiC = "+
-              p.getSimulatorStatus().isDecayedInCalorimeter()+": Left = "+p.getSimulatorStatus().hasLeftDetector()+": Stopped = " +
-              p.getSimulatorStatus().isStopped());
              ip++;
           }
        }
+       ievt++;
+    }
+
+    protected void endEvents(int nevents)
+    {
+        ievt=0;
+        System.out.println("TestStatuses - DONE");
     }
+
 }
CVSspam 0.2.8