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  March 2015

HPS-SVN March 2015

Subject:

r2248 - in /java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics: ./ event/ ui/ util/

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 5 Mar 2015 01:19:12 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (1135 lines)

Author: [log in to unmask]
Date: Wed Mar  4 17:19:06 2015
New Revision: 2248

Log:
Essentially the final structural update to the trigger diagnostics. All functionality is now present including GUI tables for displaying statistical information. Only plots remain to be added. The next update is intended to include the ability to read to from the EVIO stream DAQ configuration.

Added:
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerEfficiencyModule.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTwoColumnTablePanel.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/EfficiencyTablePanel.java
Modified:
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/DiagSnapshot.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/TriggerDiagnosticDriver.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerMatchEvent.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerStatModule.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTablePanel.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTriggerTablePanel.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ClusterTablePanel.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ComponentUtils.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/PairTrigger.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/SinglesTrigger.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/Trigger.java
    java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/TriggerDiagnosticUtil.java

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/DiagSnapshot.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/DiagSnapshot.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/DiagSnapshot.java	Wed Mar  4 17:19:06 2015
@@ -2,6 +2,7 @@
 
 import org.hps.users.kmccarty.triggerdiagnostics.event.ClusterMatchStatus;
 import org.hps.users.kmccarty.triggerdiagnostics.event.ClusterStatModule;
+import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerEfficiencyModule;
 import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerMatchStatus;
 import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerStatModule;
 import org.hps.users.kmccarty.triggerdiagnostics.util.TriggerDiagnosticUtil;
@@ -21,6 +22,8 @@
 	public final SinglesTriggerStatModule singlesLocalStatistics;
 	public final PairTriggerStatModule pairRunStatistics;
 	public final PairTriggerStatModule pairLocalStatistics;
