Print

Print


Commit in hps-java/src/main/java on MAIN
Utilities/DatFileToStdhepTVM.java+357added 1.1
         /DatFileToStdhep.java+13-71.5 -> 1.6
org/lcsim/HPSDedicatedv2/TrackReconstructionDriver.java+3-31.3 -> 1.4
                        /MultiTrackReco.java+3-31.2 -> 1.3
org/lcsim/HPSVertexing/BilliorTrack.java+4-41.1 -> 1.2
                      /BilliorVertex.java+184-151.1 -> 1.2
org/lcsim/HPSDedicatedv3/MultiTrackReco.java+5-31.4 -> 1.5
                        /FastTrackAnalysisDriver.java+39-31.1 -> 1.2
                        /TestVertexing.java+5-51.4 -> 1.5
                        /ReReconstructionDriver.java+2-11.1 -> 1.2
org/lcsim/HPSDedicated/TrackReconstructionDriver_HPS_12.java+2-21.3 -> 1.4
+617-46
1 added + 10 modified, total 11 files
minor changes

hps-java/src/main/java/Utilities
DatFileToStdhepTVM.java added at 1.1
diff -N DatFileToStdhepTVM.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ DatFileToStdhepTVM.java	10 Nov 2010 17:31:20 -0000	1.1
@@ -0,0 +1,357 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Utilities;
+
+/**
+ *
+ * @author richp
+ * modified by mbussonn to take arguments from command line
+ */
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StreamTokenizer;
+import java.util.ArrayList;
+import java.util.List;
+
+import hep.io.stdhep.StdhepBeginRun;
+import hep.io.stdhep.StdhepEndRun;
+import hep.io.stdhep.StdhepEvent;
+import hep.io.stdhep.StdhepWriter;
+import java.io.File;
+import java.util.Random;
+
+public class DatFileToStdhepTVM {
+
+    static boolean expDecay = false;
+    static boolean flatDecay = false;
+    static boolean trident = false;
+    static double _declength = 0.0;//A' decay length (mm)
+    static double _xoff = 0.03;
+    static double _yoff = 0;
+    static double _zoff = 0;
+    static double sigx = 0.0;        // Luminous region size in x (mm)
+    static double sigy = 0.01;        // Luminous region size in y (mm)
+    static double sigz = 0.01;         // Luminous region size in z (mm)
+    static double aMass = 0.05;  //Aprime mass (GeV)
+    static double maxLen = 200; // maximum decay length (mm)
+    static double _ecm = 5.5; //GeV
+    static StdhepWriter sw;
+    static int nmax = 500000;
+
+    /**
+     * @param args the command line arguments
+     * @throws IOException
+     */
+    public static void main(String[] args) throws IOException {
+        int nInFiles = 10000;
+        double apMass = 0.2;
+        _ecm = 6.6;
+        _declength=0;//mm
+        sigx = 0.1;
+        sigy = 0.1;
+
+        String fileLabel = "ap6.6gev200mevsel";
+        String postfix = "_100u_beamspot_gammactau_0cm.stdhep";
+
+        int nread = -1;
+        int nOutFile = 0;
+        for (int i = 0; i < nInFiles; i++) {
+            int fnum = i + 1;
+            String snum = "_" + fnum;
+            if (fnum < 1000) snum = "_0" + fnum;
+            if (fnum < 100) snum = "_00" + fnum;
+            if (fnum < 10) snum = "_000" + fnum;
+
+            aMass = apMass;
+            String file = "/a/surrey10/vol/vol0/g.hps/mgraham/DarkPhoton/tvm/ap6.6gev/" + fileLabel + snum + ".dat";
+            String infile = file;
+            if (nread == -1) {
+                nOutFile++;
+                String outfile = "/a/surrey10/vol/vol0/g.hps/mgraham/DarkPhoton/SignalEvents/" + fileLabel + "_" + nOutFile + postfix;//replace .txt by .stdhep
+                System.out.println("==== processing " + infile + " into " + outfile + "  aP mass = " + aMass + "====");
+                openStdHepFile(outfile);
+            }
+            File f = new File(infile);
+            if (f.exists()) nread += process(infile);
+            if (nread > nmax) {
+                nread = -1;
+                closeStdHepFile();
+            }
+        }
+        closeStdHepFile();
+    }
+
+    @SuppressWarnings("static-access")
+    private static int lineCounter(StreamTokenizer tok) throws IOException {
+        int lines = 0;
+        while (tok.nextToken() != tok.TT_EOF) {
+            if (tok.ttype == tok.TT_EOL)
+                lines++;
+            if (tok.ttype == tok.TT_WORD && tok.sval.startsWith("nev"))
+                return lines;
+        }
+        //shouldn't get here...but maybe
+        return lines;
+    }
+
+    private static void openStdHepFile(String outfile) throws IOException {
+
+        int nwrit = (int) nmax;
+
+
+        sw = new StdhepWriter(outfile, "Imported Stdhep Events",
+                "From file", nwrit);
+        sw.setCompatibilityMode(false);
+    }
+
+    private static int process(String infile) throws IOException {
+        Random generator = new Random();
+
+        FileReader lc = new FileReader(infile);
+        StreamTokenizer lctok = new StreamTokenizer(lc);
+        lctok.resetSyntax();
+        lctok.wordChars(33, 255);
+        lctok.parseNumbers();
+
+        lctok.whitespaceChars(0, ' ');
+        lctok.eolIsSignificant(true);
+        int nevts = lineCounter(lctok);
+        lc.close();
+        FileReader fr = new FileReader(infile);
+
+        StreamTokenizer tok = new StreamTokenizer(fr);
+
+        tok.resetSyntax();
+        tok.wordChars(33, 255);
+        tok.parseNumbers();
+
+        tok.whitespaceChars(0, ' ');
+        tok.eolIsSignificant(true);
+
+        System.out.println("Found " + nevts + "  events");
+        int nreq = (int) nevts;
+        int ngen = (int) nevts;
+        int nwrit = (int) nevts;
+        float ecm = (float) _ecm;
+        float xsec = (float) 99999997952.;
+        double rn1 = 12345321;
+        double rn2 = 66666666;
+        StdhepBeginRun sb = new StdhepBeginRun(nreq, ngen, nwrit, ecm, xsec, rn1, rn2);
+        sw.writeRecord(sb);
+
+
+        tok.resetSyntax();
+        tok.wordChars(33, 255);
+        tok.wordChars('0', '9');        // java.io.StreamTokenizer fails to parse
+        tok.wordChars('e', 'e');        // scientific notation like "1.09E-008".
+        tok.wordChars('E', 'E');        // The solution is to read and parse
+        tok.wordChars('.', '.');        // coordinates as "words".
+        tok.wordChars('+', '+');        // You run into trouble if the input file
+        tok.wordChars('-', '-');        // contains text with "e" or "E" which is
+        tok.whitespaceChars(0, ' ');
+        tok.eolIsSignificant(true);
+
+        double maxWght = 0;
+        if (expDecay) maxWght = findMaxWeight();
+
+        double[] beam = {0, 0, 0, 0};
+        int nevhep = 0;
+        for (int icross = 0; icross < nwrit; icross++) {
+            beam[0] = sigx * generator.nextGaussian() + _xoff;
+            beam[1] = sigy * generator.nextGaussian() + _yoff;
+            beam[2] = sigz * generator.nextGaussian() + _zoff;
+
+//            getToNextEvent(tok);
+            List<Double> vals = getNumbersInLine(tok);
+//            System.out.println(nums.toString());
+
+            if (vals.size() != 16)
+                throw new RuntimeException("Unexpected entry for event:  size = " + vals.size());
+
+            nevhep++;
+//            int nhep = nums.get(0).intValue();
+            int nhep = 4;  // two daughters of the A' and the recoil e-
+
+//            System.out.println("Number of particles for event " + nevhep + ": " + nhep);
+
+
+            int isthep[] = new int[nhep];
+            int idhep[] = new int[nhep];
+            int jmohep[] = new int[2 * nhep];
+            int jdahep[] = new int[2 * nhep];
+            double phep[] = new double[5 * nhep];
+            double vhep[] = new double[4 * nhep];
+            int i = 0;
+            double tmpDecLen = 0;
+            double[] ApMom = {0, 0, 0};
+            if (expDecay) tmpDecLen = getDecayLength(maxWght);
+            if (flatDecay) tmpDecLen = generator.nextDouble() * maxLen;
+            for (int npart = 0; npart < nhep; npart++) {
+
+                isthep[i] = 1;
+                if (npart == 0) isthep[i] = 2;
+//                 if (npart == 0) isthep[i] = 0;
+//                 if (npart == 0) isthep[i] = 1;
+                idhep[i] = 622;
+                if (npart == 1) idhep[i] = -11;
+                if (npart == 2) idhep[i] = 11;
+                if (npart == 3) idhep[i] = 11;
+                jmohep[2 * i] = 0;
+                jmohep[2 * i + 1] = 0;
+                jdahep[2 * i] = 2;
+                jdahep[2 * i + 1] = 3;
+                if (npart == 1 || npart == 2) {
+                    jmohep[2 * i] = 1;
+                    jmohep[2 * i + 1] = 1;
+                    jdahep[2 * i] = 0;
+                    jdahep[2 * i + 1] = 0;
+                }
+                if (npart == 3) {
+                    jmohep[2 * i] = 0;
+                    jmohep[2 * i + 1] = 0;
+                    jdahep[2 * i] = 0;
+                    jdahep[2 * i + 1] = 0;
+                }
+                for (int j = 0; j < 4; j++)
+                    phep[5 * i + j] = vals.get(4 * i + j);
+                phep[5 * i + 4] = 0.51109989000E-03;
+                if (npart == 0 && !trident) {
+                    phep[5 * i + 4] = aMass;
+                    ApMom[0] = phep[5 * i + 2];
+                    ApMom[1] = phep[5 * i + 1];
+                    ApMom[2] = phep[5 * i + 0];
+                }
+                for (int j = 0; j < 4; j++)
+                    vhep[4 * i + j] = beam[j];
+                //decay the A' and daughters daughters at _declength
+                if (!trident && (npart == 1 || npart == 2 || npart == 0))
+                    if (!expDecay && !flatDecay)
+                        vhep[4 * i + 0] = beam[0] + _declength;
+                    else {
+                        double totApMom = Math.sqrt(ApMom[0] * ApMom[0] + ApMom[1] * ApMom[1] + ApMom[2] * ApMom[2]);
+//                        System.out.println("Decay at : " + tmpDecLen);
+                        vhep[4 * i + 0] = beam[0] + tmpDecLen * ApMom[0] / totApMom;
+                        vhep[4 * i + 1] = beam[1] + tmpDecLen * ApMom[1] / totApMom;
+                        vhep[4 * i + 2] = beam[2] + tmpDecLen * ApMom[2] / totApMom;
+                    }
+                double px = phep[5 * i + 0];
+                double pz = phep[5 * i + 2];
+                phep[5 * i + 0] = pz;
+                phep[5 * i + 2] = px;
+                //                                if (i == 0 || i == nhep - 1) {
+/*
+                System.out.println(i + " st: " + isthep[i] + " id: " + idhep[i] +
+                " jmo: " + jmohep[2 * i] + " " + jmohep[2 * i + 1] +
+                " jda: " + jdahep[2 * i] + " " + jdahep[2 * i + 1]);
+                System.out.println("p: " + phep[5 * i] + " " + phep[5 * i + 1] + " " +
+                phep[5 * i + 2] + " " + phep[5 * i + 3] + " " + phep[5 * i + 4]);
+                System.out.println("v: " + vhep[4 * i] + " " + vhep[4 * i + 1] + " " +
+                vhep[4 * i + 2] + " " + vhep[4 * i + 3]);
+                 */
+                //                                }
+                i++;
+//                }
+            }
+            StdhepEvent ev = new StdhepEvent(nevhep, nhep, isthep, idhep, jmohep, jdahep, phep, vhep);
+            sw.writeRecord(ev);
+        }
+        fr.close();
+        int nreqe = (int) nevts;
+        int ngene = (int) nevts;
+        int nwrite = (int) nevts;
+        float ecme = (float) 6.0;
+        float xsece = (float) 99999997952.;
+        double rn1e = 12345321;
+        double rn2e = 66666666;
+        StdhepEndRun se = new StdhepEndRun(nreqe, ngene, nwrite, ecme, xsece, rn1e, rn2e);
+        sw.writeRecord(se);
+        return nwrit;
+
+
+    }
+
+    private static void closeStdHepFile() throws IOException {
+
+        sw.close();
+        System.out.println("Ok...done!");
+    }
+
+    @SuppressWarnings("static-access")
+    private static List<Double> getNumbersInLine(StreamTokenizer tok) throws IOException {
+        List<Double> nums = new ArrayList<Double>();
+        while (tok.nextToken() != tok.TT_EOF) {
+            if (tok.ttype == tok.TT_EOL)
+                break;
+            String tokVal = tok.sval;
+//            System.out.println(tokVal);
+            nums.add(Double.valueOf(tokVal).doubleValue());
+        }
+
+        return nums;
+    }
+
+    @SuppressWarnings("static-access")
+    private static double getNumberOfEvents(StreamTokenizer tok) throws IOException {
+        boolean fndNumber = false;
+        boolean fndOf = false;
+        boolean fndEvents = false;
+        double evts = -999;
+        while (tok.nextToken() != tok.TT_EOF) {
+//            System.out.println(tok.toString());
+            if (tok.ttype == tok.TT_EOL)
+                break;
+            if (tok.ttype == tok.TT_WORD && tok.sval.contentEquals("Number"))
+                fndNumber = true;
+            if (tok.ttype == tok.TT_WORD && tok.sval.contentEquals("of"))
+                fndOf = true;
+            if (tok.ttype == tok.TT_WORD && tok.sval.contentEquals("Events"))
+                fndEvents = true;
+            if (tok.ttype == tok.TT_NUMBER && fndEvents && fndOf && fndNumber)
+                evts = tok.nval;
+        }
+        return evts;
+    }
+
+    @SuppressWarnings("static-access")
+    private static void getToNextEvent(StreamTokenizer tok) throws IOException {
+        while (tok.nextToken() != tok.TT_EOF)
+            //            System.out.println(tok.toString());
+            if (tok.ttype == tok.TT_WORD && tok.sval.contentEquals("<event>")) {
+                tok.nextToken();//get to the EOL
+                return;
+            }
+    }
+
+    static private double expWeight(double x) {
+        return Math.exp(-x / _declength);
+    }
+
+    static private double findMaxWeight() {
+        Random generator = new Random();
+        int ntrials = 100000;
+        double maxlength = maxLen;
+        double maxWeight = 0;
+        for (int i = 0; i < ntrials; i++) {
+            double x = generator.nextDouble() * maxlength;
+            double wght = expWeight(x);
+            if (wght > maxWeight) maxWeight = wght;
+        }
+
+        return maxWeight;
+    }
+
+    static private double getDecayLength(double MaxWeight) {
+        Random generator = new Random();
+        double maxlength = maxLen;
+        double dl = 0;
+        double draw = generator.nextDouble();
+        double tmpwght = 0;
+        while (tmpwght < draw) {
+            dl = generator.nextDouble() * maxlength;
+            tmpwght = expWeight(dl) / MaxWeight;
+        }
+        return dl;
+    }
+}

