Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/monitoring/svt on MAIN
TrackingReconstructionPlots.java+278-711.9 -> 1.10
Lots of changes to plots...

hps-java/src/main/java/org/lcsim/hps/monitoring/svt
TrackingReconstructionPlots.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- TrackingReconstructionPlots.java	24 May 2012 17:08:18 -0000	1.9
+++ TrackingReconstructionPlots.java	4 Jun 2012 20:17:45 -0000	1.10
@@ -33,8 +33,10 @@
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.event.LCIOParameters.ParameterName;
+import org.lcsim.fit.helicaltrack.*;
 import org.lcsim.hps.recon.tracking.*;
 import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants.ChannelConstants;
+import org.lcsim.hps.users.omoreno.ExtendTrack;
 
 /**
  *
@@ -43,6 +45,8 @@
 public class TrackingReconstructionPlots extends Driver implements Resettable {
 
     private AIDAFrame plotterFrame;
+    private AIDAFrame topFrame;
+    private AIDAFrame bottomFrame;
     private AIDA aida = AIDA.defaultInstance();
     private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
     private String fittedTrackerHitCollectionName = "SVTFittedRawTrackerHits";
@@ -58,7 +62,7 @@
     IDDecoder dec;
     private int eventCount;
     private List<SiSensor> sensors;
-    private double zAtConverter = -600;//mm
+    private double zAtConverter = -674.062;//mm
     private String outputPlots = null;
     IPlotter plotter;
     IPlotter plotter2;
@@ -72,6 +76,13 @@
     IPlotter plotter5_1;
     IPlotter plotter55;
     IPlotter plotter6;
+    IPlotter plotter7;
+    IPlotter top1;
+    IPlotter top2;
+    IPlotter top3;
+    IPlotter bot1;
+    IPlotter bot2;
+    IPlotter bot3;
     double zEcal = 1500;
     double zAtDownStrPairSpec = 914.0; //mm
     double zAtColl = -1500;
@@ -85,6 +96,11 @@
         plotterFrame = new AIDAFrame();
         plotterFrame.setTitle("HPS Tracking Plots");
 
+        topFrame = new AIDAFrame();
+        topFrame.setTitle("Top Tracking Plots");
+        bottomFrame = new AIDAFrame();
+        bottomFrame.setTitle("Bottom Tracking Plots");
+
         sensors = detector.getSubdetector(trackerName).getDetectorElement().findDescendants(SiSensor.class);
 
         IAnalysisFactory fac = aida.analysisFactory();
@@ -106,6 +122,47 @@
         plotter.region(2).plot(trkPz);
         plotter.region(3).plot(trkChi2);
 
+//   ******************************************************************
+
+
+        top1 = fac.createPlotterFactory().create("Top Tracking Plots");
+        top1.setTitle("Top Momentum");
+        IPlotterStyle stop1 = top1.style();
+        stop1.dataStyle().fillStyle().setColor("green");
+        stop1.dataStyle().errorBarStyle().setVisible(false);
+        top1.createRegions(2, 2);
+        topFrame.addPlotter(top1);
+
+        IHistogram1D toptrkPx = aida.histogram1D("Top Track Momentum (Px)", 25, -0.25, 0.25);
+        IHistogram1D toptrkPy = aida.histogram1D("Top Track Momentum (Py)", 25, -0.1, 0.1);
+        IHistogram1D toptrkPz = aida.histogram1D("Top Track Momentum (Pz)", 25, 0, 3.5);
+        IHistogram1D toptrkChi2 = aida.histogram1D("Top Track Chi2", 25, 0, 25.0);
+
+        top1.region(0).plot(toptrkPx);
+        top1.region(1).plot(toptrkPy);
+        top1.region(2).plot(toptrkPz);
+        top1.region(3).plot(toptrkChi2);
+
+
+        bot1 = fac.createPlotterFactory().create("Bottom Tracking Plots");
+        bot1.setTitle("Bottom Momentum");
+        IPlotterStyle sbot1 = bot1.style();
+        sbot1.dataStyle().fillStyle().setColor("blue");
+        sbot1.dataStyle().errorBarStyle().setVisible(false);
+        bot1.createRegions(2, 2);
+        bottomFrame.addPlotter(bot1);
+
+        IHistogram1D bottrkPx = aida.histogram1D("Bottom Track Momentum (Px)", 25, -0.25, 0.25);
+        IHistogram1D bottrkPy = aida.histogram1D("Bottom Track Momentum (Py)", 25, -0.1, 0.1);
+        IHistogram1D bottrkPz = aida.histogram1D("Bottom Track Momentum (Pz)", 25, 0, 3.5);
+        IHistogram1D bottrkChi2 = aida.histogram1D("Bottom Track Chi2", 25, 0, 25.0);
+
+        bot1.region(0).plot(bottrkPx);
+        bot1.region(1).plot(bottrkPy);
+        bot1.region(2).plot(bottrkPz);
+        bot1.region(3).plot(bottrkChi2);
+
+//   ******************************************************************
 
         IHistogram1D trkd0 = aida.histogram1D("d0 ", 25, -100.0, 100.0);
         IHistogram1D trkphi = aida.histogram1D("sinphi ", 25, -0.2, 0.2);
@@ -134,14 +191,14 @@
         style2.dataStyle().fillStyle().setColor("yellow");
         style2.dataStyle().errorBarStyle().setVisible(false);
         plotter2.createRegions(2, 4);
-        IHistogram1D xAtConverter = aida.histogram1D("X (mm) @ Z=-60cm", 25, -100, 100);
-        IHistogram1D yAtConverter = aida.histogram1D("Y (mm) @ Z=-60cm", 50, -50, 50);
+        IHistogram1D xAtConverter = aida.histogram1D("X (mm) @ Z=-60cm", 50, -50, 50);
+        IHistogram1D yAtConverter = aida.histogram1D("Y (mm) @ Z=-60cm", 50, -20, 20);
         IHistogram1D xAtColl = aida.histogram1D("X (mm) @ Z=-150cm", 50, -200, 200);
         IHistogram1D yAtColl = aida.histogram1D("Y (mm) @ Z=-150cm", 50, -200, 200);
-        IHistogram1D xAtEcal = aida.histogram1D("X (mm) @ Z=150cm", 50, -700, 700);
-        IHistogram1D yAtEcal = aida.histogram1D("Y (mm) @ Z=150cm", 50, -50, 150);
-        IHistogram1D xAtEcal2 = aida.histogram1D("X (mm) @ Z=150cm (Pz>1)", 50, -50, 50);
-        IHistogram1D yAtEcal2 = aida.histogram1D("Y (mm) @ Z=150cm (Pz>1)", 50, -50, 150);
+        IHistogram1D xAtEcal = aida.histogram1D("X (mm) @ ECAL", 50, -500, 500);
+        IHistogram1D yAtEcal = aida.histogram1D("Y (mm) @ ECAL", 50, -100, 100);
+        IHistogram1D xAtEcal2 = aida.histogram1D("X (mm) @ ECAL (Pz>1)", 50, -500, 500);
+        IHistogram1D yAtEcal2 = aida.histogram1D("Y (mm) @ ECAL (Pz>1)", 50, -100, 100);
 
         plotter2.region(0).plot(xAtConverter);
         plotter2.region(4).plot(yAtConverter);
@@ -301,23 +358,89 @@
         style4.dataStyle().errorBarStyle().setVisible(false);
         plotter4.createRegions(2, 3);
 
-        IHistogram2D eVsP = aida.histogram2D("Energy Vs Momentum", 50, 0, 3500, 50, 0, 3500);
-        IHistogram1D eOverP = aida.histogram1D("Energy Over Momentum", 50, 0, 5);
+        IHistogram2D eVsP = aida.histogram2D("Energy Vs Momentum", 50, 0, 500, 50, 0, 3000);
+        IHistogram1D eOverP = aida.histogram1D("Energy Over Momentum", 50, 0, 2);
 
         IHistogram1D distX = aida.histogram1D("deltaX", 50, -400, 400);
-        IHistogram1D distY = aida.histogram1D("deltaY", 50, -100, 100);
+        IHistogram1D distY = aida.histogram1D("deltaY", 50, -40, 40);
 
-        IHistogram1D distX2 = aida.histogram1D("deltaX (Pz>1)", 50, -400, 400);
-        IHistogram1D distY2 = aida.histogram1D("deltaY (Pz>1)", 50, -100, 100);
+//        IHistogram1D distX2 = aida.histogram1D("deltaX (Pz>1)", 50, -400, 400);
+//        IHistogram1D distY2 = aida.histogram1D("deltaY (Pz>1)", 50, -40, 40);
+
+        IHistogram2D xEcalVsTrk = aida.histogram2D("X ECal Vs Track", 100, -400, 400, 100, -400, 400);
+        IHistogram2D yEcalVsTrk = aida.histogram2D("Y ECal Vs Track", 100, -100, 100, 100, -100, 100);
 
         plotter4.region(0).plot(eVsP);
         plotter4.region(3).plot(eOverP);
         plotter4.region(1).plot(distX);
         plotter4.region(4).plot(distY);
-        plotter4.region(2).plot(distX2);
-        plotter4.region(5).plot(distY2);
+        plotter4.region(2).plot(xEcalVsTrk);
+        plotter4.region(5).plot(yEcalVsTrk);
+
+
+        //   ******************************************************************
+
+
+        top2 = fac.createPlotterFactory().create("Top ECal Plots");
+        top2.setTitle("Top ECal Correlations");
+        IPlotterStyle stop2 = top2.style();
+        stop2.dataStyle().fillStyle().setColor("green");
+        stop2.dataStyle().errorBarStyle().setVisible(false);
+        stop2.setParameter("hist2DStyle", "colorMap");
+        stop2.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+        top2.createRegions(2, 3);
+        topFrame.addPlotter(top2);
+
+        IHistogram2D topeVsP = aida.histogram2D("Top Energy Vs Momentum", 50, 0, 500, 50, 0, 3000);
+        IHistogram1D topeOverP = aida.histogram1D("Top Energy Over Momentum", 50, 0, 2);
+
+        IHistogram1D topdistX = aida.histogram1D("Top deltaX", 50, -400, 400);
+        IHistogram1D topdistY = aida.histogram1D("Top deltaY", 50, -40, 40);
+
+
+        IHistogram2D topxEcalVsTrk = aida.histogram2D("Top X ECal Vs Track", 100, -400, 400, 100, -400, 400);
+        IHistogram2D topyEcalVsTrk = aida.histogram2D("Top Y ECal Vs Track", 100, 0, 100, 100, 0, 100);
+
+
+        top2.region(0).plot(topeVsP);
+        top2.region(3).plot(topeOverP);
+        top2.region(1).plot(topdistX);
+        top2.region(4).plot(topdistY);
+        top2.region(2).plot(topxEcalVsTrk);
+        top2.region(5).plot(topyEcalVsTrk);
 
 
+        bot2 = fac.createPlotterFactory().create("Bottom ECal Plots");
+        bot2.setTitle("Bottom ECal Correlations");
+        IPlotterStyle sbot2 = bot2.style();
+        sbot2.dataStyle().fillStyle().setColor("green");
+        sbot2.dataStyle().errorBarStyle().setVisible(false);
+        sbot2.setParameter("hist2DStyle", "colorMap");
+        sbot2.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+        bot2.createRegions(2, 3);
+        bottomFrame.addPlotter(bot2);
+
+        IHistogram2D BottomeVsP = aida.histogram2D("Bottom Energy Vs Momentum", 50, 0, 500, 50, 0, 3000);
+        IHistogram1D BottomeOverP = aida.histogram1D("Bottom Energy Over Momentum", 50, 0, 2);
+
+        IHistogram1D BottomdistX = aida.histogram1D("Bottom deltaX", 50, -400, 400);
+        IHistogram1D BottomdistY = aida.histogram1D("Bottom deltaY", 50, -40, 40);
+
+
+        IHistogram2D BottomxEcalVsTrk = aida.histogram2D("Bottom X ECal Vs Track", 100, -400, 400, 100, -400, 400);
+        IHistogram2D BottomyEcalVsTrk = aida.histogram2D("Bottom Y ECal Vs Track", 100, -100, 0, 100, -100, 0);
+
+
+        bot2.region(0).plot(BottomeVsP);
+        bot2.region(3).plot(BottomeOverP);
+        bot2.region(1).plot(BottomdistX);
+        bot2.region(4).plot(BottomdistY);
+        bot2.region(2).plot(BottomxEcalVsTrk);
+        bot2.region(5).plot(BottomyEcalVsTrk);
+
+
+//   ******************************************************************
+
 
         plotter5 = fac.createPlotterFactory().create("HPS Hit Positions");
         plotter5.setTitle("Hit Positions:  Top");
@@ -399,11 +522,27 @@
         plotter6.region(6).plot(topECal3);
         plotter6.region(7).plot(botECal3);
 
-
-
         plotterFrame.pack();
         plotterFrame.setVisible(true);
 
+        topFrame.pack();
+        topFrame.setVisible(true);
+
+        bottomFrame.pack();
+        bottomFrame.setVisible(true);
+
+        plotter7 = fac.createPlotterFactory().create("HPS ECAL Hit Positions");
+        plotter7.setTitle("Basic Misc Stuff");
+        plotterFrame.addPlotter(plotter7);
+        IPlotterStyle style7 = plotter7.style();
+        style7.setParameter("hist2DStyle", "colorMap");
+        style7.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+        style7.dataStyle().fillStyle().setColor("yellow");
+        style7.dataStyle().errorBarStyle().setVisible(false);
+        plotter7.createRegions(2, 2);
+
+        IHistogram2D quadrants = aida.histogram2D("Charge vs Slope", 2, -1, 1, 2, -1, 1);
+        plotter7.region(0).plot(quadrants);
 
 
     }
@@ -442,7 +581,7 @@
             return;
         }
 
-         List<HelicalTrackHit> rotList = event.get(HelicalTrackHit.class, rotatedTrackHitCollectionName);
+        List<HelicalTrackHit> rotList = event.get(HelicalTrackHit.class, rotatedTrackHitCollectionName);
         for (HelicalTrackHit hth : rotList) {
             HelicalTrackCross htc = (HelicalTrackCross) hth;
 //            System.out.println("TrackingReconstructionPlots::original helical track position = "+hth.getPosition()[0]+","+hth.getPosition()[1]+","+hth.getPosition()[2]);
@@ -456,7 +595,7 @@
 //            System.out.println("TrackingReconstructionPlots::original helical track position = "+hth.getPosition()[0]+","+hth.getPosition()[1]+","+hth.getPosition()[2]);
 //            System.out.println("TrackingReconstructionPlots::corrected helical track position = "+htc.getCorrectedPosition().toString());
             //These Helical Track Hits are in the JLAB frame
-            htc.resetTrackDirection();
+//            htc.resetTrackDirection();
             double x = htc.getPosition()[0];
             double y = htc.getPosition()[1];
             SiSensor sensor = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement());
@@ -466,20 +605,20 @@
                 if (htc.Layer() == 1) {
 //                    System.out.println(sensorPos.toString());
 //                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
-                    aida.histogram2D("Layer 1 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
+//                    aida.histogram2D("Layer 1 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
                 }
-                if (htc.Layer() == 7)
-                    aida.histogram2D("Layer 7 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
+//                if (htc.Layer() == 7)
+//                    aida.histogram2D("Layer 7 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
             } else {
                 layersBot[htc.Layer() - 1]++;
-                  Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
+                Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
                 if (htc.Layer() == 1) {
 //                    System.out.println(sensorPos.toString());
 //                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
-                    aida.histogram2D("Layer 1 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
+//                    aida.histogram2D("Layer 1 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
                 }
-                if (htc.Layer() == 7)
-                    aida.histogram2D("Layer 7 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
+//                if (htc.Layer() == 7)
+//                    aida.histogram2D("Layer 7 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
             }
         }
         for (int i = 0; i < 10; i++) {
@@ -551,6 +690,10 @@
             HelixConverter converter = new HelixConverter(0);
             StraightLineTrack slt = converter.Convert(ht);
 
+            ExtendTrack extend = new ExtendTrack();
+            extend.setTrack(stEle);
+            Hep3Vector posAtEcal = extend.positionAtEcal();
+
             aida.histogram1D("X (mm) @ Z=-60cm").fill(slt.getYZAtX(zAtConverter)[0]);  //this is y in the tracker frame
             aida.histogram1D("Y (mm) @ Z=-60cm").fill(slt.getYZAtX(zAtConverter)[1]);  //this is z in the tracker frame
             //double sECAL = HelixUtils.PathToXPlane(ht, zEcal, 3000, 1).get(0);
@@ -561,14 +704,14 @@
             //Straight line after field-region???
             //HelixConverter converterEcal = new HelixConverter(zAtDownStrPairSpec);
             //StraightLineTrack sltEcal = converterEcal.Convert(ht);
-            double sECAL = HelixUtils.PathToXPlane(ht, zEcal, 3000, 1).get(0);
-            Hep3Vector posonhelix = HelixUtils.PointOnHelix(ht, sECAL);//position in tracker coordinates!
+//            double sECAL = HelixUtils.PathToXPlane(ht, zEcal, 3000, 1).get(0);
+//            Hep3Vector posonhelix = HelixUtils.PointOnHelix(ht, sECAL);//position in tracker coordinates!
 
-            aida.histogram1D("X (mm) @ Z=150cm").fill(posonhelix.y());
-            aida.histogram1D("Y (mm) @ Z=150cm").fill(posonhelix.z());
+            aida.histogram1D("X (mm) @ ECAL").fill(posAtEcal.y());
+            aida.histogram1D("Y (mm) @ ECAL").fill(posAtEcal.z());
             if (trk.getPX() > 1.0) {
-                aida.histogram1D("X (mm) @ Z=150cm (Pz>1)").fill(slt.getYZAtX(zAtColl)[0]);
-                aida.histogram1D("Y (mm) @ Z=150cm (Pz>1)").fill(slt.getYZAtX(zAtColl)[1]);
+                aida.histogram1D("X (mm) @ ECAL (Pz>1)").fill(posAtEcal.y());
+                aida.histogram1D("Y (mm) @ ECAL (Pz>1)").fill(posAtEcal.z());
             }
             aida.histogram1D("d0 ").fill(trk.getTrackParameter(ParameterName.d0.ordinal()));
             aida.histogram1D("sinphi ").fill(Math.sin(trk.getTrackParameter(ParameterName.phi0.ordinal())));
@@ -576,15 +719,31 @@
             aida.histogram1D("tan(lambda) ").fill(trk.getTrackParameter(ParameterName.tanLambda.ordinal()));
             aida.histogram1D("z0 ").fill(trk.getTrackParameter(ParameterName.z0.ordinal()));
 
-
-
-
+            int isTop = -1;
+            if (trk.getTrackerHits().get(0).getPosition()[2] > 0)
+                isTop = 0;//make plot look pretty
+            int charge = trk.getCharge();
+            if (charge > 0)
+                charge = 0;//make plot look pretty
+//            System.out.println("Charge = " + charge + "; isTop = " + isTop);
+            aida.histogram2D("Charge vs Slope").fill(charge, isTop);
+            if (isTop == 0) {
+                aida.histogram1D("Top Track Momentum (Px)").fill(trk.getPY());
+                aida.histogram1D("Top Track Momentum (Py)").fill(trk.getPZ());
+                aida.histogram1D("Top Track Momentum (Pz)").fill(trk.getPX());
+                aida.histogram1D("Top Track Chi2").fill(trk.getChi2());
+            } else {
+                aida.histogram1D("Bottom Track Momentum (Px)").fill(trk.getPY());
+                aida.histogram1D("Bottom Track Momentum (Py)").fill(trk.getPZ());
+                aida.histogram1D("Bottom Track Momentum (Pz)").fill(trk.getPX());
+                aida.histogram1D("Bottom Track Chi2").fill(trk.getChi2());
+            }
             List<TrackerHit> hitsOnTrack = trk.getTrackerHits();
             for (TrackerHit hit : hitsOnTrack) {
                 HelicalTrackHit htc = (HelicalTrackHit) hit;
-                HelicalTrackCross htcross=(HelicalTrackCross) htc;
+                HelicalTrackCross htcross = (HelicalTrackCross) htc;
                 double sHit = ht.PathMap().get(htc);
-                posonhelix = HelixUtils.PointOnHelix(ht, sHit);
+                Hep3Vector posonhelix = HelixUtils.PointOnHelix(ht, sHit);
 
                 double yTr = posonhelix.y();
                 double zTr = posonhelix.z();
@@ -602,59 +761,105 @@
                     modNum = "Module 5 ";
                 SymmetricMatrix cov = htc.getCorrectedCovMatrix();
 
-                aida.histogram1D(modNum + "Residual X(mm)").fill( htcross.getCorrectedPosition().y()- yTr);//these hits should be rotated track hits already
-                aida.histogram1D(modNum + "Residual Y(mm)").fill( htcross.getCorrectedPosition().z() - zTr);//these hits should be rotated track hits already
-                if (hit.getPosition()[2]>0) {
+                aida.histogram1D(modNum + "Residual X(mm)").fill(htcross.getCorrectedPosition().y() - yTr);//these hits should be rotated track hits already
+                aida.histogram1D(modNum + "Residual Y(mm)").fill(htcross.getCorrectedPosition().z() - zTr);//these hits should be rotated track hits already
+                if (hit.getPosition()[2] > 0) {
                     aida.histogram1D(modNum + "Residual X(mm) Top").fill(htcross.getCorrectedPosition().y() - yTr);//these hits should be rotated track hits already
                     aida.histogram1D(modNum + "Residual Y(mm) Top").fill(htcross.getCorrectedPosition().z() - zTr);//these hits should be rotated track hits already
 
                 }
-                if (hit.getPosition()[2]<0) {
+                if (hit.getPosition()[2] < 0) {
                     aida.histogram1D(modNum + "Residual X(mm) Bottom").fill(htcross.getCorrectedPosition().y() - yTr);//these hits should be rotated track hits already
                     aida.histogram1D(modNum + "Residual Y(mm) Bottom").fill(htcross.getCorrectedPosition().z() - zTr);//these hits should be rotated track hits already
 
                 }
-
-                List<RawTrackerHit> rawHits = hit.getRawHits();
+                SiSensor sensor = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement());
+                double x = htcross.getCorrectedPosition().y();
+                double y = htcross.getCorrectedPosition().z();
+                if (SvtUtils.getInstance().isTopLayer(sensor)) {
+                    layersTop[htc.Layer() - 1]++;
+                    Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
+                    if (htc.Layer() == 1) {
+//                    System.out.println(sensorPos.toString());
+//                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
+                        aida.histogram2D("Layer 1 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
+                    }
+                    if (htc.Layer() == 7)
+                        aida.histogram2D("Layer 7 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
+                } else {
+                    layersBot[htc.Layer() - 1]++;
+                    Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
+                    if (htc.Layer() == 1) {
+//                    System.out.println(sensorPos.toString());
+//                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
+                        aida.histogram2D("Layer 1 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
+                    }
+                    if (htc.Layer() == 7)
+                        aida.histogram2D("Layer 7 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
+                }
+/*
+                List<RawTrackerHit> rawHits = hit.getRawHits();                
                 for (RawTrackerHit rawHit : rawHits) {
-
                     ChannelConstants constants = HPSSVTCalibrationConstants.getChannelConstants((SiSensor) rawHit.getDetectorElement(), rawHit.getIdentifierFieldValue("strip"));
                     HPSShapeFitParameters fit = _shaper.fitShape(rawHit, constants);
                     double amp = fit.getAmp();
+                    
                     aida.histogram1D("Amp (HitOnTrack)").fill(amp);
                     if (trk.getPX() > 1)
                         aida.histogram1D("Amp Pz>1000 (HitOnTrack)").fill(amp);
-                }
-
-                //Fill the cluster energy directly
-                //This should return energyin GeV but without gain I should get 
-                // sum(ADC)*[energy of hole pair]
-                aida.histogram1D("Amp (CluOnTrack)").fill(hit.getdEdx() / DopedSilicon.ENERGY_EHPAIR);
-                if (trk.getPX() > 1)
-                    aida.histogram1D("Amp Pz>1000 (CluOnTrack)").fill(hit.getdEdx() / DopedSilicon.ENERGY_EHPAIR);
-
-
-
-
+                }                
+                */
 
