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  December 2014

HPS-SVN December 2014

Subject:

r1732 - in /java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal: FADCPrimaryTriggerDriver.java SSPTriggerLogic.java SinglesTriggerDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Mon, 15 Dec 2014 17:15:08 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (627 lines)

Author: [log in to unmask]
Date: Mon Dec 15 09:15:01 2014
New Revision: 1732

Log:
Created a module that performs the primary trigger cuts for a give threshold. This allows for multiple triggers to make use of these cuts without implementing uniquely for each trigger. This reduces the chances of errors and also makes updating the trigger logic easy, if it is needed. The FADCPrimaryTriggerDriver was updated to use this new format. Additionally, a new trigger driver, SinglesTriggerDriver, was created to represent a singles trigger. It also uses this module. The trigger diagnostic drivers will make use of it as well when they are created.

Added:
    java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SSPTriggerLogic.java
    java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java
Modified:
    java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java

Modified: java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java
 =============================================================================
--- java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java	(original)
+++ java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java	Mon Dec 15 09:15:01 2014
@@ -227,7 +227,10 @@
                 }
                 
                 // If the cluster fails the cut, skip to the next cluster.
-                if(!clusterSeedEnergyCut(cluster)) { continue clusterLoop; }
+                if(!SSPTriggerLogic.clusterSeedEnergyCut(cluster, seedEnergyLow, seedEnergyHigh)) {
+                	continue clusterLoop;
+                }
+                //if(!clusterSeedEnergyCut(cluster)) { continue clusterLoop; }
                 
                 // Otherwise, note that it passed the cut.
                 clusterSeedEnergyCount++;
@@ -240,7 +243,10 @@
                 }
                 
                 // If the cluster fails the cut, skip to the next cluster.
-                if(!clusterHitCountCut(cluster)) { continue clusterLoop; }
+                if(!SSPTriggerLogic.clusterHitCountCut(cluster, minHitCount)) {
+                	continue clusterLoop;
+                }
+                //if(!clusterHitCountCut(cluster)) { continue clusterLoop; }
                 
                 // Otherwise, note that it passed the cut.
                 clusterHitCountCount++;
@@ -253,7 +259,10 @@
                 }
                 
                 // If the cluster fails the cut, skip to the next cluster.
-                if(!clusterTotalEnergyCut(cluster)) { continue clusterLoop; }
+                if(!SSPTriggerLogic.clusterTotalEnergyCut(cluster, clusterEnergyLow, clusterEnergyHigh)) {
+                	continue clusterLoop;
+                }
+                //if(!clusterTotalEnergyCut(cluster)) { continue clusterLoop; }
                 
                 // Otherwise, note that it passed the cut.
                 clusterTotalEnergyCount++;
@@ -523,6 +532,7 @@
      * @return Returns <code>true</code> if the cluster passes the cut
      * and <code>false</code> if the cluster does not.
      */
+    @Deprecated
     private boolean clusterHitCountCut(HPSEcalCluster cluster) {
         return (getValueClusterHitCount(cluster) >= minHitCount);
     }
@@ -534,6 +544,7 @@
      * @return Returns <code>true</code> if the cluster passes the cut
      * and <code>false</code> if the cluster does not.
      */
