https://daq00.triumf.ca/MidasWiki/index.php?title=Super_Event&feed=atom&action=historySuper Event - Revision history2024-03-28T16:13:34ZRevision history for this page on the wikiMediaWiki 1.39.6https://daq00.triumf.ca/MidasWiki/index.php?title=Super_Event&diff=1931&oldid=prevSuz at 21:59, 14 July 20152015-07-14T21:59:38Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:59, 14 July 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{Pagelinks}}</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Links ====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Links ====</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l109">Line 109:</td>
<td colspan="2" class="diff-lineno">Line 110:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The ODB key <span style="color: purple; font-style:italic;">/Equipment/<equipment name>/statistics/event rate</span> event rate will indicate the rate of sub-events.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The ODB key <span style="color: purple; font-style:italic;">/Equipment/<equipment name>/statistics/event rate</span> event rate will indicate the rate of sub-events.</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Frontend]] [[Category:Event]]</ins></div></td></tr>
</table>Suzhttps://daq00.triumf.ca/MidasWiki/index.php?title=Super_Event&diff=858&oldid=prevSuz at 22:41, 8 November 20132013-11-08T22:41:28Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:41, 8 November 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">==== Links ====</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* [[Frontend user code]] </ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* [[Event Structure]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* [[Equipment List Parameters]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></div></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Introduction==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Introduction==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Super-Event is an option implemented in the [[Frontend user code|Frontend code]] in order to reduce the amount of data to be transferred to the back-end computer(s) by removing the bank header for each event constructed. It is not applicable to [[Event Structure#FIXED Format Event|FIXED Format]] events. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Super-Event is an option implemented in the [[Frontend user code|Frontend code]] in order to reduce the amount of data to be transferred to the back-end computer(s) by removing the bank header for each event constructed. It is not applicable to [[Event Structure#FIXED Format Event|FIXED Format]] events. </div></td></tr>
</table>Suzhttps://daq00.triumf.ca/MidasWiki/index.php?title=Super_Event&diff=857&oldid=prevSuz at 22:38, 8 November 20132013-11-08T22:38:09Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:38, 8 November 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Introduction==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Introduction==</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The Super-Event is an option implemented in the [[Frontend <del style="font-weight: bold; text-decoration: none;">Operation#Frontend</del>|Frontend]]<del style="font-weight: bold; text-decoration: none;">code </del>in order to reduce the amount of data to be transferred to the back-end computer(s) by removing the bank header for each event constructed. It is not applicable to [[Event Structure#FIXED Format Event|FIXED Format]] events. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The Super-Event is an option implemented in the [[Frontend <ins style="font-weight: bold; text-decoration: none;">user code</ins>|Frontend <ins style="font-weight: bold; text-decoration: none;">code</ins>]] in order to reduce the amount of data to be transferred to the back-end computer(s) by removing the bank header for each event constructed. It is not applicable to [[Event Structure#FIXED Format Event|FIXED Format]] events. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In other words, when an equipment readout in [[Event Structure#MIDAS Format Event|MIDAS Format]] is complete, the event is composed of the bank header followed by the data section.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In other words, when an equipment readout in [[Event Structure#MIDAS Format Event|MIDAS Format]] is complete, the event is composed of the bank header followed by the data section.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The overhead in bytes of the bank structure is 16 bytes for ''bk_init()'', 20 bytes for bk_init32<del style="font-weight: bold; text-decoration: none;">() and ybk_init</del>(). If the data section size is close to the number above, the data transfer as well as the data storage has an non-negligible overhead. To address this problem, the equipment can be set up to generate a so called Super-Event which is an event composed of the initial standard bank header for the first event of the super-event, and up to the <del style="font-weight: bold; text-decoration: none;">@ref FE_tbl_NumSubevents "</del>number of sub-events<del style="font-weight: bold; text-decoration: none;">" </del>maximum successive data sections before the closing of the bank.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The overhead in bytes of the bank structure is 16 bytes for ''bk_init()'', 20 bytes for bk_init32(). If the data section size is close to the number above, the data transfer as well as the data storage has an non-negligible overhead. To address this problem, the equipment can be set up to generate a so called Super-Event which is an event composed of the initial standard bank header for the first event of the super-event, and up to the <ins style="font-weight: bold; text-decoration: none;">[[Equipment List Parameters#Number of subevents|</ins>number of sub-events<ins style="font-weight: bold; text-decoration: none;">]] </ins>maximum successive data sections before the closing of the bank.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Example frontend code ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Example frontend code ==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To demonstrate the use of the super-event, consider the following example of the Equipment Declaration in the frontend code:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To demonstrate the use of the super-event, consider the following example of the Equipment Declaration in the frontend code:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> // Define equipment to be able to generate the <del style="font-weight: bold; text-decoration: none;">\b </del>Super-Event </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> // Define equipment to be able to generate the Super-Event </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> //</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> //</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> { "GE", // equipment name </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> { "GE", // equipment name </div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 200, // poll for 200ms </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 200, // poll for 200ms </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 0, // stop run after this event limit </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 0, // stop run after this event limit </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> 1000, // <del style="font-weight: bold; text-decoration: none;">-----> </del>number of sub events <del style="font-weight: bold; text-decoration: none;"><----- enable </del>Super-event</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;"><span style="color:red"></ins>1000, // number of sub events <ins style="font-weight: bold; text-decoration: none;">> 0 ... enables </ins>Super-event<ins style="font-weight: bold; text-decoration: none;"></span></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 0, // don't log history </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 0, // don't log history </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> "", "", "",</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> "", "", "",</div></td></tr>
</table>Suzhttps://daq00.triumf.ca/MidasWiki/index.php?title=Super_Event&diff=807&oldid=prevSuz: Created page with "==Introduction== The Super-Event is an option implemented in the Frontendcode in order to reduce the amount of data to be transferred to the ..."2013-10-30T23:55:04Z<p>Created page with "==Introduction== The Super-Event is an option implemented in the <a href="/MidasWiki/index.php/Frontend_Operation#Frontend" title="Frontend Operation">Frontendcode</a> in order to reduce the amount of data to be transferred to the ..."</p>
<p><b>New page</b></p><div>==Introduction==<br />
The Super-Event is an option implemented in the [[Frontend Operation#Frontend|Frontend]]code in order to reduce the amount of data to be transferred to the back-end computer(s) by removing the bank header for each event constructed. It is not applicable to [[Event Structure#FIXED Format Event|FIXED Format]] events. <br />
<br />
In other words, when an equipment readout in [[Event Structure#MIDAS Format Event|MIDAS Format]] is complete, the event is composed of the bank header followed by the data section.<br />
<br />
The overhead in bytes of the bank structure is 16 bytes for ''bk_init()'', 20 bytes for bk_init32() and ybk_init(). If the data section size is close to the number above, the data transfer as well as the data storage has an non-negligible overhead. To address this problem, the equipment can be set up to generate a so called Super-Event which is an event composed of the initial standard bank header for the first event of the super-event, and up to the @ref FE_tbl_NumSubevents "number of sub-events" maximum successive data sections before the closing of the bank.<br />
<br />
==Example frontend code ==<br />
To demonstrate the use of the super-event, consider the following example of the Equipment Declaration in the frontend code:<br />
<br />
// Define equipment to be able to generate the \b Super-Event <br />
//<br />
{ "GE", // equipment name <br />
2, 0x0002, // event ID, trigger mask <br />
"SYSTEM", // event buffer <br />
#ifdef USE_INT<br />
EQ_INTERRUPT, // equipment type <br />
#else<br />
EQ_POLLED, // equipment type <br />
#endif<br />
LAM_SOURCE(GE_C, LAM_STATION(GE_N)), // interrupt source <br />
"MIDAS", // format <br />
TRUE, // enabled <br />
RO_RUNNING, // read only when running <br />
200, // poll for 200ms <br />
0, // stop run after this event limit <br />
1000, // -----> number of sub events <----- enable Super-event<br />
0, // don't log history <br />
"", "", "",<br />
read_ge_event, // readout routine <br />
,<br />
...<br />
<br />
<br />
==Example Readout code ==<br />
<br />
Set up the readout function for Super-Event collection, e.g. <br />
<br />
//-- Event readout<br />
// Global and fixed -- Expect NWORDS 16bits data readout per sub-event<br />
#define NWORDS 3<br />
//<br />
INT read_ge_event(char *pevent, INT offset)<br />
{<br />
static WORD *pdata;<br />
//<br />
// Super-event structure <br />
if (offset == 0)<br />
{<br />
// FIRST event of the Super-event <br />
bk_init(pevent);<br />
bk_create(pevent, "GERM", TID_WORD, &pdata);<br />
//<br />
else if (offset == -1)<br />
{<br />
// close the Super-event if offset is -1<br />
bk_close(pevent, pdata);<br />
//<br />
// End of Super-Event<br />
return bk_size(pevent);<br />
//<br />
//<br />
// read GE sub-event (ADC) <br />
cam16i(GE_C, GE_N, 0, GE_READ, pdata++);<br />
cam16i(GE_C, GE_N, 1, GE_READ, pdata++);<br />
cam16i(GE_C, GE_N, 2, GE_READ, pdata++);<br />
//<br />
// clear hardware <br />
re_arm_ge(); <br />
//<br />
if (offset == 0)<br />
{<br />
// Compute the proper event length on the FIRST event in the Super-Event<br />
// NWORDS correspond to the !! NWORDS WORD above !!<br />
// sizeof(BANK_HEADER) + sizeof(BANK) will make the 16 bytes header<br />
// sizeof(WORD) is defined by the TID_WORD in bk_create()<br />
//<br />
return NWORDS * sizeof(WORD) + sizeof(BANK_HEADER) + sizeof(BANK);<br />
//<br />
else<br />
// Return the data section size only<br />
// sizeof(WORD) is defined by the TID_WORD in bk_create()<br />
//<br />
return NWORDS * sizeof(WORD);<br />
<br />
===Discussion===<br />
As shown in the example above:<br />
<br />
* For the first event, the correct size of the event, including the header, must be calculated and returned<br />
* Subsequent events return the size of the data only, excluding the header. <br />
<br />
<br />
The input parameter "offset" is used to indicate whether the event is the first, last or intermediate. After the last event, the bank is closed.<br />
<br />
The encoding of the data section is left to the user. If the number of words per sub-event is fixed (i.e. NWORDS in the above example), the sub-event extraction by an analyzer is simple. In the case of variable sub-event length, it is necessary to tag the first or the last word of each sub-event.The contents of the sub-event is the choice of the user.<br />
<br />
; Note:<br />
* Since no particular tagging is applied to the Super-Event by the Midas transfer mechanism, the user must provide code in the backend analyzer to interpret the contents of the Super-Event bank(s).<br />
<br />
* If the Super-Event is composed by an equipment on a remote processor running a different '''Endian''' mode than the backend processor, it would be necessary to ensure the data type consistency throughout the Super-Event in order to guarantee the proper byte-swapping of the data content. [[Byte Swap Macros]] are available for this purpose.<br />
<br />
* It may be convenient to change the '''time-stamp''' of the super-event using the [[MIDAS Event Header Macros|TIME_STAMP]] Macro.<br />
<br />
* The ODB key <span style="color: purple; font-style:italic;">/Equipment/<equipment name>/statistics/event rate</span> event rate will indicate the rate of sub-events.</div>Suz