Commit in hps-java/src/test/java/org/lcsim/hps/evio on MAIN | |||
TestRunReconToEvio_Test.java | +11 | -23 | 1.3 -> 1.4 |
minor restructuring
diff -u -r1.3 -r1.4 --- TestRunReconToEvio_Test.java 29 Mar 2012 04:14:14 -0000 1.3 +++ TestRunReconToEvio_Test.java 29 Mar 2012 04:23:20 -0000 1.4 @@ -11,7 +11,6 @@
import junit.framework.TestCase; import org.jlab.coda.jevio.BaseStructure;
-import org.jlab.coda.jevio.BaseStructureHeader;
import org.jlab.coda.jevio.CompositeData; import org.jlab.coda.jevio.EvioEvent; import org.jlab.coda.jevio.EvioException;
@@ -60,18 +59,11 @@
EvioEvent event = null; event = reader.parseNextEvent(); while (event != null) {
- - System.out.println("event has " + event.getChildCount() + " children");
if (event.getChildren() != null) {
- for (BaseStructure topBank : event.getChildren()) { - BaseStructureHeader header = topBank.getHeader(); - if (topBank.getChildren() == null) { - System.out.println("subbank has no children"); - } else { - System.out.println("subbank has " + topBank.getChildCount() + " children"); - } - if (header.getTag() == SVT_BANK_TAG) { - int[] intData = topBank.getIntData();
+ for (BaseStructure crateBank : event.getChildren()) { + int crateTag = crateBank.getHeader().getTag(); + if (crateTag == SVT_BANK_TAG) { + int[] intData = crateBank.getIntData();
if (intData.length % 4 != 0) { throw new RuntimeException("Size of int array not divisible by 4!"); }
@@ -93,28 +85,26 @@
int apv = trackerSample.apv(); System.out.println("fpga=" + fpga + "; hybrid=" + hybrid + "; channel=" + channel + "; apv=" + apv);
-
for (int j=0; j<6; j++) { int val = trackerSample.value(j); System.out.println(" sample[" + j + "]="+val); } }
- } else if (header.getTag() == ECAL_TOP_BANK_TAG || header.getTag() == ECAL_BOTTOM_BANK_TAG) { - System.out.println("got ecal bank from event: " + Integer.toHexString(header.getTag())); - if (topBank.getChildCount() > 0) { - for (BaseStructure slotBank : topBank.getChildren()) {
+ } else if (crateTag == ECAL_TOP_BANK_TAG || crateTag == ECAL_BOTTOM_BANK_TAG) { + if (crateBank.getChildCount() > 0) { + for (BaseStructure slotBank : crateBank.getChildren()) {
CompositeData cdata = slotBank.getCompositeData();
- System.out.println("bank.tag="+Integer.toHexString(slotBank.getHeader().getTag()));
+ System.out.println("ecal.tag="+Integer.toHexString(slotBank.getHeader().getTag()));
System.out.println("cdata has " + cdata.getItems().size() + " items"); System.out.println("cdata has " + cdata.getTypes().size() + " types"); System.out.println("cdata has " + cdata.getNValues().size() + " N values"); int n = cdata.getNValues().size(); for (int i=0; i<n; i++) {
- System.out.println("N["+i+"]="+cdata.getNValues().get(i));
+ System.out.println("cdata.N["+i+"]="+cdata.getNValues().get(i));
} int ni = cdata.getItems().size(); for (int i=0; i<ni; i++) {
- System.out.println("type["+i+"]="+cdata.getTypes().get(i));
+ System.out.println("cdata.type["+i+"]="+cdata.getTypes().get(i));
} int slot = cdata.getByte(); int trigger = cdata.getInt();
@@ -132,9 +122,7 @@
} } }
- } else { - System.out.println("ecal bank has no children"); - }
+ }
} }
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