hps-java/src/main/java/Utilities
DatFileToStdhep.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- DatFileToStdhep.java	28 Oct 2010 17:26:32 -0000	1.5
+++ DatFileToStdhep.java	10 Nov 2010 17:31:20 -0000	1.6
@@ -23,11 +23,11 @@
 
 public class DatFileToStdhep {
 
-    static boolean expDecay = true;
+    static boolean expDecay = false;
     static boolean flatDecay = false;
     static boolean trident = false;
 //    static double _declength = 0.0;//A' decay length (mm)
-     static double _declength = 50.0;//A' decay length (mm)
+     static double _declength = 0.0;//A' decay length (mm)
     static double _xoff = 0.03;
     static double _yoff = 0;
     static double _zoff = 0;
@@ -51,10 +51,16 @@
         //String[] files = {"ap5.5gev050mevall.dat", "ap5.5gev100mevall.dat", "ap5.5gev150mevall.dat", "ap5.5gev200mevall.dat", "ap5.5gev250mevall.dat", "ap5.5gev300mevall.dat", "ap5.5gev400mevall.dat", "ap5.5gev500mevall.dat", "ap5.5gev600mevall.dat", "ap5.5gev700mevall.dat"};
         //double[] mass = {0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7};
 
-          int nfiles=10;
-          String fileLabel="ap5.5gev100mevsel";
-          double apMass=0.1;
-          _ecm=5.5;
+//          int nfiles=10;
+//          String fileLabel="ap5.5gev100mevsel";
+//          double apMass=0.1;
+//          _ecm=5.5;
+          
+            int nfiles=40;
+          String fileLabel="ap2.2gev80mevsel";
+          double apMass=0.08;
+          _ecm=2.2;
+
 //           int nfiles=7;
 //        String fileLabel="ap3.3gev075mevsel";
 //        double apMass=0.075;
@@ -79,7 +85,7 @@
 //          String outfile = file.substring(0, file.length() - 4) + "_100u_beamspot_5cm.stdhep";//replace .txt by .stdhep
 //            String outfile = file.substring(0, file.length() - 4) + "_10u_beamspot_0cm.stdhep";//replace .txt by .stdhep
 //            String outfile = file.substring(0, file.length() - 4) + "_10u_beamspot_FlatDecay.stdhep";//replace .txt by .stdhep
-            String outfile = file.substring(0, file.length() - 4) + "_10u_beamspot_gammactau_5cm.stdhep";//replace .txt by .stdhep
+            String outfile = file.substring(0, file.length() - 4) + "_10u_beamspot_gammactau_0cm.stdhep";//replace .txt by .stdhep
             System.out.println("==== processing " + infile + " into " + outfile + "  aP mass = " + aMass + "====");
             process(infile, outfile);
         }

