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:

r2666 - in /java/trunk/analysis/src/main/java/org/hps/analysis/trigger: TriggerDiagnosticDriver.java event/TriggerPlotsModule.java

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 9 Apr 2015 16:12:36 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (369 lines)

Author: [log in to unmask]
Date: Thu Apr  9 09:12:30 2015
New Revision: 2666

Log:
Update some diagnostic plots for the trigger diagnostics.

Modified:
    java/trunk/analysis/src/main/java/org/hps/analysis/trigger/TriggerDiagnosticDriver.java
    java/trunk/analysis/src/main/java/org/hps/analysis/trigger/event/TriggerPlotsModule.java

Modified: java/trunk/analysis/src/main/java/org/hps/analysis/trigger/TriggerDiagnosticDriver.java
 =============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/trigger/TriggerDiagnosticDriver.java	(original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/trigger/TriggerDiagnosticDriver.java	Thu Apr  9 09:12:30 2015
@@ -105,7 +105,7 @@
     private boolean printSinglesTriggerInternalFail = true;
     private boolean printPairTriggerEfficiencyFail = true;
     private boolean printPairTriggerInternalFail = true;
-    private int     statPrintInterval = 100000;
+    private int     statPrintInterval = Integer.MAX_VALUE;
 
     // Cut index arrays for trigger verification.
 	private static final int ENERGY_MIN   = TriggerDiagnosticUtil.SINGLES_ENERGY_MIN;
@@ -260,6 +260,10 @@
 						pairCutsEnabled[i][3 + COPLANARITY] = pairs[i].getCoplanarityCutConfig().isEnabled();
 					}
 					
+					// Update the trigger plots values.
+					globalTriggerPlots.setEnergySlopeParamF(0, daq.getSSPConfig().getPair1Config().getEnergySlopeCutConfig().getParameterF());
+					globalTriggerPlots.setEnergySlopeParamF(1, daq.getSSPConfig().getPair2Config().getEnergySlopeCutConfig().getParameterF());
+					
 					// Print a DAQ configuration settings header.
 					System.out.println();
 					System.out.println();
@@ -418,9 +422,6 @@
 		// ==========================================================
 		// ==== Obtain SSP and TI Banks =============================
 		// ==========================================================
-		
-		// Output the event number and information.
-		OutputLogger.printf("Event Number %d (%d)%n", globalStats.getEventCount(), event.getEventNumber());
 		
 		// Get the SSP clusters.
 		if(event.hasCollection(GenericObject.class, bankCollectionName)) {
@@ -485,6 +486,9 @@
 			System.err.println("TriggerDiagnosticDriver :: SEVERE WARNING :: TI bank or SSP bank missing from event!");
 			return;
 		}
+		
+		// Output the event number and information.
+		OutputLogger.printf("Event Number %d (%d)%n", sspBank.getEventNumber(), event.getEventNumber());
 		
 		
 		
