Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/users/phansson on MAIN
RunMPAlignment.java+6-11.7 -> 1.8
MPAlignmentParameters.java+273-1881.11 -> 1.12
+279-189
2 modified files
Added structure to use new track track extrapolation. New plots and switches to turn on/off MS error in residuals. Use profiles instead of graphs in mean residual plots.

hps-java/src/main/java/org/lcsim/hps/users/phansson
RunMPAlignment.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- RunMPAlignment.java	9 Oct 2012 01:17:35 -0000	1.7
+++ RunMPAlignment.java	12 Oct 2012 05:59:36 -0000	1.8
@@ -1,5 +1,7 @@
 package org.lcsim.hps.users.phansson;
 
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
 import java.io.BufferedReader;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
@@ -85,7 +87,10 @@
         
         //ap = new MPAlignmentParameters("/Users/phansson/work/HPS/software/reco/run/alignMP.txt",_debug,hideFrame);
         String outputMilleTxtFile = "alignMP.txt";
-        ap = new MPAlignmentParameters(outputMilleTxtFile,_debug,hideFrame);
+        Hep3Vector IP = new BasicHep3Vector(0., 0., 1.);
+        Hep3Vector _bfield = new BasicHep3Vector(0,0,detector.getFieldMap().getField(IP).y());
+
+        ap = new MPAlignmentParameters(outputMilleTxtFile,_bfield,_debug,hideFrame);
                
         //Initialize the res limits
         for(int i=1;i<=10;++i) {

hps-java/src/main/java/org/lcsim/hps/users/phansson
MPAlignmentParameters.java 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- MPAlignmentParameters.java	9 Oct 2012 01:17:35 -0000	1.11
+++ MPAlignmentParameters.java	12 Oct 2012 05:59:36 -0000	1.12
@@ -25,6 +25,7 @@
 import org.lcsim.fit.helicaltrack.*;
 import org.lcsim.hps.event.HPSTransformations;
 import org.lcsim.hps.monitoring.AIDAFrame;
+import org.lcsim.hps.recon.tracking.SvtUtils;
 import org.lcsim.hps.recon.tracking.TrackUtils;
 import org.lcsim.hps.recon.tracking.TrackerHitUtils;
 import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHit;
@@ -71,13 +72,18 @@
     AlignmentUtils _alignUtils;
     TrackUtils trackUtil;
     TrackerHitUtils trackerHitUtil;
+    Hep3Vector _bfield = null;
+    WTrackUtils wutils = new WTrackUtils();
+    
+    boolean _doSimHitsResiduals = false;
+    boolean _includeMS = false;
     
     private AIDAFrame plotterFrame;
     private AIDAFrame plotterFrameHTH;
     private AIDAFrame plotterFrameSimHit;
     private AIDAFrame plotterFrameSummary;
     private boolean hideFrame = false;
-     private AIDA aida = AIDA.defaultInstance();
+    private AIDA aida = AIDA.defaultInstance();
     private IAnalysisFactory af = aida.analysisFactory();
     IDataPointSet dps_t;
     IDataPointSet dps_b;
@@ -91,7 +97,7 @@
     IDataPointSet dps_pull_hth_y_t;
     IDataPointSet dps_pull_hth_z_b;
     IDataPointSet dps_pull_hth_z_t;
-    IPlotter plotter_resuydiff;
+    IPlotter plotter_resuydiff_t;
     IPlotter plotter_resuydiff_b;
     IDataPointSet[] dps_resuydiff_t = new IDataPointSet[10];
     IDataPointSet[] dps_resuydiff_b = new IDataPointSet[10];
@@ -102,13 +108,15 @@
     
     
     
-    public MPAlignmentParameters(String outfile, boolean debug, boolean hidePlots) {
+    public MPAlignmentParameters(String outfile, Hep3Vector bfield_vec, boolean debug, boolean hidePlots) {
         _DEBUG = debug;
         _detToTrk = new HPSTransformations();
         _alignUtils = new AlignmentUtils(_DEBUG);
         trackUtil = new TrackUtils();
         trackerHitUtil = new TrackerHitUtils(_DEBUG);
         hideFrame = hidePlots;
+        _bfield = bfield_vec;
+        this.wutils.setDebug(debug);
         try {
 //open things up
             fWriter = new FileWriter(outfile);
@@ -149,16 +157,22 @@
         aida.histogram1D("Track Chi2 "+ half).fill(track.getChi2());
         if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": Loop over " + hitsOnTrack.size() + " hitsOnTrack");
         for (TrackerHit hit : hitsOnTrack) {
+            
             HelicalTrackHit htc = (HelicalTrackHit) hit;
+            
+            HelicalTrackCross cross = (HelicalTrackCross) htc;
+            cross.setTrackDirection(_trk);
+            
             double msdrphi = msmap.get(htc).drphi();
             double msdz = msmap.get(htc).dz();
             double sHit = _trk.PathMap().get(htc);
+
             calculateTrackHitResidual(htc,msmap);
-            HelicalTrackCross cross = (HelicalTrackCross) htc;
+
             List<HelicalTrackStrip> clusterlist = cross.getStrips();
-            TrackDirection trkdir = HelixUtils.CalculateTrackDirection(_trk, sHit);
-            cross.setTrackDirection(trkdir, _trk.covariance());
+            
             if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": Loop over " + clusterlist.size() + " clusterlist for this hitontrack");
+            
             for (HelicalTrackStrip cl : clusterlist) {
                 if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": cluster size " + cl.rawhits().size());
                 //if(cl.rawhits().size()>1) continue;
@@ -170,7 +184,8 @@
                     
                 } else {
                     CalculateResidual(cl, msdrphi, msdz);
-                    //CalculateResidualSim(cl, msdrphi, msdz,simhits);
+                    
+                    if(_doSimHitsResiduals) CalculateResidualSim(cl, msdrphi, msdz,simhits);
                     
                     CalculateLocalDerivatives(cl);
                     CalculateGlobalDerivatives(cl);
@@ -662,15 +677,27 @@
         Hep3Vector u = strip.u();
         Hep3Vector v = strip.v();
         Hep3Vector w = strip.w();
+        Hep3Vector eta = VecOp.cross(u,v);
         Hep3Vector corigin = strip.origin();
+        
+        if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": Finding interception point for residual calculation");
+        
+        WTrack wtrack = new WTrack(_trk,Math.abs(_bfield.z()),true); //flip the charge since I'm looking at fitted tracks with B negative?
+        
+        Hep3Vector trkpos = wutils.getHelixAndPlaneIntercept(wtrack, strip.origin(), eta, new BasicHep3Vector(0,0,1));
+        double xint = trkpos.x();
         double phi0 = _trk.phi0();
         double R = _trk.R();
         //double xint = strip.origin().x();
-        double xint = trackUtil.calculateHelixInterceptXPlane(_trk, strip);
         double s = HelixUtils.PathToXPlane(_trk, xint, smax, _nlc).get(0);
         double phi = -s/R + phi0;
-        Hep3Vector trkpos = HelixUtils.PointOnHelix(_trk, s);
-
+        if(_DEBUG) {
+        double xint_wrong = trackUtil.calculateHelixInterceptXPlane(_trk, strip);
+        double s_wrong = HelixUtils.PathToXPlane(_trk, xint_wrong, smax, _nlc).get(0);
+        Hep3Vector trkpos_wrong= HelixUtils.PointOnHelix(_trk, s_wrong);   
+        System.out.println(this.getClass().getSimpleName() + ": trkposdiff " + VecOp.sub(trkpos, trkpos_wrong).toString() + " from trkpos_cor " + trkpos.toString() + " trkpos_wrong " + trkpos_wrong.toString());
+        }
+        
         //System.out.println("trkpos = "+trkpos.toString());
         //System.out.println("origin = "+corigin.toString());
         
@@ -679,16 +706,17 @@
         Hep3Matrix trkToStrip = this.trackerHitUtil.getTrackToStripRotation(strip);
         Hep3Vector vdiff = VecOp.mult(trkToStrip, vdiffTrk);
         //Hep3Vector mserrrot = VecOp.mult(trkToStrip, mserr);
+        //int idiffbin = 0;
         
-        int idiffbin = (int)Math.floor((vdiffTrk.y())/10);
-        if(idiffbin<-7) {
-            idiffbin = -7;
-            System.out.println("WARNING vdiffTrk.y() = " + vdiffTrk.y() + " merge to -> idiffbin= " + idiffbin);
-        }
-        if(idiffbin>6) {
-            idiffbin = 6;
-            System.out.println("WARNING vdiffTrk.y() = " + vdiffTrk.y() + " merge to -> idiffbin= " + idiffbin);
-        }
+        //double  idiffbin = (vdiffTrk.y())/10;
+//        if(idiffbin<-2) {
+//            idiffbin = -2;
+//            System.out.println("WARNING vdiffTrk.y() = " + vdiffTrk.y() + " merge to -> idiffbin= " + idiffbin);
+//        }
+//        if(idiffbin>2) {
+//            idiffbin = 2;
+//            System.out.println("WARNING vdiffTrk.y() = " + vdiffTrk.y() + " merge to -> idiffbin= " + idiffbin);
+//        }
         
         
         double umc = vdiff.x();
@@ -703,12 +731,12 @@
         double wError = 10.0/Math.sqrt(12); //0.001;
         //if(idiffbin==0) {
             _resid[0] = umeas - umc;
-            _error[0] = Math.sqrt(uError * uError + msuError * msuError);
+            _error[0] = this._includeMS ? Math.sqrt(uError * uError + msuError * msuError) : uError;
             _resid[1] = vmeas - vmc;
             _error[1] = vError;
             _resid[2] = wmeas - wmc;
             _error[2] = wError;
-            if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": idiffbin= " + idiffbin + " resid[0]=" + _resid[0]);
+            //if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": idiffbin= " + idiffbin + " resid[0]=" + _resid[0]);
         //} else {
         //    _resid[0] = 9999999.9;        
         //}
@@ -716,8 +744,9 @@
         
         //Calcualte the distance from the center of the sensor
         String side = corigin.z()>0. ? "top" : "bottom";
-        if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": idiffbin= " + idiffbin + " filling ydiff bist with " + _resid[0]);
-        aida.histogram1D("res_u_vs_ydiff_"+idiffbin+"_layer_" + strip.layer() + "_" + side).fill(_resid[0]);
+        //if(_DEBUG) System.out.println(this.getClass().getSimpleName() + ": idiffbin= " + idiffbin + " filling ydiff bist with " + _resid[0]);
+        //aida.histogram1D("res_u_vs_ydiff_"+idiffbin+"_layer_" + strip.layer() + "_" + side).fill(_resid[0]);
+        aida.profile1D("res_u_vs_ydiff_layer_" + strip.layer() + "_" + side).fill(vdiffTrk.y(),_resid[0]);
         
         if (_DEBUG) {
             System.out.println("---- " + this.getClass().getSimpleName() + " CalculateResidual ----");
@@ -1031,7 +1060,7 @@
         double s = _trk.PathMap().get(hth);
         Hep3Vector posOnHelix = HelixUtils.PointOnHelix(_trk, s);
         double resy = hth.y() - posOnHelix.y();
-        double resypull = resy/wrphi;
+        double resypull = this._includeMS ? resy/wrphi : resy/drphi_res;
         
         String side = "top";
         if (hth.getPosition()[2]<0) side = "bottom";
@@ -1059,14 +1088,25 @@
         //  Take the resolution uncertainty to be dr * |slope|
         double dzres = hth.dr() * Math.abs(slope);
         //  Combine resolution and multiple scattering uncertainties in quadrature
-        double dz = Math.sqrt(dzres*dzres + msdz*msdz);
+        double dz = dzres; //Math.sqrt(dzres*dzres + msdz*msdz);
 
         aida.histogram1D("hthres_z_layer" + layer + "_" + side).fill(resz);
         aida.histogram1D("hthrespull_z_layer" + layer + "_" + side).fill(resz/dz);
         aida.histogram1D("hthreserr_z_layer" + layer + "_" + side).fill(dz);
         aida.histogram1D("hthreserrms_z_layer" + layer + "_" + side).fill(msdz);
         aida.histogram1D("hthreserrres_z_layer" + layer + "_" + side).fill(dzres);
+
         
+        //if(this._DEBUG) {
+            if(resy<-0.15) {
+                System.out.println(this.getClass().getSimpleName() + ": LARGE TRACK HIT RESIDUAL yres " + resy + " zres " + resz );
+                double[] pos = hth.getPosition();
+                double[] pos_cor = hth.getCorrectedPosition().v();
+                System.out.println(this.getClass().getSimpleName() + ": HelicalTrackHit at [" + pos[0] + "," + pos[1] + "," + pos[2] + "]  cor : [" + pos_cor[0] + "," + pos_cor[1] + "," + pos_cor[2] + "]");
+                System.exit(1);
+            }
+        //}
+
           
           //        
 //        //  Store the coordinates and errors for the line fit
@@ -1374,23 +1414,33 @@
         plotter_chi2.setTitle("Track Chi2");
         plotterFrame.addPlotter(plotter_chi2);
         IHistogram hchi2_top = aida.histogram1D("Track Chi2 top",50,0,15);
-        IHistogram hchi2_bot = aida.histogram1D("Track Chi2 bottom",50,0,15);
+        IHistogram hchi2_bot = aida.histogram1D("Track Chi2 bottom",50,0,3);
         plotter_chi2.region(0).plot(hchi2_top);
         plotter_chi2.region(1).plot(hchi2_bot);
         
         
         String[] direction = {"u"};
         double xbins_u_res[][] = {
-                {-0.3,0.3},
-                {-0.7,0.7},
-                {-0.7,0.7},
-                {-0.5,0.5},
-                {-0.5,0.5},
-                {-0.5,0.5},
-                {-2,2},
-                {-2,2},
-                {-2,2},
-                {-2,2}            
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01},
+            {-0.01,0.01}
+//                {-0.3,0.3},
+//                {-0.7,0.7},
+//                {-0.7,0.7},
+//                {-0.5,0.5},
+//                {-0.5,0.5},
+//                {-0.5,0.5},
+//                {-2,2},
+//                {-2,2},
+//                {-2,2},
+//                {-2,2}            
         };
         double xbins_u_reserr[][] = {
                 {0,0.04},
@@ -1463,11 +1513,7 @@
                     plotter_respull_slope.style().dataStyle().fillStyle().setParameter("colorMapScheme","rainbow");
                     ((PlotterRegion) plotter_respull_slope.region(region)).getPlot().setAllowPopupMenus(true);
 
-                    for(int idiff=-10;idiff<10;++idiff) {
-                        
-                        IHistogram hvdiff = aida.histogram1D("res_"+direction[d]+"_ydiff_"+idiff+"_layer" + (iLayer) + "_" + side[s] , 50, xbins_u_res[iLayer-1][0], xbins_u_res[iLayer-1][1]);                        
-                    }
-                    
+                   
                 } 
 
                 //plotter_res.show();