hps-java/src/main/java/org/lcsim/HPSDedicatedv2
TrackReconstructionDriver.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- TrackReconstructionDriver.java	26 Aug 2010 19:55:51 -0000	1.3
+++ TrackReconstructionDriver.java	10 Nov 2010 17:31:20 -0000	1.4
@@ -53,7 +53,7 @@
             List<SeedStrategy> slist = StrategyXMLUtils.getStrategyListFromFile(new File(strategyPrefix + sAxialfile));
             SeedTracker st = new SeedTracker(slist);
             st.setInputCollectionName("AxialTrackHits");
-            st.setTrackCollectionName("AxialTracks");
+            st.setTrkCollectionName("AxialTracks");
             st.setBField(BField);
             st.setTimingPlots(true);
 //        st.setDiagnostics(new SeedTrackerDiagnostics());
@@ -93,12 +93,12 @@
         if (!sAxialfile.contentEquals("none")) {
             stFinal = new SeedTracker(sFinallist);
             stFinal.setInputCollectionName("MatchedHTHits");
-            stFinal.setTrackCollectionName("MatchedTracks");
+            stFinal.setTrkCollectionName("MatchedTracks");
 
         } else {
             stFinal = new SeedTracker(sFinallist);
             stFinal.setInputCollectionName("HelicalTrackHits");
-            stFinal.setTrackCollectionName("MatchedTracks");
+            stFinal.setTrkCollectionName("MatchedTracks");
         }
         stFinal.setBField(BField);
         stFinal.setTimingPlots(true);

hps-java/src/main/java/org/lcsim/HPSDedicatedv2
MultiTrackReco.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- MultiTrackReco.java	11 Aug 2010 23:08:12 -0000	1.2
+++ MultiTrackReco.java	10 Nov 2010 17:31:20 -0000	1.3
@@ -73,7 +73,7 @@
         
             stFinal = new SeedTracker(sFinallist);
              stFinal.setInputCollectionName("HelicalTrackHits");