@@ -1622,11 +1626,17 @@
 		// Run the SSP clusters through the singles trigger to determine
 		// whether they pass it or not.
 		for(SSPCluster cluster : sspClusters) {
+			// Add the cluster to the "NO_CUTS" plots for each singles
+			// TI bit that is active.
+			if(tiBank.isSingle0Trigger()) { globalTriggerPlots.sawCluster(0, cluster); }
+			if(tiBank.isSingle1Trigger()) { globalTriggerPlots.sawCluster(1, cluster); }
+			
 			triggerLoop:
 			for(int triggerNum = 0; triggerNum < 2; triggerNum++) {
-				// For a cluster to have formed it is assumed to have passed
-				// the cluster seed energy cuts. This can not be verified
-				// since the SSP bank does not report individual hit. 
+				// For a cluster to have formed it is assumed to have
+				// passed the cluster seed energy cuts. This can not
+				// be verified since the SSP bank does not report
+				// individual hit. 
 				boolean passSeedLow = true;
 				boolean passSeedHigh = true;
 				
@@ -1654,6 +1664,12 @@
 					continue triggerLoop;
 				}
 				
+				// If all the trigger cuts passed, plot this trigger
+				// in the "triggered" plots.
+				if(trigger.getTriggerState()) {
+					globalTriggerPlots.passedTrigger(trigger);
+				}
+				
 				// If all the necessary checks passed, store the new
 				// trigger for verification.
 				sspSinglesTriggers.get(triggerNum).add(trigger);
@@ -1663,6 +1679,11 @@
 		// Run the reconstructed clusters through the singles trigger
 		// to determine whether they pass it or not.
 		for(Cluster cluster : reconClusters) {
+			// Add the cluster to the "NO_CUTS" plots for each singles
+			// TI bit that is active.
+			if(tiBank.isSingle0Trigger()) { globalTriggerPlots.sawCluster(0, cluster); }
+			if(tiBank.isSingle1Trigger()) { globalTriggerPlots.sawCluster(1, cluster); }
+			
 			// Simulate each of the cluster singles triggers.
 			triggerLoop:
 			for(int triggerNum = 0; triggerNum < 2; triggerNum++) {
@@ -1694,6 +1715,12 @@
 					continue triggerLoop;
 				} if(singlesCutsEnabled[triggerNum][HIT_COUNT] && !trigger.getStateHitCount()) {
 					continue triggerLoop;
+				}
+				
+				// If all the trigger cuts passed, plot this trigger
+				// in the "triggered" plots.
+				if(trigger.getTriggerState()) {
+					globalTriggerPlots.passedTrigger(trigger);
 				}
 				
 				// Store the trigger.
@@ -1759,6 +1786,12 @@
 				// destroyed.
 				if(!pairsTrigger[triggerIndex].pairTimeCoincidenceCut(reconPair)) {
 					continue pairTriggerLoop;
+				}
+				
+				// Add the cluster to the "NO_CUTS" plots for each
+				// singles TI bit that is active.
+				if((triggerIndex == 0 && tiBank.isPair0Trigger()) || (triggerIndex == 1 && tiBank.isPair1Trigger())) {
+					globalTriggerPlots.sawPair(triggerIndex, reconPair);
 				}
 				
 				// For a cluster to have formed it is assumed to have passed
@@ -1814,6 +1847,12 @@
 					continue pairTriggerLoop;
 				}
 				
+				// If all the trigger cuts passed, plot this trigger
+				// in the "triggered" plots.
+				if(trigger.getTriggerState()) {
+					globalTriggerPlots.passedTrigger(trigger);
+				}
+				
 				// Add the trigger to the list.
 				reconPairsTriggers.get(triggerIndex).add(trigger);
 			}
@@ -1827,6 +1866,12 @@
 				// destroyed.
 				if(!pairsTrigger[triggerIndex].pairTimeCoincidenceCut(sspPair)) {
 					continue pairTriggerLoop;
+				}
+				
+				// Add the cluster to the "NO_CUTS" plots for each
+				// singles TI bit that is active.
+				if((triggerIndex == 0 && tiBank.isPair0Trigger()) || (triggerIndex == 1 && tiBank.isPair1Trigger())) {
+					globalTriggerPlots.sawPair(triggerIndex, sspPair);
 				}
 				
 				// For a cluster to have formed it is assumed to have passed
@@ -1880,6 +1925,12 @@
 					continue pairTriggerLoop;
 				} if(pairCutsEnabled[triggerIndex][3 + COPLANARITY] && !trigger.getStateCoplanarity()) {
 					continue pairTriggerLoop;
+				}
+				
+				// If all the trigger cuts passed, plot this trigger
+				// in the "triggered" plots.
+				if(trigger.getTriggerState()) {
+					globalTriggerPlots.passedTrigger(trigger);
 				}
 				
 				// Add the trigger to the list.

