LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  August 2015

HPS-SVN August 2015

Subject:

r3444 - in /java/trunk/record-util/src/main/java/org/hps/record/evio/crawler: CrawlerConfig.java RunProcessor.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Fri, 28 Aug 2015 20:07:09 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (204 lines)

Author: [log in to unmask]
Date: Fri Aug 28 13:07:08 2015
New Revision: 3444

Log:
Minor changes to argument interface.

Modified:
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/CrawlerConfig.java
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/CrawlerConfig.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/CrawlerConfig.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/CrawlerConfig.java	Fri Aug 28 13:07:08 2015
@@ -348,7 +348,7 @@
      *
      * @return <code>true</code> if the run database should be updated
      */
-    boolean updateRunLog() {
+    boolean updateRunDatabase() {
         return updateRunLog;
     }
 

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java	Fri Aug 28 13:07:08 2015
@@ -35,7 +35,7 @@
      * Setup logger.
      */
     private static final Logger LOGGER = LogUtil.create(RunProcessor.class, new DefaultLogFormatter(), Level.FINE);
-    
+
     /**
      * The cache manager.
      */
@@ -74,7 +74,7 @@
     /**
      * Set to <code>true</code> to use file caching.
      */
-    private boolean useFileCache;
+    private final boolean useFileCache;
 
     /**
      * Create a run processor.
@@ -82,14 +82,14 @@
      * @param runSummary the run summary object for the run
      * @return the run processor
      */
-    RunProcessor(final JCacheManager cacheManager, final RunSummaryImpl runSummary, boolean useFileCache) {
+    RunProcessor(final JCacheManager cacheManager, final RunSummaryImpl runSummary, final boolean useFileCache) {
 
         this.runSummary = runSummary;
         this.cacheManager = cacheManager;
 
         // Set whether file caching from MSS is enabled.
         this.useFileCache = useFileCache;
-        
+
         // Sort the list of EVIO files.
         Collections.sort(runSummary.getEvioFiles(), new EvioFileSequenceComparator());
 
@@ -106,7 +106,7 @@
         scalersProcessor.setResetEveryEvent(false);
         evioLoop.addEvioEventProcessor(scalersProcessor);
 
-        // Add processor for extracting TI time offset. 
+        // Add processor for extracting TI time offset.
         triggerTimeProcessor = new TiTimeOffsetEvioProcessor();
         evioLoop.addEvioEventProcessor(triggerTimeProcessor);
     }
@@ -134,41 +134,20 @@
     }
 
     /**
-     * Process the run by executing the registered {@link org.hps.record.evio.EvioEventProcessor}s and extracting the
-     * start and end dates.
-     * <p>
-     * This method will also execute file caching from MSS, if enabled by the {@link #useFileCache} option.
-     *
-     * @throws Exception if there is an error processing a file
-     */
-    void processRun() throws Exception {
-
-        LOGGER.info("processing " + this.runSummary.getEvioFiles().size() + " files from run "
-                + this.runSummary.getRun());
-
-        // Cache files from MSS if this is enabled.
-        if (this.useFileCache) {
-            LOGGER.info("caching files from MSS");
-            this.cacheFiles();
-        }
-
-        // Run processors over all files.
-        LOGGER.info("looping over all events");
-        evioLoop.loop(-1);
-
-        // Get run start date.
-        LOGGER.info("processing first file");
-        this.processFirstFile();
-
-        // Get run end date.
-        LOGGER.info("processing last file");
-        this.processLastFile();
-
-        // Update run summary from processors.
-        LOGGER.info("updating run summary");
-        this.updateRunSummary();
-
-        LOGGER.info("done processing run " + this.runSummary.getRun());
+     * Extract meta data from first file in run.
+     */
+    private void processFirstFile() {
+        final File firstEvioFile = runSummary.getEvioFiles().get(0);
+        LOGGER.info("getting meta data for " + firstEvioFile.getPath());
+        final EvioFileMetaDataReader metaDataReader = new EvioFileMetaDataReader();
+        final EvioFileMetaData metaData = metaDataReader.getMetaData(firstEvioFile);
+        LOGGER.info(metaData.toString());
+        if (metaData.getStartDate() == null) {
+            throw new IllegalStateException("The start date is not set in the EVIO file meta data from "
+                    + firstEvioFile.getPath());
+        }
+        LOGGER.info("setting unix start time to " + metaData.getStartDate().getTime() + " from meta data");
+        runSummary.setStartDate(metaData.getStartDate());
     }
 
     /**
@@ -190,20 +169,41 @@
     }
 
     /**
-     * Extract meta data from first file in run.
-     */
-    private void processFirstFile() {
-        final File firstEvioFile = runSummary.getEvioFiles().get(0);
-        LOGGER.info("getting meta data for " + firstEvioFile.getPath());
-        final EvioFileMetaDataReader metaDataReader = new EvioFileMetaDataReader();
-        final EvioFileMetaData metaData = metaDataReader.getMetaData(firstEvioFile);
-        LOGGER.info(metaData.toString());
-        if (metaData.getStartDate() == null) {
-            throw new IllegalStateException("The start date is not set in the EVIO file meta data from "
-                    + firstEvioFile.getPath());
-        }
-        LOGGER.info("setting unix start time to " + metaData.getStartDate().getTime() + " from meta data");
-        runSummary.setStartDate(metaData.getStartDate());
+     * Process the run by executing the registered {@link org.hps.record.evio.EvioEventProcessor}s and extracting the
+     * start and end dates.
+     * <p>
+     * This method will also execute file caching from MSS, if enabled by the {@link #useFileCache} option.
+     *
+     * @throws Exception if there is an error processing a file
+     */
+    void processRun() throws Exception {
+
+        LOGGER.info("processing " + this.runSummary.getEvioFiles().size() + " files from run "
+                + this.runSummary.getRun());
+
+        // Cache files from MSS if this is enabled.
+        if (this.useFileCache) {
+            LOGGER.info("caching files from MSS");
+            this.cacheFiles();
+        }
+
+        // Run processors over all files.
+        LOGGER.info("looping over all events");
+        evioLoop.loop(-1);
+
+        // Get run start date.
+        LOGGER.info("processing first file");
+        this.processFirstFile();
+
+        // Get run end date.
+        LOGGER.info("processing last file");
+        this.processLastFile();
+
+        // Update run summary from processors.
+        LOGGER.info("updating run summary");
+        this.updateRunSummary();
+
+        LOGGER.info("done processing run " + this.runSummary.getRun());
     }
 
     /**
@@ -225,12 +225,12 @@
 
         // Add trigger config from the trigger time processor.
         LOGGER.info("updating trigger config");
-        TriggerConfig triggerConfig = new TriggerConfig();
+        final TriggerConfig triggerConfig = new TriggerConfig();
         this.triggerTimeProcessor.updateTriggerConfig(triggerConfig);
-        LOGGER.info("tiTimeOffset: " + triggerConfig.get(TriggerConfigVariable.TI_TIME_OFFSET.name()));
-        System.out.println("tiTimeOffset: " + triggerConfig.get(TriggerConfigVariable.TI_TIME_OFFSET.name()));
+        LOGGER.info("tiTimeOffset: " + triggerConfig.get(TriggerConfigVariable.TI_TIME_OFFSET));
+        System.out.println("tiTimeOffset: " + triggerConfig.get(TriggerConfigVariable.TI_TIME_OFFSET));
         runSummary.setTriggerConfigInt(triggerConfig);
-        
+
         LOGGER.getHandlers()[0].flush();
-    }  
+    }
 }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use