Commit in hps-java/src/test/java/org/lcsim on MAIN
DoEvioTest.java+25-151.4 -> 1.5
creating hits now and iterating over them :-)

hps-java/src/test/java/org/lcsim
DoEvioTest.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- DoEvioTest.java	16 Feb 2012 05:18:52 -0000	1.4
+++ DoEvioTest.java	16 Feb 2012 06:20:42 -0000	1.5
@@ -32,6 +32,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Iterator;
 import java.util.Set;
 import java.util.logging.Logger;
 import org.lcsim.event.EventHeader;
@@ -49,7 +50,7 @@
  * This is a test of using jevio routines to read EVIO files.  
  * 
  * @author homer
- * @version $Id: DoEvioTest.java,v 1.4 2012/02/16 05:18:52 homer Exp $
+ * @version $Id: DoEvioTest.java,v 1.5 2012/02/16 06:20:42 homer Exp $
  */
 public class DoEvioTest extends TestCase {
 
@@ -140,24 +141,33 @@
                             System.out.println("got trksamp, trksamp = " + trksamp);
                             long chanaddr = trksamp.channel();
                             System.out.println("got chanaddr");
+                            long chanapv = trksamp.apv();
+                            System.out.println("got apv");
                             short chanadc[] = new short[6];
-                            System.out.println("getting channel data");
+                            System.out.println("getting sample data");
 
-                            for (int ichan = 0; ichan < 6; ichan++) {
-                                System.out.println("channel = " + ichan);
+                            for (int isamp = 0; isamp < 6; isamp++) {
+                                System.out.println("sample = " + isamp);
 
-                                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);
-                                raw_hits.add(raw_hit);
+                                chanadc[isamp] = (short) trksamp.value(isamp);
                             }
-//                            break;
+                            IDetectorElement detector_element = null;
+
+                            System.out.println("Creating raw_hit with channel,apv = " + chanaddr + " , " + chanapv + " and adc = " + chanadc[0]);
+
+                            int time = 0; // need to find source of this
+                            RawTrackerHit raw_hit = new BaseRawTrackerHit(time, chanaddr, chanadc, sim_hits, detector_element);
+                            // Put hits onto readout and hit list
+//                    ro.addHit(raw_hit);
+                            raw_hits.add(raw_hit);
+                        }
+                        
+                        System.out.println("Show the hits we created ...");
+                        Iterator<RawTrackerHit> rhiter = raw_hits.iterator();
+
+                        while (rhiter.hasNext()) {
+                            RawTrackerHit rh = rhiter.next();
+                            System.out.println("this hit was created: cellID=" + rh.getCellID() + " adc[0]=" + (rh.getADCValues())[0]);
                         }
                         switch (header.getDataTypeEnum()) {
                             case FLOAT32:
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