Modified: java/trunk/analysis/src/main/java/org/hps/analysis/trigger/event/TriggerPlotsModule.java
 =============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/trigger/event/TriggerPlotsModule.java	(original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/trigger/event/TriggerPlotsModule.java	Thu Apr  9 09:12:30 2015
@@ -16,27 +16,31 @@
  */
 public class TriggerPlotsModule {
 	// Reference variables.
-	private static final int RECON   = 0;
-	private static final int SSP     = 1;
-	private static final int ALL     = 0;
-	private static final int MATCHED = 1;
-	private static final int FAILED  = 2;
+	private static final int RECON     = 0;
+	private static final int SSP       = 1;
+	private static final int ALL       = 0;
+	private static final int MATCHED   = 1;
+	private static final int FAILED    = 2;
+	private static final int TRIGGERED = 3;
+	private static final int NO_CUTS   = 4;
 	
 	// Class variables.
 	private final double[] energySlopeParamF;
 	
 	// Plots.
 	private AIDA aida = AIDA.defaultInstance();
-	private IHistogram1D[][][] singlesClusterEnergyPlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] singlesHitCountPlot = new IHistogram1D[2][2][3];
-	
-	private IHistogram1D[][][] pairClusterEnergyPlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairHitCountPlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairTimePlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairSumPlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairDiffPlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairSlopePlot = new IHistogram1D[2][2][3];
-	private IHistogram1D[][][] pairCoplanarityPlot = new IHistogram1D[2][2][3];
+	private IHistogram1D[][][] singlesClusterEnergyPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] singlesHitCountPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] singlesTriggerTimePlot = new IHistogram1D[2][2][5];
+	
+	private IHistogram1D[][][] pairClusterEnergyPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairHitCountPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairTimePlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairSumPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairDiffPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairSlopePlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairCoplanarityPlot = new IHistogram1D[2][2][5];
+	private IHistogram1D[][][] pairTriggerTimePlot = new IHistogram1D[2][2][5];
 	
 	/**
 	 * Instantiates a new <code>TriggerPlotsModule</code> that will use
@@ -56,7 +60,7 @@
 		
 		// Define type string values.
 		String[] sourceType = { "Recon", "SSP" };
-		String[] resultType = { "All", "Matched", "Failed" };
+		String[] resultType = { "All", "Matched", "Failed", "Triggered", "No Cuts" };
 		
 		// Instantiate the trigger result plots for each trigger.
 		for(int triggerNum = 0; triggerNum < 2; triggerNum++) {
@@ -69,12 +73,14 @@
 			for(int source = 0; source < 2; source++) {
 				// Instantiate the trigger result plots for each type
 				// of trigger match result.
-				for(int result = 0; result < 3; result++) {
+				for(int result = 0; result < 5; result++) {
 					// Instantiate the singles trigger plots.
-					singlesClusterEnergyPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Singles Hit Count (%s)",
+					singlesClusterEnergyPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Singles Cluster Energy (%s)",
+							singlesDir, sourceType[source], resultType[result]), 300, 0.0, 3.0);
+					singlesHitCountPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Singles Hit Count (%s)",
 							singlesDir, sourceType[source], resultType[result]), 9, 0.5, 9.5);
-					singlesHitCountPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Singles Cluster Energy (%s)",
-							singlesDir, sourceType[source], resultType[result]), 300, 0.0, 3.0);
+					singlesTriggerTimePlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Singles Trigger Time (%s)",
+							singlesDir, sourceType[source], resultType[result]), 100, 0, 400);
 					
 					// Instantiate the pair trigger plots.
 					pairHitCountPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Pair Hit Count (%s)",
@@ -91,12 +97,57 @@
 							pairDir, sourceType[source], resultType[result]), 300, 0.0, 3.0);
 					pairCoplanarityPlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Pair Coplanarity (%s)",
 							pairDir, sourceType[source], resultType[result]), 180, 0, 180);
+					pairTriggerTimePlot[triggerNum][source][result] = aida.histogram1D(String.format("%s/%s Pair Trigger Time (%s)",
+							pairDir, sourceType[source], resultType[result]), 100, 0, 400);
 				}
 			}
 		}
 	}
 	
 	/**
+	 * Populates the "failed" plots of the appropriate type with the
+	 * cut results from the argument trigger.
+	 * @param trigger - The trigger from which to populate the plots.
+	 */
+	public void failedTrigger(Trigger<?> trigger) {
+		processTrigger(trigger, FAILED);
+	}
+	
+	/**
+	 * Populates the "matched" plots of the appropriate type with the
+	 * cut results from the argument trigger.
+	 * @param trigger - The trigger from which to populate the plots.
+	 */
+	public void matchedTrigger(Trigger<?> trigger) {
+		processTrigger(trigger, MATCHED);
+	}
+	
+	/**
+	 * Populates the "triggered" plots of the appropriate type with the
+	 * cut results from the argument trigger.
+	 * @param trigger - The trigger from which to populate the plots.
+	 */
+	public void passedTrigger(Trigger<?> trigger) {
+		processTrigger(trigger, TRIGGERED);
+	}
+	
+	public void sawCluster(int triggerNum, Cluster cluster) {
+		processSingles(triggerNum, NO_CUTS, cluster);
+	}
+	
+	public void sawCluster(int triggerNum, SSPCluster cluster) {
+		processSingles(triggerNum, NO_CUTS, cluster);
+	}
+	
+	public void sawPair(int triggerNum, Cluster[] pair) {
+		processPair(triggerNum, NO_CUTS, pair);
+	}
+	
+	public void sawPair(int triggerNum, SSPCluster[] pair) {
+		processPair(triggerNum, NO_CUTS, pair);
+	}
+	
+	/**
 	 * Populates the "all" plots of the appropriate type with the cut
 	 * results from the argument trigger.
 	 * @param trigger - The trigger from which to populate the plots.
@@ -106,23 +157,12 @@
 	}
 	
 	/**
-	 * Populates the "matched" plots of the appropriate type with the
-	 * cut results from the argument trigger.
-	 * @param trigger - The trigger from which to populate the plots.
-	 */
-	public void matchedTrigger(Trigger<?> trigger) {
-		processTrigger(trigger, MATCHED);
-	}
-	
-	/**
-	 * Populates the "failed" plots of the appropriate type with the
-	 * cut results from the argument trigger.
-	 * @param trigger - The trigger from which to populate the plots.
-	 */
-	public void failedTrigger(Trigger<?> trigger) {
-		processTrigger(trigger, FAILED);
-	}
-	
+	 * Sets the energy slope conversion factor to be used to calculate
+	 * the energy slope value for plots.
+	 * @param triggerNum - The trigger for which the conversion factor
+	 * should be used.
+	 * @param value - The conversion factor in units of GeV/mm.
+	 */
 	public void setEnergySlopeParamF(int triggerNum, double value) {
 		// Make sure that the trigger number is valid.
 		if(triggerNum < 0 || triggerNum > 1) {
@@ -177,6 +217,7 @@
 		// Fill the cluster singles plots.
 		singlesHitCountPlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueClusterHitCount(cluster));
 		singlesClusterEnergyPlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueClusterTotalEnergy(cluster));
