Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/evio on MAIN
TestRunEvioToLcio.java+23-61.17 -> 1.18
print event times

hps-java/src/main/java/org/lcsim/hps/evio
TestRunEvioToLcio.java 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- TestRunEvioToLcio.java	29 May 2012 22:25:10 -0000	1.17
+++ TestRunEvioToLcio.java	21 Jun 2012 18:44:26 -0000	1.18
@@ -2,6 +2,8 @@
 
 import java.io.*;
 
+import java.util.Date;
+import java.util.List;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.HelpFormatter;
@@ -166,6 +168,9 @@
                 throw new RuntimeException(e);
             }
 
+            boolean firstEvent = true;
+            int time = 0;
+
             // Loop over EVIO events, build LCSim events, process them, and then
             // write events to disk.
             fileLoop:
@@ -190,11 +195,13 @@
                         int[] data = evioEvent.getIntData();
                         int seconds = data[0];
                         int runNumber = data[1];
+                        System.out.println("Prestart event time: " + seconds + " - " + new Date(((long) seconds) * 1000));
                         calibListener.prestart(seconds, runNumber);
                     } else if (EventConstants.isEndEvent(evioEvent)) {
                         int[] data = evioEvent.getIntData();
                         int seconds = data[0];
                         int nevents = data[2];
+                        System.out.println("End event time: " + seconds + " - " + new Date(((long) seconds) * 1000));
                         calibListener.endRun(seconds, nevents);
                     } else if (eventBuilder.isPhysicsEvent(evioEvent)) {
                         EventHeader lcioEvent = eventBuilder.makeLCSimEvent(evioEvent);
@@ -202,8 +209,15 @@
 //                            if (lcioEvent.hasCollection(BaseRawCalorimeterHit.class, "EcalReadoutHits") && !lcioEvent.get(BaseRawCalorimeterHit.class, "EcalReadoutHits").isEmpty()) {
 //                                continue;
 //                            }
-//                            if (lcioEvent.hasCollection(TriggerData.class, "TriggerBank")) {
-//                                List<TriggerData> triggerList = lcioEvent.get(TriggerData.class, "TriggerBank");
+                            if (lcioEvent.hasCollection(TriggerData.class, "TriggerBank")) {
+                                List<TriggerData> triggerList = lcioEvent.get(TriggerData.class, "TriggerBank");
+                                if (!triggerList.isEmpty()) {
+                                    time = triggerList.get(0).getTime();
+                                    if (firstEvent) {
+                                        System.out.println("First physics event time: " + time + " - " + new Date(((long) time) * 1000));
+                                        firstEvent = false;
+                                    }
+                                }
 //                                if (!triggerList.isEmpty()) {
 //                                    TriggerData triggerData = triggerList.get(0);
 //
@@ -211,11 +225,13 @@
 //                                    int topTrig = triggerData.getTopTrig();
 //                                    int botTrig = triggerData.getBotTrig();
 //                                    int pairTrig = triggerData.getPairTrig();
-//                                    if (topTrig!=0 && botTrig!=0) {
-//                                        System.out.format("%x\t%x\t%x\t%x\n",orTrig, topTrig, botTrig,pairTrig);
-//                                    } else {continue;}
+//                                    if (topTrig != 0 && botTrig != 0) {
+//                                        System.out.format("%x\t%x\t%x\t%x\n", orTrig, topTrig, botTrig, pairTrig);
+//                                    } else {
+//                                        continue;
+//                                    }
 //                                }
-//                            }
+                            }
                             jobManager.processEvent(lcioEvent);
                             if (writer != null) {
                                 writer.write(lcioEvent);
@@ -239,6 +255,7 @@
                 }
                 nEvents++;
             }
+            System.out.println("Last physics event time: " + time + " - " + new Date(((long) time) * 1000));
             reader.close();
         }
         System.out.println("No more data");
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