<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="margin: 0px;"><span style="color: rgb(127, 127, 127);"><b>From: </b></span>David Lawrence <<a href="mailto:david.lawrence.nn@gmail.com">david.lawrence.nn@gmail.com</a>><br></div><div style="margin: 0px;"><span style="color: rgb(127, 127, 127);"><b>Subject: </b></span><b>JANA status bits</b><br></div><div style="margin: 0px;"><span style="color: rgb(127, 127, 127);"><b>Date: </b></span>November 20, 2015 at 2:50:05 PM EST<br></div><div style="margin: 0px;"><span style="color: rgb(127, 127, 127);"><b>To: </b></span>HallD Software Group <<a href="mailto:halld-offline@jlab.org">halld-offline@jlab.org</a>><br></div><br><br><div>Hi All,</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>I’ve just submitted a pull request for a change that implements a feature in JANA</div><div>that we’ve not used up to now. This is a set of up to 64 flags that can be set for each</div><div>event. I have defined a few of these “status bits” which can be used for identifying</div><div>properties of the event. The main example is identifying whether it is a “physics”</div><div>event, “epics” event, “sync” event, etc.. To test whether the current event is a physics</div><div>event, use something like the following:</div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: rgb(120, 73, 42);">#include </span><DANA/DStatusBits.h></div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="color: rgb(187, 44, 162);">bool</span> isPhysics = loop->GetJEvent().GetStatusBit(kSTATUS_PHYSICS_EVENT);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="color: rgb(187, 44, 162);">if</span>(isPhysics){</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><font color="#d12f1b"> </font><font color="#669c35">// Do something with the physics event</font></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; min-height: 13px;">The currently available flags are:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_HDDM,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_REST,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_EVIO,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_FROM_FILE,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_FROM_ET,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_CONTROL_EVENT,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_PHYSICS_EVENT,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_EPICS_EVENT,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_SYNC_EVENT,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;"> </span>kSTATUS_BOR_EVENT</div></div><div><br></div><div><br></div><div style="margin: 0px; min-height: 13px;">To get a feel for which flags are being set for an event you can add<br class="webkit-block-placeholder"></div><div style="margin: 0px; min-height: 13px;">the following to your evnt() method (though you will only want to run</div><div>this for a couple of events).</div><div><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">cout << japp->StatusWordToString(loop->GetJEvent().GetStatus()) << endl;</div></div><div><br></div><div><br></div><div>The output for each event will look something like this:</div><div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">status: 0x000000000000004c</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> bin |00000000|00000000|00000000|00000000|00000000|00000000|00000000|01001100|</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> hex 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x4c </div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 0] HDDM file</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 1] REST file</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 1 - [ 2] EVIO</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 1 - [ 3] Event read from file</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 4] Event read from ET system</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 5] Control event</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 1 - [ 6] Physics event</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 7] EPICS event</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 8] SYNC event</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;"> 0 - [ 9] Beginning Of Run (BOR) event</div></div><div><br></div><div><br></div><div>Regards,</div><div>-David</div></body></html>