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

HPS-SVN March 2015

Subject:

r2521 - in /java/trunk/record-util/src/main/java/org/hps/record/evio: EvioEventConstants.java EvioEventUtilities.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 24 Mar 2015 16:40:00 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (115 lines)

Author: [log in to unmask]
Date: Tue Mar 24 09:39:54 2015
New Revision: 2521

Log:
Add method for checking if an event has the EPICS tag.

Modified:
    java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventConstants.java
    java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventUtilities.java

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventConstants.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventConstants.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventConstants.java	Tue Mar 24 09:39:54 2015
@@ -2,19 +2,31 @@
 
 public class EvioEventConstants {
     
+    // This is the old tag for physics events.
     public static final int PHYSICS_EVENT_TAG = 1;
+    
+    // CODA control event tags.
     public static final int SYNC_EVENT_TAG = 16;
     public static final int PRESTART_EVENT_TAG = 17;
     public static final int GO_EVENT_TAG = 18;
     public static final int PAUSE_EVENT_TAG = 19;
     public static final int END_EVENT_TAG = 20;
     
+    // Special tag for events with EPICS scalars.
+    public static final int EPICS_EVENT_TAG = 31;
+    
+    // Event tags greater than or equal to this will be physics events.
+    public static final int PHYSICS_START_TAG = 32;
+    
     public static final int EVENTID_BANK_TAG = 0xC000;
-    
+  
+    // Bank tag for header bank with run and event numbers in physics events.
     public static final int HEAD_BANK_TAG = 0xe10F;
   
-    public static final int EPICS_EVENT_TAG = 31;
     public static final int EPICS_BANK_TAG = 57620;
     public static final int EPICS_BANK_TAG_2s = -1;
     public static final int EPICS_BANK_TAG_20s = -1;
+    //public static final int EPICS_BANK_TAG_2s = -1;
+    //public static final int EPICS_BANK_TAG_20s = -1;
+    
 }

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventUtilities.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventUtilities.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/EvioEventUtilities.java	Tue Mar 24 09:39:54 2015
@@ -1,10 +1,6 @@
 package org.hps.record.evio;
 
-import static org.hps.record.evio.EvioEventConstants.END_EVENT_TAG;
-import static org.hps.record.evio.EvioEventConstants.GO_EVENT_TAG;
-import static org.hps.record.evio.EvioEventConstants.PAUSE_EVENT_TAG;
-import static org.hps.record.evio.EvioEventConstants.PRESTART_EVENT_TAG;
-import static org.hps.record.evio.EvioEventConstants.SYNC_EVENT_TAG;
+import static org.hps.record.evio.EvioEventConstants.*;
 
 import org.jlab.coda.jevio.BaseStructure;
 import org.jlab.coda.jevio.EvioEvent;
@@ -20,6 +16,11 @@
     private EvioEventUtilities() {
     }
     
+    /**
+     * Get the event tag from the header bank.
+     * @param event The input EvioEvent.
+     * @return The event tag from the header bank.
+     */
     public static int getEventTag(EvioEvent event) {
         return event.getHeader().getTag();
     }
@@ -72,7 +73,7 @@
      * @return True if this event is a physics event.
      */
     public static boolean isPhysicsEvent(EvioEvent event) {
-        return (event.getHeader().getTag() >= SYNC_EVENT_TAG+16 ||
+        return (event.getHeader().getTag() >= PHYSICS_START_TAG ||
                 event.getHeader().getTag() < SYNC_EVENT_TAG);
         // return event.getHeader().getTag() == PHYSICS_EVENT_TAG;
     }
@@ -88,6 +89,16 @@
     }
     
     /**
+     * Check if this event is an EPICS event containing scalar data.
+     * 
+     * @param event The EvioEvent.
+     * @return True if this event is an EPICS event.
+     */
+    public static boolean isEpicsEvent(EvioEvent event) {
+        return event.getHeader().getTag() == EPICS_EVENT_TAG;
+    }
+    
+    /**
      * True if <code>event</code> is an EVIO control event.
      * @return True if event is a control event.
      */
@@ -96,7 +107,8 @@
                 isGoEvent(event) || 
                 isPauseEvent(event) || 
                 isEndEvent(event) || 
-                isSyncEvent(event);
+                isSyncEvent(event) ||
+                isEpicsEvent(event);
     }
 
     /**

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