Commit in lcsim-contrib/src/main/java/org/lcsim/contrib/Partridge/TrackingTest on MAIN
AnalysisDriver.java+31-51.2 -> 1.3
ResolutionAnalysis.java+15-31.1.1.1 -> 1.2
+46-8
2 modified files
Minor updates

lcsim-contrib/src/main/java/org/lcsim/contrib/Partridge/TrackingTest
AnalysisDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- AnalysisDriver.java	30 Jan 2009 15:46:16 -0000	1.2
+++ AnalysisDriver.java	20 Feb 2009 22:50:15 -0000	1.3
@@ -62,8 +62,6 @@
         List<SeedStrategy> slist = StrategyXMLUtils.getStrategyListFromResource(
                 StrategyXMLUtils.getDefaultStrategiesPrefix() + sfile);
 
-
-
         //  Create a relational table that maps TrackerHits to MCParticles
         RelationalTable hittomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
         List<LCRelation> mcrelations = event.get(LCRelation.class, "HelicalTrackMCRelations");
@@ -79,7 +77,9 @@
         RelationalTable trktomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
         for (Track track : tracklist) {
             TrackAnalysis tkanal = new TrackAnalysis(track, hittomc);
-            aida.cloud1D("Purity for " + tkanal.getNHits() + " hits").fill(tkanal.getPurity());
+            int nbad = tkanal.getNBadHits();
+            double purity = tkanal.getPurity();
+            aida.cloud1D("Purity for " + tkanal.getNHits() + " hits").fill(purity);
             tkmap.put(track, tkanal);
             MCParticle mcp = tkanal.getMCParticle();
             if (mcp != null) {
@@ -94,8 +94,34 @@
                 HelixParamCalculator helix = new HelixParamCalculator(mcp, 2.0);
                 double d0tk = track.getTrackParameter(HelicalTrackFit.dcaIndex);
                 double d0mc = helix.getDCA();
-                aida.cloud2D("Pt trk vs MC with "+tkanal.getNBadHits()+" bad hits").fill(ptmc,pttk);
-                aida.cloud2D("d0 trk vs MC with "+tkanal.getNBadHits()+" bad hits").fill(d0mc,d0tk);
+                double d0err = Math.sqrt(track.getErrorMatrix().diagonal(HelicalTrackFit.dcaIndex));
+                double curv = track.getTrackParameter(HelicalTrackFit.curvatureIndex);
+                double curverr = Math.sqrt(track.getErrorMatrix().diagonal(HelicalTrackFit.curvatureIndex));
+                double pterr = pttk * curverr / curv;
+                double d0pull = (d0tk - d0mc) / d0err;
+                double ptpull = (pttk - ptmc) / pterr;
+                if (nbad == 0) {
+                    aida.histogram2D("pT MC vs pT Reco for 0 Bad Hits",
+                            100, 0., 5., 100, 0., 5.).fill(ptmc,pttk);
+                    aida.histogram2D("d0 MC vs d0 Reco for 0 Bad Hits",
+                            100, -0.2, 0.2, 100, -0.2, 0.2).fill(d0mc, d0tk);
+                    aida.histogram1D("pT Pull for 0 Bad Hits", 100, -10., 10.).fill(ptpull);
+                    aida.histogram1D("d0 pull for 0 Bad Hits", 100, -10., 10.).fill(d0pull);
+                } else if (purity > 0.5) {
+                    aida.histogram2D("pT MC vs pT Reco for 0.5 < purity < 1",
+                            100, 0., 5., 100, 0., 5.).fill(ptmc,pttk);
+                    aida.histogram2D("d0 MC vs d0 Reco for 0.5 < purity < 1",
+                            100, -0.2, 0.2, 100, -0.2, 0.2).fill(d0mc, d0tk);
+                    aida.histogram1D("pT Pull for 0.5 < purity < 1", 100, -10., 10.).fill(ptpull);
+                    aida.histogram1D("d0 pull for 0.5 < purity < 1", 100, -10., 10.).fill(d0pull);
+                } else if (purity < 0.5) {
+                    aida.histogram2D("pT MC vs pT Reco for purity <= 0.5",
+                            100, 0., 5., 100, 0., 5.).fill(ptmc,pttk);
+                    aida.histogram2D("d0 MC vs d0 Reco for purity <= 0.5",
+                            100, -0.2, 0.2, 100, -0.2, 0.2).fill(d0mc, d0tk);
+                    aida.histogram1D("pT Pull for purity <= 0.5", 100, -10., 10.).fill(ptpull);
+                    aida.histogram1D("d0 pull for purity <= 0.5", 100, -10., 10.).fill(d0pull);
+                }
             }
         }
 

lcsim-contrib/src/main/java/org/lcsim/contrib/Partridge/TrackingTest
ResolutionAnalysis.java 1.1.1.1 -> 1.2
diff -u -r1.1.1.1 -r1.2
--- ResolutionAnalysis.java	10 Dec 2008 22:03:06 -0000	1.1.1.1
+++ ResolutionAnalysis.java	20 Feb 2009 22:50:15 -0000	1.2
@@ -10,6 +10,7 @@
 package org.lcsim.contrib.Partridge.TrackingTest;
 
 import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
 import java.util.List;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.LCRelation;
@@ -26,7 +27,8 @@
  */
 public class ResolutionAnalysis extends Driver {
     private AIDA aida = AIDA.defaultInstance();
-    
+    private int nevt = 0;
+
     /** Creates a new instance of ResolutionAnalysis */
     public ResolutionAnalysis() {
     }
@@ -39,9 +41,19 @@
         for (LCRelation relation : mcrelations) {
             hittomc.add(relation.getFrom(), relation.getTo());
         }
-        
+
+        nevt++;
         List<Track> tracklist = event.getTracks();
-        if (tracklist.size() > 1) System.out.println("Found "+tracklist.size()+" Tracks!");
+        List<MCParticle> mclist = event.getMCParticles();
+        for (MCParticle mcp : mclist) {
+            Hep3Vector p = mcp.getMomentum();
+            double pt = Math.sqrt(p.x()*p.x()+p.y()*p.y());
+            if (pt<0.2) continue;
+            double angle = 180. * Math.acos(p.z()/p.magnitude())/Math.PI;
+            if (angle < 8.5 || angle > 171.5) continue;
+            if (tracklist.size() != 1) System.out.println("Event: "+nevt+" pT: "+pt+" theta: "+angle);
+        }
+//        if (tracklist.size() != 1) System.out.println("Found "+tracklist.size()+" Tracks!");
         for (Track track : tracklist) {
             TrackAnalysis tkanal = new TrackAnalysis(track, hittomc);
             MCParticle mcp = tkanal.getMCParticle();
CVSspam 0.2.8