Commit in hps-java/src/test/java/org/lcsim on MAIN
DoEvioTest.java+15-71.2 -> 1.3
a little close to a functioning test of the tracker

hps-java/src/test/java/org/lcsim
DoEvioTest.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- DoEvioTest.java	15 Feb 2012 01:11:39 -0000	1.2
+++ DoEvioTest.java	15 Feb 2012 09:07:43 -0000	1.3
@@ -49,7 +49,7 @@
  * This is a test of using jevio routines to read EVIO files.  
  * 
  * @author homer
- * @version $Id: DoEvioTest.java,v 1.2 2012/02/15 01:11:39 homer Exp $
+ * @version $Id: DoEvioTest.java,v 1.3 2012/02/15 09:07:43 homer Exp $
  */
 public class DoEvioTest extends TestCase {
 
@@ -60,8 +60,8 @@
      */
     private MappedByteBuffer mappedByteBuffer;
     int eventDataSizeBytes = 8000000;
-//        byte trkbytes[] = new byte[eventDataSizeBytes];
-    int trkbytes[] = new int[eventDataSizeBytes];
+//        byte rawdataInts[] = new byte[eventDataSizeBytes];
+    int rawdataInts[] = new int[eventDataSizeBytes];
 
     public void testDoTestEvio() throws IOException {
         System.out.println("Test for EVIO.");
@@ -127,9 +127,11 @@
 //                        for (int ii=0; ii<10; ii++) System.out.println("trkdata["+ii+"] = "+trkdata[ii]+"\t"+Integer.toString(trkdata[ii] & 0xffff, 16).toUpperCase());
 //                        trkev.setData(trkdata); 
                         for (int ii = 0; ii < 10; ii++) {
-                            System.out.println("trkbytes[" + ii + "] = " + trkbytes[ii] + "\t" + Integer.toString(trkbytes[ii] & 0xffff, 16).toUpperCase());
+                            System.out.println("rawdataInts[" + ii + "] = " + rawdataInts[ii] + "\t"
+                                    + Integer.toString((rawdataInts[ii] >> 16) & 0xffff, 16).toUpperCase() + ":"
+                                    + Integer.toString(rawdataInts[ii] & 0xffff, 16).toUpperCase());
                         }
-                        trkev.setData(trkbytes);
+                        trkev.setData(rawdataInts);
                         System.out.println("starting loop over samples");
                         for (int i = 0; i < header.getNumber(); i++) {
                             System.out.println("sample# = " + i);
@@ -146,6 +148,9 @@
                                 chanadc[0] = (short) trksamp.value(ichan);
                                 int time = 0; // need to find source of this
                                 IDetectorElement detector_element = null;
+
+                                System.out.println("Creating raw_hit with channel = " + chanaddr + " and adc = " + chanadc[0]);
+                                
                                 RawTrackerHit raw_hit = new BaseRawTrackerHit(time, chanaddr, chanadc, sim_hits, detector_element);
                                 // Put hits onto readout and hit list
 //                    ro.addHit(raw_hit);
@@ -260,9 +265,12 @@
 
         int offset = 0;
         int IntsRemaining = mappedByteBuffer.remaining() / 4;
+        System.out.println("Number of Ints to read is " + IntsRemaining);
+        ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
+        mappedByteBuffer.order(byteOrder);
         for (int ii = 0; ii < IntsRemaining; ii++) {
-//            System.out.println("trkbytes["+ii+"]");
-            trkbytes[ii] = mappedByteBuffer.getInt();
+//            System.out.println("rawdataInts["+ii+"]");
+            rawdataInts[ii] = mappedByteBuffer.getInt();
         }
 
 //        int[] header = new int[8000000];
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