+		singlesTriggerTimePlot[triggerNum][RECON][plotType].fill(cluster.getCalorimeterHits().get(0).getTime());
 	}
 	
 	/**
@@ -191,6 +232,7 @@
 		// Fill the cluster singles plots.
 		singlesHitCountPlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueClusterHitCount(cluster));
 		singlesClusterEnergyPlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueClusterTotalEnergy(cluster));
+		singlesTriggerTimePlot[triggerNum][SSP][plotType].fill(cluster.getTime());
 	}
 	
 	/**
@@ -207,6 +249,8 @@
 		pairHitCountPlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueClusterHitCount(pair[1]));
 		pairClusterEnergyPlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueClusterTotalEnergy(pair[0]));
 		pairClusterEnergyPlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueClusterTotalEnergy(pair[1]));
+		pairTriggerTimePlot[triggerNum][RECON][plotType].fill(pair[0].getCalorimeterHits().get(0).getTime());
+		pairTriggerTimePlot[triggerNum][RECON][plotType].fill(pair[1].getCalorimeterHits().get(0).getTime());
 		
 		// Fill the cluster pair plots.
 		pairTimePlot[triggerNum][RECON][plotType].fill(TriggerModule.getValueTimeCoincidence(pair));
@@ -230,6 +274,8 @@
 		pairHitCountPlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueClusterHitCount(pair[1]));
 		pairClusterEnergyPlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueClusterTotalEnergy(pair[0]));
 		pairClusterEnergyPlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueClusterTotalEnergy(pair[1]));
+		pairTriggerTimePlot[triggerNum][SSP][plotType].fill(pair[0].getTime());
+		pairTriggerTimePlot[triggerNum][SSP][plotType].fill(pair[1].getTime());
 		
 		// Fill the cluster pair plots.
 		pairTimePlot[triggerNum][SSP][plotType].fill(TriggerModule.getValueTimeCoincidence(pair));

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