-        stFinal.setTrackCollectionName("MatchedTracks");
+        stFinal.setTrkCollectionName("MatchedTracks");
         stFinal.setBField(BField);
         stFinal.setTimingPlots(true);
 //        stFinal.setDiagnostics(new SeedTrackerDiagnostics());
@@ -89,7 +89,7 @@
         
         SeedTracker stLL = new SeedTracker(sLLlist);
          stLL.setInputCollectionName("RemainingHits");
-        stLL.setTrackCollectionName("LLTracks");
+        stLL.setTrkCollectionName("LLTracks");
         stLL.setBField(BField);
         stLL.setTimingPlots(true);
 //        stFinal.setDiagnostics(new SeedTrackerDiagnostics());
@@ -105,7 +105,7 @@
         
         SeedTracker stVLL = new SeedTracker(sVLLlist);
          stVLL.setInputCollectionName("DregHits");
-        stVLL.setTrackCollectionName("VLLTracks");
+        stVLL.setTrkCollectionName("VLLTracks");
         stVLL.setBField(BField);
         stVLL.setTimingPlots(true);
 //        stFinal.setDiagnostics(new SeedTrackerDiagnostics());

hps-java/src/main/java/org/lcsim/HPSVertexing
BilliorTrack.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- BilliorTrack.java	28 Oct 2010 17:26:32 -0000	1.1
+++ BilliorTrack.java	10 Nov 2010 17:31:20 -0000	1.2
@@ -1,11 +1,11 @@
+package org.lcsim.HPSVertexing;
 /*
- * HelicalTrackFit.java
+ * BilliorTrack.java
  *
- * Created on March 25, 2006, 6:11 PM
  *
- * $Id: BilliorTrack.java,v 1.1 2010/10/28 17:26:32 mgraham Exp $
+ * $Id: BilliorTrack.java,v 1.2 2010/11/10 17:31:20 mgraham Exp $
  */
-package org.lcsim.HPSVertexing;
+
 
 import hep.physics.matrix.BasicMatrix;
 import hep.physics.matrix.Matrix;

hps-java/src/main/java/org/lcsim/HPSVertexing
BilliorVertex.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- BilliorVertex.java	28 Oct 2010 17:26:32 -0000	1.1
+++ BilliorVertex.java	10 Nov 2010 17:31:20 -0000	1.2
@@ -11,7 +11,7 @@
 import static java.lang.Math.tan;
 
 /**
- * @version $Id: BilliorVertex.java,v 1.1 2010/10/28 17:26:32 mgraham Exp $
+ * @version $Id: BilliorVertex.java,v 1.2 2010/11/10 17:31:20 mgraham Exp $
  * @version Vertex tracks using least-squares method laid out by billior etal used in the HPS Java package.
  */
 public class BilliorVertex {
@@ -21,7 +21,8 @@
     private boolean _debug = false;
     private double _bField;
     private boolean _beamspotConstraint = true;
-    private double[] _beamSize = {10000.0, 0.01, 0.01}; //10um in y and z
+    private boolean _constrainToBS = false;
+    private double[] _beamSize = {0.001, 0.01, 0.01}; //10um in y and z
     private int _ntracks;
     private List<Matrix> paramList = new ArrayList<Matrix>();
     private List<Matrix> WList = new ArrayList<Matrix>();
@@ -64,7 +65,9 @@
         calculateCovariance();
         calculateChisq();
         if (_beamspotConstraint)
-            addV0fromBSConstraint(tracks);
+            addV0fromBSConstraint();
+        else if (_constrainToBS)
+            constrainV0toBS();
 
     }
 
@@ -72,7 +75,9 @@
         _ntracks = tracks.size();
         follow1985Paper(tracks);
         if (_beamspotConstraint)