+               for(HelicalTrackStrip hts:htcross.getStrips()){
+                   double clusterSum=0;                 
+                   for(RawTrackerHit rawHit: (List<RawTrackerHit>)hts.rawhits()){
+                       ChannelConstants constants = HPSSVTCalibrationConstants.getChannelConstants((SiSensor) rawHit.getDetectorElement(), rawHit.getIdentifierFieldValue("strip"));
+                        HPSShapeFitParameters fit = _shaper.fitShape(rawHit, constants);
+                        double amp = fit.getAmp();
+                        clusterSum+=amp;
+                         aida.histogram1D("Amp (HitOnTrack)").fill(amp);
+                    if (trk.getPX() > 1)
+                        aida.histogram1D("Amp Pz>1000 (HitOnTrack)").fill(amp);
+                   }
+                   aida.histogram1D("Amp (CluOnTrack)").fill(clusterSum);
+                      if (trk.getPX() > 1)
+                    aida.histogram1D("Amp Pz>1000 (CluOnTrack)").fill(clusterSum);
+                }
             }
             List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, ecalCollectionName);
-//            System.out.println("Number of ECAL clusters=" + clusters.size());
-//            sECAL = HelixUtils.PathToXPlane(ht, zEcal, 3000, 1).get(0);
-            posonhelix = HelixUtils.PointOnHelix(ht, sECAL);//position in tracker coordinates!
-            HPSEcalCluster clust = findClosestCluster(posonhelix, clusters);
- /*
+            HPSEcalCluster clust = findClosestCluster(posAtEcal, clusters);
+
+            //           if (clust != null) {
             if (clust != null) {
                 aida.histogram2D("Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
                 aida.histogram1D("Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
-                aida.histogram1D("deltaX").fill(clust.getPosition()[0] - posonhelix.y());
-                aida.histogram1D("deltaY").fill(clust.getPosition()[1] - posonhelix.z());
-                if (trk.getPX() > 1.0) {
-                    aida.histogram1D("deltaX (Pz>1)").fill(clust.getPosition()[0] - posonhelix.y());
-                    aida.histogram1D("deltaY (Pz>1)").fill(clust.getPosition()[1] - posonhelix.z());
+                aida.histogram1D("deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
+                aida.histogram1D("deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
+//                if (trk.getPX() > 1.0) {
+//                    aida.histogram1D("deltaX (Pz>1)").fill(clust.getPosition()[0] - posAtEcal.y());
+//                    aida.histogram1D("deltaY (Pz>1)").fill(clust.getPosition()[1] - posAtEcal.z());
+//                }
+                aida.histogram2D("X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
+                aida.histogram2D("Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
+                if (isTop == 0) {
+                    aida.histogram2D("Top Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
+//                    aida.histogram2D("Top Energy Vs Momentum").fill(posAtEcal.y(), trk.getPX() * 1000.0);
+                    aida.histogram1D("Top Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
+                    aida.histogram1D("Top deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
+                    aida.histogram1D("Top deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
+                    aida.histogram2D("Top X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
+                    aida.histogram2D("Top Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
+                } else {
+                    aida.histogram2D("Bottom Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
+                    aida.histogram1D("Bottom Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
+                    aida.histogram1D("Bottom deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
+                    aida.histogram1D("Bottom deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
+                    aida.histogram2D("Bottom X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
+                    aida.histogram2D("Bottom Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
                 }
-            }             
-            */
+
+            }
+
         }
     }
 