@@ -1511,11 +1557,16 @@
             plotter_hthresypullslope.setTitle("hthrespullslope_y " + side[s]);
             
             double xbins_hthy_res[][] = {
-                {-0.4,0.4},
-                {-0.5,0.5},
-                {-1.5,1.5},
-                {-2.5,2.5},
-                {-2.5,2.5}
+                {-0.05,0.05},
+                {-0.05,0.05},
+                {-0.05,0.05},
+                {-0.2,0.2},
+                {-0.05,0.05}
+//                {-0.4,0.4},
+//                {-0.5,0.5},
+//                {-1.5,1.5},
+//                {-2.5,2.5},
+//                {-2.5,2.5}
              };
              double xbins_hthy_reserr[][] = {
                 {0,0.5},
@@ -1532,11 +1583,16 @@
                 {-4,4}
              };
              double xbins_hthz_res[][] = {
-                {-0.03,0.03},
-                {-0.8,0.8},
-                {-0.8,0.8},
-                {-2,2},
-                {-2,2}
+                {-0.01,0.01},
+                {-0.01,0.01},
+                {-0.01,0.01},
+                {-0.01,0.01},
+                {-0.01,0.01}
+//                {-0.03,0.03},
+//                {-0.8,0.8},
+//                {-0.8,0.8},
+//                {-2,2},
+//                {-2,2}
              };
              double xbins_hthz_reserr[][] = {
                 {0,0.05},
@@ -1630,116 +1686,131 @@
         }
         
         