+    @Deprecated
     private boolean clusterSeedEnergyCut(HPSEcalCluster cluster) {
         // Get the cluster seed energy.
         double energy = getValueClusterSeedEnergy(cluster);
@@ -550,6 +561,7 @@
      * @return Returns <code>true</code> if the cluster passes the cut
      * and <code>false</code> if the cluster does not.
      */
+    @Deprecated
     private boolean clusterTotalEnergyCut(HPSEcalCluster cluster) {
         // Get the total cluster energy.
         double energy = getValueClusterTotalEnergy(cluster);
@@ -565,6 +577,7 @@
      * be calculated.
      * @return Returns the distance between the clusters.
      */
+    @Deprecated
     private double getClusterDistance(HPSEcalCluster cluster) {
         return Math.hypot(cluster.getSeedHit().getPosition()[0] - originX, cluster.getSeedHit().getPosition()[1]);
     }
@@ -575,6 +588,7 @@
      * derived.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueClusterTotalEnergy(HPSEcalCluster cluster) {
         return cluster.getEnergy();
     }
@@ -585,6 +599,7 @@
      * derived.
      * @return Returns the cut value.
      */
+    @Deprecated
     private int getValueClusterHitCount(HPSEcalCluster cluster) {
         return cluster.getCalorimeterHits().size();
     }
@@ -595,6 +610,7 @@
      * derived.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueClusterSeedEnergy(HPSEcalCluster cluster) {
         return cluster.getSeedHit().getCorrectedEnergy();
     }
@@ -605,6 +621,7 @@
      * be calculated.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueCoplanarity(HPSEcalCluster[] clusterPair) {
         // Get the cluster angles.
         double[] clusterAngle = new double[2];
@@ -623,6 +640,7 @@
      * be calculated.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueEnergyDifference(HPSEcalCluster[] clusterPair) {
         return clusterPair[0].getEnergy() - clusterPair[1].getEnergy();
     }
@@ -633,6 +651,7 @@
      * be calculated.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueEnergySlope(HPSEcalCluster[] clusterPair) {
         // E + R*F
         // Get the low energy cluster energy.
@@ -651,6 +670,7 @@
      * be calculated.
      * @return Returns the cut value.
      */
+    @Deprecated
     private double getValueEnergySum(HPSEcalCluster[] clusterPair) {
         return clusterPair[0].getEnergy() + clusterPair[1].getEnergy();
     }
@@ -662,6 +682,7 @@
      * @return Returns <code>true</code> if the cluster pair passes
      * the cut and <code>false</code> if it does not.
      */
+    @Deprecated
     private boolean pairCoplanarityCut(HPSEcalCluster[] clusterPair) {
         return (getValueCoplanarity(clusterPair) < coplanarityHigh);
     }
@@ -673,6 +694,7 @@
      * @return Returns <code>true</code> if the cluster pair passes
      * the cut and <code>false</code> if it does not.
      */
+    @Deprecated
     private boolean pairEnergyDifferenceCut(HPSEcalCluster[] clusterPair) {
         return (getValueEnergyDifference(clusterPair) < energyDifferenceHigh);
     }
@@ -684,6 +706,7 @@
      * @param clusterPair : pair of clusters
      * @return true if pair is found, false otherwise
      */
+    @Deprecated
     private boolean pairEnergySlopeCut(HPSEcalCluster[] clusterPair) {
         return (getValueEnergySlope(clusterPair) > energySlopeLow);
     }
@@ -695,6 +718,7 @@
      * @return Returns <code>true</code> if the cluster pair passes
      * the cut and <code>false</code> if it does not.
      */
+    @Deprecated
     private boolean pairEnergySumCut(HPSEcalCluster[] clusterPair) {
         // Get the energy sum value.
         double energySum = getValueEnergySum(clusterPair);
@@ -801,10 +825,10 @@
             allPairs++;
             
             // Get the plot values for the pair cuts.
-            double energySum = getValueEnergySum(clusterPair);
-            double energyDifference = getValueEnergyDifference(clusterPair);
-            double energySlope = getValueEnergySlope(clusterPair);
-            double coplanarity = getValueCoplanarity(clusterPair);
+            double energySum = SSPTriggerLogic.getValueEnergySum(clusterPair);
+            double energyDifference = SSPTriggerLogic.getValueEnergyDifference(clusterPair);
+            double energySlope = SSPTriggerLogic.getValueEnergySlope(clusterPair, energySlopeParamF, originX);
+            double coplanarity = SSPTriggerLogic.getValueCoplanarity(clusterPair, originX);
             
             // Fill the general plots.
             pairEnergySum.fill(energySum, 1);
@@ -815,7 +839,10 @@
             // ==== Pair Energy Sum Cut ====================================
             // =============================================================
             // If the cluster fails the cut, skip to the next pair.
-            if(!pairEnergySumCut(clusterPair)) { continue pairLoop; }
+            if(!SSPTriggerLogic.pairEnergySumCut(clusterPair, energySumLow, energySumHigh)) {
+            	continue pairLoop;
+            }
+            //if(!pairEnergySumCut(clusterPair)) { continue pairLoop; }
             
             // Otherwise, note that it passed the cut.
             pairEnergySumCount++;
@@ -823,7 +850,9 @@
             // ==== Pair Energy Difference Cut =============================
             // =============================================================
             // If the cluster fails the cut, skip to the next pair.
-            if(!pairEnergyDifferenceCut(clusterPair)) { continue pairLoop; }
+            if(!SSPTriggerLogic.pairEnergyDifferenceCut(clusterPair, energyDifferenceHigh)) {
+            	continue pairLoop;
+            }
             
             // Otherwise, note that it passed the cut.
             pairEnergyDifferenceCount++;
@@ -831,7 +860,10 @@
             // ==== Pair Energy Slope Cut ==================================
             // =============================================================
             // If the cluster fails the cut, skip to the next pair.
-            if(!pairEnergySlopeCut(clusterPair)) { continue pairLoop; }
+            if(!SSPTriggerLogic.pairEnergySlopeCut(clusterPair, energySlopeLow, energySlopeParamF, originX)) {
+            	continue pairLoop;
+            }
+            //if(!pairEnergySlopeCut(clusterPair)) { continue pairLoop; }
             
             // Otherwise, note that it passed the cut.
             pairEnergySlopeCount++;
@@ -839,7 +871,10 @@
             // ==== Pair Coplanarity Cut ===================================
             // =============================================================
             // If the cluster fails the cut, skip to the next pair.
-            if(!pairCoplanarityCut(clusterPair)) { continue pairLoop; }
+            if(!SSPTriggerLogic.pairCoplanarityCut(clusterPair, coplanarityHigh, originX)) {
+            	continue pairLoop;
+            }
+            //if(!pairCoplanarityCut(clusterPair)) { continue pairLoop; }
             
             // Otherwise, note that it passed the cut.
             pairCoplanarityCount++;

Added: java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SSPTriggerLogic.java
 =============================================================================
--- java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SSPTriggerLogic.java	(added)
+++ java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SSPTriggerLogic.java	Mon Dec 15 09:15:01 2014
@@ -0,0 +1,211 @@
+package org.hps.readout.ecal;
+
+import org.hps.recon.ecal.HPSEcalCluster;
+
+/**
+ * Class <code>SSPLogic</code> implements each of the trigger cuts. It
+ * provides a central location for all primary trigger cuts so that they
+ * can be used by multiple drivers without reimplementing them and any
+ * changes can be easily propagated to all appropriate drivers.
+ * 
+ * @author Kyle MCCarty <[log in to unmask]>
+ */
+public class SSPTriggerLogic {
+    /**
+     * Checks whether the argument cluster possesses the minimum
+     * allowed hits.
+     * @param cluster - The cluster to check.
+     * @return Returns <code>true</code> if the cluster passes the cut
+     * and <code>false</code> if the cluster does not.
+     */
+    static final boolean clusterHitCountCut(HPSEcalCluster cluster, int thresholdLow) {
+        return (getValueClusterHitCount(cluster) >= thresholdLow);
+    }
+    
+    /**
+     * Checks whether the argument cluster seed hit falls within the
+     * allowed seed hit energy range.
+     * @param cluster - The cluster to check.
+     * @return Returns <code>true</code> if the cluster passes the cut
+     * and <code>false</code> if the cluster does not.
+     */
+    static final boolean clusterSeedEnergyCut(HPSEcalCluster cluster, double thresholdLow, double thresholdHigh) {
+        // Get the cluster seed energy.
+        double energy = getValueClusterSeedEnergy(cluster);
+        
+        // Check that it is above the minimum threshold and below the
+        // maximum threshold.
+        return (energy < thresholdHigh) && (energy > thresholdLow);
+    }
+    
+    /**
+     * Checks whether the argument cluster falls within the allowed
+     * cluster total energy range.
+     * @param cluster - The cluster to check.
+     * @param thresholdLow - The lower bound of the cut.
+     * @param thresholdHigh - The upper bound of the cut.
+     * @return Returns <code>true</code> if the cluster passes the cut
+     * and <code>false</code> if the cluster does not.
+     */
+    static final boolean clusterTotalEnergyCut(HPSEcalCluster cluster, double thresholdLow, double thresholdHigh) {
+        // Get the total cluster energy.
+        double energy = getValueClusterTotalEnergy(cluster);
+        
+        // Check that it is above the minimum threshold and below the
+        // maximum threshold.
+        return (energy < thresholdHigh) && (energy > thresholdLow);
+    }
+    
+    /**
+     * Calculates the distance between two clusters.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns the distance between the clusters.
+     */
+    static final double getClusterDistance(HPSEcalCluster cluster, double originX) {
+        return Math.hypot(cluster.getSeedHit().getPosition()[0] - originX, cluster.getSeedHit().getPosition()[1]);
+    }
+    
+    /**
+     * Gets the value used for the cluster total energy cut.
+     * @param cluster - The cluster from which the value should be
+     * derived.
+     * @return Returns the cut value.
+     */
+    static final double getValueClusterTotalEnergy(HPSEcalCluster cluster) {
+        return cluster.getEnergy();
+    }
+    
+    /**
+     * Gets the value used for the cluster hit count cut.
+     * @param cluster - The cluster from which the value should be
+     * derived.
+     * @return Returns the cut value.
+     */
+    static final int getValueClusterHitCount(HPSEcalCluster cluster) {
+        return cluster.getCalorimeterHits().size();
+    }
+    
+    /**
+     * Gets the value used for the seed hit energy cut.
+     * @param cluster - The cluster from which the value should be
+     * derived.
+     * @return Returns the cut value.
+     */
+    static final double getValueClusterSeedEnergy(HPSEcalCluster cluster) {
+        return cluster.getSeedHit().getCorrectedEnergy();
+    }
+    
+    /**
+     * Calculates the value used by the coplanarity cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @param originX - The calorimeter center.
+     * @return Returns the cut value.
+     */
+    static final double getValueCoplanarity(HPSEcalCluster[] clusterPair, double originX) {
+        // Get the cluster angles.
+        double[] clusterAngle = new double[2];
+        for(int i = 0; i < 2; i++) {
+            double position[] = clusterPair[i].getSeedHit().getPosition();
+            clusterAngle[i] = (Math.toDegrees(Math.atan2(position[1], position[0] - originX)) + 180.0) % 180.0;
+        }
+        
+        // Calculate the coplanarity cut value.
+        return Math.abs(clusterAngle[1] - clusterAngle[0]);
+    }
+    
+    /**
+     * Calculates the value used by the energy difference cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns the cut value.
+     */
+    static final double getValueEnergyDifference(HPSEcalCluster[] clusterPair) {
+        return clusterPair[0].getEnergy() - clusterPair[1].getEnergy();
+    }
+    
+    /**
+     * Calculates the value used by the energy slope cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @param energySlopeParamF - The value of the variable F in the
+     * energy slope equation E_low + R_min * F.
+     * @return Returns the cut value.
+     */
+    static final double getValueEnergySlope(HPSEcalCluster[] clusterPair, double energySlopeParamF, double originX) {
+        // E + R*F
+        // Get the low energy cluster energy.
+        double slopeParamE = clusterPair[1].getEnergy();
+        
+        // Get the low energy cluster radial distance.
+        double slopeParamR = getClusterDistance(clusterPair[1], originX);
+        
+        // Calculate the energy slope.
+        return slopeParamE + slopeParamR * energySlopeParamF;
+    }
+    
+    /**
+     * Calculates the value used by the energy sum cut.
+     * @param clusterPair - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns the cut value.
+     */
+    static final double getValueEnergySum(HPSEcalCluster[] clusterPair) {
+        return clusterPair[0].getEnergy() + clusterPair[1].getEnergy();
+    }
+    
+    /**
+     * Checks if a cluster pair is coplanar to the beam within a given
+     * angle.
+     * @param clusterPair - The cluster pair to check.
+     * @param thresholdHigh - The upper bound for the cut.
+     * @return Returns <code>true</code> if the cluster pair passes
+     * the cut and <code>false</code> if it does not.
+     */
+    static final boolean pairCoplanarityCut(HPSEcalCluster[] clusterPair, double thresholdHigh, double originX) {
+        return (getValueCoplanarity(clusterPair, originX) < thresholdHigh);
+    }
+    
+    /**
+     * Checks if the energy difference between the clusters making up
+     * a cluster pair is below an energy difference threshold.
+     * @param clusterPair - The cluster pair to check.
+     * @param thresholdHigh - The upper bound for the cut.
+     * @return Returns <code>true</code> if the cluster pair passes
+     * the cut and <code>false</code> if it does not.
+     */
+    static final boolean pairEnergyDifferenceCut(HPSEcalCluster[] clusterPair, double thresholdHigh) {
+        return (getValueEnergyDifference(clusterPair) < thresholdHigh);
+    }
+    
+    /**
+     * Requires that the distance from the beam of the lowest energy
+     * cluster in a cluster pair satisfies the following:
+     * E_low + d_b * 0.0032 GeV/mm < [ Threshold ]
+     * @param clusterPair : pair of clusters
+     * @param thresholdLow - The lower bound for the cut.
+     * @return true if pair is found, false otherwise
+     */
+    static final boolean pairEnergySlopeCut(HPSEcalCluster[] clusterPair, double thresholdLow,
+    		double energySlopeParamF, double originX) {
+        return (getValueEnergySlope(clusterPair, energySlopeParamF, originX) > thresholdLow);
+    }
+    
+    /**
+     * Checks if the sum of the energies of clusters making up a cluster
+     * pair is below an energy sum threshold.
+     * @param clusterPair - The cluster pair to check.
+     * @param thresholdLow - The lower bound for the cut.
+     * @param thresholdHigh - The upper bound for the cut.
+     * @return Returns <code>true</code> if the cluster pair passes
+     * the cut and <code>false</code> if it does not.
+     */
+    static final boolean pairEnergySumCut(HPSEcalCluster[] clusterPair, double thresholdLow, double thresholdHigh) {
+        // Get the energy sum value.
+        double energySum = getValueEnergySum(clusterPair);
+        
+        // Check that it is within the allowed range.
+        return (energySum < thresholdHigh) && (energySum > thresholdLow);
+    }
+}

Added: java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java
 =============================================================================
--- java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java	(added)
+++ java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java	Mon Dec 15 09:15:01 2014
@@ -0,0 +1,168 @@
+package org.hps.readout.ecal;
+
+import hep.aida.IHistogram1D;
+import hep.aida.IHistogram2D;
+
+import java.util.List;
+
+import org.hps.recon.ecal.HPSEcalCluster;
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.aida.AIDA;
+
+/**
+ * Class <code>SinglesTriggerDriver</code> represents a basic single
+ * cluster trigger. It triggers off of seed energy (upper and lower
+ * bounds), cluster total energy (upper and lower bounds), and the
+ * cluster hit count (lower bound only). All parameters may be set
+ * through a steering file.
+ * 
+ * @author Kyle McCarty <[log in to unmask]>
+ * @see TriggerDriver
+ */
+public class SinglesTriggerDriver extends TriggerDriver {
+    // Cut Values
+    private int hitCountLow = 2;
+    private double seedEnergyLow = 0.125;
+    private double seedEnergyHigh = 6.6;
+    private double clusterEnergyLow = 0.200;
+    private double clusterEnergyHigh = 6.6;
+    
+    // LCIO Collection Names
+    private String clusterCollectionName = "EcalClusters";
+    
+    // AIDA Plots
+    private AIDA aida = AIDA.defaultInstance();
+    private IHistogram1D clusterSeedEnergy = aida.histogram1D("Trigger Plots :: Cluster Seed Energy Distribution", 176, 0.0, 2.2);
+    private IHistogram1D clusterSeedEnergySingle = aida.histogram1D("Trigger Plots :: Cluster Seed Energy Distribution (Passed Single Cuts)", 176, 0.0, 2.2);
+    private IHistogram1D clusterHitCount = aida.histogram1D("Trigger Plots :: Cluster Hit Count Distribution", 9, 1, 10);
+    private IHistogram1D clusterHitCountSingle = aida.histogram1D("Trigger Plots :: Cluster Hit Count Distribution (Passed Single Cuts)", 9, 1, 10);
+    private IHistogram1D clusterTotalEnergy = aida.histogram1D("Trigger Plots :: Cluster Total Energy Distribution", 176, 0.0, 2.2);
+    private IHistogram1D clusterTotalEnergySingle = aida.histogram1D("Trigger Plots :: Cluster Total Energy Distribution (Passed Single Cuts)", 176, 0.0, 2.2);
+    private IHistogram2D clusterDistribution = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution", 46, -23, 23, 11, -5.5, 5.5);
+    private IHistogram2D clusterDistributionSingle = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution (Passed Single Cuts)", 46, -23, 23, 11, -5.5, 5.5);
+    
+    @Override
+    public void process(EventHeader event) {
+        // Make sure that there are clusters in the event.
+        if(event.hasCollection(HPSEcalCluster.class, clusterCollectionName)) {
+            // Get the list of clusters.
+            List<HPSEcalCluster> clusterList = event.get(HPSEcalCluster.class, clusterCollectionName);
+            
+            // Iterate over the clusters.
+            for(HPSEcalCluster cluster : clusterList) {
+                // Get the x and y indices.
+                int ix = cluster.getSeedHit().getIdentifierFieldValue("ix");
+                int iy = cluster.getSeedHit().getIdentifierFieldValue("iy");
+                ix = ix > 0 ? ix - 1 : ix;
+                
+                // Populate the uncut plots.
+                clusterSeedEnergy.fill(cluster.getSeedHit().getCorrectedEnergy(), 1);
+                clusterTotalEnergy.fill(cluster.getEnergy(), 1);
+                clusterHitCount.fill(cluster.getCalorimeterHits().size(), 1);
+                clusterDistribution.fill(ix, iy, 1);
+            }
+        }
+    }
+    
+    /**
+     * Performs cluster singles cuts. These include seed energy, cluster
+     * energy, and minimum hit count.
+     * @return Returns <code>true</code> if the event passes the trigger
+     * conditions and <code>false</code> otherwise.
+     */
+    @Override
+    protected boolean triggerDecision(EventHeader event) {
+        // Check that there is a cluster object collection.
+        if(event.hasCollection(HPSEcalCluster.class, clusterCollectionName)) {
+            // Get the list of hits.
+            List<HPSEcalCluster> clusterList = event.get(HPSEcalCluster.class, clusterCollectionName);
+            
+            // Iterate over the hits and perform the cuts.
+            triggerLoop:
+            for(HPSEcalCluster cluster : clusterList) {
+                // Perform the hit count cut.
+                if(!SSPTriggerLogic.clusterHitCountCut(cluster, hitCountLow)) {
+                    continue triggerLoop;
+                }
+                
+                // Perform the seed hit cut.
+                if(!SSPTriggerLogic.clusterSeedEnergyCut(cluster, seedEnergyLow, seedEnergyHigh)) {
+                    continue triggerLoop;
+                }
+                
+                // Perform the cluster energy cut.
+                if(!SSPTriggerLogic.clusterTotalEnergyCut(cluster, clusterEnergyLow, clusterEnergyHigh)) {
+                    continue triggerLoop;
+                }
+                
+                // Get the x and y indices.
+                int ix = cluster.getSeedHit().getIdentifierFieldValue("ix");
+                int iy = cluster.getSeedHit().getIdentifierFieldValue("iy");
+                ix = ix > 0 ? ix - 1 : ix;
+                
+                // Populate the cut plots.
+                clusterSeedEnergySingle.fill(cluster.getSeedHit().getCorrectedEnergy(), 1);
+                clusterTotalEnergySingle.fill(cluster.getEnergy(), 1);
+                clusterHitCountSingle.fill(cluster.getCalorimeterHits().size(), 1);
+                clusterDistributionSingle.fill(ix, iy, 1);
+            }
+        }
+        
+        // If there were either no passing hits or not hits at all,
+        // then there is also no trigger.
+        return false;
+    }
+    
+    /**
+     * Sets the minimum hit count threshold for the trigger. This value
+     * is inclusive.
+     * @param hitCountThreshold - The value of the threshold.
+     */
+    public void setHitCountThreshold(int hitCountThreshold) {
+        hitCountLow = hitCountThreshold;
+    }
+    
+    /**
+     * Sets the lower bound for the seed energy threshold on the trigger.
+     * This value is inclusive.
+     * @param seedEnergyLow - The value of the threshold.
+     */
+    public void setSeedEnergyLowThreshold(double seedEnergyLow) {
+        this.seedEnergyLow = seedEnergyLow;
+    }
+    
+    /**
+     * Sets the upper bound for the seed energy threshold on the trigger.
+     * This value is inclusive.
+     * @param seedEnergyHigh - The value of the threshold.
+     */
+    public void setSeedEnergyHighThreshold(double seedEnergyHigh) {
+        this.seedEnergyHigh = seedEnergyHigh;
+    }
+    
+    /**
+     * Sets the lower bound for the cluster energy threshold on the
+     * trigger. This value is inclusive.
+     * @param clusterEnergyLow - The value of the threshold.
+     */
+    public void setClusterEnergyLowThreshold(double clusterEnergyLow) {
+        this.clusterEnergyLow = clusterEnergyLow;
+    }
+    
+    /**
+     * Sets the upper bound for the cluster energy threshold on the
+     * trigger. This value is inclusive.
+     * @param clusterEnergyHigh - The value of the threshold.
+     */
+    public void setClusterEnergyHighThreshold(double clusterEnergyHigh) {
+        this.clusterEnergyHigh = clusterEnergyHigh;
+    }
+    
+    /**
+     * Sets the name of the LCIO collection from which clusters are drawn.
+     * @param clusterCollectionName - The name of the LCIO collection.
+     */
+    public void setClusterCollectionName(String clusterCollectionName) {
+        this.clusterCollectionName = clusterCollectionName;
+    }
+}

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