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());
|