@@ -665,9 +870,9 @@
         for (TrackerHit hit : hitsOnTrack) {
             HelicalTrackHit htc = (HelicalTrackHit) hit;
 //            if (htc.getPosition()[2] < 0) {
-                layer = htc.Layer();
-                layer = (layer - 1) / 2;
-                n[layer] = n[layer] + 1;
+            layer = htc.Layer();
+            layer = (layer - 1) / 2;
+            n[layer] = n[layer] + 1;
 //            }
         }
 
@@ -762,6 +967,8 @@
                 Logger.getLogger(TrackingReconstructionPlots.class.getName()).log(Level.SEVERE, null, ex);
             }
         plotterFrame.dispose();
+        topFrame.dispose();
+        bottomFrame.dispose();
     }
 
     private HPSEcalCluster findClosestCluster(Hep3Vector posonhelix, List<HPSEcalCluster> clusters) {
@@ -772,7 +979,7 @@
             double clEne = cluster.getEnergy();
 //            double dist = Math.sqrt(Math.pow(clPos[0] - posonhelix.y(), 2) + Math.pow(clPos[1] - posonhelix.z(), 2)); //coordinates!!!
             double dist = Math.sqrt(Math.pow(clPos[1] - posonhelix.z(), 2)); //coordinates!!!
-            if (dist < minDist && clEne > 500) {
+            if (dist < minDist && clEne > 50) {
                 closest = cluster;
                 minDist = dist;
             }
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