Commit in lcsim/src/org/lcsim/contrib/compile/SteveMagill on MAIN
BTrMipClus.java+17-71.4 -> 1.5
Added threshold hit collection for event display
Added timing cut for scintillator HCAL

lcsim/src/org/lcsim/contrib/compile/SteveMagill
BTrMipClus.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- BTrMipClus.java	9 Aug 2005 01:38:42 -0000	1.4
+++ BTrMipClus.java	9 Aug 2005 23:16:07 -0000	1.5
@@ -7,16 +7,13 @@
 //  Clusters, and HAD NN Shower Clusters to form Track-CAL Associated Shower Clusters
 // import java.util.List;
 import java.util.*;
-import hep.physics.jet.JetFinder;
-import hep.physics.jet.DurhamJetFinder;
-import hep.physics.vec.HepLorentzVector;
 import hep.physics.vec.Hep3Vector;
 // import org.lcsim.event.Cluster;
 // import org.lcsim.event.EventHeader;
 import org.lcsim.event.*;
+import org.lcsim.event.EventHeader.LCMetaData;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
-import org.lcsim.util.fourvec.Momentum4Vector;
 import org.lcsim.geometry.*;
 import org.lcsim.geometry.subdetector.CylindricalCalorimeter;
 import org.lcsim.recon.cluster.util.*;
@@ -122,6 +119,7 @@
       double EEMlowE=0;  double EEMhighE=0;
       double ESumBTotCAL=0;
       double hthrshld = 0;
+      double htime = 0;
       int nhitsBTotCAL=0;
       double[][] celbtheta = new double[5000][_numbemlayers+_numbhadlayers];
       double[][] celbphi = new double[5000][_numbemlayers+_numbhadlayers];
@@ -167,16 +165,21 @@
       CalorimeterIDDecoder hadbdecoder = (CalorimeterIDDecoder) event.getMetaData(hadbHits).getIDDecoder();
       // create a map of cells keyed on their index
       Map<Long, CalorimeterHit> hadbhitmap = new HashMap<Long, CalorimeterHit>();
-      if (event.getDetectorName().equals("cdcaug05")) hthrshld = 0.0002;   // 1/3 mip threshold for cdc Scin HCAL
+
+      if (event.getDetectorName().equals("cdcaug05"))
+      {
+          hthrshld = 0.0005;   // 1/3 mip threshold for cdc Scin HCAL
+          htime = 100;  // 100 ns cut on hit time
 //      System.out.println("HAD Threshold = " +hthrshld);
+      }
       for (SimCalorimeterHit hadbhit : hadbHits)
       {
           long hitID = hadbhit.getCellID();
           hadbdecoder.setID(hitID);
           int hadblayer = hadbdecoder.getLayer();
-//          if (hadbhit.getEnergy() > hthrshld)
           aida.cloud1D("HAD Cell Vis E before thr cut").fill(hadbhit.getRawEnergy());
-          if (hadbhit.getRawEnergy() > hthrshld)
+          aida.cloud1D("HAD Cell Time before timing cut").fill(hadbhit.getTime());
+          if (hadbhit.getRawEnergy() > hthrshld && hadbhit.getTime() < 100)
           {
               aida.cloud1D("HAD Cell Vis E after thr cut").fill(hadbhit.getRawEnergy());
               celbtheta[nhitbLayer[_numbemlayers+hadblayer]][_numbemlayers+hadblayer] = hadbdecoder.getTheta();				  
@@ -258,6 +261,11 @@
       aida.cloud1D("Total EM B Vis ESum").fill(EMBESum);
       aida.cloud1D("Total EM B Calib ESum").fill(EMBESumC);
       aida.cloud1D("Total HAD B Vis ESum").fill(HADBESum);
+
+      //  Make a new collection that only includes had hits above threshold - for Event display
+      List<CalorimeterHit> hlist = new ArrayList(hadbhitmap.values());
+      LCMetaData meta = event.getMetaData(hadbHits);
+      event.put("ThrHcalBHits",hlist,CalorimeterHit.class,meta.getFlags(),meta.getName());
       
       /** This section finds mip clusters in cal attached to a reconstructed (or true) track.
        *  The starting point is the first layer of the ECAL and the endpoint is the point
@@ -917,6 +925,7 @@
           double mcppy = mcob.getPY();
           double mcppz = mcob.getPZ();
           double mcpE = mcob.getEnergy();
+          double mckE = mcob.getEnergy()-mcob.getMass();
           double mcpmt = Math.sqrt(mcppx*mcppx+mcppy*mcppy+mcppz*mcppz);
           double mcpct = mcppz/mcpmt;
           double mcppt = Math.sqrt(mcppx*mcppx+mcppy*mcppy);
@@ -936,6 +945,7 @@
                   nneu++;
                   neuE += mcpE;
                   aida.cloud1D("Neutral E Distribution").fill(mcpE);
+                  if (nhitsEMB < 1) aida.cloud2D("Neutral E vs NhadHits").fill(mckE,nhitsHADB);
               }
           } else
           {
CVSspam 0.2.8