LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  April 2015

HPS-SVN April 2015

Subject:

r2762 - /java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/trackrecon/TrackingReconPlots.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Tue, 21 Apr 2015 15:58:14 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (151 lines)

Author: [log in to unmask]
Date: Tue Apr 21 08:58:07 2015
New Revision: 2762

Log:
Add helical track hit monitoring plots...probably needs some improvement to the axis ranges etal. 

Modified:
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/trackrecon/TrackingReconPlots.java

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/trackrecon/TrackingReconPlots.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/trackrecon/TrackingReconPlots.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/trackrecon/TrackingReconPlots.java	Tue Apr 21 08:58:07 2015
@@ -18,7 +18,9 @@
 
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.LCIOParameters.ParameterName;
+import org.lcsim.event.RawTrackerHit;
 import org.lcsim.event.Track;
+import org.lcsim.event.TrackerHit;
 import org.lcsim.fit.helicaltrack.HelicalTrackFit;
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.IDDecoder;
@@ -35,18 +37,22 @@
 
     private AIDA aida = AIDA.defaultInstance();
     private String trackCollectionName = "MatchedTracks";
+    private String helicalTrackHitCollectionName = "HelicalTrackHits";
     String ecalSubdetectorName = "Ecal";
     String ecalCollectionName = "EcalClusters";
     IDDecoder dec;
     private String outputPlots = null;
     private boolean debug = false;
 
-    double feeMomentumCut = 1.6;
+    double feeMomentumCut = 0.8;
+    int nmodules = 6;
 
     IPlotter plotter;
     IPlotter plotter22;
     IPlotter plotterECal;
     IPlotter plotterFEE;
+    IPlotter plotterHTH;
+    IPlotter plotterXvsY;
 
     IHistogram1D nTracks;
     IHistogram1D nhits;
@@ -69,6 +75,11 @@
     IHistogram1D hfeePOverE;
     IHistogram2D hfeeClustPos;
 
+    IHistogram1D[] hthTop = new IHistogram1D[nmodules];
+    IHistogram1D[] hthBot = new IHistogram1D[nmodules];
+    IHistogram2D[] xvsyTop = new IHistogram2D[nmodules];
+    IHistogram2D[] xvsyBot = new IHistogram2D[nmodules];
+
     @Override
     protected void detectorChanged(Detector detector) {
         aida.tree().cd("/");
@@ -145,6 +156,25 @@
 
         plotterFEE.show();
 
+        plotterHTH = pfac.create("Track Hits");
+        plotterHTH.createRegions(3, 4);
+        plotterXvsY = pfac.create("3d Hit Positions");
+        plotterXvsY.createRegions(3, 4);
+
+        for (int i = 1; i <= nmodules; i++) {
+
+            xvsyTop[i - 1] = aida.histogram2D("Module " + i + " Top", 50, -10, 10, 50, 0, 4);
+            xvsyBot[i - 1] = aida.histogram2D("Module " + i + " Bottom", 50, -10, 10, 50, 0, 4);
+            hthTop[i - 1] = aida.histogram1D("Module " + i + "Top: Track Hits", 25, 0, 25);
+            hthBot[i - 1] = aida.histogram1D("Module " + i + "Bot: Track Hits", 25, 0, 25);
+            plot(plotterHTH, hthTop[i - 1], null, computePlotterRegion(i - 1, true));
+            plot(plotterHTH, hthBot[i - 1], null, computePlotterRegion(i - 1, false));
+             plot(plotterXvsY, xvsyTop[i - 1], null, computePlotterRegion(i - 1, true));
+            plot(plotterXvsY, xvsyBot[i - 1], null, computePlotterRegion(i - 1, false));
+        }
+        plotterHTH.show();
+        plotterXvsY.show();
+
     }
 
     public TrackingReconPlots() {
@@ -169,6 +199,42 @@
         if (!event.hasCollection(Track.class, trackCollectionName)) {
             nTracks.fill(0);
             return;
+        }
+
+        if (!event.hasCollection(TrackerHit.class, helicalTrackHitCollectionName))
+            return;
+
+        int[] topHits = {0, 0, 0, 0, 0, 0};
+        int[] botHits = {0, 0, 0, 0, 0, 0};
+        List<TrackerHit> hth = event.get(TrackerHit.class, helicalTrackHitCollectionName);
+        for (TrackerHit hit : hth) {
+            int module = -99;
+            int layer = ((RawTrackerHit) hit.getRawHits().get(0)).getLayerNumber();
+            if (layer < 2)
+                module = 1;
+            else if (layer < 4)
+                module = 2;
+            else if (layer < 6)
+                module = 3;
+            else if (layer < 8)
+                module = 4;
+            else if (layer < 10)
+                module = 5;
+            else
+                module = 6;
+
+            if (hit.getPosition()[1] > 0) {
+                topHits[module - 1]++;
+                xvsyTop[module - 1].fill(hit.getPosition()[0], hit.getPosition()[0]);
+            } else {
+                botHits[module - 1]++;
+                xvsyBot[module - 1].fill(hit.getPosition()[0], Math.abs(hit.getPosition()[0]));
+            }
+        }
+
+        for (int i = 0; i < nmodules; i++) {
+            hthTop[i].fill(topHits[i]);
+            hthBot[i].fill(botHits[i]);
         }
 
         List<Track> tracks = event.get(Track.class, trackCollectionName);
@@ -268,4 +334,20 @@
         return closest;
     }
 
+    private int computePlotterRegion(int i, boolean istop) {
+
+        int region = -99;
+        if (i < 3)
+            if (istop)
+                region = i * 4;
+            else
+                region = i * 4 + 1;
+        else if (istop)
+            region = (i - 3) * 4 + 2;
+        else
+            region = (i - 3) * 4 + 3;
+//     System.out.println("Setting region to "+region);
+        return region;
+    }
+
 }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use