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

HPS-SVN February 2015

Subject:

r2120 - /java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/TriggerModule.java

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 12 Feb 2015 05:14:24 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (135 lines)

Author: [log in to unmask]
Date: Wed Feb 11 21:14:19 2015
New Revision: 2120

Log:
Updated TriggerModule to support the pair time coincidence cut.

Modified:
    java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/TriggerModule.java

Modified: java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/TriggerModule.java
 =============================================================================
--- java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/TriggerModule.java	(original)
+++ java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/TriggerModule.java	Wed Feb 11 21:14:19 2015
@@ -62,6 +62,9 @@
      * of the difference between the energies of the cluster pair must
      * be below this value to pass the cut. */
     public static final String PAIR_ENERGY_DIFFERENCE_HIGH = "pairEnergyDifferenceHigh";
+    /** The maximum amount of time by which two clusters are allowed
+     * to be separated. */
+    public static final String PAIR_TIME_COINCIDENCE = "pairTimeCoincidence";
     
     // Trigger cut settings map.
     private final Map<String, Double> cuts = new HashMap<String, Double>(11);
@@ -84,6 +87,7 @@
     	cuts.put(PAIR_ENERGY_SLOPE_LOW, 0.0);
     	cuts.put(PAIR_ENERGY_SUM_LOW, 0.0);
     	cuts.put(PAIR_ENERGY_SUM_HIGH, Double.MAX_VALUE);
+    	cuts.put(PAIR_TIME_COINCIDENCE, Double.MAX_VALUE);
     	
     	// Set the default value of the energy slope parameter F.
     	cuts.put(PAIR_ENERGY_SLOPE_F, 0.0055);
@@ -440,6 +444,35 @@
     }
     
     /**
+     * Calculates the value used by the time coincidence cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns the absolute difference in the cluster times..
+     */
+    public static double getValueTimeCoincidence(Cluster[] clusterPair) {
+    	// Get the variables used by the calculation.
+    	double[] time = { clusterPair[0].getCalorimeterHits().get(0).getTime(),
+    			clusterPair[1].getCalorimeterHits().get(0).getTime() };
+    	
+    	// Perform the calculation.
+    	return getValueTimeCoincidence(time);
+    }
+    
+    /**
+     * Calculates the value used by the time coincidence cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns the absolute difference in the cluster times..
+     */
+    public static double getValueTimeCoincidence(SSPCluster[] clusterPair) {
+    	// Get the variables used by the calculation.
+    	double[] time = { clusterPair[0].getTime(), clusterPair[1].getTime() };
+    	
+    	// Perform the calculation.
+    	return getValueTimeCoincidence(time);
+    }
+    
+    /**
      * Checks if a cluster pair is coplanar to the beam within a given
      * angle.
      * @param clusterPair - The cluster pair to check.
@@ -550,9 +583,27 @@
     	return pairEnergySumCutLow(getValueEnergySum(clusterPair));
     }
     
-    
-    
-    
+    /**
+     * Checks if the absolute difference between the times between
+     * two clusters is below the time coincidence cut.
+     * @param clusterPair - The cluster pair to check.
+     * @return <code>true</code> if the energy sum passes
+     * the cut and <code>false</code> if it does not.
+     */
+    public boolean pairTimeCoincidenceCut(Cluster[] clusterPair) {
+    	return pairTimeCoincidenceCut(getValueTimeCoincidence(clusterPair));
+    }
+    
+    /**
+     * Checks if the absolute difference between the times between
+     * two clusters is below the time coincidence cut.
+     * @param clusterPair - The cluster pair to check.
+     * @return <code>true</code> if the energy sum passes
+     * the cut and <code>false</code> if it does not.
+     */
+    public boolean pairTimeCoincidenceCut(SSPCluster[] clusterPair) {
+    	return pairTimeCoincidenceCut(getValueTimeCoincidence(clusterPair));
+    }
     
     
     
@@ -736,6 +787,17 @@
     }
     
     /**
+     * Calculates the value used by the time coincidence cut.
+     * @param time - A two-dimensional array consisting of the first
+     * and second clusters' times.
+     * @return Returns the absolute difference between the times of
+     * the two clusters.
+     */
+    private static double getValueTimeCoincidence(double[] time) {
+    	return Math.abs(time[0] - time[1]);
+    }
+    
+    /**
      * Checks if a coplanarity angle is within threshold.
      * @param coplanarityAngle - The cluster coplanarity angle.
      * @return Returns <code>true</code> if the angle passes
@@ -799,4 +861,16 @@
     private boolean pairEnergySumCutLow(double energySum) {
         return (energySum > cuts.get(PAIR_ENERGY_SUM_LOW));
     }
+    
+    /**
+     * Checks if the absolute difference between the times between
+     * two clusters is below the time coincidence cut.
+     * @param timeDifference - The absolute difference in time between
+     * the clusters.
+     * @return <code>true</code> if the energy sum passes
+     * the cut and <code>false</code> if it does not.
+     */
+    private boolean pairTimeCoincidenceCut(double timeDifference) {
+    	return (timeDifference <= cuts.get(PAIR_TIME_COINCIDENCE));
+    }
 }

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