-        IPlotter plotter_simhitstripres_z_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_z_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_z_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_z_b.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_y_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_y_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_y_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_y_b.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_x_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_x_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_x_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_x_b.createRegions(5,2,0);
-        
-        IPlotter plotter_simhitallstripres_z_t = af.createPlotterFactory().create();
-        plotter_simhitallstripres_z_t.createRegions(5,2,0);
-        IPlotter plotter_simhitallstripres_z_b = af.createPlotterFactory().create();
-        plotter_simhitallstripres_z_b.createRegions(5,2,0);
-        IPlotter plotter_simhitallstripres_y_t = af.createPlotterFactory().create();
-        plotter_simhitallstripres_y_t.createRegions(5,2,0);
-        IPlotter plotter_simhitallstripres_y_b = af.createPlotterFactory().create();
-        plotter_simhitallstripres_y_b.createRegions(5,2,0);
-        IPlotter plotter_simhitallstripres_x_t = af.createPlotterFactory().create();
-        plotter_simhitallstripres_x_t.createRegions(5,2,0);
-        IPlotter plotter_simhitallstripres_x_b = af.createPlotterFactory().create();
-        plotter_simhitallstripres_x_b.createRegions(5,2,0);
-        
-        IPlotter plotter_simhitstripres_u_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_u_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_u_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_u_b.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_v_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_v_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_v_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_v_b.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_w_t = af.createPlotterFactory().create();
-        plotter_simhitstripres_w_t.createRegions(5,2,0);
-        IPlotter plotter_simhitstripres_w_b = af.createPlotterFactory().create();
-        plotter_simhitstripres_w_b.createRegions(5,2,0);
-        
-        
-         for (int iLayer=1;iLayer<11;++iLayer) {
-                IHistogram h_t = aida.histogram1D("simhitstripres_z_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram h_b = aida.histogram1D("simhitstripres_z_layer" + iLayer + "_bottom" , 50, -4,4);       
-                IHistogram h1_t = aida.histogram1D("simhitstripres_y_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram h1_b = aida.histogram1D("simhitstripres_y_layer" + iLayer + "_bottom" , 50, -4,4);
-                IHistogram h2_t = aida.histogram1D("simhitstripres_x_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram h2_b = aida.histogram1D("simhitstripres_x_layer" + iLayer + "_bottom" , 50, -4,4);
-                
-                int region = iLayer-1;
-                plotter_simhitstripres_z_t.region(region).plot(h_t);
-                plotter_simhitstripres_z_b.region(region).plot(h_b);
-                plotter_simhitstripres_y_t.region(region).plot(h1_t);
-                plotter_simhitstripres_y_b.region(region).plot(h1_b);
-                plotter_simhitstripres_x_t.region(region).plot(h2_t);
-                plotter_simhitstripres_x_b.region(region).plot(h2_b);
-                
-                IHistogram ha_t = aida.histogram1D("simhitallstripres_z_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram ha_b = aida.histogram1D("simhitallstripres_z_layer" + iLayer + "_bottom" , 50, -4,4);       
-                IHistogram ha1_t = aida.histogram1D("simhitallstripres_y_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram ha1_b = aida.histogram1D("simhitallstripres_y_layer" + iLayer + "_bottom" , 50, -4,4);
-                IHistogram ha2_t = aida.histogram1D("simhitallstripres_x_layer" + iLayer + "_top" , 50, -4,4);
-                IHistogram ha2_b = aida.histogram1D("simhitallstripres_x_layer" + iLayer + "_bottom" , 50, -4,4);
-                
-                
-                plotter_simhitallstripres_z_t.region(region).plot(ha_t);
-                plotter_simhitallstripres_z_b.region(region).plot(ha_b);
-                plotter_simhitallstripres_y_t.region(region).plot(ha1_t);
-                plotter_simhitallstripres_y_b.region(region).plot(ha1_b);
-                plotter_simhitallstripres_x_t.region(region).plot(ha2_t);
-                plotter_simhitallstripres_x_b.region(region).plot(ha2_b);
-                
-                IHistogram hh_t = aida.histogram1D("simhitstripres_u_layer" + iLayer + "_top" , 50, -1,1);
-                IHistogram hh_b = aida.histogram1D("simhitstripres_u_layer" + iLayer + "_bottom" , 50, -1,1);       
-                IHistogram hh1_t = aida.histogram1D("simhitstripres_v_layer" + iLayer + "_top" , 50, -1,1);
-                IHistogram hh1_b = aida.histogram1D("simhitstripres_v_layer" + iLayer + "_bottom" , 50, -1,1);
-                IHistogram hh2_t = aida.histogram1D("simhitstripres_w_layer" + iLayer + "_top" , 50, -1,1);
-                IHistogram hh2_b = aida.histogram1D("simhitstripres_w_layer" + iLayer + "_bottom" , 50, -1,1);
-                
-                //int region = iLayer-1;
-                plotter_simhitstripres_u_t.region(region).plot(hh_t);
-                plotter_simhitstripres_u_b.region(region).plot(hh_b);
-                plotter_simhitstripres_v_t.region(region).plot(hh1_t);
-                plotter_simhitstripres_v_b.region(region).plot(hh1_b);
-                plotter_simhitstripres_w_t.region(region).plot(hh2_t);
-                plotter_simhitstripres_w_b.region(region).plot(hh2_b);
-
-             
-         }
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_z_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_z_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_y_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_y_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_x_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_x_b);
-        
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_z_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_z_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_y_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_y_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_x_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitallstripres_x_b);
-         
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_u_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_u_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_v_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_v_b);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_w_t);
-        plotterFrameSimHit.addPlotter(plotter_simhitstripres_w_b);
         
         
+        
+        
+        
+        
+        
+        
+        
+        
+        if(_doSimHitsResiduals) {
+        
+            IPlotter plotter_simhitstripres_z_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_z_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_z_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_z_b.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_y_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_y_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_y_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_y_b.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_x_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_x_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_x_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_x_b.createRegions(5,2,0);
+
+            IPlotter plotter_simhitallstripres_z_t = af.createPlotterFactory().create();
+            plotter_simhitallstripres_z_t.createRegions(5,2,0);
+            IPlotter plotter_simhitallstripres_z_b = af.createPlotterFactory().create();
+            plotter_simhitallstripres_z_b.createRegions(5,2,0);
+            IPlotter plotter_simhitallstripres_y_t = af.createPlotterFactory().create();
+            plotter_simhitallstripres_y_t.createRegions(5,2,0);
+            IPlotter plotter_simhitallstripres_y_b = af.createPlotterFactory().create();
+            plotter_simhitallstripres_y_b.createRegions(5,2,0);
+            IPlotter plotter_simhitallstripres_x_t = af.createPlotterFactory().create();
+            plotter_simhitallstripres_x_t.createRegions(5,2,0);
+            IPlotter plotter_simhitallstripres_x_b = af.createPlotterFactory().create();
+            plotter_simhitallstripres_x_b.createRegions(5,2,0);
+
+            IPlotter plotter_simhitstripres_u_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_u_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_u_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_u_b.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_v_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_v_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_v_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_v_b.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_w_t = af.createPlotterFactory().create();
+            plotter_simhitstripres_w_t.createRegions(5,2,0);
+            IPlotter plotter_simhitstripres_w_b = af.createPlotterFactory().create();
+            plotter_simhitstripres_w_b.createRegions(5,2,0);
+
+
+            for (int iLayer=1;iLayer<11;++iLayer) {
+                    IHistogram h_t = aida.histogram1D("simhitstripres_z_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram h_b = aida.histogram1D("simhitstripres_z_layer" + iLayer + "_bottom" , 50, -4,4);       
+                    IHistogram h1_t = aida.histogram1D("simhitstripres_y_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram h1_b = aida.histogram1D("simhitstripres_y_layer" + iLayer + "_bottom" , 50, -4,4);
+                    IHistogram h2_t = aida.histogram1D("simhitstripres_x_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram h2_b = aida.histogram1D("simhitstripres_x_layer" + iLayer + "_bottom" , 50, -4,4);
+
+                    int region = iLayer-1;
+                    plotter_simhitstripres_z_t.region(region).plot(h_t);
+                    plotter_simhitstripres_z_b.region(region).plot(h_b);
+                    plotter_simhitstripres_y_t.region(region).plot(h1_t);
+                    plotter_simhitstripres_y_b.region(region).plot(h1_b);
+                    plotter_simhitstripres_x_t.region(region).plot(h2_t);
+                    plotter_simhitstripres_x_b.region(region).plot(h2_b);
+
+                    IHistogram ha_t = aida.histogram1D("simhitallstripres_z_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram ha_b = aida.histogram1D("simhitallstripres_z_layer" + iLayer + "_bottom" , 50, -4,4);       
+                    IHistogram ha1_t = aida.histogram1D("simhitallstripres_y_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram ha1_b = aida.histogram1D("simhitallstripres_y_layer" + iLayer + "_bottom" , 50, -4,4);
+                    IHistogram ha2_t = aida.histogram1D("simhitallstripres_x_layer" + iLayer + "_top" , 50, -4,4);
+                    IHistogram ha2_b = aida.histogram1D("simhitallstripres_x_layer" + iLayer + "_bottom" , 50, -4,4);
+
+
+                    plotter_simhitallstripres_z_t.region(region).plot(ha_t);
+                    plotter_simhitallstripres_z_b.region(region).plot(ha_b);
+                    plotter_simhitallstripres_y_t.region(region).plot(ha1_t);
+                    plotter_simhitallstripres_y_b.region(region).plot(ha1_b);
+                    plotter_simhitallstripres_x_t.region(region).plot(ha2_t);
+                    plotter_simhitallstripres_x_b.region(region).plot(ha2_b);
+
+                    IHistogram hh_t = aida.histogram1D("simhitstripres_u_layer" + iLayer + "_top" , 50, -1,1);
+                    IHistogram hh_b = aida.histogram1D("simhitstripres_u_layer" + iLayer + "_bottom" , 50, -1,1);       
+                    IHistogram hh1_t = aida.histogram1D("simhitstripres_v_layer" + iLayer + "_top" , 50, -1,1);
+                    IHistogram hh1_b = aida.histogram1D("simhitstripres_v_layer" + iLayer + "_bottom" , 50, -1,1);
+                    IHistogram hh2_t = aida.histogram1D("simhitstripres_w_layer" + iLayer + "_top" , 50, -1,1);
+                    IHistogram hh2_b = aida.histogram1D("simhitstripres_w_layer" + iLayer + "_bottom" , 50, -1,1);
+
+                    //int region = iLayer-1;
+                    plotter_simhitstripres_u_t.region(region).plot(hh_t);
+                    plotter_simhitstripres_u_b.region(region).plot(hh_b);
+                    plotter_simhitstripres_v_t.region(region).plot(hh1_t);
+                    plotter_simhitstripres_v_b.region(region).plot(hh1_b);
+                    plotter_simhitstripres_w_t.region(region).plot(hh2_t);
+                    plotter_simhitstripres_w_b.region(region).plot(hh2_b);
+
+
+            }
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_z_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_z_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_y_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_y_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_x_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_x_b);
+
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_z_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_z_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_y_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_y_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_x_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitallstripres_x_b);
+
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_u_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_u_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_v_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_v_b);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_w_t);
+            plotterFrameSimHit.addPlotter(plotter_simhitstripres_w_b);
+
+            plotterFrameSimHit.pack();
+            plotterFrameSimHit.setVisible(!hideFrame);        
+
+        }
          
          
         IPlotter plotter_prf = af.createPlotterFactory().create();
@@ -1784,30 +1855,44 @@
         plotterFrameSummary.addPlotter(plotter_prf);
         
         
-        plotter_resuydiff = af.createPlotterFactory().create();
-        plotter_resuydiff.createRegions(5,2,0);
-        plotter_resuydiff.setTitle("res u vs ydiff");      
+        plotter_resuydiff_t = af.createPlotterFactory().create();
+        plotter_resuydiff_t.createRegions(5,2,0);
+        plotter_resuydiff_t.setTitle("res u vs ydiff top");      
         plotter_resuydiff_b = af.createPlotterFactory().create();
         plotter_resuydiff_b.createRegions(5,2,0);
-        plotter_resuydiff_b.setTitle("distr: res u vs ydiff");      
+        plotter_resuydiff_b.setTitle("res u vs ydiff bot");      
+        //plotter_resuydiff_t_b.createRegions(5,2,0);
+        //plotter_resuydiff_b.setTitle("distr: res u vs ydiff");      
         for(int iLayer=1;iLayer<11;++iLayer) {
-            for(int i=-7;i<7;++i) {
-                IHistogram ht = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_top",50,-0.5,0.5);
-                IHistogram hb = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_bottom",50,-0.5,0.5);
-                if(i==-4) plotter_resuydiff_b.region(iLayer-1).plot(ht);
-                else if(i==4||i==0) plotter_resuydiff_b.region(iLayer-1).plot(ht,"mode=overlay");
-            }
-            dps_resuydiff_t[iLayer-1] = dpsf.create("dps_resuydiff_layer_"+iLayer+"_t", "L"+iLayer+"u residual vs sensor v position (top)",2);
-            plotter_resuydiff.region(iLayer-1).plot(dps_resuydiff_t[iLayer-1]);
-            dps_resuydiff_b[iLayer-1] = dpsf.create("dps_resuydiff_layer_"+iLayer+"_b", "L"+iLayer+"u residual vs sensor v position (bot)",2);
-            plotter_resuydiff.region(iLayer-1).plot(dps_resuydiff_b[iLayer-1]);
-            plotter_resuydiff.style().statisticsBoxStyle().setVisible(false);
+            IProfile1D prf_t = aida.profile1D("res_u_vs_ydiff_layer_"+iLayer+"_top",10,-50,50);
+            IProfile1D prf_b = aida.profile1D("res_u_vs_ydiff_layer_"+iLayer+"_bottom",10,-50,50);
+//            for(int i=-2;i<3;++i) {
+//                IHistogram ht = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_top",50,-0.5,0.5);
+//                IHistogram hb = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_bottom",50,-0.5,0.5);
+//                if(i==0) plotter_resuydiff_b.region(iLayer-1).plot(ht);
+//                else if(i==99990) plotter_resuydiff_b.region(iLayer-1).plot(ht,"mode=overlay");
+//            }
+            
+            plotter_resuydiff_t.region(iLayer-1).plot(prf_t);
+            plotter_resuydiff_b.region(iLayer-1).plot(prf_b);
+            
+            ((PlotterRegion) plotter_resuydiff_t.region(iLayer-1)).getPlot().setAllowUserInteraction(true);
+            ((PlotterRegion) plotter_resuydiff_t.region(iLayer-1)).getPlot().setAllowPopupMenus(true);
+            ((PlotterRegion) plotter_resuydiff_b.region(iLayer-1)).getPlot().setAllowUserInteraction(true);
+            ((PlotterRegion) plotter_resuydiff_b.region(iLayer-1)).getPlot().setAllowPopupMenus(true);
+            
+            //plotter_resuydiff_t.style().statisticsBoxStyle().setVisible(false);
+//            dps_resuydiff_t[iLayer-1] = dpsf.create("dps_resuydiff_layer_"+iLayer+"_t", "L"+iLayer+"u residual vs sensor v position (top)",2);
+//            plotter_resuydiff.region(iLayer-1).plot(dps_resuydiff_t[iLayer-1]);
+//            dps_resuydiff_b[iLayer-1] = dpsf.create("dps_resuydiff_layer_"+iLayer+"_b", "L"+iLayer+"u residual vs sensor v position (bot)",2);
+//            plotter_resuydiff.region(iLayer-1).plot(dps_resuydiff_b[iLayer-1]);
+//            plotter_resuydiff.style().statisticsBoxStyle().setVisible(false);
         }
         
         
         
         
-        plotterFrameSummary.addPlotter(plotter_resuydiff);
+        plotterFrameSummary.addPlotter(plotter_resuydiff_t);
         plotterFrameSummary.addPlotter(plotter_resuydiff_b);
         
         
@@ -1820,8 +1905,6 @@
         plotterFrameHTH.setVisible(!hideFrame);        
         plotterFrameSummary.pack();
         plotterFrameSummary.setVisible(!hideFrame);
-        plotterFrameSimHit.pack();
-        plotterFrameSimHit.setVisible(!hideFrame);        
         
     
     
@@ -1974,32 +2057,34 @@
 
          }
     
-         
+         /*
          for(int iLayer=1;iLayer<11;++iLayer) { 
             dps_resuydiff_t[iLayer-1].clear();
             dps_resuydiff_b[iLayer-1].clear();
-            for(int i=-7;i<7;++i) {
+            for(int i=-2;i<3;++i) {
                 IHistogram1D h = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_top");
                 dps_resuydiff_t[iLayer-1].addPoint();
-                dps_resuydiff_t[iLayer-1].point(i+7).coordinate(1).setValue(h.mean());
+                dps_resuydiff_t[iLayer-1].point(i+2).coordinate(1).setValue(h.mean());
                 double N = h.entries();
                 double error = N>0 ? h.rms()/Math.sqrt(N) : 0;
-                double vdiff = -i*10.0+0.5;
-                dps_resuydiff_t[iLayer-1].point(i+7).coordinate(1).setValue(h.mean());
-                dps_resuydiff_t[iLayer-1].point(i+7).coordinate(1).setErrorPlus(error);
-                dps_resuydiff_t[iLayer-1].point(i+7).coordinate(0).setValue(vdiff);
+                double vdiff = -i*25.0;
+                dps_resuydiff_t[iLayer-1].point(i+2).coordinate(1).setValue(h.mean());
+                dps_resuydiff_t[iLayer-1].point(i+2).coordinate(1).setErrorPlus(error);
+                dps_resuydiff_t[iLayer-1].point(i+2).coordinate(0).setValue(vdiff);
                 
                 IHistogram1D hb = aida.histogram1D("res_u_vs_ydiff_"+i+"_layer_"+iLayer+"_bottom");
                 dps_resuydiff_b[iLayer-1].addPoint();
-                dps_resuydiff_b[iLayer-1].point(i+7).coordinate(1).setValue(hb.mean());
+                dps_resuydiff_b[iLayer-1].point(i+2).coordinate(1).setValue(hb.mean());
                 N = hb.entries();
                 error = N>0 ? hb.rms()/Math.sqrt(N) : 0;
-                dps_resuydiff_b[iLayer-1].point(i+7).coordinate(1).setValue(hb.mean());
-                dps_resuydiff_b[iLayer-1].point(i+7).coordinate(1).setErrorPlus(error);
-                dps_resuydiff_b[iLayer-1].point(i+7).coordinate(0).setValue(vdiff);
+                dps_resuydiff_b[iLayer-1].point(i+2).coordinate(1).setValue(hb.mean());
+                dps_resuydiff_b[iLayer-1].point(i+2).coordinate(1).setErrorPlus(error);
+                dps_resuydiff_b[iLayer-1].point(i+2).coordinate(0).setValue(vdiff);
             }
             
          }
+         * 
+         */
          
          
          
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1