-           addV0fromBSConstraint(tracks);
+            addV0fromBSConstraint();
+        else if (_constrainToBS)
+            constrainV0toBS();
     }
 
     public void fitFastVertex(List<BilliorTrack> tracks) {
@@ -368,7 +373,7 @@
      *  all notation is taken from:
      * W. Hulsbergen, NIM 552 (2005) 566-575
      */
-    private void addV0fromBSConstraint(List<BilliorTrack> tracks) {
+    private void addV0fromBSConstraint() {
         BasicMatrix Hk = new BasicMatrix(3 * (_ntracks + 1), 3);
         BasicMatrix Ckm1 = new BasicMatrix(3 * (_ntracks + 1), 3 * (_ntracks + 1));
         BasicMatrix Xkm1 = new BasicMatrix(3 * (_ntracks + 1), 1);
@@ -522,6 +527,160 @@
 //        if(_debug)System.out.println("Constrained chi^2 = "+_chiSq);
     }
 
+    private void constrainV0toBS() {
+        BasicMatrix Hk = new BasicMatrix(3 * (_ntracks + 1), 3);
+        BasicMatrix Ckm1 = new BasicMatrix(3 * (_ntracks + 1), 3 * (_ntracks + 1));
+        BasicMatrix Xkm1 = new BasicMatrix(3 * (_ntracks + 1), 1);
+        MatrixOp.setSubMatrix(Ckm1, _covVtx, 0, 0);
+        MatrixOp.setSubMatrix(Xkm1, _vertexPosition, 0, 0);
+
+        int n = 1;
+        for (Matrix covVtxMom : covVtxMomList) {
+            if (_debug)
+                System.out.println("Track " + n + "  covVtxMom : " + covVtxMom.toString());
+            MatrixOp.setSubMatrix(Ckm1, covVtxMom, 0, 3 * n);
+            MatrixOp.setSubMatrix(Ckm1, MatrixOp.transposed(covVtxMom), 3 * n, 0);
+            n++;
+        }
+        for (int i = 0; i < _ntracks; i++) {
+            BasicMatrix pi = (BasicMatrix) _pFit.get(i);
+            MatrixOp.setSubMatrix(Xkm1, pi, 3 * (i + 1), 0);
+            //           if(_debug)System.out.println("Track "+i+"  p : " + pi.toString());
+            for (int j = 0; j < _ntracks; j++)
+                MatrixOp.setSubMatrix(Ckm1, covMomList[i][j], 3 * (i + 1), 3 * (j + 1));
+        }
+
+        //  now calculate the derivative matrix for the beam constraint.
+        //  the beamspot is assumed to be at bvec=(0,0,0)
+        //  the V0 production position is Vbvec=(0,0,0)
+        //  where ptot=sum_i (pi)
+        //  need derivites wrt to the vertex position and momentum (theta,phi_v,rho)
+        double Vx = _vertexPosition.e(0, 0);
+        double Vy = _vertexPosition.e(1, 0);
+        double Vz = _vertexPosition.e(2, 0);
+        //first, get the sum of momenta...
+        double pxtot = 0;
+        double pytot = 0;
+        double pztot = 0;
+        for (int i = 0; i < _ntracks; i++) {
+            BasicMatrix pi = (BasicMatrix) _pFit.get(i);
+            double theta = pi.e(0, 0);
+            double phiv = pi.e(1, 0);
+            double rho = pi.e(2, 0);
+            double Pt = Math.abs((1. / rho) * _bField * Constants.fieldConversion);
+            double px = Pt * Math.cos(phiv);
+            double py = Pt * Math.sin(phiv);
+            double pz = Pt * 1 / Math.tan(theta);
+            pxtot += px;
+            pytot += py;
+            pztot += pz;
+        }
+        //calculate the position of the A' at X=0
+        BasicMatrix rk = new BasicMatrix(3, 1);
+        //       if(_debug)System.out.println("Vx = " + Vx + "; Vy = " + Vy + "; Vz = " + Vz + "; pxtot = " + pxtot + "; pytot = " + pytot + "; pztot = " + pztot);
+        rk.setElement(0, 0, -Vx);
+        rk.setElement(1, 0, -Vy);
+        rk.setElement(2, 0, -Vz);
+
+//  ok, can set the derivitives wrt to V
+        Hk.setElement(0, 0, 1);
+        Hk.setElement(0, 1, 0);
+        Hk.setElement(0, 2, 0);
+        Hk.setElement(1, 0, 0);
+        Hk.setElement(1, 1, 1);
+        Hk.setElement(1, 2, 0);
+        Hk.setElement(2, 0, 0);
+        Hk.setElement(2, 1, 0);
+        Hk.setElement(2, 2, 1);
+//ok, loop over tracks again to set the derivitives wrt track momenta (theta,phi,rho)
+        for (int i = 0; i < _ntracks; i++) {
+            BasicMatrix pi = (BasicMatrix) _pFit.get(i);
+            double theta = pi.e(0, 0);
+            double phiv = pi.e(1, 0);
+            double rho = pi.e(2, 0);
+            double Pt = Math.abs((1. / rho) * _bField * Constants.fieldConversion);
+            double px = Pt * Math.cos(phiv);
+            double py = Pt * Math.sin(phiv);
+            double pz = Pt * 1 / Math.tan(theta);
+            //derivities wrt theta
+            Hk.setElement(3 * (i + 1), 0, 0);
+            Hk.setElement(3 * (i + 1), 1, 0);
+            Hk.setElement(3 * (i + 1), 2, 0);
+            //derivities wrt phi
+            Hk.setElement(3 * (i + 1) + 1, 0, 0);
+            Hk.setElement(3 * (i + 1) + 1, 1,
+                    0);
+            Hk.setElement(3 * (i + 1) + 1, 2, 0);
+            //derivities wrt rho
+            Hk.setElement(3 * (i + 1) + 2, 0, 0);
+//            Hk.setElement(3 * (i + 1) + 2, 1,
+//                    (pytot / pxtot - 1) * (Pt / rho) * (1 / pxtot) * Vx);
+//            Hk.setElement(3 * (i + 1) + 2, 2,
+//                    (pztot / pxtot - 1) * (Pt / rho) * (1 / pxtot) * Vx);
+            Hk.setElement(3 * (i + 1) + 2, 1,
+                    0);
+            Hk.setElement(3 * (i + 1) + 2, 2,
+                    0);
+        //                   if(_debug)System.out.println("pxtot = "+pxtot+"; rho = "+rho+"; Pt = "+Pt);
+        //                   if(_debug)System.out.println("cos(phiv)*pytot / pxtot - sin(phiv) = "+(cos(phiv)*pytot / pxtot - sin(phiv)));
+        //                   if(_debug)System.out.println("Pt/(rho*pxtot) = "+(Pt / rho) * (1 / pxtot));
+        }
+        // the beam covariance
+        BasicMatrix Vk = new BasicMatrix(3, 3);
+        Vk.setElement(0, 0, _beamSize[0] * _beamSize[0]);
+        Vk.setElement(1, 1, _beamSize[1] * _beamSize[1]);
+        Vk.setElement(2, 2, _beamSize[2] * _beamSize[1]);
+
+        //now do the matrix operations to get the constrained parameters
+        BasicMatrix Hkt = (BasicMatrix) MatrixOp.transposed(Hk);
+//         if(_debug)System.out.println("Ckm1Hk = " + MatrixOp.mult(Ckm1, Hk));
+
+        BasicMatrix Rk = (BasicMatrix) MatrixOp.mult(Hkt, MatrixOp.mult(Ckm1, Hk));
+//        if(_debug)System.out.println("Pre Vk:  Rk = " + Rk.toString());
+        Rk = (BasicMatrix) MatrixOp.add(Rk, Vk);
+        BasicMatrix Rkinv = (BasicMatrix) MatrixOp.inverse(Rk);
+        BasicMatrix Kk = (BasicMatrix) MatrixOp.mult(Ckm1, MatrixOp.mult(Hk, Rkinv));
+
+//        if(_debug)System.out.println("Ckm1 = " + Ckm1.toString());
+//        if(_debug)System.out.println("Hk = " + Hk.toString());
+//        if(_debug)System.out.println("Rk = " + Rk.toString());
+//        if(_debug)System.out.println("Vk = " + Vk.toString());
+//        if(_debug)System.out.println("rk = " + rk.toString());
+//        if(_debug)System.out.println("Kk = " + Kk.toString());
+        _constrainedFit = MatrixOp.mult(Kk, rk);
+        _constrainedFit = MatrixOp.add(_constrainedFit, Xkm1);//Xk
+
+        //ok, get the new covariance
+        BasicMatrix RkKkt = (BasicMatrix) MatrixOp.mult(Rk, MatrixOp.transposed(Kk));
+        BasicMatrix HkCkm1 = (BasicMatrix) MatrixOp.mult(Hkt, Ckm1);
+        RkKkt = (BasicMatrix) MatrixOp.mult(1, RkKkt);
+        HkCkm1 = (BasicMatrix) MatrixOp.mult(-2, HkCkm1);
+        BasicMatrix sumMatrix = (BasicMatrix) MatrixOp.mult(Kk, MatrixOp.add(HkCkm1, RkKkt));
+        _constrainedCov = (BasicMatrix) MatrixOp.add(Ckm1, sumMatrix);
+
+        //update the regular parameter names to the constrained result
+//        if(_debug)System.out.println("Without Constraint : " + _vertexPosition.toString());
+//        if(_debug)System.out.println("Without Constraint:  x= "+_vertexPosition.e(0,0));
+        //        if(_debug)System.out.println(_constrainedFit.toString());
+//         if(_debug)System.out.println("Without Constraint : " + _covVtx.toString());
+        _vertexPosition = (BasicMatrix) MatrixOp.getSubMatrix(_constrainedFit, 0, 0, 3, 1);
+        _covVtx = (BasicMatrix) MatrixOp.getSubMatrix(_constrainedCov, 0, 0, 3, 3);
+//        if(_debug)System.out.println("With Constraint : " + _vertexPosition.toString());
+//        if(_debug)System.out.println("With Constraint : " + _covVtx.toString());
+
+        for (int i = 0; i < _ntracks; i++) {
+            BasicMatrix ptmp = (BasicMatrix) MatrixOp.getSubMatrix(_constrainedFit, 3 * (i + 1), 0, 3, 1);
+            _pFit.set(i, ptmp);
+        }
+
+//        if(_debug)System.out.println("Unconstrained chi^2 = "+_chiSq);
+        //ok...add to the chi^2
+        if (_debug)
+            System.out.println(MatrixOp.mult(MatrixOp.transposed(rk), MatrixOp.mult(Rkinv, rk)));
+        _chiSq += MatrixOp.mult(MatrixOp.transposed(rk), MatrixOp.mult(Rkinv, rk)).e(0, 0);
+//        if(_debug)System.out.println("Constrained chi^2 = "+_chiSq);
+    }
+
     public Matrix getVertexPosition() {
         return _vertexPosition;
     }
@@ -534,10 +693,20 @@
         _v0 = v0;
     }
 
+    public void setBeamSize(double[] bs) {
+        _beamSize[0] = bs[0];
+        _beamSize[1] = bs[1];
+        _beamSize[2] = bs[2];
+    }
+
     public void doBeamSpotConstraint(boolean bsconst) {
         _beamspotConstraint = bsconst;
     }
 
+    public void constrainV0toBeamSpot(boolean bsconst) {
+        _constrainToBS = bsconst;
+    }
+
     public double getChiSq() {
         return _chiSq;
     }
@@ -553,7 +722,7 @@
         mom[0] = Pt * Math.cos(phiv);
         mom[1] = Pt * Math.sin(phiv);
         mom[2] = Pt * 1 / Math.tan(theta);
-        if(_debug)System.out.println(mom[0]+"; "+mom[1]+"; "+mom[2]);
+        if (_debug) System.out.println(mom[0] + "; " + mom[1] + "; " + mom[2]);
         return mom;
     }
 
