Commit in hps-java/src/main/java/org/lcsim/hps/monitoring/svt on MAIN | |||
SVTHitRecoCorrelations.java | +106 | -8 | 1.1 -> 1.2 |
Added stereo hit correlation.
diff -u -r1.1 -r1.2 --- SVTHitRecoCorrelations.java 10 May 2012 18:13:48 -0000 1.1 +++ SVTHitRecoCorrelations.java 11 May 2012 00:33:25 -0000 1.2 @@ -13,6 +13,8 @@
import org.lcsim.detector.tracker.silicon.SiSensor; import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit;
+import org.lcsim.event.TrackerHit; +import org.lcsim.fit.helicaltrack.HelicalTrackHit;
import org.lcsim.geometry.Detector; import org.lcsim.hps.monitoring.AIDAFrame; import org.lcsim.hps.monitoring.Resettable;
@@ -34,6 +36,7 @@
private String rawTrackerHitCollectionName = "SVTRawTrackerHits"; private String fittedTrackerHitCollectionName = "SVTFittedRawTrackerHits"; private String trackerHitCollectionName = "StripClusterer_SiTrackerHitStrip1D";
+ private String hthOutputCollectionName = "HelicalTrackHits";
private String trackerName = "Tracker"; private int eventCount; private List<SiSensor> sensors;
@@ -67,19 +70,51 @@
plotterFrame.addPlotter(plotter); plotters.add(plotter); IPlotterStyle style = plotter.style();
- style.dataStyle().fillStyle().setColor("yellow"); - style.dataStyle().errorBarStyle().setVisible(false);
+ style.setParameter("hist2DStyle", "colorMap"); + style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + style.statisticsBoxStyle().setVisible(false); + //style.dataStyle().fillStyle().setColor("yellow"); + //style.dataStyle().errorBarStyle().setVisible(false);
plotter.createRegions(5, 5);
-
+
plotter2 = fac.createPlotterFactory().create("Stereo hits"); plotter2.setTitle("Stereo hits top"); plotterFrame.addPlotter(plotter2); plotters.add(plotter2); IPlotterStyle style2 = plotter2.style();
- style2.dataStyle().fillStyle().setColor("yellow"); - style2.dataStyle().errorBarStyle().setVisible(false);
+ style2.setParameter("hist2DStyle", "colorMap"); + style2.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + style2.statisticsBoxStyle().setVisible(false); + + //style2.dataStyle().fillStyle().setColor("yellow"); + //style2.dataStyle().errorBarStyle().setVisible(false);
plotter2.createRegions(5, 5);
+ plotter3 = fac.createPlotterFactory().create("HTH hits"); + plotter3.setTitle("HTH hits Y top"); + plotterFrame.addPlotter(plotter3); + plotters.add(plotter3); + IPlotterStyle style3 = plotter3.style(); + style3.setParameter("hist2DStyle", "colorMap"); + style3.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + //style3.statisticsBoxStyle().setVisibileStatistics("10"); + style3.statisticsBoxStyle().setVisible(false); + //style3.dataStyle().fillStyle().setColor("yellow"); + //style3.dataStyle().errorBarStyle().setVisible(false); + plotter3.createRegions(5, 5); + + plotter4 = fac.createPlotterFactory().create("HTH hits"); + plotter4.setTitle("HTH hits X top"); + plotterFrame.addPlotter(plotter4); + plotters.add(plotter4); + IPlotterStyle style4 = plotter4.style(); + style4.setParameter("hist2DStyle", "colorMap"); + style4.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + //style3.statisticsBoxStyle().setVisibileStatistics("10"); + style4.statisticsBoxStyle().setVisible(false); + //style3.dataStyle().fillStyle().setColor("yellow"); + //style3.dataStyle().errorBarStyle().setVisible(false); + plotter4.createRegions(5, 5);
for (SiSensor ref_sensor : sensors) {
@@ -105,13 +140,13 @@
if ( ref_a == a && ref_s == s ) { if(s == 0 && a ) {
- IHistogram2D corPlot = aida.histogram2D("corr_TA_layer" + ref_l + "_layer" + l, 60, 10, 60.0, 60, 10, 60.0);
+ IHistogram2D corPlot = aida.histogram2D("corr_TA_layer" + ref_l + "_layer" + l, 50, 10, 60.0, 50, 10, 60.0);
int region = (ref_l-1) + (l-1)*5; //System.out.println("ref_l " + ref_l + " l " + l + " ---> " + region); plotter.region(region).plot(corPlot); } if(s == 0 && !a ) {
- IHistogram2D corPlot = aida.histogram2D("corr_TS_layer" + ref_l + "_layer" + l, 60, 10, 60.0, 60, 10, 60.0);
+ IHistogram2D corPlot = aida.histogram2D("corr_TS_layer" + ref_l + "_layer" + l, 50, 10, 60.0, 50, 10, 60.0);
int region = (ref_l-1) + (l-1)*5; //System.out.println("ref_l " + ref_l + " l " + l + " ---> " + region); plotter2.region(region).plot(corPlot);
@@ -121,6 +156,18 @@
} }
+ + for (int i=1;i<6;++i) { + for (int ii=1;ii<6;++ii) { + IHistogram2D corPlot = aida.histogram2D("corrY_HTH_layer" + i + "_layer" + ii, 50, 10, 60.0, 50, 10, 60.0); + IHistogram2D corPlot1 = aida.histogram2D("corrX_HTH_layer" + i + "_layer" + ii, 60, -60, 60.0, 60, -60, 60.0); + int region = (i-1) + (ii-1)*5; + plotter3.region(region).plot(corPlot); + plotter4.region(region).plot(corPlot1); + } + } + +
plotterFrame.pack(); plotterFrame.setVisible(true);
@@ -146,7 +193,9 @@
} public void process(EventHeader event) {
-//
+ + +
// if (!event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName)) { // System.out.println(rawTrackerHitCollectionName + " does not exist; skipping event"); // int ns = sensors.size();
@@ -219,6 +268,53 @@
} } }
+ + + + if (event.hasCollection(TrackerHit.class, hthOutputCollectionName)) { + + List<TrackerHit> hth = event.get(TrackerHit.class, hthOutputCollectionName); + System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits."); + + for (TrackerHit h_ref : hth) { + HelicalTrackHit hit_ref = (HelicalTrackHit)h_ref; + int layer_ref = hit_ref.Layer(); + //HTH hits uses the axial layer nr i.e. odd numbers 1-10 + layer_ref = (layer_ref+1)/2; + //How do I find the top or bottom side? + int side_ref = 0; + if (hit_ref.getPosition()[1] < 0 ) side_ref = 1; + + for (TrackerHit h : hth) { + HelicalTrackHit hit = (HelicalTrackHit)h; + + int layer = hit.Layer(); + layer = (layer+1)/2; + String name = hit.Detector(); + int side = 0; + if (hit.getPosition()[1] < 0 ) side = 1; + //System.out.println("Hit name " + name + " layer " + layer + " x,y , z" + hit.getPosition()[0] + "," + hit.getPosition()[1] + "," + hit.getPosition()[2] ); + //System.out.println("Hit name " + name + " layer " + layer_ref + " x,y , z" + hit_ref.getPosition()[0] + "," + hit_ref.getPosition()[1] + "," + hit_ref.getPosition()[2] ); + + if ( side == side_ref) { + + if( side == 0 ) { + aida.histogram2D("corrY_HTH_layer" + layer_ref + "_layer" + layer).fill(hit_ref.getPosition()[1],hit.getPosition()[1]); + aida.histogram2D("corrX_HTH_layer" + layer_ref + "_layer" + layer).fill(hit_ref.getPosition()[0],hit.getPosition()[0]); + } + } + } + + } + + } else { + + System.out.println("No " + hthOutputCollectionName + " was found in this event."); + } + + + +
}
@@ -239,6 +335,8 @@
for (int ii = 0; ii < 5; ii++) { aida.histogram2D("corr_TA_layer" + (i+1) + "_layer" + (ii+1)).reset(); aida.histogram2D("corr_TS_layer" + (i+1) + "_layer" + (ii+1)).reset();
+ aida.histogram2D("corrY_HTH_layer" + (i+1) + "_layer" + (ii+1)).reset(); + aida.histogram2D("corrX_HTH_layer" + (i+1) + "_layer" + (ii+1)).reset();
} }
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