Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps on MAIN
readout/ecal/TriggerDriver.java+2-21.3 -> 1.4
            /FADCEcalReadoutDriver.java+10-21.1 -> 1.2
            /EcalReadoutDriver.java+2-101.3 -> 1.4
            /TriggerableDriver.java+6-61.2 -> 1.3
recon/tracking/SimpleSvtReadout.java+10-81.10 -> 1.11
evio/ECalHitWriter.java+5-21.4 -> 1.5
recon/ecal/EcalRawConverterDriver.java+31.1 -> 1.2
+38-30
7 modified files
set RCHBIT_TIME so hit times get saved properly; fix time offsets in readout timestamp code

hps-java/src/main/java/org/lcsim/hps/readout/ecal
TriggerDriver.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- TriggerDriver.java	20 Mar 2013 00:09:42 -0000	1.3
+++ TriggerDriver.java	20 Mar 2013 01:03:32 -0000	1.4
@@ -21,7 +21,7 @@
  * Applies SVT trigger latency and sends trigger signal to SVT
  *
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: TriggerDriver.java,v 1.3 2013/03/20 00:09:42 meeg Exp $
+ * @version $Id: TriggerDriver.java,v 1.4 2013/03/20 01:03:32 meeg Exp $
  */
 public abstract class TriggerDriver extends TriggerableDriver {
 
@@ -38,7 +38,7 @@
     private static final List<TriggerableDriver> triggerables = new ArrayList<TriggerableDriver>();
 
     public TriggerDriver() {
-        latency = 50.0;
+        triggerDelay = 50.0;
     }
 
     public void setLcioFile(String lcioFile) {

hps-java/src/main/java/org/lcsim/hps/readout/ecal
FADCEcalReadoutDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- FADCEcalReadoutDriver.java	25 Feb 2013 22:39:26 -0000	1.1
+++ FADCEcalReadoutDriver.java	20 Mar 2013 01:03:32 -0000	1.2
@@ -30,7 +30,7 @@
  * Simulates time evolution of preamp output pulse.
  *
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: FADCEcalReadoutDriver.java,v 1.1 2013/02/25 22:39:26 meeg Exp $
+ * @version $Id: FADCEcalReadoutDriver.java,v 1.2 2013/03/20 01:03:32 meeg Exp $
  */
 public class FADCEcalReadoutDriver extends EcalReadoutDriver<RawCalorimeterHit> {
 
@@ -276,11 +276,19 @@
                 if (debug) {
                     System.out.println("Reading out ECal in integral mode");
                 }
-                event.put(ecalReadoutCollectionName, readIntegrals(), RawCalorimeterHit.class, 0, ecalReadoutName);
+                event.put(ecalReadoutCollectionName, readIntegrals(), RawCalorimeterHit.class, flags, ecalReadoutName);
                 break;
         }
     }
 
+    @Override
+    public double readoutDeltaT() {
+        double triggerTime = ClockSingleton.getTime() + triggerDelay;
+        int cycle = (int) Math.floor((triggerTime - readoutOffset + ClockSingleton.getDt()) / readoutPeriod);
+        double readoutTime = (cycle - readoutLatency) * readoutPeriod + readoutOffset - ClockSingleton.getDt();
+        return readoutTime;
+    }
+
     protected short[] getWindow(long cellID) {
         FADCPipeline pipeline = pipelineMap.get(cellID);
         short[] adcValues = new short[readoutWindow];

hps-java/src/main/java/org/lcsim/hps/readout/ecal
EcalReadoutDriver.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- EcalReadoutDriver.java	20 Mar 2013 00:09:42 -0000	1.3
+++ EcalReadoutDriver.java	20 Mar 2013 01:03:32 -0000	1.4
@@ -12,7 +12,7 @@
  * Performs readout of ECal hits.
  *
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: EcalReadoutDriver.java,v 1.3 2013/03/20 00:09:42 meeg Exp $
+ * @version $Id: EcalReadoutDriver.java,v 1.4 2013/03/20 01:03:32 meeg Exp $
  */
 public abstract class EcalReadoutDriver<T> extends TriggerableDriver {
 
@@ -40,7 +40,7 @@
     public EcalReadoutDriver() {
         flags += 1 << LCIOConstants.CHBIT_LONG; //store position
         flags += 1 << LCIOConstants.RCHBIT_ID1; //store cell ID
-        latency = 100.0;
+        triggerDelay = 100.0;
     }
 
     public void setDebug(boolean debug) {
@@ -145,14 +145,6 @@
     protected void processTrigger(EventHeader event) {
     }
 
-    @Override
-    public double readoutDeltaT() {
-        double triggerTime = ClockSingleton.getTime() + latency;
-        int cycle = (int) Math.floor((triggerTime - readoutOffset + ClockSingleton.getDt()) / readoutPeriod);
-        double readoutTime = cycle * readoutPeriod + readoutOffset - ClockSingleton.getDt();
-        return readoutTime;
-    }
-
     //initialize buffers
     protected abstract void initReadout();
 }
\ No newline at end of file

hps-java/src/main/java/org/lcsim/hps/readout/ecal
TriggerableDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TriggerableDriver.java	20 Mar 2013 00:09:42 -0000	1.2
+++ TriggerableDriver.java	20 Mar 2013 01:03:32 -0000	1.3
@@ -12,15 +12,15 @@
  * You might want to set your own default latency in your constructor.
  * readoutDeltaT() and isLive() are meant to be overridden if you're doing something unusual.
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: TriggerableDriver.java,v 1.2 2013/03/20 00:09:42 meeg Exp $
+ * @version $Id: TriggerableDriver.java,v 1.3 2013/03/20 01:03:32 meeg Exp $
  */
 public abstract class TriggerableDriver extends Driver {
 
     private Queue<Double> triggerTimestamps = new LinkedList<Double>();
-    protected double latency = 0.0; // [ns]
+    protected double triggerDelay = 0.0; // [ns]
 
-    public void setLatency(double latency) {
-        this.latency = latency;
+    public void setTriggerDelay(double triggerDelay) {
+        this.triggerDelay = triggerDelay;
     }
 
     /**
@@ -28,7 +28,7 @@
      * @return time reference for hits written by this driver in response to a trigger
      */
     public double readoutDeltaT() {
-        return ClockSingleton.getTime() + latency;
+        return ClockSingleton.getTime() + triggerDelay;
     }
 
     @Override
@@ -46,7 +46,7 @@
     }
 
     public void addTrigger() {
-        triggerTimestamps.add(ClockSingleton.getTime() + latency);
+        triggerTimestamps.add(ClockSingleton.getTime() + triggerDelay);
     }
 
     public boolean isLive() {

hps-java/src/main/java/org/lcsim/hps/recon/tracking
SimpleSvtReadout.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- SimpleSvtReadout.java	20 Mar 2013 00:09:43 -0000	1.10
+++ SimpleSvtReadout.java	20 Mar 2013 01:03:32 -0000	1.11
@@ -28,7 +28,7 @@
 /**
  * 
  * @author Omar Moreno <[log in to unmask]>
- * @version $Id: SimpleSvtReadout.java,v 1.10 2013/03/20 00:09:43 meeg Exp $
+ * @version $Id: SimpleSvtReadout.java,v 1.11 2013/03/20 01:03:32 meeg Exp $
  */
 public class SimpleSvtReadout extends TriggerableDriver {
 
@@ -38,6 +38,7 @@
     private Map<SiSensor, APV25Pipeline[]> pipelineMap = new HashMap<SiSensor, APV25Pipeline[]>();
     //readout period time offset in ns
     private double readoutOffset = 0.0;
+    private int readoutLatency = 11;
     private String readout = "TrackerHits";
     private int readoutCycle = 0;
     private double timeOffset = 30.0;
@@ -52,7 +53,7 @@
 
     public SimpleSvtReadout() {
         add(readoutDriver);
-        latency = 100.0;
+        triggerDelay = 100.0;
     }
 
     public void setAddNoise(boolean addNoise) {
@@ -101,7 +102,7 @@
                 pipelineMap.put(sensor, pipelines);
                 if (addNoise) {
                     for (int channel = 0; channel < HPSSVTConstants.TOTAL_STRIPS_PER_SENSOR; channel++) {
-                        pipelines[channel] = new APV25Pipeline();
+                        pipelines[channel] = new APV25Pipeline(readoutLatency);
                     }
                 }
             }
@@ -137,7 +138,7 @@
                 double amplitude = stripHit.amplitude;
                 APV25Pipeline[] pipelines = pipelineMap.get(sensor);
                 if (pipelines[channel] == null) {
-                    pipelines[channel] = new APV25Pipeline();
+                    pipelines[channel] = new APV25Pipeline(readoutLatency);
                 }
                 for (int i = 0; i < 20; i++) {
                     pipelines[channel].addToCell(i, amplitude * pulseAmplitude((i + 1) * Apv25Constants.SAMPLING_INTERVAL + readoutTime() - ClockSingleton.getTime(), HPSSVTCalibrationConstants.getTShaping(sensor, channel)));
@@ -323,18 +324,19 @@
 
     @Override
     public double readoutDeltaT() {
-        double triggerTime = ClockSingleton.getTime() + latency;
+        double triggerTime = ClockSingleton.getTime() + triggerDelay;
         int cycle = (int) Math.floor((triggerTime - readoutOffset + ClockSingleton.getDt()) / Apv25Constants.SAMPLING_INTERVAL);
-        double readoutTime = cycle * Apv25Constants.SAMPLING_INTERVAL + readoutOffset - ClockSingleton.getDt();
+        double readoutTime = (cycle - readoutLatency + 1) * Apv25Constants.SAMPLING_INTERVAL + readoutOffset - ClockSingleton.getDt();
         return readoutTime;
     }
 
     private class APV25Pipeline extends RingBuffer {
 
-        private int _trigger_latency = (int) Math.floor(270 / Apv25Constants.SAMPLING_INTERVAL);
+        private int _trigger_latency = (int) Math.floor(270 / Apv25Constants.SAMPLING_INTERVAL); // 11 clocks
 
-        public APV25Pipeline() {
+        public APV25Pipeline(int latency) {
             super(Apv25Constants.ANALOG_PIPELINE_LENGTH);
+            _trigger_latency = latency;
         }
 
         /**

hps-java/src/main/java/org/lcsim/hps/evio
ECalHitWriter.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ECalHitWriter.java	25 Feb 2013 22:39:25 -0000	1.4
+++ ECalHitWriter.java	20 Mar 2013 01:03:32 -0000	1.5
@@ -1,5 +1,6 @@
 package org.lcsim.hps.evio;
 
+import org.lcsim.util.lcio.LCIOConstants;
 import org.jlab.coda.jevio.BaseStructure;
 import org.lcsim.event.RawTrackerHit;
 import org.jlab.coda.jevio.CompositeData;
@@ -25,7 +26,7 @@
 /**
  *
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: ECalHitWriter.java,v 1.4 2013/02/25 22:39:25 meeg Exp $
+ * @version $Id: ECalHitWriter.java,v 1.5 2013/03/20 01:03:32 meeg Exp $
  */
 public class ECalHitWriter implements HitWriter {
 
@@ -425,7 +426,9 @@
             case EventConstants.ECAL_PULSE_INTEGRAL_MODE:
                 List<RawCalorimeterHit> rawCalorimeterHits = event.get(RawCalorimeterHit.class, hitCollectionName);
                 System.out.println("Writing " + rawCalorimeterHits.size() + " ECal hits in integral format");
-                toEvent.put(hitCollectionName, rawCalorimeterHits, RawCalorimeterHit.class, 0, readoutName);
+                int flags = 0;
+                flags += 1 << LCIOConstants.RCHBIT_TIME; //store cell ID
+                toEvent.put(hitCollectionName, rawCalorimeterHits, RawCalorimeterHit.class, flags, readoutName);
                 break;
             default:
                 break;

hps-java/src/main/java/org/lcsim/hps/recon/ecal
EcalRawConverterDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- EcalRawConverterDriver.java	25 Feb 2013 22:39:24 -0000	1.1
+++ EcalRawConverterDriver.java	20 Mar 2013 01:03:32 -0000	1.2
@@ -8,6 +8,7 @@
 import org.lcsim.event.RawTrackerHit;
 import org.lcsim.geometry.Detector;
 import org.lcsim.util.Driver;
+import org.lcsim.util.lcio.LCIOConstants;
 
 /**
  *
@@ -132,6 +133,7 @@
                 }
             }
             int flags = 0;
+            flags += 1 << LCIOConstants.RCHBIT_TIME; //store cell ID
             event.put(ecalCollectionName, newHits, CalorimeterHit.class, flags, ecalReadoutName);
         } else {
             ArrayList<RawCalorimeterHit> newHits = new ArrayList<RawCalorimeterHit>();
@@ -152,6 +154,7 @@
                 }
             }
             int flags = 0;
+            flags += 1 << LCIOConstants.RCHBIT_TIME; //store cell ID
             event.put(rawCollectionName, newHits, RawCalorimeterHit.class, flags, ecalReadoutName);
         }
     }
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1