[Halld-offline] JANA status bits

David Lawrence davidl at jlab.org
Fri Nov 20 14:51:38 EST 2015


From: David Lawrence <david.lawrence.nn at gmail.com>
Subject: JANA status bits
Date: November 20, 2015 at 2:50:05 PM EST
To: HallD Software Group <halld-offline at jlab.org>


Hi All,

	I’ve just submitted a pull request for a change that implements a feature in JANA
that we’ve not used up to now. This is a set of up to 64 flags that can be set for each
event. I have defined a few of these “status bits” which can be used for identifying
properties of the event. The main example is identifying whether it is a “physics”
event, “epics” event, “sync” event, etc.. To test whether the current event is a physics
event, use something like the following:


#include <DANA/DStatusBits.h>

bool isPhysics = loop->GetJEvent().GetStatusBit(kSTATUS_PHYSICS_EVENT);
if(isPhysics){
   // Do something with the physics event
}


The currently available flags are:

	kSTATUS_HDDM,
	kSTATUS_REST,
	kSTATUS_EVIO,
	kSTATUS_FROM_FILE,
	kSTATUS_FROM_ET,
	kSTATUS_CONTROL_EVENT,
	kSTATUS_PHYSICS_EVENT,
	kSTATUS_EPICS_EVENT,
	kSTATUS_SYNC_EVENT,
	kSTATUS_BOR_EVENT


To get a feel for which flags are being set for an event you can add
the following to your evnt() method (though you will only want to run
this for a couple of events).

cout << japp->StatusWordToString(loop->GetJEvent().GetStatus()) << endl;


The output for each event will look something like this:

status: 0x000000000000004c
   bin |00000000|00000000|00000000|00000000|00000000|00000000|00000000|01001100|
   hex    0x00     0x00     0x00     0x00     0x00     0x00     0x00     0x4c  
  0 - [ 0] HDDM file
  0 - [ 1] REST file
  1 - [ 2] EVIO
  1 - [ 3] Event read from file
  0 - [ 4] Event read from ET system
  0 - [ 5] Control event
  1 - [ 6] Physics event
  0 - [ 7] EPICS event
  0 - [ 8] SYNC event
  0 - [ 9] Beginning Of Run (BOR) event


Regards,
-David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20151120/23c95e1a/attachment.html>


More information about the Halld-offline mailing list