Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25 on MAIN
Apv25Full.java+10-101.3 -> 1.4
SvtReadout.java+48-41.3 -> 1.4
+58-14
2 modified files
More fixes; timed in SVT; Almost ready to go ...

hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25
Apv25Full.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Apv25Full.java	15 Aug 2012 02:52:59 -0000	1.3
+++ Apv25Full.java	16 Aug 2012 01:11:50 -0000	1.4
@@ -13,7 +13,7 @@
 /**
  * 
  * @author Omar Moreno <[log in to unmask]>
- * @version $Id: Apv25Full.java,v 1.3 2012/08/15 02:52:59 omoreno Exp $
+ * @version $Id: Apv25Full.java,v 1.4 2012/08/16 01:11:50 omoreno Exp $
  */
 public class Apv25Full {
     
@@ -49,15 +49,11 @@
      */
     public void injectCharge(int channel, double charge) {
         
-        // Only inject charge if the channel isn't bad
-        if(!this.getChannel(channel).isBadChannel()){
-        
         	// Shape the injected charge
             this.getChannel(channel).shapeSignal(charge);
 
             // Sample the resulting shaper signal
             this.getChannel(channel).sampleShaperSignal();
-        }
     }
     
     /**
@@ -176,7 +172,7 @@
                 double sample = shaperSignal.getAmplitudeAtTime(sampleTime, shapingTime);
                 
                 // Add the value to the pipeline
-                pipeline.addToCell(cell, sample);
+                if(sample > .001) pipeline.addToCell(cell, sample);
             }
         }
     }
@@ -190,17 +186,19 @@
         
         // Note: ptr gives the position of the trigger pointer
         
-        private int triggerLatency = (int) Math.floor(200 /* ns */ / SAMPLING_INTERVAL);
+        private int triggerLatency = (int) Math.floor(100 /* ns */ / SAMPLING_INTERVAL);
         private int writerPointer = 0;
         
         /**
          * Constructor
          */
         public Apv25Pipeline(){
-            
+             
             // Initialize the pipeline to the APV25 pipeline length
             super(ANALOG_PIPELINE_LENGTH);
             
+            System.out.println("Trigger Latency: " + triggerLatency);
+            
             // Initialize the position of the trigger pointer to a random position
             this.ptr = (int) (Math.random()*ANALOG_PIPELINE_LENGTH);
             
@@ -220,8 +218,9 @@
          */
         @Override
         public void addToCell(int position, double element){
-            if((writerPointer + position)%ANALOG_PIPELINE_LENGTH == this.ptr) return;
-            super.addToCell(position, element);
+            int writePosition = (writerPointer + position)%ANALOG_PIPELINE_LENGTH;
+            if(writePosition == this.ptr) return;
+            array[writePosition] += element;
         }
         
         /**
@@ -281,6 +280,7 @@
         Apv25ShaperSignal(double charge) {
             // Find the maximum amplitude of the shaper signal
             maxAmp = (charge/MIP)*FRONT_END_GAIN;  // mV
+            System.out.println(this.getClass().getSimpleName()+ ": Maximum shaper signal: " + maxAmp);
         }
 
         /**

hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25
SvtReadout.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- SvtReadout.java	15 Aug 2012 02:52:59 -0000	1.3
+++ SvtReadout.java	16 Aug 2012 01:11:50 -0000	1.4
@@ -2,6 +2,7 @@
 
 //--- java ---//
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -36,7 +37,7 @@
 /**
  * 
  * @author Omar Moreno <[log in to unmask]>
- * @version $Id: SvtReadout.java,v 1.3 2012/08/15 02:52:59 omoreno Exp $
+ * @version $Id: SvtReadout.java,v 1.4 2012/08/16 01:11:50 omoreno Exp $
  */
 public class SvtReadout extends Driver {
 
@@ -46,11 +47,13 @@
     // FIFO queue to store "local" triggers by time
     private Queue<Double> triggerQueue = new LinkedList<Double>();
     List<String> readouts = new ArrayList<String>();
+    Map<SiSensor, List<Integer>> sensorToChannel = new HashMap<SiSensor, List<Integer>>();
     
     double readoutDeadTime = 24; // ns
     double lastTriggerTime = 0;
     
     boolean debug = false;
+    boolean timingIn = false;
     
     public SvtReadout(){
     	// Load the driver which transfers SimTrackerHits to their 
@@ -69,6 +72,13 @@
     /**
      * 
      */
+    public void setTimingIn(boolean timingIn){
+        this.timingIn = timingIn;
+    }
+    
+    /**
+     * 
+     */
     @Override
     public void detectorChanged(Detector detector){
         super.detectorChanged(detector);
@@ -177,18 +187,39 @@
                 // Loop over all sensor channels
                 for(Integer physicalChannel : electrodeDataCol.keySet()){
                     
+                    // find the APV channel number from the physical channel
+                    int channel = physicalChannel - TOTAL_STRIPS_PER_SENSOR
+                            + halfModule.getAPV25Number(physicalChannel)*TOTAL_APV25_CHANNELS + (TOTAL_APV25_CHANNELS - 1); 
+                    
+                    // Only inject charge if the channels isn't considered bad
+                    if(halfModule.getAPV25(physicalChannel).getChannel(channel).isBadChannel()) continue;
+                    
                     // Get the electrode data for this channel
                     SiElectrodeData electrodeData = electrodeDataCol.get(physicalChannel);
                     
                     // Get the charge in units of electrons
                     double charge = electrodeData.getCharge();
                     
-                    // find the APV channel number from the physical channel
-                    int channel = physicalChannel - TOTAL_STRIPS_PER_SENSOR
-    						+ halfModule.getAPV25Number(physicalChannel)*TOTAL_APV25_CHANNELS + (TOTAL_APV25_CHANNELS - 1); 
+                    if(debug){
+                        if(charge > 0) System.out.println(this.getClass().getSimpleName() + ": Injecting charge " + charge + " into channel " + physicalChannel);
+                    }
+                    
+                    if(timingIn){
+                        if(charge > 0){
+                            if(!sensorToChannel.containsKey(halfModule.getSensor())){
+                                sensorToChannel.put(halfModule.getSensor(), new ArrayList<Integer>());
+                            }
+                            sensorToChannel.get(halfModule.getSensor()).add(physicalChannel);
+                        }
+                    }
                     
                     // Inject the charge into the APV25 amplifier chain
                     halfModule.getAPV25(physicalChannel).injectCharge(channel, charge);
+                    
+                    if(debug){
+                            System.out.println(this.getClass().getSimpleName() + ": Writer pointer value: " + halfModule.getAPV25(physicalChannel).getChannel(channel).getPipeline().getWriterPointerValue());
+                            System.out.println(this.getClass().getSimpleName() + ": Channel " + physicalChannel + " pipeline: " + halfModule.getAPV25(physicalChannel).getChannel(channel).getPipeline().toString() );
+                    }
                 }
             }
         }
@@ -210,6 +241,19 @@
             // Get the sensor associated with this half-module
             SiSensor sensor = halfModule.getSensor();
             
+            if(timingIn && sensorToChannel.containsKey(sensor)){
+                for(Integer physicalChannel = 0; physicalChannel < 640; physicalChannel++){
+                    if(sensorToChannel.get(sensor).contains(physicalChannel)){
+                        // find the APV channel number from the physical channel
+                        int channel = physicalChannel - TOTAL_STRIPS_PER_SENSOR
+                                + halfModule.getAPV25Number(physicalChannel)*TOTAL_APV25_CHANNELS + (TOTAL_APV25_CHANNELS - 1); 
+                        System.out.println(this.getClass().getSimpleName() + ": Channel " + physicalChannel + " pipeline: " + halfModule.getAPV25(physicalChannel).getChannel(channel).getPipeline().toString() );
+                    }
+                
+                    sensorToChannel.get(sensor).remove(physicalChannel);
+                }
+            }
+            
             // Get all of the APVs associated with the sensor
             Apv25Full[] apv25 = halfModule.getAllApv25s();
         
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