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  July 2015

HPS-SVN July 2015

Subject:

r3290 - in /java/trunk/record-util/src/main/java/org/hps/record/evio/crawler: EventCountProcessor.java EventTypeLog.java RunProcessor.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 28 Jul 2015 22:22:19 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (148 lines)

Author: [log in to unmask]
Date: Tue Jul 28 15:22:17 2015
New Revision: 3290

Log:
Rename class.

Added:
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventCountProcessor.java
      - copied, changed from r3283, java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventTypeLog.java
Removed:
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventTypeLog.java
Modified:
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java

Copied: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventCountProcessor.java (from r3283, java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventTypeLog.java)
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventTypeLog.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EventCountProcessor.java	Tue Jul 28 15:22:17 2015
@@ -14,7 +14,7 @@
  *
  * @author Jeremy McCormick, SLAC
  */
-final class EventTypeLog extends EvioEventProcessor {
+final class EventCountProcessor extends EvioEventProcessor {
 
     /**
      * The event tag counts for the run.
@@ -27,11 +27,16 @@
     private int physicsEventCount = 0;
 
     /**
+     * The total number of events processed of any type.
+     */
+    private int totalEventCount = 0;
+
+    /**
      * Create the log pointing to a run summary.
      *
      * @param runSummary the run summary
      */
-    EventTypeLog() {
+    EventCountProcessor() {
         for (final EventTagConstant constant : EventTagConstant.values()) {
             this.eventTypeCounts.put(constant, 0);
         }
@@ -45,7 +50,7 @@
      *
      * @return a map of event types to their counts
      */
-    Map<Object, Integer> getEventTypeCounts() {
+    Map<Object, Integer> getEventCounts() {
         return this.eventTypeCounts;
     }
 
@@ -59,6 +64,15 @@
     }
 
     /**
+     * Get the number of events counted of any type.
+     *
+     * @return the number of events counted
+     */
+    int getTotalEventCount() {
+        return totalEventCount;
+    }
+
+    /**
      * Process an EVIO event and add its type to the map.
      *
      * @param event the EVIO event
@@ -66,7 +80,15 @@
     @Override
     public void process(final EvioEvent event) {
 
-        // Increment counts for exact event tag values.
+        // Increment physics event count.
+        if (EvioEventUtilities.isPhysicsEvent(event)) {
+            ++this.physicsEventCount;
+        }
+
+        // Increment total event count.
+        ++this.totalEventCount;
+
+        // Increment counts for event tag values.
         for (final EventTagConstant constant : EventTagConstant.values()) {
             if (constant.isEventTag(event)) {
                 final int count = this.eventTypeCounts.get(constant) + 1;
@@ -74,17 +96,12 @@
             }
         }
 
-        // Increment counts for bit masking of tags.
+        // Increment counts for event tags with bit masks (different types of physics events).
         for (final EventTagBitMask mask : EventTagBitMask.values()) {
             if (mask.isEventTag(event)) {
                 final int count = this.eventTypeCounts.get(mask) + 1;
                 this.eventTypeCounts.put(mask, count);
             }
         }
-
-        // Increment physics event count.
-        if (EvioEventUtilities.isPhysicsEvent(event)) {
-            ++this.physicsEventCount;
-        }
     }
 }

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	Tue Jul 28 15:22:17 2015
@@ -93,7 +93,7 @@
     /**
      * Processor for extracting event type counts (sync, physics, trigger types, etc.).
      */
-    private final EventTypeLog eventTypeLog;
+    private final EventCountProcessor eventCountProcessor;
 
     /**
      * Max files to read (defaults to unlimited).
@@ -141,8 +141,8 @@
         this.addProcessor(scalersProcessor);
 
         // Event log processor.
-        eventTypeLog = new EventTypeLog();
-        this.addProcessor(eventTypeLog);
+        eventCountProcessor = new EventCountProcessor();
+        this.addProcessor(eventCountProcessor);
 
         // Max files.
         if (config.maxFiles() != -1) {
@@ -294,10 +294,10 @@
         runSummary.setScalerData(this.scalersProcessor.getScalerData());
 
         // Set the counts of event types on the run summary.
-        runSummary.setEventTypeCounts(eventTypeLog.getEventTypeCounts());
-
-        // Set total number of physics events on the run summary from the event counter.
-        runSummary.setTotalEvents(this.eventTypeLog.getPhysicsEventCount());
+        runSummary.setEventTypeCounts(eventCountProcessor.getEventCounts());
+
+        // Set total number of events on the run summary from the event counter.
+        runSummary.setTotalEvents(this.eventCountProcessor.getTotalEventCount());
 
         // Set EpicsData for the run.
         runSummary.setEpicsData(this.epicsLog.getEpicsData());

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