+	public final TriggerEfficiencyModule efficiencyRunStatistics;
+	public final TriggerEfficiencyModule efficiencyLocalStatistics;
 	
 	/**
 	 * Instantiates a new snapshot. The snapshot creates a copy of the
@@ -35,13 +38,16 @@
 	 */
 	DiagSnapshot(ClusterMatchStatus localCluster, ClusterMatchStatus globalCluster,
 			TriggerMatchStatus localSingles, TriggerMatchStatus globalSingles,
-			TriggerMatchStatus localPair, TriggerMatchStatus globalPair) {
+			TriggerMatchStatus localPair, TriggerMatchStatus globalPair,
+			TriggerEfficiencyModule localEfficiency, TriggerEfficiencyModule globalEfficiency) {
 		clusterRunStatistics = globalCluster.cloneStatModule();
 		clusterLocalStatistics = localCluster.cloneStatModule();
 		singlesRunStatistics = new SinglesTriggerStatModule(globalSingles);
 		singlesLocalStatistics = new SinglesTriggerStatModule(localSingles);
 		pairRunStatistics = new PairTriggerStatModule(globalPair);
 		pairLocalStatistics = new PairTriggerStatModule(localPair);
+		efficiencyRunStatistics = globalEfficiency.clone();
+		efficiencyLocalStatistics = localEfficiency.clone();
 	}
 	
 	/**

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/TriggerDiagnosticDriver.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/TriggerDiagnosticDriver.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/TriggerDiagnosticDriver.java	Wed Mar  4 17:19:06 2015
@@ -22,6 +22,7 @@
 import org.hps.users.kmccarty.triggerdiagnostics.event.ClusterMatchEvent;
 import org.hps.users.kmccarty.triggerdiagnostics.event.ClusterMatchStatus;
 import org.hps.users.kmccarty.triggerdiagnostics.event.ClusterMatchedPair;
+import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerEfficiencyModule;
 import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerMatchEvent;
 import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerMatchStatus;
 import org.hps.users.kmccarty.triggerdiagnostics.util.OutputLogger;
@@ -54,6 +55,7 @@
 	private List<List<SinglesTrigger<SSPCluster>>> sspSinglesTriggers = new ArrayList<List<SinglesTrigger<SSPCluster>>>(2);
 	
 	// Trigger modules for performing trigger analysis.
+	private int activeTrigger = -1;
 	private TriggerModule[] singlesTrigger = new TriggerModule[2];
 	private TriggerModule[] pairsTrigger = new TriggerModule[2];
 	
@@ -73,6 +75,8 @@
 	// Efficiency tracking variables.
 	private ClusterMatchStatus clusterRunStats = new ClusterMatchStatus();
 	private ClusterMatchStatus clusterLocalStats = new ClusterMatchStatus();
+	private TriggerEfficiencyModule efficiencyRunStats = new TriggerEfficiencyModule();
+	private TriggerEfficiencyModule efficiencyLocalStats = new TriggerEfficiencyModule();
 	private TriggerMatchStatus[] triggerRunStats = { new TriggerMatchStatus(), new TriggerMatchStatus() };
 	private TriggerMatchStatus[] triggerLocalStats = { new TriggerMatchStatus(), new TriggerMatchStatus() };
 	
@@ -326,6 +330,8 @@
 				}
 			}
 		}
+		
+		this.efficiencyRunStats.printModule();
 	}
 	
 	/**
@@ -375,10 +381,25 @@
 				else if(AbstractIntData.getTag(obj) == TIData.BANK_TAG) {
 					tiBank = new TIData(obj);
 					
-					if(tiBank.isPulserTrigger()) { OutputLogger.println("Trigger type :: Pulser"); }
-					else if(tiBank.isSingle0Trigger() || tiBank.isSingle1Trigger()) { OutputLogger.println("Trigger type :: Singles"); }
-					else if(tiBank.isPair0Trigger() || tiBank.isPair1Trigger()) { OutputLogger.println("Trigger type :: Pair"); }
-					else if(tiBank.isCalibTrigger()) { OutputLogger.println("Trigger type :: Cosmic"); }
+					if(tiBank.isPulserTrigger()) {
+						OutputLogger.println("Trigger type :: Pulser");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_PULSER;
+					} else if(tiBank.isSingle0Trigger()) {
+						OutputLogger.println("Trigger type :: Singles 1");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_SINGLES_1;
+					} else if(tiBank.isSingle1Trigger()) {
+						OutputLogger.println("Trigger type :: Singles 2");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_SINGLES_2;
+					} else if(tiBank.isPair0Trigger()) {
+						OutputLogger.println("Trigger type :: Pair 1");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_PAIR_1;
+					} else if(tiBank.isPair1Trigger()) {
+						OutputLogger.println("Trigger type :: Pair 2");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_PAIR_2;
+					} else if(tiBank.isCalibTrigger()) {
+						OutputLogger.println("Trigger type :: Cosmic");
+						activeTrigger = TriggerDiagnosticUtil.TRIGGER_COSMIC;
+					}
 				}
 			}
 			
@@ -523,35 +544,19 @@
 		if(Calendar.getInstance().getTimeInMillis() - localWindowStart > localWindowThreshold) {
 			// Write a snapshot of the driver to the event stream.
 			DiagSnapshot snapshot = new DiagSnapshot(clusterLocalStats, clusterRunStats,
-					triggerLocalStats[0], triggerRunStats[0], triggerLocalStats[1], triggerRunStats[1]);
+					triggerLocalStats[0], triggerRunStats[0], triggerLocalStats[1],
+					triggerRunStats[1], efficiencyRunStats, efficiencyLocalStats);
 			
 			// Push the snapshot to the data stream.
 			List<DiagSnapshot> snapshotCollection = new ArrayList<DiagSnapshot>(1);
 			snapshotCollection.add(snapshot);
 			event.put(diagnosticCollectionName, snapshotCollection);
 			
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println("WROTE SNAPSHOT");
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			System.out.println();
-			
 			// Clear the local statistical data.
 			clusterLocalStats.clear();
 			triggerLocalStats[0].clear();
 			triggerLocalStats[1].clear();
+			efficiencyLocalStats.clear();
 			
 			// Update the last write time.
 			localWindowStart = Calendar.getInstance().getTimeInMillis();
@@ -1046,9 +1051,9 @@
 				// so that the closest match may be found.
 				int numMatched = -1;
 				boolean[] matchedCut = null;
+				SSPNumberedTrigger bestMatch = null;
 				
 				// Iterate over the reported triggers to find a match.
-				SSPNumberedTrigger bestMatch = null;
 				reportedLoop:
 				for(SSPNumberedTrigger sspTrigger : sspTriggers) {
 					// If the two triggers have different times, this
@@ -1081,10 +1086,12 @@
 				// If there was no match found, it means that there were
 				// no triggers that were both unmatched and at the same
 				// time as this simulated trigger.
-				event.matchedSSPPair(simTrigger, bestMatch, matchedCut);
-				if(matchedCut == null) {
+				
+				if(bestMatch == null) {
 					if(isSingles) { singlesInternalFail = true; }
 					else { pairInternalFail = true; }
+				} else {
+					event.matchedSSPPair(simTrigger, bestMatch, matchedCut);
 				}
 			}
 		}
@@ -1209,6 +1216,10 @@
 			// Update the global trigger tracking variables.
 			triggerRunStats[0].addEvent(event, reconTriggerList, sspTriggerList, sspTriggers);
 			triggerLocalStats[0].addEvent(event, reconTriggerList, sspTriggerList, sspTriggers);
+			efficiencyRunStats.addSinglesTriggers(activeTrigger, reconTriggerList);
+			efficiencyLocalStats.addSinglesTriggers(activeTrigger, reconTriggerList);
+			efficiencyRunStats.addEvent(activeTrigger, event);
+			efficiencyLocalStats.addEvent(activeTrigger, event);
 		} else {
 			for(int triggerNum = 0; triggerNum < 2; triggerNum++) {
 				OutputLogger.println();
@@ -1234,6 +1245,10 @@
 			// Update the global trigger tracking variables.
 			triggerRunStats[1].addEvent(event, reconTriggerList, sspTriggerList, sspTriggers);
 			triggerLocalStats[1].addEvent(event, reconTriggerList, sspTriggerList, sspTriggers);
+			efficiencyRunStats.addPairTriggers(activeTrigger, reconTriggerList);
+			efficiencyLocalStats.addSinglesTriggers(activeTrigger, reconTriggerList);
+			efficiencyRunStats.addEvent(activeTrigger, event);
+			efficiencyLocalStats.addEvent(activeTrigger, event);
 		}
 		
 		// Note whether the was a trigger match failure.
@@ -1264,7 +1279,7 @@
 				boolean passHitCount = singlesTrigger[triggerNum].clusterHitCountCut(cluster);
 				
 				// Make a trigger to store the results.
-				SinglesTrigger<SSPCluster> trigger = new SinglesTrigger<SSPCluster>(cluster);
+				SinglesTrigger<SSPCluster> trigger = new SinglesTrigger<SSPCluster>(cluster, triggerNum);
 				trigger.setStateSeedEnergyLow(passSeedLow);
 				trigger.setStateSeedEnergyHigh(passSeedHigh);
 				trigger.setStateClusterEnergyLow(passClusterLow);
@@ -1293,7 +1308,7 @@
 				boolean passHitCount = singlesTrigger[triggerNum].clusterHitCountCut(cluster);
 				
 				// Make a trigger to store the results.
-				SinglesTrigger<Cluster> trigger = new SinglesTrigger<Cluster>(cluster);
+				SinglesTrigger<Cluster> trigger = new SinglesTrigger<Cluster>(cluster, triggerNum);
 				trigger.setStateSeedEnergyLow(passSeedLow);
 				trigger.setStateSeedEnergyHigh(passSeedHigh);
 				trigger.setStateClusterEnergyLow(passClusterLow);
@@ -1386,7 +1401,7 @@
 				boolean passTimeCoincidence = pairsTrigger[triggerIndex].pairTimeCoincidenceCut(reconPair);
 				
 				// Create a trigger from the results.
-				PairTrigger<Cluster[]> trigger = new PairTrigger<Cluster[]>(reconPair);
+				PairTrigger<Cluster[]> trigger = new PairTrigger<Cluster[]>(reconPair, triggerIndex);
 				trigger.setStateSeedEnergyLow(passSeedLow);
 				trigger.setStateSeedEnergyHigh(passSeedHigh);
 				trigger.setStateClusterEnergyLow(passClusterLow);
@@ -1435,7 +1450,7 @@
 				boolean passTimeCoincidence = pairsTrigger[triggerIndex].pairTimeCoincidenceCut(sspPair);
 				
 				// Create a trigger from the results.
-				PairTrigger<SSPCluster[]> trigger = new PairTrigger<SSPCluster[]>(sspPair);
+				PairTrigger<SSPCluster[]> trigger = new PairTrigger<SSPCluster[]>(sspPair, triggerIndex);
 				trigger.setStateSeedEnergyLow(passSeedLow);
 				trigger.setStateSeedEnergyHigh(passSeedHigh);
 				trigger.setStateClusterEnergyLow(passClusterLow);

Added: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerEfficiencyModule.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerEfficiencyModule.java	(added)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerEfficiencyModule.java	Wed Mar  4 17:19:06 2015
@@ -0,0 +1,264 @@
+package org.hps.users.kmccarty.triggerdiagnostics.event;
+
+import java.util.List;
+
+import org.hps.readout.ecal.triggerbank.SSPNumberedTrigger;
+import org.hps.users.kmccarty.triggerdiagnostics.ui.ComponentUtils;
+import org.hps.users.kmccarty.triggerdiagnostics.util.Pair;
+import org.hps.users.kmccarty.triggerdiagnostics.util.PairTrigger;
+import org.hps.users.kmccarty.triggerdiagnostics.util.SinglesTrigger;
+import org.hps.users.kmccarty.triggerdiagnostics.util.Trigger;
+import org.hps.users.kmccarty.triggerdiagnostics.util.TriggerDiagnosticUtil;
+
+public class TriggerEfficiencyModule {
+	// Store the statistics.
+	protected int[][] triggersSeenByType = new int[6][6];
+	protected int[][] triggersMatchedByType = new int[6][6];
+	
+	/**
+	 * Adds the number of matched triggers from the event to the total
+	 * seen for each of the appropriate trigger types.
+	 * @param eventTriggerType - The trigger type ID for the trigger that
+	 * caused the event readout.
+	 * @param event - A trigger statistical event.
+	 */
+	public void addEvent(int eventTriggerType, TriggerMatchEvent event) {
+		// Iterate over the matched triggers and track how many were
+		// found of each trigger type.
+		List<Pair<Trigger<?>, SSPNumberedTrigger>> pairList = event.getMatchedReconPairs();
+		for(Pair<Trigger<?>, SSPNumberedTrigger> pair : pairList) {
+			// Update the appropriate counter based on the trigger type.
+			int triggerType = getTriggerType(pair.getFirstElement());
+			triggersMatchedByType[eventTriggerType][triggerType]++;
+		}
+	}
+	
+	/**
+	 * Adds singles triggers to the list of triggers seen.
+	 * @param eventTriggerType - The trigger type ID for the event
+	 * trigger type.
+	 * @param singlesTriggers - A list of size two containing the
+	 * triggers seen for each of the two singles triggers.
+	 */
+	public void addSinglesTriggers(int eventTriggerType, List<List<? extends Trigger<?>>> singlesTriggers) {
+		// Note the trigger type.
+		int[] triggerType = { TriggerDiagnosticUtil.TRIGGER_SINGLES_1, TriggerDiagnosticUtil.TRIGGER_SINGLES_2 };
+		
+		// Track the total number of singles triggers seen.
+		addTriggers(eventTriggerType, singlesTriggers, triggerType);
+	}
+	
+	/**
+	 * Adds pair triggers to the list of triggers seen.
+	 * @param eventTriggerType - The trigger type ID for the event
+	 * trigger type.
+	 * @param pairTriggers - A list of size two containing the
+	 * triggers seen for each of the two pair triggers.
+	 */
+	public void addPairTriggers(int eventTriggerType, List<List<? extends Trigger<?>>> pairTriggers) {
+		// Note the trigger type.
+		int[] triggerType = { TriggerDiagnosticUtil.TRIGGER_PAIR_1, TriggerDiagnosticUtil.TRIGGER_PAIR_2 };
+		
+		// Track the total number of singles triggers seen.
+		addTriggers(eventTriggerType, pairTriggers, triggerType);
+	}
+	
+	/**
+	 * Clears the data stored in the module.
+	 */
+	public void clear() {
+		triggersSeenByType = new int[6][6];
+		triggersMatchedByType = new int[6][6];
+	}
+	
+	@Override
+	public TriggerEfficiencyModule clone() {
+		// Create a new module.
+		TriggerEfficiencyModule clone = new TriggerEfficiencyModule();
+		
+		// Clone the data.
+		clone.triggersMatchedByType = triggersMatchedByType.clone();
+		clone.triggersSeenByType = triggersSeenByType.clone();
+		
+		// Return the clone.
+		return clone;
+	}
+	
+	/**
+	 * Gets the number of triggers matched in events that were caused
+	 * by trigger <code>eventTriggerID</code> for <code>seenTriggerID
+	 * </code> trigger.
+	 * @param eventTriggerID - The trigger that caused the event.
+	 * @param seenTriggerID - The trigger that was seen in the event.
+	 * @return Returns the number of matches as an <code>int</code>.
+	 */
+	public int getTriggersMatched(int eventTriggerID, int seenTriggerID) {
+		return triggersMatchedByType[eventTriggerID][seenTriggerID];
+	}
+	
+	/**
+	 * Gets the number of triggers seen in events that were caused
+	 * by trigger <code>eventTriggerID</code> for <code>seenTriggerID
+	 * </code> trigger.
+	 * @param eventTriggerID - The trigger that caused the event.
+	 * @param seenTriggerID - The trigger that was seen in the event.
+	 * @return Returns the number of triggers as an <code>int</code>.
+	 */
+	public int getTriggersSeen(int eventTriggerID, int seenTriggerID) {
+		return triggersSeenByType[eventTriggerID][seenTriggerID];
+	}
+	
+	/**
+	 * Prints the trigger statistics to the terminal as a table.
+	 */
+	public void printModule() {
+		// Define constant spacing variables.
+		int columnSpacing = 3;
+		
+		// Define table headers.
+		String sourceName = "Source";
+		String seenName = "Trigger Efficiency";
+		
+		// Get the longest column header name.
+		int longestHeader = -1;
+		for(String triggerName : TriggerDiagnosticUtil.TRIGGER_NAME) {
+			longestHeader = ComponentUtils.max(longestHeader, triggerName.length());
+		}
+		longestHeader = ComponentUtils.max(longestHeader, sourceName.length());
+		
+		// Determine the spacing needed to display the largest numerical
+		// cell value.
+		int numWidth = -1;
+		int longestCell = -1;
+		for(int eventTriggerID = 0; eventTriggerID < 6; eventTriggerID++) {
+			for(int seenTriggerID = 0; seenTriggerID < 6; seenTriggerID++) {
+				int valueSize = ComponentUtils.getDigits(triggersSeenByType[eventTriggerID][seenTriggerID]);
+				int cellSize = valueSize * 2 + 3;
+				if(cellSize > longestCell) {
+					longestCell = cellSize;
+					numWidth = valueSize;
+				}
+			}
+		}
+		
+		// The total column width can then be calculated from the
+		// longer of the header and cell values.
+		int columnWidth = ComponentUtils.max(longestCell, longestHeader);
+		
+		// Calculate the total width of the table value header columns.
+		int headerTotalWidth = (TriggerDiagnosticUtil.TRIGGER_NAME.length * columnWidth)
+				+ ((TriggerDiagnosticUtil.TRIGGER_NAME.length - 1) * columnSpacing);
+		
+		// Write the table header.
+		String spacingText = ComponentUtils.getChars(' ', columnSpacing);
+		System.out.println(ComponentUtils.getChars(' ', columnWidth) + spacingText
+				+ getCenteredString(seenName, headerTotalWidth));
+		
+		// Create the format strings for the cell values.
+		String headerFormat = "%-" + columnWidth + "s" + spacingText;
+		String cellFormat = "%" + numWidth + "d / %" + numWidth + "d";
+		String nullText = getCenteredString(ComponentUtils.getChars('-', numWidth) + " / "
+				+ ComponentUtils.getChars('-', numWidth), columnWidth) + spacingText;
+		
+		// Print the column headers.
+		System.out.printf(headerFormat, sourceName);
+		for(String header : TriggerDiagnosticUtil.TRIGGER_NAME) {
+			System.out.print(getCenteredString(header, columnWidth) + spacingText);
+		}
+		System.out.println();
+		
+		// Write out the value columns.
+		for(int eventTriggerID = 0; eventTriggerID < 6; eventTriggerID++) {
+			// Print out the row header.
+			System.out.printf(headerFormat, TriggerDiagnosticUtil.TRIGGER_NAME[eventTriggerID]);
+			
+			// Print the cell values.
+			for(int seenTriggerID = 0; seenTriggerID < 6; seenTriggerID++) {
+				if(seenTriggerID == eventTriggerID) { System.out.print(nullText); }
+				else {
+					String cellText = String.format(cellFormat, triggersMatchedByType[eventTriggerID][seenTriggerID],
+							triggersSeenByType[eventTriggerID][seenTriggerID]);
+					System.out.print(getCenteredString(cellText, columnWidth) + spacingText);
+				}
+			}
+			
+			// Start a new line.
+			System.out.println();
+		}
+	}
+	
+	/**
+	 * Adds triggers in a generic way to the number of triggers seen.
+	 * @param eventTriggerType - The trigger type ID for the event
+	 * trigger type.
+	 * @param triggerList - A list of size two containing the
+	 * triggers seen for each of the two triggers of its type.
+	 * @param triggerTypeID - The two trigger IDs corresponding to the
+	 * list entries.
+	 */
+	private void addTriggers(int eventTriggerType, List<List<? extends Trigger<?>>> triggerList, int[] triggerTypeID) {
+		// Track the total number of singles triggers seen.
+		for(int triggerNum = 0; triggerNum < 2; triggerNum++) {
+			List<? extends Trigger<?>> triggers = triggerList.get(triggerNum);
+			triggersSeenByType[eventTriggerType][triggerTypeID[triggerNum]] += triggers.size();
+		}
+	}
+	
+	/**
+	 * Produces a <code>String</code> of the indicated length with the
+	 * text <code>value</code> centered in the middle. Extra length is
+	 * filled through spaces before and after the text.
+	 * @param value - The text to display.
+	 * @param width - The number of spaces to include.
+	 * @return Returns a <code>String</code> of the specified length,
+	 * or the argument text if it is longer.
+	 */
+	private static final String getCenteredString(String value, int width) {
+		// The method can not perform as intended if the argument text
+		// exceeds the requested string length. Just return the text.
+		if(width <= value.length()) {
+			return value;
+		}
+		
+		// Otherwise, get the amount of buffering needed to center the
+		// text and add it around the text to produce the string.
+		else {
+			int buffer = (width - value.length()) / 2;
+			return ComponentUtils.getChars(' ', buffer) + value
+					+ ComponentUtils.getChars(' ', width - buffer - value.length());
+		}
+	}
+	
+	/**
+	 * Gets the trigger type identifier from a trigger object.
+	 * @param trigger - A trigger.
+	 * @return Returns the trigger type ID of the argument trigger.
+	 */
+	private static final int getTriggerType(Trigger<?> trigger) {
+		// Choose the appropriate trigger type ID based on the class
+		// of the trigger.
+		if(trigger instanceof PairTrigger) {
+			// Use the trigger number to determine which of the two
+			// triggers this is. Note that this assumes that the trigger
+			// number is stored as either 0 or 1.
+			if(trigger.getTriggerNumber() == 0) {
+				return TriggerDiagnosticUtil.TRIGGER_PAIR_1;
+			} else {
+				return TriggerDiagnosticUtil.TRIGGER_PAIR_2;
+			}
+		} else if(trigger instanceof SinglesTrigger) {
+			// Use the trigger number to determine which of the two
+			// triggers this is. Note that this assumes that the trigger
+			// number is stored as either 0 or 1.
+			if(trigger.getTriggerNumber() == 0) {
+				return TriggerDiagnosticUtil.TRIGGER_SINGLES_1;
+			} else {
+				return TriggerDiagnosticUtil.TRIGGER_SINGLES_2;
+			}
+		}
+		
+		// If the trigger type is not supported, throw an exception.
+		throw new IllegalArgumentException(String.format("Trigger type \"%s\" is not supported.",
+				trigger.getClass().getSimpleName()));
+	}
+}

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerMatchEvent.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerMatchEvent.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerMatchEvent.java	Wed Mar  4 17:19:06 2015
@@ -95,6 +95,16 @@
 	}
 	
 	/**
+	 * Gets a list containing all reconstructed cluster triggers and
+	 * their matched SSP bank triggers.
+	 * @return Returns the trigger pairs as a <code>List</code>
+	 * collection of <code>Pair</code> objects.
+	 */
+	public List<Pair<Trigger<?>, SSPNumberedTrigger>> getMatchedReconPairs() {
+		return reconPairList;
+	}
+	
+	/**
 	 * Adds a reconstructed trigger and SSP bank trigger pair that is
 	 * marked as matched for all trigger cuts.
 	 * @param reconTrigger - The reconstructed cluster trigger.

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerStatModule.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerStatModule.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/event/TriggerStatModule.java	Wed Mar  4 17:19:06 2015
@@ -15,6 +15,7 @@
 	protected int[] sspInternalMatched = new int[2];
 	protected int[] reconTriggersMatched = new int[2];
 	protected int[][] triggerComp = new int[4][2];
+	
 	
 	/**
 	 * Instantiates a <code>TriggerStatModule</code> with no statistics

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTablePanel.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTablePanel.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTablePanel.java	Wed Mar  4 17:19:06 2015
@@ -27,45 +27,26 @@
 	// Static variables.
 	private static final long serialVersionUID = 0L;
 	
-	// Table models.
-	private final TableTextModel localModel;
-	private final TableTextModel globalModel;
-	
 	// Components.
-	private JTable localTable;
+	protected final JTable localTable;
 	private JLabel localHeader;
-	private JTable globalTable;
+	protected final JTable globalTable;
 	private JLabel globalHeader;
 	private Dimension defaultPrefSize = new Dimension(0, 0);
 	private Dimension userPrefSize = null;
 	
-	// Table model mappings.
-	private static final int COL_TITLE = 0;
-	private static final int COL_VALUE = 1;
-	
-	/**
-	 * Instantiates an <code>AbstractTablePanel</code> with a number
-	 * of rows equal to the length of the argument array. Note that
-	 * the panel requires that there be at least one row.
-	 * @param rowNames - An array of <code>String</code> objects that
-	 * are to be displayed for the names of the table rows.
-	 */
-	public AbstractTablePanel(String[] rowNames) {
-		// Initialize the table models. They should have two columns
-		// (one for values and one for headers) and a number of rows
-		// equal to the number of row names.
-		localModel = new TableTextModel(rowNames.length, 2);
-		globalModel = new TableTextModel(rowNames.length, 2);
+	public AbstractTablePanel(Object... args) {
+		// Initialize the tables.
+		JTable[] tables = initializeTables(args);
+		localTable = tables[0];
+		globalTable = tables[1];
+		add(globalTable);
+		add(localTable);
 		
-		// Initialize the titles.
-		for(int i = 0; i < rowNames.length; i++) {
-			localModel.setValueAt(rowNames[i], i, COL_TITLE);
-			globalModel.setValueAt(rowNames[i], i, COL_TITLE);
-		}
+		// Set the panels to their null starting values.
 		updatePanel(null);
 		
 		// Define the panel layout.
-		//SpringLayout layout = new SpringLayout();
 		setLayout(null);
 		
 		// Create header labels for the tables.
@@ -76,21 +57,6 @@
 		globalHeader = new JLabel("Run Statistics");
 		globalHeader.setHorizontalAlignment(JLabel.CENTER);
 		add(globalHeader);
-		
-		// Create JTable objects to display the data.
-		localTable = new JTable(localModel);
-		localTable.setRowSelectionAllowed(false);
-		localTable.setColumnSelectionAllowed(false);
-		localTable.setCellSelectionEnabled(false);
-		localTable.setShowVerticalLines(false);
-		add(localTable);
-		
-		globalTable = new JTable(globalModel);
-		globalTable.setRowSelectionAllowed(false);
-		globalTable.setColumnSelectionAllowed(false);
-		globalTable.setCellSelectionEnabled(false);
-		globalTable.setShowVerticalLines(false);
-		add(globalTable);
 		
 		// Track when the component changes size and reposition the
 		// components accordingly.
@@ -170,24 +136,14 @@
 	}
 	
 	/**
-	 * Sets the value of the indicated row for the global statistical
-	 * table.
-	 * @param rowIndex - The row.
-	 * @param value - The new value.
+	 * Generates the two tables that are used by the component. This
+	 * must return an array of size two.
+	 * @param args - Any arguments that should be passed to the method
+	 * for generating tables.
+	 * @return Returns an array of size two, where the first index must
+	 * contain the local table and the second index the global table.
 	 */
-	protected void setGlobalRowValue(int rowIndex, String value) {
-		globalModel.setValueAt(value, rowIndex, COL_VALUE);
-	}
-	
-	/**
-	 * Sets the value of the indicated row for the local statistical
-	 * table.
-	 * @param rowIndex - The row.
-	 * @param value - The new value.
-	 */
-	protected void setLocalRowValue(int rowIndex, String value) {
-		localModel.setValueAt(value, rowIndex, COL_VALUE);
-	}
+	protected abstract JTable[] initializeTables(Object... args);
 	
 	/**
 	 * Repositions the components to the correct places on the parent

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTriggerTablePanel.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTriggerTablePanel.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTriggerTablePanel.java	Wed Mar  4 17:19:06 2015
@@ -12,7 +12,7 @@
  * 
  * @author Kyle McCarty <[log in to unmask]>
  */
-public abstract class AbstractTriggerTablePanel extends AbstractTablePanel {
+public abstract class AbstractTriggerTablePanel extends AbstractTwoColumnTablePanel {
 	// Static variables.
 	private static final long serialVersionUID = 0L;
 	

Added: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTwoColumnTablePanel.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTwoColumnTablePanel.java	(added)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/AbstractTwoColumnTablePanel.java	Wed Mar  4 17:19:06 2015
@@ -0,0 +1,93 @@
+package org.hps.users.kmccarty.triggerdiagnostics.ui;
+
+import javax.swing.JTable;
+
+/**
+ * Class <code>AbstractTwoColumnTablePanel</code> is an implementation
+ * of <code>AbstractTablePanel</code> that specifically handles tables
+ * with two columns where the first column's cells are row headers and
+ * the second column contains values.
+ * 
+ * @author Kyle McCarty <[log in to unmask]>
+ * @see AbstractTablePanel
+ */
+public abstract class AbstractTwoColumnTablePanel extends AbstractTablePanel {
+	// Static variables.
+	private static final long serialVersionUID = 0L;
+	
+	// Table models.
+	private TableTextModel localModel;
+	private TableTextModel globalModel;
+	
+	// Table model mappings.
+	private static final int COL_TITLE = 0;
+	private static final int COL_VALUE = 1;
+	
+	/**
+	 * Instantiates an <code>AbstractTwoColumnTablePanel</code> object
+	 * with the indicated row names.
+	 * @param rowNames - The names of the rows.
+	 */
+	public AbstractTwoColumnTablePanel(String[] rowNames) {
+		super((Object[]) rowNames);
+	}
+	
+	@Override
+	protected JTable[] initializeTables(Object... args) {
+		// The arguments should be a string array.
+		if(!(args instanceof String[])) {
+			throw new IllegalArgumentException("Row names must be strings!");
+		}
+		String[] rowNames = (String[]) args;
+		
+		// Initialize the table models. They should have two columns
+		// (one for values and one for headers) and a number of rows
+		// equal to the number of row names.
+		localModel = new TableTextModel(rowNames.length, 2);
+		globalModel = new TableTextModel(rowNames.length, 2);
+		
+		// Initialize the titles.
+		for(int i = 0; i < rowNames.length; i++) {
+			localModel.setValueAt(rowNames[i], i, COL_TITLE);
+			globalModel.setValueAt(rowNames[i], i, COL_TITLE);
+		}
+		updatePanel(null);
+		
+		// Create JTable objects to display the data.
+		JTable localTable = new JTable(localModel);
+		localTable.setRowSelectionAllowed(false);
+		localTable.setColumnSelectionAllowed(false);
+		localTable.setCellSelectionEnabled(false);
+		localTable.setShowVerticalLines(false);
+		
+		JTable globalTable = new JTable(globalModel);
+		globalTable.setRowSelectionAllowed(false);
+		globalTable.setColumnSelectionAllowed(false);
+		globalTable.setCellSelectionEnabled(false);
+		globalTable.setShowVerticalLines(false);
+		
+		// Return the two tables.
+		return new JTable[] { localTable, globalTable };
+	}
+	
+	/**
+	 * Sets the value of the indicated row for the global statistical
+	 * table.
+	 * @param rowIndex - The row.
+	 * @param value - The new value.
+	 */
+	protected void setGlobalRowValue(int rowIndex, String value) {
+		globalModel.setValueAt(value, rowIndex, COL_VALUE);
+	}
+	
+	/**
+	 * Sets the value of the indicated row for the local statistical
+	 * table.
+	 * @param rowIndex - The row.
+	 * @param value - The new value.
+	 */
+	protected void setLocalRowValue(int rowIndex, String value) {
+		localModel.setValueAt(value, rowIndex, COL_VALUE);
+	}
+
+}

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ClusterTablePanel.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ClusterTablePanel.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ClusterTablePanel.java	Wed Mar  4 17:19:06 2015
@@ -12,7 +12,7 @@
  * @author Kyle McCarty <[log in to unmask]>
  * @see AbstractTablePanel
  */
-public class ClusterTablePanel extends AbstractTablePanel {
+public class ClusterTablePanel extends AbstractTwoColumnTablePanel {
 	// Static variables.
 	private static final long serialVersionUID = 0L;
 	private static final String[] TABLE_TITLES = { "Recon Clusters", "SSP Clusters", "Matched Clusters",

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ComponentUtils.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ComponentUtils.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/ComponentUtils.java	Wed Mar  4 17:19:06 2015
@@ -10,19 +10,39 @@
  * 
  * @author Kyle McCarty <[log in to unmask]>
  */
-class ComponentUtils {
+public class ComponentUtils {
 	/** The default spacing used between a horizontal edge of one
 	 * component and the horizontal edge of another. */
-	public static final int hinternal = 10;
+	static final int hinternal = 10;
 	/** The default spacing used between a vertical edge of one
 	 * component and the vertical edge of another. */
-	public static final int vinternal = 10;
+	static final int vinternal = 10;
 	/** The default spacing used between a horizontal edge of one
 	 * component and the edge of its parent component. */
-	public static final int hexternal = 0;
+	static final int hexternal = 0;
 	/** The default spacing used between a vertical edge of one
 	 * component and the edge of its parent component. */
-	public static final int vexternal = 0;
+	static final int vexternal = 0;
+	
+	/**
+	 * Gets a <code>String</code> composed of a number of instances of
+	 * character <code>c</code> equal to <code>number</code>.
+	 * @param c - The character to repeat.
+	 * @param number - The number of repetitions.
+	 * @return Returns the repeated character as a <code>String</code>.
+	 */
+	public static final String getChars(char c, int number) {
+		// Create a buffer to store the characters in.
+		StringBuffer s = new StringBuffer();
+		
+		// Add the indicated number of instances.
+		for(int i = 0; i < number; i++) {
+			s.append(c);
+		}
+		
+		// Return the string.
+		return s.toString();
+	}
 	
 	/**
 	 * Gets the number of digits in the base-10 String representation
@@ -34,6 +54,31 @@
 	 */
 	public static final int getDigits(int value) {
 		return TriggerDiagnosticUtil.getDigits(value);
+	}
+	
+	/**
+	 * Gets the maximum value from a list of values.
+	 * @param values - The values to compare.
+	 * @return Returns the largest of the argument values.
+	 * @throws IllegalArgumentException Occurs if no values are given.
+	 */
+	public static final int max(int... values) throws IllegalArgumentException {
+		// Throw an error if no arguments are provided.
+		if(values == null || values.length == 0) {
+			throw new IllegalArgumentException("Can not determine maximum value from a list of 0 values.");
+		}
+		
+		// If there is only one value, return it.
+		if(values.length == 1) { return values[0]; }
+		
+		// Otherwise, get the largest value.
+		int largest = Integer.MIN_VALUE;
+		for(int value : values) {
+			if(value > largest) { largest = value; }
+		}
+		
+		// Return the result.
+		return largest;
 	}
 	
 	/**
@@ -78,29 +123,4 @@
 	static final int getNextY(Component c, int spacing) {
 		return c.getY() + c.getHeight() + spacing;
 	}
-	
-	/**
-	 * Gets the maximum value from a list of values.
-	 * @param values - The values to compare.
-	 * @return Returns the largest of the argument values.
-	 * @throws IllegalArgumentException Occurs if no values are given.
-	 */
-	public static final int max(int... values) throws IllegalArgumentException {
-		// Throw an error if no arguments are provided.
-		if(values == null || values.length == 0) {
-			throw new IllegalArgumentException("Can not determine maximum value from a list of 0 values.");
-		}
-		
-		// If there is only one value, return it.
-		if(values.length == 1) { return values[0]; }
-		
-		// Otherwise, get the largest value.
-		int largest = Integer.MIN_VALUE;
-		for(int value : values) {
-			if(value > largest) { largest = value; }
-		}
-		
-		// Return the result.
-		return largest;
-	}
 }

Added: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/EfficiencyTablePanel.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/EfficiencyTablePanel.java	(added)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/ui/EfficiencyTablePanel.java	Wed Mar  4 17:19:06 2015
@@ -0,0 +1,109 @@
+package org.hps.users.kmccarty.triggerdiagnostics.ui;
+
+import javax.swing.JTable;
+
+import org.hps.users.kmccarty.triggerdiagnostics.DiagSnapshot;
+import org.hps.users.kmccarty.triggerdiagnostics.event.TriggerEfficiencyModule;
+import org.hps.users.kmccarty.triggerdiagnostics.util.TriggerDiagnosticUtil;
+
+public class EfficiencyTablePanel extends AbstractTablePanel implements DiagnosticUpdatable {
+	// Static variables.
+	private static final long serialVersionUID = 0L;
+	
+	// Table models.
+	private TableTextModel localModel;
+	private TableTextModel globalModel;
+	
+	/**
+	 * Instantiates a new <code>EfficiencyTablePanel</code>.
+	 */
+	public EfficiencyTablePanel() { super(); }
+	
+	@Override
+	public void updatePanel(DiagSnapshot snapshot) {
+		// If there is no snapshot, the tables should all display an
+		// empty value.
+		if(snapshot == null) {
+			for(int eventTriggerID = 0; eventTriggerID < 6; eventTriggerID++) {
+				for(int seenTriggerID = 0; seenTriggerID < 6; seenTriggerID++) {
+					localModel.setValueAt("--- / ---", eventTriggerID + 1, seenTriggerID + 1);
+					globalModel.setValueAt("--- / ---", eventTriggerID + 1, seenTriggerID + 1);
+				}
+			}
+		}
+		
+		// Otherwise, update the table cells from the snapshot data.
+		else {
+		// Get the efficiency modules.
+			TriggerEfficiencyModule rmod = snapshot.efficiencyRunStatistics;
+			TriggerEfficiencyModule lmod = snapshot.efficiencyLocalStatistics;
+			
+			// Determine the spacing needed to display the largest numerical
+			// cell value.
+			int numWidth = -1;
+			for(int eventTriggerID = 0; eventTriggerID < 6; eventTriggerID++) {
+				for(int seenTriggerID = 0; seenTriggerID < 6; seenTriggerID++) {
+					int rSize = ComponentUtils.getDigits(rmod.getTriggersSeen(eventTriggerID, seenTriggerID));
+					int lSize = ComponentUtils.getDigits(lmod.getTriggersSeen(eventTriggerID, seenTriggerID));
+					numWidth = ComponentUtils.max(numWidth, rSize, lSize);
+				}
+			}
+			
+			// Generate the format string for the cells.
+			String nullText = String.format("%s / %s", ComponentUtils.getChars('-', numWidth),
+					ComponentUtils.getChars('-', numWidth));
+			String format = "%" + numWidth + "d / %" + numWidth + "d";
+			
+			// Update the table.
+			for(int eventTriggerID = 0; eventTriggerID < 6; eventTriggerID++) {
+				for(int seenTriggerID = 0; seenTriggerID < 6; seenTriggerID++) {
+					if(eventTriggerID == seenTriggerID) {
+						localModel.setValueAt(nullText, eventTriggerID + 1, seenTriggerID + 1);
+					} else {
+						localModel.setValueAt(String.format(format, lmod.getTriggersMatched(eventTriggerID, seenTriggerID),
+								lmod.getTriggersSeen(eventTriggerID, seenTriggerID)), eventTriggerID + 1, seenTriggerID + 1);
+						globalModel.setValueAt(String.format(format, rmod.getTriggersMatched(eventTriggerID, seenTriggerID),
+								rmod.getTriggersSeen(eventTriggerID, seenTriggerID)), eventTriggerID + 1, seenTriggerID + 1);
+					}
+				}
+			}
+		}
+	}
+	
+	@Override
+	protected JTable[] initializeTables(Object... args) {
+		// Get a shorter reference to the trigger name list.
+		String[] triggerNames = TriggerDiagnosticUtil.TRIGGER_NAME;
+		
+		// Initialize the table models. There should be one row and
+		// one column for each type of trigger plus an additional one
+		// of each for headers.
+		localModel = new TableTextModel(triggerNames.length + 1, triggerNames.length + 1);
+		globalModel = new TableTextModel(triggerNames.length + 1, triggerNames.length + 1);
+		
+		// Set the column and row headers.
+		for(int triggerType = 0; triggerType < triggerNames.length; triggerType++) {
+			localModel.setValueAt(triggerNames[triggerType], triggerType + 1, 0);
+			localModel.setValueAt(triggerNames[triggerType], 0, triggerType + 1);
+			globalModel.setValueAt(triggerNames[triggerType], triggerType + 1, 0);
+			globalModel.setValueAt(triggerNames[triggerType], 0, triggerType + 1);
+		}
+		
+		// Create JTable objects to display the data.
+		JTable localTable = new JTable(localModel);
+		localTable.setRowSelectionAllowed(false);
+		localTable.setColumnSelectionAllowed(false);
+		localTable.setCellSelectionEnabled(false);
+		localTable.setShowVerticalLines(false);
+		
+		JTable globalTable = new JTable(globalModel);
+		globalTable.setRowSelectionAllowed(false);
+		globalTable.setColumnSelectionAllowed(false);
+		globalTable.setCellSelectionEnabled(false);
+		globalTable.setShowVerticalLines(false);
+		
+		// Return the tables.
+		return new JTable[] { localTable, globalTable };
+	}
+	
+}

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/PairTrigger.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/PairTrigger.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/PairTrigger.java	Wed Mar  4 17:19:06 2015
@@ -18,9 +18,9 @@
 	 * @param source - The object from which the trigger cut states
 	 * are derived.
 	 */
-	public PairTrigger(E source) {
+	public PairTrigger(E source, int triggerNum) {
 		// Instantiate the superclass.
-		super(source);
+		super(source, triggerNum);
 		
 		// Add the supported cuts types.
 		addValidCut(PAIR_ENERGY_SUM_LOW);

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/SinglesTrigger.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/SinglesTrigger.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/SinglesTrigger.java	Wed Mar  4 17:19:06 2015
@@ -17,9 +17,9 @@
 	 * @param source - The object from which the trigger cut states
 	 * are derived.
 	 */
-	public SinglesTrigger(E source) {
+	public SinglesTrigger(E source, int triggerNum) {
 		// Instantiate the superclass.
-		super(source);
+		super(source, triggerNum);
 		
 		// Add the supported cuts types.
 		addValidCut(CLUSTER_HIT_COUNT_LOW);

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/Trigger.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/Trigger.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/Trigger.java	Wed Mar  4 17:19:06 2015
@@ -20,6 +20,8 @@
 	private Map<String, Boolean> passMap = new HashMap<String, Boolean>();
 	// Store the cluster associated with the trigger.
 	private final E source;
+	// Store the trigger number.
+	private final int triggerNum;
 	
 	/**
 	 * Creates a new <code>Trigger</code> object with the argument
@@ -27,7 +29,18 @@
 	 * @param source - The trigger source object.
 	 */
 	protected Trigger(E source) {
+		this(source, -1);
+	}
+	
+	/**
+	 * Creates a new <code>Trigger</code> object with the argument
+	 * specifying the object from whence the trigger state is derived.
+	 * @param source - The trigger source object.
+	 * @param triggerNum - The number of the trigger.
+	 */
+	protected Trigger(E source, int triggerNum) {
 		this.source = source;
+		this.triggerNum = triggerNum;
 	}
 	
 	/**
@@ -52,6 +65,15 @@
 		} else {
 			throw new IllegalArgumentException(String.format("Trigger cut \"%s\" is not a supported trigger cut.", cut));
 		}
+	}
+	
+	/**
+	 * Gets the number of the trigger. If the trigger has no number,
+	 * it will return <code>-1</code>.
+	 * @return Returns the trigger number as an <code>int</code>.
+	 */
+	public int getTriggerNumber() {
+		return triggerNum;
 	}
 	
 	/**

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/TriggerDiagnosticUtil.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/TriggerDiagnosticUtil.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/triggerdiagnostics/util/TriggerDiagnosticUtil.java	Wed Mar  4 17:19:06 2015
@@ -30,6 +30,15 @@
 	public static final int PAIR_ENERGY_SLOPE = 2;
 	public static final int PAIR_COPLANARITY = 3;
 	
+	// Trigger type variables.
+	public static final int TRIGGER_PULSER    = 0;
+	public static final int TRIGGER_COSMIC    = 1;
+	public static final int TRIGGER_SINGLES_1 = 2;
+	public static final int TRIGGER_SINGLES_2 = 3;
+	public static final int TRIGGER_PAIR_1    = 4;
+	public static final int TRIGGER_PAIR_2    = 5;
+	public static final String[] TRIGGER_NAME = { "Pulser", "Cosmic", "Singles 1", "Singles 2", "Pair 1", "Pair 2" };
+	
 	/**
 	 * Convenience method that writes the position of a cluster in the
 	 * form (ix, iy).

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