Print

Print


Author: [log in to unmask]
Date: Fri Feb 12 10:24:23 2016
New Revision: 4215

Log:
Catch exception due to multisample count check in the SVT bank. Need to update firmware but the problem should be benign. Outputting warning now. Add some detailed logging as well.

Modified:
    java/trunk/evio/src/main/java/org/hps/evio/AbstractSvtEvioReader.java
    java/trunk/evio/src/main/java/org/hps/evio/AugmentedSvtEvioReader.java

Modified: java/trunk/evio/src/main/java/org/hps/evio/AbstractSvtEvioReader.java
 =============================================================================
--- java/trunk/evio/src/main/java/org/hps/evio/AbstractSvtEvioReader.java	(original)
+++ java/trunk/evio/src/main/java/org/hps/evio/AbstractSvtEvioReader.java	Fri Feb 12 10:24:23 2016
@@ -232,7 +232,11 @@
                 SvtHeaderDataInfo headerData = this.extractSvtHeader(dataBank.getHeader().getNumber(), data);
                 
                 // Check that the multisample count is consistent
-                this.checkSvtSampleCount(sampleCount, headerData);
+                try {
+                    this.checkSvtSampleCount(sampleCount, headerData);
+                }  catch(final SvtEvioHeaderException e) {
+                    LOGGER.warning("Caught SVT exception:" + e.getMessage());
+                }
                 
                 // Add header to list
                 headers.add(headerData);
@@ -344,7 +348,7 @@
      */
     protected void checkSvtSampleCount(int sampleCount, SvtHeaderDataInfo headerData) throws SvtEvioHeaderException {
         if( sampleCount != SvtEvioUtils.getSvtTailMultisampleCount(headerData.getTail())*4)
-            throw new SvtEvioHeaderException("multisample count is not consistent with bank size.");
+            throw new SvtEvioHeaderException("ROC " + headerData.getNum() + " multisample count " + sampleCount + " is not consistent with bank size " + SvtEvioUtils.getSvtTailMultisampleCount(headerData.getTail()));
     }
     
     /**

Modified: java/trunk/evio/src/main/java/org/hps/evio/AugmentedSvtEvioReader.java
 =============================================================================
--- java/trunk/evio/src/main/java/org/hps/evio/AugmentedSvtEvioReader.java	(original)
+++ java/trunk/evio/src/main/java/org/hps/evio/AugmentedSvtEvioReader.java	Fri Feb 12 10:24:23 2016
@@ -32,7 +32,10 @@
     
     @Override
     protected void processSvtHeaders(List<SvtHeaderDataInfo> headers, EventHeader lcsimEvent) throws SvtEvioHeaderException {
-    
+
+
+        LOGGER.finest("Process " + headers.size() + " SVT headers for run " + lcsimEvent.getRunNumber() + " and event " + lcsimEvent.getEventNumber());
+        
         // Check that the SVT header data is valid
         // Catch the exceptions locally, add stuff to the event, then throw it again
         // and handle it outside
@@ -43,6 +46,8 @@
 
         if( !exceptions.isEmpty() ) {
 
+            LOGGER.finest("Found " + exceptions.size() + " " + SvtEvioHeaderException.class.getSimpleName() + " exceptions");
+            
             // print some debug info 
             
             List<String> exceptionNames = SvtEventHeaderChecker.getSvtEvioHeaderExceptionNames(exceptions);
@@ -68,8 +73,14 @@
                 throw new SvtEvioHeaderException(exceptions.get(0));
             
         } else { 
+            
+            LOGGER.finest("No " + SvtEvioHeaderException.class.getSimpleName() + " exceptions found for this event");
+            
             // add skimming flag - the header is OK since I would never get here otherwise
             SvtEventFlagger.voidAddHeaderCheckResultToMetaData(true, lcsimEvent);
+            
+            
+            
         }
 
         // Add SVT header data to the event