Commit in hps-java/src/main/java/org/lcsim/hps/monitoring/svt on MAIN | |||
TrackingReconstructionPlots.java | +252 | -6 | 1.3 -> 1.4 |
Added residual plots for events where there are single hits in each layer.
diff -u -r1.3 -r1.4 --- TrackingReconstructionPlots.java 8 May 2012 16:01:33 -0000 1.3 +++ TrackingReconstructionPlots.java 10 May 2012 18:14:52 -0000 1.4 @@ -58,6 +58,8 @@
IPlotter plotter; IPlotter plotter2; IPlotter plotter3;
+ IPlotter plotter3_1; + IPlotter plotter3_2;
IPlotter plotter4; IPlotter plotter5; IPlotter plotter6;
@@ -151,6 +153,80 @@
plotter3.region(7).plot(mod4ResY); plotter3.region(9).plot(mod5ResY);
+ + plotter3_1 = fac.createPlotterFactory().create("HPS Residual Plots (Single hit per layer)"); + plotter3_1.setTitle("Residuals (1hpl)"); + plotterFrame.addPlotter(plotter3_1); + IPlotterStyle style3_1 = plotter3_1.style(); + style3_1.dataStyle().fillStyle().setColor("yellow"); + style3_1.dataStyle().errorBarStyle().setVisible(false); + plotter3_1.createRegions(5, 2); + + IHistogram1D mod1ResX_1hpl = aida.histogram1D("Module 1 Residual X(mm) 1hpl", 25, minResidX, maxResidX); + IHistogram1D mod1ResY_1hpl = aida.histogram1D("Module 1 Residual Y(mm) 1hpl", 25, minResidY, maxResidY); + + IHistogram1D mod2ResX_1hpl = aida.histogram1D("Module 2 Residual X(mm) 1hpl", 25, minResidX, maxResidX); + IHistogram1D mod2ResY_1hpl = aida.histogram1D("Module 2 Residual Y(mm) 1hpl", 25, minResidY, maxResidY); + + IHistogram1D mod3ResX_1hpl = aida.histogram1D("Module 3 Residual X(mm) 1hpl", 25, minResidX, maxResidX); + IHistogram1D mod3ResY_1hpl = aida.histogram1D("Module 3 Residual Y(mm) 1hpl", 25, minResidY, maxResidY); + + IHistogram1D mod4ResX_1hpl = aida.histogram1D("Module 4 Residual X(mm) 1hpl", 25, minResidX, maxResidX); + IHistogram1D mod4ResY_1hpl = aida.histogram1D("Module 4 Residual Y(mm) 1hpl", 25, minResidY, maxResidY); + + IHistogram1D mod5ResX_1hpl = aida.histogram1D("Module 5 Residual X(mm) 1hpl", 25, minResidX, maxResidX); + IHistogram1D mod5ResY_1hpl = aida.histogram1D("Module 5 Residual Y(mm) 1hpl", 25, minResidY, maxResidY); + + plotter3_1.region(0).plot(mod1ResX_1hpl); + plotter3_1.region(2).plot(mod2ResX_1hpl); + plotter3_1.region(4).plot(mod3ResX_1hpl); + plotter3_1.region(6).plot(mod4ResX_1hpl); + plotter3_1.region(8).plot(mod5ResX_1hpl); + + plotter3_1.region(1).plot(mod1ResY_1hpl); + plotter3_1.region(3).plot(mod2ResY_1hpl); + plotter3_1.region(5).plot(mod3ResY_1hpl); + plotter3_1.region(7).plot(mod4ResY_1hpl); + plotter3_1.region(9).plot(mod5ResY_1hpl); + + + plotter3_2 = fac.createPlotterFactory().create("HPS Residual Plots (Single strip cluster per layer)"); + plotter3_2.setTitle("Residuals (1clpl)"); + plotterFrame.addPlotter(plotter3_2); + IPlotterStyle style3_2 = plotter3_2.style(); + style3_2.dataStyle().fillStyle().setColor("yellow"); + style3_2.dataStyle().errorBarStyle().setVisible(false); + plotter3_2.createRegions(5, 2); + + IHistogram1D mod1ResX_1clpl = aida.histogram1D("Module 1 Residual X(mm) 1clpl", 25, minResidX, maxResidX); + IHistogram1D mod1ResY_1clpl = aida.histogram1D("Module 1 Residual Y(mm) 1clpl", 25, minResidY, maxResidY); + + IHistogram1D mod2ResX_1clpl = aida.histogram1D("Module 2 Residual X(mm) 1clpl", 25, minResidX, maxResidX); + IHistogram1D mod2ResY_1clpl = aida.histogram1D("Module 2 Residual Y(mm) 1clpl", 25, minResidY, maxResidY); + + IHistogram1D mod3ResX_1clpl = aida.histogram1D("Module 3 Residual X(mm) 1clpl", 25, minResidX, maxResidX); + IHistogram1D mod3ResY_1clpl = aida.histogram1D("Module 3 Residual Y(mm) 1clpl", 25, minResidY, maxResidY); + + IHistogram1D mod4ResX_1clpl = aida.histogram1D("Module 4 Residual X(mm) 1clpl", 25, minResidX, maxResidX); + IHistogram1D mod4ResY_1clpl = aida.histogram1D("Module 4 Residual Y(mm) 1clpl", 25, minResidY, maxResidY); + + IHistogram1D mod5ResX_1clpl = aida.histogram1D("Module 5 Residual X(mm) 1clpl", 25, minResidX, maxResidX); + IHistogram1D mod5ResY_1clpl = aida.histogram1D("Module 5 Residual Y(mm) 1clpl", 25, minResidY, maxResidY); + + plotter3_2.region(0).plot(mod1ResX_1clpl); + plotter3_2.region(2).plot(mod2ResX_1clpl); + plotter3_2.region(4).plot(mod3ResX_1clpl); + plotter3_2.region(6).plot(mod4ResX_1clpl); + plotter3_2.region(8).plot(mod5ResX_1clpl); + + plotter3_2.region(1).plot(mod1ResY_1clpl); + plotter3_2.region(3).plot(mod2ResY_1clpl); + plotter3_2.region(5).plot(mod3ResY_1clpl); + plotter3_2.region(7).plot(mod4ResY_1clpl); + plotter3_2.region(9).plot(mod5ResY_1clpl); + + +
plotter4 = fac.createPlotterFactory().create("HPS Track and ECal Plots"); plotter4.setTitle("Track and ECal Correlations");
@@ -202,14 +278,27 @@
style6.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); style6.dataStyle().fillStyle().setColor("yellow"); style6.dataStyle().errorBarStyle().setVisible(false);
- plotter6.createRegions(1, 2);
+ plotter6.createRegions(4, 2);
IHistogram2D topECal = aida.histogram2D("Top ECal Cluster Position", 50, -400, 400, 10, 0, 100); IHistogram2D botECal = aida.histogram2D("Bottom ECal Cluster Position", 50, -400, 400, 10, -100, 0);
+ IHistogram2D topECal1 = aida.histogram2D("Top ECal Cluster Position (>0 tracks)", 50, -400, 400, 10, 0, 100); + IHistogram2D botECal1 = aida.histogram2D("Bottom ECal Cluster Position (>0 tracks)", 50, -400, 400, 10, -100, 0); + IHistogram2D topECal2 = aida.histogram2D("Top ECal Cluster Position (E>100,>0 tracks)", 50, -400, 400, 10, 0, 100); + IHistogram2D botECal2 = aida.histogram2D("Bottom ECal Cluster Position (E>100,>0 tracks)", 50, -400, 400, 10, -100, 0); + IHistogram2D topECal3 = aida.histogram2D("Top ECal Cluster Position w_E (E>100,>0 tracks)", 50, -400, 400, 10, 0, 100); + IHistogram2D botECal3 = aida.histogram2D("Bottom ECal Cluster Position w_E (E>100,>0 tracks)", 50, -400, 400, 10, -100, 0); +
plotter6.region(0).plot(topECal); plotter6.region(1).plot(botECal);
+ plotter6.region(2).plot(topECal1); + plotter6.region(3).plot(botECal1); + plotter6.region(4).plot(topECal2); + plotter6.region(5).plot(botECal2); + plotter6.region(6).plot(topECal3); + plotter6.region(7).plot(botECal3);
@@ -286,19 +375,49 @@
List<Track> tracks = event.get(Track.class, trackCollectionName); nTracks.fill(tracks.size());
- if (event.hasCollection(HPSEcalCluster.class, ecalCollectionName) && tracks.size() > 0) {
+ if (event.hasCollection(HPSEcalCluster.class, ecalCollectionName)) {
List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, ecalCollectionName); for (HPSEcalCluster cluster : clusters) {
-// System.out.println("cluser position = ("+cluster.getPosition()[0]+","+cluster.getPosition()[1]+") with energy = "+cluster.getEnergy()); - if (cluster.getEnergy() > 100) {
+ //System.out.println("cluser position = ("+cluster.getPosition()[0]+","+cluster.getPosition()[1]+") with energy = "+cluster.getEnergy()); + if (cluster.getPosition()[1] > 0) + aida.histogram2D("Top ECal Cluster Position").fill(cluster.getPosition()[0], cluster.getPosition()[1]); + if (cluster.getPosition()[1] < 0) + aida.histogram2D("Bottom ECal Cluster Position").fill(cluster.getPosition()[0], cluster.getPosition()[1]); + + if ( tracks.size() > 0) {
if (cluster.getPosition()[1] > 0)
- aida.histogram2D("Top ECal Cluster Position").fill(cluster.getPosition()[0], cluster.getPosition()[1], cluster.getEnergy());
+ aida.histogram2D("Top ECal Cluster Position (>0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1]);
if (cluster.getPosition()[1] < 0)
- aida.histogram2D("Bottom ECal Cluster Position").fill(cluster.getPosition()[0], cluster.getPosition()[1], cluster.getEnergy());
+ aida.histogram2D("Bottom ECal Cluster Position (>0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1]); + + if (cluster.getEnergy() > 100) { + if (cluster.getPosition()[1] > 0) { + aida.histogram2D("Top ECal Cluster Position (E>100,>0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1]); + aida.histogram2D("Top ECal Cluster Position w_E (E>100,>0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1], cluster.getEnergy()); + } + if (cluster.getPosition()[1] < 0) { + aida.histogram2D("Bottom ECal Cluster Position (E>100, >0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1]); + aida.histogram2D("Bottom ECal Cluster Position w_E (E>100, >0 tracks)").fill(cluster.getPosition()[0], cluster.getPosition()[1], cluster.getEnergy()); + } + }
}
+ + +
} }
+ + + List<SiTrackerHitStrip1D> stripHits = event.get(SiTrackerHitStrip1D.class, "StripClusterer_SiTrackerHitStrip1D"); + int stripClustersPerLayerTop[] = getStripClustersPerLayer(stripHits,"up"); + //int stripClustersPerLayerBottom[] = getStripClustersPerLayer(stripHits,"down"); + + boolean hasSingleStripClusterPerLayer = singleStripClusterPerLayer( stripClustersPerLayerTop ); +
for (Track trk : tracks) {
+ + boolean isSingleHitPerLayerTrack = singleTrackHitPerLayer(trk); +
aida.histogram1D("Track Momentum (Px)").fill(trk.getPY()); aida.histogram1D("Track Momentum (Py)").fill(trk.getPZ()); aida.histogram1D("Track Momentum (Pz)").fill(trk.getPX());
@@ -341,6 +460,20 @@
aida.histogram1D(modNum + "Residual X(mm)").fill(hit.getPosition()[1] - yTr);//these hits should be rotated track hits already aida.histogram1D(modNum + "Residual Y(mm)").fill(hit.getPosition()[2] - zTr);//these hits should be rotated track hits already
+ + if (isSingleHitPerLayerTrack) { + aida.histogram1D(modNum + "Residual X(mm) 1hpl").fill(hit.getPosition()[1] - yTr);//these hits should be rotated track hits already + aida.histogram1D(modNum + "Residual Y(mm) 1hpl").fill(hit.getPosition()[2] - zTr);//these hits should be rotated track hits already + + } + if ( hasSingleStripClusterPerLayer ) { + aida.histogram1D(modNum + "Residual X(mm) 1clpl").fill(hit.getPosition()[1] - yTr);//these hits should be rotated track hits already + aida.histogram1D(modNum + "Residual Y(mm) 1clpl").fill(hit.getPosition()[2] - zTr);//these hits should be rotated track hits already + + } + + +
} List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, ecalCollectionName); // System.out.println("Number of ECAL clusters=" + clusters.size());
@@ -356,6 +489,99 @@
} }
+ public int[] getTrackHitsPerLayer( Track trk ) { + int n[] = {0,0,0,0,0}; + List<TrackerHit> hitsOnTrack = trk.getTrackerHits(); + int layer; + for (TrackerHit hit : hitsOnTrack) { + HelicalTrackHit htc = (HelicalTrackHit)hit; + layer = htc.Layer(); + layer = (layer-1)/2; + n[layer] = n[layer] + 1; + } + + return n; + } + + public boolean singleTrackHitPerLayer( Track track) { + int hitsPerLayer[] = getTrackHitsPerLayer(track); + for (int i=0;i<5;++i) { + if (hitsPerLayer[i]!=1) { + return false; + } + } + return true; + } + + + public boolean singleStripClusterPerLayer( int hitsPerLayer[]) { + //This includes both axial and stereo separately + // so for a hit in each double layer we need 10 hits + for (int i=0;i<10;++i) { + if (hitsPerLayer[i]!=1) { + return false; + } + } + return true; + } + + public int[] getStripClustersPerLayer(List<SiTrackerHitStrip1D> trackerHits, String side) { + String si_side; + String name; + int l; + int i; + int n[] = {0,0,0,0,0,0,0,0,0,0}; + boolean ddd = false; + + if (ddd) { + System.out.println("Get # hits per layer on side \"" + side +"\""); + } + + for ( SiTrackerHitStrip1D stripCluster : trackerHits ) { + + if (ddd) { + System.out.println("Processing stripCluster " + stripCluster.toString()); + } + + + if (side!="") { + String s; + if (stripCluster.getPosition()[1]>=0.0) s = "up"; + else s = "down"; + if (s != side) continue; + } + + name = stripCluster.getSensor().getName(); + if ( name.length() < 14) { + System.err.println("This name is too short!!"); + throw new RuntimeException("SiSensor name " + name + " is invalid?"); + } + + if (ddd) { + System.out.println("sensor name " + name ); + } + + //String str_l = name.substring(13); + String str_l = name.substring(name.indexOf("layer")+5, name.indexOf("_module")); + l = Integer.parseInt(str_l); + + if (ddd) { + System.out.println("sensor name " + name + " --> layer " + l); + } + + if ( l < 1 || l > 10 ) { + System.out.println("This layer doesn't exist?"); + throw new RuntimeException("SiSensor name " + name + " is invalid?"); + } + + n[l-1] = n[l-1] + 1; + + } + + return n; + } + +
public void endOfData() { if (outputPlots != null) try {
@@ -406,6 +632,26 @@
aida.histogram1D("Module 4 Residual Y(mm)").reset(); aida.histogram1D("Module 5 Residual X(mm)").reset(); aida.histogram1D("Module 5 Residual Y(mm)").reset();
+ aida.histogram1D("Module 1 Residual X(mm) 1hpl").reset(); + aida.histogram1D("Module 1 Residual Y(mm) 1hpl").reset(); + aida.histogram1D("Module 2 Residual X(mm) 1hpl").reset(); + aida.histogram1D("Module 2 Residual Y(mm) 1hpl").reset(); + aida.histogram1D("Module 3 Residual X(mm) 1hpl").reset(); + aida.histogram1D("Module 3 Residual Y(mm) 1hpl").reset(); + aida.histogram1D("Module 4 Residual X(mm) 1hpl").reset(); + aida.histogram1D("Module 4 Residual Y(mm) 1hpl").reset(); + aida.histogram1D("Module 5 Residual X(mm) 1hpl").reset(); + aida.histogram1D("Module 5 Residual Y(mm) 1hpl").reset(); + aida.histogram1D("Module 1 Residual X(mm) 1clpl").reset(); + aida.histogram1D("Module 1 Residual Y(mm) 1clpl").reset(); + aida.histogram1D("Module 2 Residual X(mm) 1clpl").reset(); + aida.histogram1D("Module 2 Residual Y(mm) 1clpl").reset(); + aida.histogram1D("Module 3 Residual X(mm) 1clpl").reset(); + aida.histogram1D("Module 3 Residual Y(mm) 1clpl").reset(); + aida.histogram1D("Module 4 Residual X(mm) 1clpl").reset(); + aida.histogram1D("Module 4 Residual Y(mm) 1clpl").reset(); + aida.histogram1D("Module 5 Residual X(mm) 1clpl").reset(); + aida.histogram1D("Module 5 Residual Y(mm) 1clpl").reset();
aida.histogram2D("Energy Vs Momentum").reset(); aida.histogram1D("Energy Over Momentum").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