@@ -579,7 +748,7 @@
         double psum = Math.sqrt(pxsum * pxsum + pysum * pysum + pzsum * pzsum);
         double evtmass = esum * esum - psum * psum;
 
-        if(evtmass>0)return Math.sqrt(evtmass);
+        if (evtmass > 0) return Math.sqrt(evtmass);
         else return -99;
     }
 
@@ -638,12 +807,12 @@
             p0.setElement(4, 0, rho);
 
             BasicMatrix q0 = new BasicMatrix(3, 1);
- /*   this looks just wrong...
+            /*   this looks just wrong...
             q0.setElement(0, 0, Pt * Math.cos(phiv));
             q0.setElement(1, 0, Pt * Math.sin(phiv));
             q0.setElement(2, 0, Pt * 1 / Math.tan(theta));
             q0s.add(q0);
-*/
+             */
             q0.setElement(0, 0, theta);
             q0.setElement(1, 0, phiVert);
             q0.setElement(2, 0, rho);
@@ -724,7 +893,7 @@
         List<Matrix> qtildes = new ArrayList<Matrix>();
         List<Matrix> ptildes = new ArrayList<Matrix>();
         List<Matrix> C0j = new ArrayList<Matrix>();
-         List<Matrix> pfit = new ArrayList<Matrix>();
+        List<Matrix> pfit = new ArrayList<Matrix>();
         Matrix[][] Cij = new Matrix[2][2];//max 2 tracks...just make this bigger for more
         double chisq = 0;
         for (int j = 0; j < _ntracks; j++) {
@@ -734,7 +903,7 @@
             BasicMatrix e = (BasicMatrix) Es.get(j);
             BasicMatrix g = (BasicMatrix) Gs.get(j);
             BasicMatrix p = (BasicMatrix) pis.get(j);
-             BasicMatrix c = (BasicMatrix) cis.get(j);
+            BasicMatrix c = (BasicMatrix) cis.get(j);
             BasicMatrix first = (BasicMatrix) MatrixOp.mult(-1, MatrixOp.mult(MatrixOp.inverse(e), MatrixOp.transposed(d)));
             first = (BasicMatrix) MatrixOp.mult(first, xtilde);
             BasicMatrix second = (BasicMatrix) MatrixOp.mult(MatrixOp.inverse(e), MatrixOp.mult(MatrixOp.transposed(b), g));
@@ -768,10 +937,10 @@
                 BasicMatrix tmpCij = (BasicMatrix) MatrixOp.mult(-1, MatrixOp.mult(MatrixOp.inverse(e), MatrixOp.mult(MatrixOp.transposed(d), tmpC0j)));
                 Cij[i][j] = tmpCij;
             }
-            BasicMatrix tmppfit=new BasicMatrix(3,1);
-            tmppfit.setElement(0, 0, qtilde.e(0,0)+c.e(2,0));
-            tmppfit.setElement(1, 0, qtilde.e(1,0)+c.e(3,0));
-            tmppfit.setElement(2, 0, qtilde.e(2,0)+c.e(4,0));
+            BasicMatrix tmppfit = new BasicMatrix(3, 1);
+            tmppfit.setElement(0, 0, qtilde.e(0, 0) + c.e(2, 0));
+            tmppfit.setElement(1, 0, qtilde.e(1, 0) + c.e(3, 0));
+            tmppfit.setElement(2, 0, qtilde.e(2, 0) + c.e(4, 0));
             pfit.add(tmppfit);
         }
 

hps-java/src/main/java/org/lcsim/HPSDedicatedv3
MultiTrackReco.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- MultiTrackReco.java	28 Oct 2010 17:26:33 -0000	1.4
+++ MultiTrackReco.java	10 Nov 2010 17:31:20 -0000	1.5
@@ -11,6 +11,7 @@
 import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
 import org.lcsim.recon.tracking.seedtracker.SeedTracker;
 import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
+import org.lcsim.recon.tracking.seedtracker.diagnostic.SeedTrackerDiagnostics;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
@@ -53,7 +54,7 @@
             List<SeedStrategy> slist = StrategyXMLUtils.getStrategyListFromFile(new File(strategyPrefix + sAxialfile));
             SeedTracker st = new SeedTracker(slist);
             st.setInputCollectionName("AxialTrackHits");
