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

HPS-SVN August 2015

Subject:

r3337 - in /java/trunk: ecal-readout-sim/src/main/java/org/hps/readout/ecal/ steering-files/src/main/resources/org/hps/steering/readout/ tracking/src/main/java/org/hps/readout/svt/

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 5 Aug 2015 02:00:31 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (358 lines)

Author: [log in to unmask]
Date: Tue Aug  4 19:00:29 2015
New Revision: 3337

Log:
fix mismatch between pairs and singles trigger delays

Modified:
    java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java
    java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1.lcsim
    java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigSingles1.lcsim
    java/trunk/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java

Modified: 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	(original)
+++ java/trunk/ecal-readout-sim/src/main/java/org/hps/readout/ecal/SinglesTriggerDriver.java	Tue Aug  4 19:00:29 2015
@@ -2,31 +2,32 @@
 
 import hep.aida.IHistogram1D;
 import hep.aida.IHistogram2D;
-
+import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
-
+import java.util.Queue;
 import org.hps.recon.ecal.triggerbank.TriggerModule;
 import org.lcsim.event.Cluster;
 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.
- * 
+ * 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 TriggerModule triggerModule = new TriggerModule();
-    
+
     // 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);
@@ -37,21 +38,44 @@
     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);
-    
+
+    private final Queue<List<Cluster>> clusterDelayQueue; //the length of this queue sets the trigger delay. Defaults to length 1 (zero delay).
+
+    public SinglesTriggerDriver() {
+        clusterDelayQueue = new LinkedList<List<Cluster>>();
+        clusterDelayQueue.add(new ArrayList<Cluster>());
+    }
+
+    /**
+     * Sets the trigger delay (units of 4-ns FADC clocks). Default of 0.
+     *
+     * @param delay
+     */
+    public void setDelay(int delay) {
+        clusterDelayQueue.clear();
+        for (int i = 0; i <= delay; i++) {
+            clusterDelayQueue.add(new ArrayList<Cluster>());
+        }
+    }
+
     @Override
     public void process(EventHeader event) {
         // Make sure that there are clusters in the event.
-        if(event.hasCollection(Cluster.class, clusterCollectionName)) {
+        if (event.hasCollection(Cluster.class, clusterCollectionName)) {
             // Get the list of clusters.
             List<Cluster> clusterList = event.get(Cluster.class, clusterCollectionName);
-            
+
+            // Add the new cluster collection to the queue.
+            clusterDelayQueue.add(clusterList);
+            clusterDelayQueue.remove();
+
             // Iterate over the clusters.
-            for(Cluster cluster : clusterList) {
+            for (Cluster cluster : clusterList) {
                 // Get the x and y indices.
                 int ix = cluster.getCalorimeterHits().get(0).getIdentifierFieldValue("ix");
                 int iy = cluster.getCalorimeterHits().get(0).getIdentifierFieldValue("iy");
                 ix = ix > 0 ? ix - 1 : ix;
-                
+
                 // Populate the uncut plots.
                 clusterSeedEnergy.fill(cluster.getCalorimeterHits().get(0).getCorrectedEnergy(), 1);
                 clusterTotalEnergy.fill(cluster.getEnergy(), 1);
@@ -63,49 +87,50 @@
         // Perform the superclass event processing.
         super.process(event);
     }
-    
-    /**
-     * Performs cluster singles cuts. These include seed energy, cluster
-     * energy, and minimum hit count.
+
+    /**
+     * 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) {
-    	// Track whether triggering cluster was seen.
-    	boolean passTrigger = false;
-    	
+        // Track whether triggering cluster was seen.
+        boolean passTrigger = false;
+
         // Check that there is a cluster object collection.
-        if(event.hasCollection(Cluster.class, clusterCollectionName)) {
-            // Get the list of hits.
-            List<Cluster> clusterList = event.get(Cluster.class, clusterCollectionName);
-            
+        if (event.hasCollection(Cluster.class, clusterCollectionName)) {
+            // Get the list of clusters.
+            List<Cluster> clusterList = clusterDelayQueue.peek();
+
             // Iterate over the hits and perform the cuts.
             triggerLoop:
-            for(Cluster cluster : clusterList) {
+            for (Cluster cluster : clusterList) {
                 // Perform the hit count cut.
-                if(!triggerModule.clusterHitCountCut(cluster)) {
+                if (!triggerModule.clusterHitCountCut(cluster)) {
                     continue triggerLoop;
                 }
-                
+
                 // Perform the seed hit cut.
-                if(!triggerModule.clusterSeedEnergyCut(cluster)) {
+                if (!triggerModule.clusterSeedEnergyCut(cluster)) {
                     continue triggerLoop;
                 }
-                
+
                 // Perform the cluster energy cut.
-                if(!triggerModule.clusterTotalEnergyCut(cluster)) {
+                if (!triggerModule.clusterTotalEnergyCut(cluster)) {
                     continue triggerLoop;
                 }
-                
+
                 // A trigger was seen. Note it.
                 passTrigger = true;
-                
+
                 // Get the x and y indices.
                 int ix = cluster.getCalorimeterHits().get(0).getIdentifierFieldValue("ix");
                 int iy = cluster.getCalorimeterHits().get(0).getIdentifierFieldValue("iy");
                 ix = ix > 0 ? ix - 1 : ix;
-                
+
                 // Populate the cut plots.
                 clusterSeedEnergySingle.fill(cluster.getCalorimeterHits().get(0).getCorrectedEnergy(), 1);
                 clusterTotalEnergySingle.fill(cluster.getEnergy(), 1);
@@ -113,70 +138,77 @@
                 clusterDistributionSingle.fill(ix, iy, 1);
             }
         }
-        
+
         // Return whether a triggering cluster was seen.
         return passTrigger;
     }
-    
-    /**
-     * Sets the minimum hit count threshold for the trigger. This value
-     * is inclusive.
+
+    /**
+     * 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) {
-    	triggerModule.setCutValue(TriggerModule.CLUSTER_HIT_COUNT_LOW, hitCountThreshold);
-    }
-    
-    /**
-     * Sets the lower bound for the seed energy threshold on the trigger.
+        triggerModule.setCutValue(TriggerModule.CLUSTER_HIT_COUNT_LOW, 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) {
+        triggerModule.setCutValue(TriggerModule.CLUSTER_SEED_ENERGY_LOW, 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) {
+        triggerModule.setCutValue(TriggerModule.CLUSTER_SEED_ENERGY_HIGH, seedEnergyHigh);
+    }
+
+    /**
+     * Sets the lower bound for the cluster energy threshold on the trigger.
      * This value is inclusive.
-     * @param seedEnergyLow - The value of the threshold.
-     */
-    public void setSeedEnergyLowThreshold(double seedEnergyLow) {
-    	triggerModule.setCutValue(TriggerModule.CLUSTER_SEED_ENERGY_LOW, seedEnergyLow);
-    }
-    
-    /**
-     * Sets the upper bound for the seed energy threshold on the trigger.
+     *
+     * @param clusterEnergyLow - The value of the threshold.
+     */
+    public void setClusterEnergyLowThreshold(double clusterEnergyLow) {
+        triggerModule.setCutValue(TriggerModule.CLUSTER_TOTAL_ENERGY_LOW, clusterEnergyLow);
+    }
+
+    /**
+     * Sets the upper bound for the cluster energy threshold on the trigger.
      * This value is inclusive.
-     * @param seedEnergyHigh - The value of the threshold.
-     */
-    public void setSeedEnergyHighThreshold(double seedEnergyHigh) {
-    	triggerModule.setCutValue(TriggerModule.CLUSTER_SEED_ENERGY_HIGH, 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) {
-    	triggerModule.setCutValue(TriggerModule.CLUSTER_TOTAL_ENERGY_LOW, 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) {
-    	triggerModule.setCutValue(TriggerModule.CLUSTER_TOTAL_ENERGY_HIGH, clusterEnergyHigh);
-    }
-    
+        triggerModule.setCutValue(TriggerModule.CLUSTER_TOTAL_ENERGY_HIGH, 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;
     }
-    
-    /**
-     * Sets all cut values for the trigger using a string argument with
-     * the format "Emin Emax Nmin".
+
+    /**
+     * Sets all cut values for the trigger using a string argument with the
+     * format "Emin Emax Nmin".
+     *
      * @param cuts - The cut string.
      */
     public void setCuts(String cuts) {
-    	triggerModule.setCutValues(true, cuts);
-    }
-}
+        triggerModule.setCutValues(true, cuts);
+    }
+}

Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1.lcsim
 =============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1.lcsim	(original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1.lcsim	Tue Aug  4 19:00:29 2015
@@ -43,7 +43,7 @@
             <readoutThreshold>12</readoutThreshold>
             <triggerThreshold>12</triggerThreshold>
             <readoutWindow>50</readoutWindow>
-            <readoutLatency>74</readoutLatency>
+            <readoutLatency>77</readoutLatency>
             <mode>1</mode>
         </driver>
         <driver name="EcalConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">

Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigSingles1.lcsim
 =============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigSingles1.lcsim	(original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigSingles1.lcsim	Tue Aug  4 19:00:29 2015
@@ -43,7 +43,7 @@
             <readoutThreshold>12</readoutThreshold>
             <triggerThreshold>12</triggerThreshold>    
             <readoutWindow>50</readoutWindow>
-            <readoutLatency>74</readoutLatency>
+            <readoutLatency>77</readoutLatency>
             <mode>1</mode>
         </driver>
         <driver name="EcalConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
@@ -78,6 +78,7 @@
             <clusterEnergyLowThreshold>0.400</clusterEnergyLowThreshold>
             <clusterEnergyHighThreshold>1.100</clusterEnergyHighThreshold>
             <prescale>1</prescale>
+            <delay>3</delay>
             <outputFileName>${outputFile}.triggers.singles1</outputFileName>
             <!--<verbose>true</verbose>-->
         </driver>                                    

Modified: java/trunk/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java
 =============================================================================
--- java/trunk/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java	(original)
+++ java/trunk/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java	Tue Aug  4 19:00:29 2015
@@ -162,8 +162,8 @@
 
         if (useTimingConditions) {
             SvtTimingConstants timingConstants = DatabaseConditionsManager.getInstance().getCachedConditions(SvtTimingConstants.SvtTimingConstantsCollection.class, "svt_timing_constants").getCachedData().get(0);
-            readoutOffset = 4 * timingConstants.getOffsetPhase();
-            readoutLatency = 236.0 + timingConstants.getOffsetTime();
+            readoutOffset = 4 * (timingConstants.getOffsetPhase() + 3);
+            readoutLatency = 248.0 + timingConstants.getOffsetTime();
         }
     }
 

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