-            st.setTrackCollectionName("AxialTracks");
+            st.setTrkCollectionName("AxialTracks");
             st.setBField(BField);
             st.setTimingPlots(true);
 //        st.setDiagnostics(new SeedTrackerDiagnostics());
@@ -92,12 +93,13 @@
         stFinal = new SeedTracker(sFinallist);
         if (!sAxialfile.contentEquals("none")) {
             stFinal.setInputCollectionName("MatchedHTHits");
-            stFinal.setTrackCollectionName("MatchedTracks");
+            stFinal.setTrkCollectionName("MatchedTracks");
 
         } else {
             stFinal.setInputCollectionName("HelicalTrackHits");
-            stFinal.setTrackCollectionName("MatchedTracks");
+            stFinal.setTrkCollectionName("MatchedTracks");
         }
+//         stFinal.setDiagnostics(new SeedTrackerDiagnostics());
         stFinal.setBField(BField);
         stFinal.setTimingPlots(true);
 

hps-java/src/main/java/org/lcsim/HPSDedicatedv3
FastTrackAnalysisDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- FastTrackAnalysisDriver.java	28 Oct 2010 17:26:33 -0000	1.1
+++ FastTrackAnalysisDriver.java	10 Nov 2010 17:31:20 -0000	1.2
@@ -51,7 +51,7 @@
 
 /**
  *
- * @author partridge
+ * @author mgraham
  */
 public class FastTrackAnalysisDriver extends Driver {
 
@@ -64,6 +64,7 @@
     public String outputTextName = "myevents.txt";
     FileWriter fw;
     PrintWriter pw;
+    double[] beamsize = {0.001, 0.02, 0.02};
 
     public FastTrackAnalysisDriver(int layers) {
         nlayers[0] = layers;
@@ -326,6 +327,7 @@
 
                     BilliorVertex vtxfit = new BilliorVertex(1.0);
                     vtxfit.doBeamSpotConstraint(false);
+                    vtxfit.setBeamSize(beamsize);
 //                    vtxfit.fitVertex(btlist);
                     vtxfit.tryNewFormalism(btlist);
                     double[] momE = vtxfit.getFittedMomentum(0);
@@ -343,6 +345,7 @@
                     double chisqP = pos.getChi2();
 
                     BilliorVertex confit = new BilliorVertex(1.0);
+                    confit.setBeamSize(beamsize);
                     confit.doBeamSpotConstraint(true);
 //                    confit.fitVertex(btlist);
                     confit.tryNewFormalism(btlist);
@@ -360,6 +363,7 @@
 
                     // 2nd pass vertex parameters
                     BilliorVertex vtxfit2 = new BilliorVertex(1.0);
+                    vtxfit2.setBeamSize(beamsize);
                     double[] vtxfitv0 = {vtx.e(0, 0), vtx.e(1, 0), vtx.e(2, 0)};
                     vtxfit2.setV0(vtxfitv0);
                     vtxfit2.doBeamSpotConstraint(false);
@@ -378,6 +382,8 @@
                     BasicMatrix vtxcov2 = (BasicMatrix) vtxfit2.getVertexCovariance();
 
                     BilliorVertex confit2 = new BilliorVertex(1.0);
+                    confit2.setBeamSize(beamsize);
+
                     double[] confitv0 = {conVtx.e(0, 0), conVtx.e(1, 0), conVtx.e(2, 0)};
                     confit2.setV0(confitv0);
                     confit2.doBeamSpotConstraint(true);
@@ -395,6 +401,24 @@
                     BasicMatrix conVtx2 = (BasicMatrix) confit2.getVertexPosition();
                     BasicMatrix conVtxCov2 = (BasicMatrix) confit2.getVertexCovariance();
 
+                    BilliorVertex bsconfit = new BilliorVertex(1.0);
+                    bsconfit.setBeamSize(beamsize);
+                    bsconfit.doBeamSpotConstraint(false);
+                    bsconfit.constrainV0toBeamSpot(true);
+//                    bsconfit.fitVertex(btlist);
+                    bsconfit.tryNewFormalism(btlist);
+                    double[] bsconmomE = bsconfit.getFittedMomentum(0);
+                    double[] bsconmomP = bsconfit.getFittedMomentum(1);
+                    double bsconpxE = bsconmomE[0];
+                    double bsconpyE = bsconmomE[1];
+                    double bsconpzE = bsconmomE[2];
+                    double bsconpxP = bsconmomP[0];
+                    double bsconpyP = bsconmomP[1];
+                    double bsconpzP = bsconmomP[2];
+                    double bsconchisq = bsconfit.getChiSq();
+                    BasicMatrix bsconVtx = (BasicMatrix) bsconfit.getVertexPosition();
+                    BasicMatrix bsconVtxCov = (BasicMatrix) bsconfit.getVertexCovariance();
+
 
                     double l1minE = -99;
                     double l1minP = -99;
@@ -491,12 +515,12 @@
                     pw.format("%5.5f %5.5f %5.5f %5.5f %5.5f %5.5f ", conVtx.e(0, 0), conErrX, conVtx.e(1, 0), conErrY, conVtx.e(2, 0), conErrZ);
                     pw.format("%5.5f ", conchisq);
 
-                      pw.format("%5.5f %5.5f %5.5f ", vtxpx2E, vtxpy2E, vtxpz2E);
+                    pw.format("%5.5f %5.5f %5.5f ", vtxpx2E, vtxpy2E, vtxpz2E);
                     pw.format("%5.5f %5.5f %5.5f ", vtxpx2P, vtxpy2P, vtxpz2P);
                     pw.format("%5.5f %5.5f %5.5f %5.5f %5.5f %5.5f ", vtx2.e(0, 0), Math.sqrt(vtxcov2.e(0, 0)), vtx2.e(1, 0), Math.sqrt(vtxcov2.e(1, 1)), vtx2.e(2, 0), Math.sqrt(vtxcov2.e(2, 2)));
                     pw.format("%5.5f ", chisq2);
 
-                       pw.format("%5.5f %5.5f %5.5f ", conpx2E, conpy2E, conpz2E);
+                    pw.format("%5.5f %5.5f %5.5f ", conpx2E, conpy2E, conpz2E);
                     pw.format("%5.5f %5.5f %5.5f ", conpx2P, conpy2P, conpz2P);
 
                     //   get the errors on the constrained vertex an make sure they aren't NaN
@@ -508,6 +532,18 @@
                     pw.format("%5.5f %5.5f %5.5f %5.5f %5.5f %5.5f ", conVtx2.e(0, 0), conErrX2, conVtx2.e(1, 0), conErrY2, conVtx2.e(2, 0), conErrZ2);
                     pw.format("%5.5f ", conchisq2);
 
+                    pw.format("%5.5f %5.5f %5.5f ", bsconpxE, bsconpyE, bsconpzE);
+                    pw.format("%5.5f %5.5f %5.5f ", bsconpxP, bsconpyP, bsconpzP);
+
+                    //   get the errors on the bsconstrained vertex an make sure they aren't NaN
+                    //   there must be somethihhhhfang wrong in the bsconstraint...hopefully just the error calc
+                    double bsconErrX = getErr(bsconVtxCov.e(0, 0));
+                    double bsconErrY = getErr(bsconVtxCov.e(1, 1));
+                    double bsconErrZ = getErr(bsconVtxCov.e(2, 2));
+
+                    pw.format("%5.5f %5.5f %5.5f %5.5f %5.5f %5.5f ", bsconVtx.e(0, 0), bsconErrX, bsconVtx.e(1, 0), bsconErrY, bsconVtx.e(2, 0), bsconErrZ);
+                    pw.format("%5.5f ", bsconchisq);
+
 
 //  print out MC information
                     pw.format("%5.5f %5.5f %5.5f ", pmcEle[0], pmcEle[1], pmcEle[2]);

hps-java/src/main/java/org/lcsim/HPSDedicatedv3
TestVertexing.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- TestVertexing.java	28 Oct 2010 17:26:33 -0000	1.4
+++ TestVertexing.java	10 Nov 2010 17:31:20 -0000	1.5
@@ -121,21 +121,21 @@
         IHistogramFactory hf = aida.histogramFactory();
 
 
-        peffFindable = hf.createProfile1D("Findable Efficiency vs p", "", 20, 0., 6.);
+        peffFindable = hf.createProfile1D("Findable Efficiency vs p", "", 50, 0., 11.);
         thetaeffFindable = hf.createProfile1D("Findable Efficiency vs theta", "", 20, 80, 100);
         phieffFindable = hf.createProfile1D("Findable Efficiency vs phi", "", 25, -0.25, 0.25);
         ctheffFindable = hf.createProfile1D("Findable Efficiency vs cos(theta)", "", 25, -0.25, 0.25);
         d0effFindable = hf.createProfile1D("Findable Efficiency vs d0", "", 50, -2., 2.);
         z0effFindable = hf.createProfile1D("Findable Efficiency vs z0", "", 50, -2., 2.);
 
-        peffElectrons = hf.createProfile1D("Electrons Efficiency vs p", "", 20, 0., 6.);
+        peffElectrons = hf.createProfile1D("Electrons Efficiency vs p", "", 50, 0., 11.);
         thetaeffElectrons = hf.createProfile1D("Electrons Efficiency vs theta", "", 20, 80, 100);
         phieffElectrons = hf.createProfile1D("Electrons Efficiency vs phi", "", 25, -0.25, 0.25);
         ctheffElectrons = hf.createProfile1D("Electrons Efficiency vs cos(theta)", "", 25, -0.25, 0.25);
         d0effElectrons = hf.createProfile1D("Electrons Efficiency vs d0", "", 20, -1., 1.);
         z0effElectrons = hf.createProfile1D("Electrons Efficiency vs z0", "", 20, -1., 1.);
 
-        peffAxial = hf.createProfile1D("Axial Efficiency vs p", "", 20, 0., 6.);
+        peffAxial = hf.createProfile1D("Axial Efficiency vs p", "", 50, 0., 11.);
         thetaeffAxial = hf.createProfile1D("Axial Efficiency vs theta", "", 20, 80, 100);
         phieffAxial = hf.createProfile1D("Axial Efficiency vs phi", "", 25, -0.25, 0.25);
         ctheffAxial = hf.createProfile1D("Axial Efficiency vs cos(theta)", "", 25, -0.25, 0.25);
@@ -237,14 +237,14 @@
             double phi0Err = Math.sqrt(track.getErrorMatrix().e(HelicalTrackFit.phi0Index, HelicalTrackFit.phi0Index));
             double slopeErr = Math.sqrt(track.getErrorMatrix().e(HelicalTrackFit.slopeIndex, HelicalTrackFit.slopeIndex));
             double curveErr = Math.sqrt(track.getErrorMatrix().e(HelicalTrackFit.curvatureIndex, HelicalTrackFit.curvatureIndex));
-
+            double chisq=track.getChi2();
             //plot the helix parameters
             aida.cloud1D("d0").fill(d0);
             aida.cloud1D("z0").fill(z0);
             aida.cloud1D("phi0").fill(phi0);
             aida.cloud1D("slope").fill(slope);
             aida.cloud1D("curve").fill(curve);
-
+             aida.cloud1D("chi2").fill(chisq);
 
             double mom[] = track.getMomentum();
 

hps-java/src/main/java/org/lcsim/HPSDedicatedv3
ReReconstructionDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ReReconstructionDriver.java	17 Jun 2010 00:31:45 -0000	1.1
+++ ReReconstructionDriver.java	10 Nov 2010 17:31:20 -0000	1.2
@@ -27,7 +27,8 @@
 
     private AIDA aida = AIDA.defaultInstance();
     List<Integer> passLayers = new ArrayList();
-    double pcut=5.2;
+//    double pcut=5.2;
+       double pcut=0.95*11.0;
     public ReReconstructionDriver() {
     }
 

hps-java/src/main/java/org/lcsim/HPSDedicated
TrackReconstructionDriver_HPS_12.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- TrackReconstructionDriver_HPS_12.java	11 Aug 2010 23:08:12 -0000	1.3
+++ TrackReconstructionDriver_HPS_12.java	10 Nov 2010 17:31:20 -0000	1.4
@@ -64,7 +64,7 @@
 
         SeedTracker st = new SeedTracker(slist);
          st.setInputCollectionName("AxialTrackHits");
-        st.setTrackCollectionName("AxialTracks");
+        st.setTrkCollectionName("AxialTracks");
         st.setBField(BField);
         st.setTimingPlots(true);
   //      st.setDiagnostics(new SeedTrackerDiagnostics());
@@ -110,7 +110,7 @@
         SeedTracker stFinal = new SeedTracker(sFinallist);
 //         SeedTracker stFinal = new SeedTracker(sFinallist,"HelicalTrackHits","MatchedTracks");
          stFinal.setInputCollectionName("MatchedHTHits");
-        stFinal.setTrackCollectionName("MatchedTracks");
+        stFinal.setTrkCollectionName("MatchedTracks");
         stFinal.setBField(BField);
         stFinal.setTimingPlots(true);
 //        stFinal.setDiagnostics(new SeedTrackerDiagnostics());
CVSspam 0.2.8