BNMR: Histograms and Scalers: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
m (8 revisions imported)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  {{Pagelinks}}
  {{Pagelinks}}


== Introduction ==
The data from the {{bnmqr|join=or}} experiments largely consists of histogrammed scaler data.  The scaler data are read from the Multichannel Scaler(s) SIS3801 ({{bnmr}}) or SIS3820 ({{bnqr}}). The scaler data is histogrammed and saved differently depending on whether the run is Type 1 or Type 2.


== Links ==
== Hardware ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[BNMR]]
* [[BNMR: Getting Started]]
</div>
 
= Introduction =
The data from the {{bnmqr|join=or}} experiments largely consists of histogrammed scaler data.  The scaler data are read from the Multichannel Scaler(s) SIS3801
({{bnmr}})  or SIS3820 ({{bnqr}}). The scaler data is histogrammed and saved differently depending on whether the run is Type 1 or Type 2.
 
= Defining the Scalers for the experiment ==
The number of MCS scaler channels that are (or may be) connected to input signals are defined for the  {{bnmqr|join=and}} experiments in the file  {{File|name=febnmr.h}}. These are known as '''Real Scalers''. Since {{bnmr}} experiment has two Scaler Modules (Scalers A and B) and {{bnqr}} has one scaler module (Scaler B), the number of real scaler channels is different for the two experiments. The number of Real Scalers also includes the MCS Channel 1 test clock signal, which is usually enabled on Scaler B, and has no input connected.
 
In addition to Real scalers, there are also a number of '''Calculated Scalers''' defined, for example sums and asymmetry front and back counters, neutral beam counters and  polarimeter.
== Frontend Scaler structures ==
<pre>
DWORD *pfifo_A, *pfifo_B; /* FIFO local buffers */
 
/* Individual scaler channel */
typedef struct {
    double  sum_cycle;  /* cycle scaler sum  - stores the sum of nbins of scaler data for the PPG cycle */
    DWORD  nbins;      /* number of scaler bins defined */
    DWORD  *ps;        /* pointer to nbins of scaler data */
} MSCALER;
</pre>
 
Fundamental structures for reading the scaler data are defined as above. The FIFO local buffers pfifo_A and pfifo_B point to areas of memory which is malloc-ed when the frontend starts (in function bnmr init() called by frontend_init()).  The scaler channel structure is shown above.
 
For each Real Scaler, memory for the nbins of scaler data with pointer ps is malloc-ed at begin-of-run and freed at end-of-run, since the
number of bins requested by the user may change between runs. No memory is malloc-ed for the cumulative scalers, since only the sum is stored.
 
 
== Scaler readout ==
 
The Scaler Modules contain a buffer (FIFO) for the data. This FIFO is larger in the SIS3820 module than the SIS3801, so the SIS3820 can buffer more data. During the PPG cycle, the scaler time bins collect data in turn as the PPG steps through the time bins (via PPG MCS Next output signal connected to Scaler LNE input).
This data is stored in the Scaler FIFO.  During the PPG cycle, the scaler data is read out periodically, ensuring that the FIFO does not become full.
 
The FIFO data is read out (by the FIFO_acq equipment readout routine fifo_acq(...) ) [[#Frontend Scaler structures|FIFO local buffers]] pfifoA and pfifoB.
The selected format of the scaler data is "24-bit", where the channel and user-bits are encoded in the top 8 bits of the 32-bit data word, and the data is in bits 0-23. See Manual for details. 
 
The scaler data are then unpacked and saved in the scaler structure by function scaler_increment(..) called by fifo_acq(). 
 
 
The data in pfifoA and pfifoB is then stored in the scaler structure by
 
 
<pre>
/* Individual scaler channel */
typedef struct {
    double  sum_cycle;  /* cycle histogram sum */
    DWORD  nbins;
    DWORD  *ps;        /* cumulative histogram *//
} MSCALER;
</pre>
 
At the beginning of run, the structure is initialized
 
The number of MCS scaler channels that are or may be connected to input signals (which also includes the MCS Channel 1 test clock signal)
The number of histograms and scaler channels needed are different for Type 1 and Type 2 runs. The values are assigned in febnmr.h.
 
/* Histogram struct for Event builder */
typedef struct {
    double  sum;                    /* not used yet */
    double  bin_max;                /* not used yet */
    DWORD  nbins;
    DWORD  *ph;        /* cumulative histogram over run */
} MHISTO;
MHISTO  histo[N_HISTO_MAX];
MSCALER  scaler[N_SCALER_MAX];    /* max  (real + any calculated) */
 
 
 
 
 
== Cycle Scalers ==
In the [[BNMR: frontend|frontend]], data read from the VME scaler(s) (SIS3801 or SIS3820) after each PPG cycle  (known as ''Cycle Scaler Data'').
The data consists of arrays containing the counts in each time bin for each active input channel. The cycle scaler data are read into
[[#Frontend Histograms|histograms]].
 
Also the data from each scaler channel are summed, and assymmetries and ratios are calculated. The Cycle Scaler data sums and calculated data are output as MIDAS bank HSCL, and sent to the ODB under {{Odbpath|path=/Equipment/Cycle_Scalers}}.
 
For {{bnmr}}, the Front and Back Cycle data sums (Scaler A) are added together and used to check against the threshold. For {{bnqr}} sums of the Neutral Beam counters are used for thresholds.
 
== Frontend Histograms ==
The number of frontend histograms into which the scaler data are saved is greater than the number of active scaler channels. For example, some scaler data are saved in separate histograms according to the helicity.  In the case of Type 1 runs, the histograms are sent out every cycle, whereas for Type 2 the histograms are accumulated in the frontend memory, and sent out every few minutes.  A data logger running on the host computer saves the data onto disk. The data is handled differently for Type 1 and Type 2 runs. For Type 1 runs, the data are saved in a MIDAS file by the MIDAS logger [https://midas.triumf.ca/MidasWiki/index.php/Mlogger|mlogger], and converted to MUD format by the custom logger [[BNMR: mdarc|mdarc]]. For Type 2 runs, [[BNMR: mdarc|mdarc]] saved the data directly in a MUD file, and no MIDAS file is produced.
 
The histograms and data logging will therefore be described separately for Type 1 and Type 2 runs.
 
 
== Scaler Channels : Hardware Connections ==
Currently,  
Currently,  
* experiment  <span style="color:#7b68ee; font-style=italic">bnmr</span> has two SIS3801 scalers known as ''Scaler A'' and ''Scaler B''
* experiment  <span style="color:#7b68ee; font-style=italic">bnmr</span> has two SIS3801 scalers known as ''Scaler A'' and ''Scaler B''
Line 191: Line 102:
<span style=color:red;font-weight:bold>*</span> SIS3820 module has ECL inputs 1-16, NIM 17-32. Therefore BNQR's input channel start at 17 (NIM).
<span style=color:red;font-weight:bold>*</span> SIS3820 module has ECL inputs 1-16, NIM 17-32. Therefore BNQR's input channel start at 17 (NIM).


== Software ==


=== Scaler readout ===


== Midas histograms built in the frontend ==
The Scaler Modules contain a buffer (FIFO) for the data. This FIFO is larger in the SIS3820 module than the SIS3801, so the SIS3820 can buffer more data. During the PPG cycle, the scaler time bins collect data in turn as the PPG steps through the time bins (via PPG MCS Next output signal connected to Scaler LNE input).
Histograms are built in the frontend (VMIC) using the data from the Scalers - see [[#Front-end histograms and Cycle Scalers|Cycle Scalers]].<br>
This data is stored in the Scaler FIFO.  During the PPG cycle, the scaler data is read out periodically, ensuring that the FIFO does not become full.
The scaler inputs are listed in [[#Scaler Channels : Hardware Connections|scaler connections]].  


=== Type 1 Histograms ===
The selected format of the scaler data is "24-bit", where the channel and user-bits are encoded in the top 8 bits of the 32-bit data word, and the data is in bits 0-23. See Manual for details.   
Type 1 histograms
<span style= "color:#FF0000">only includes data from last cycle.</span>
 
==== Scaler A BNMR only ====
 
'''Table 4: Scaler A histograms '''  ({{bnmr}} only)
<table BORDER WIDTH="50%" NOSAVE  style="background-color: #e6e6ff;">
<tr>
<td><b>Scaler A</b></td>
<td>
<center><b>Histogram no.</b></center>
</td>
 
<td>
<center><b>Midas Bankname</b></center>
</td>
</tr>
 
<tr>
<td>sum Back scalers</td>
<td>
<center>h0</center>
</td>
 
<td>
<center>HIBP</center>
</td>
</tr>
 
<tr>
<td>sum Front scalers</td>
<td>
<center>h1</center>
</td>
 
<td>
<center>HIFP</center>
</td>
</tr>
 
<tr>
<td>userbits</td>
<td>
<center>h2</center>
</td>
 
<td>
<center>UBIT</center>
</td>
 
<tr><td colspan=4 style="font-weight:bold; text-align:center; background-color:#ccccff;"> Total number of BNMR Scaler A histograms: 3</td></tr>
</table>
 
==== Scaler B BNMR only ====
The Type 2 histograms built from data from Scaler B are shown in Table 5.
 
'''Table 5 : Scaler B histograms'''  ({{bnmr}})
<table BORDER WIDTH="50%" NOSAVE  style="background-color: #e6e6ff;">
<tr>
<td><b>Scaler B </b></td>
 
<td>
<center><b>Histogram no.</b></center>
</td>
 
<td>
<center><b>Midas Bankname</b></center>
</td>
</tr>
 
<tr>
<td>sum scaler B (scaler clock)</td>
<td>
<center>h3</center>
</td>
 
<td>
<center>HM00</center>
</td>
</tr>
 
<tr>
<td>sum scaler B (fluorescence mon)</td>
<td>
<center>h4</center>
</td>
 
<td>
<center>HM01</center>
</td>
</tr>
 
<tr>
<td>sum scaler B  (pol monitor 1)</td>
<td>
<center>h5</center>
</td>
 
<td>
<center>HM02</center>
</td>
</tr>
 
<tr>
<td>sum scaler B 3 (pol monitor 2)</td>
<td>
<center>h6</center>
</td>
 
<td>
<center>HM03</center>
</td>
</tr>
 
<tr>
<td>sum scaler B (Backwards&nbsp; neutral beam monitors)</td>
<td>
<center>h7</center>
</td>
 
<td>
<center>HM04</center>
</td>
</tr>
 
<tr>
<td>sum scaler B  (Forwards&nbsp; neutral beam monitors)</td>
<td>
<center>h8</center>
</td>
 
<td>
<center>HM05</center>
</td>
</tr>
<tr><td colspan=4 style="font-weight:bold; text-align:center; background-color:#ccccff;"> Total number of BNMR Scaler B histograms: 6</td></tr>
</table>
 
'''Total number of histograms from both scalers: 9 '''  {{bnmr}}
 
==== Scaler B BNQR only ====
The Type 2 histograms built for {{bnqr}} from data from Scaler B are shown in Table 6.  For experiment mode '''1h''' only, four extra histograms are built containing the data from the Alpha counters.
 
'''Table 6 : Scaler B histograms'''  ({{bnqr}})
<table BORDER WIDTH="50%" NOSAVE  style="background-color: #b3ffff;">
<tr>
<td><b>Scaler B </b></td>
 
<td>
<center><b>Histogram no.</b></center>
</td>
 
<td>
<center><b>Midas Bankname</b></center>
</td>
</tr>
 
 
<tr>
<td>sum scaler B (scaler clock)</td>
<td>
<center>h1</center>
</td>
 
<td>
<center>HM00</center>
</td>
</tr>
 
<tr>
<td>sum scaler B (fluorescence mon)</td>
<td>
<center>h2</center>
</td>
 
<td>
<center>HM01</center>
</td>
</tr>
 
<tr>
<td>sum scaler B  (pol monitor 1)</td>
<td>
<center>h3</center>
</td>
 
<td>
<center>HM02</center>
</td>
</tr>
 
<tr>
<td>sum scaler B 3 (pol monitor 2)</td>
<td>
<center>h4</center>
</td>
 
<td>
<center>HM03</center>
</td>
</tr>
 
<tr>
<td>sum scaler B (Backwards&nbsp; neutral beam monitors)</td>
<td>
<center>h5</center>
</td>
 
<td>
<center>HM04</center>
</td>
</tr>
 
<tr>
<td>sum scaler B  (Forwards&nbsp; neutral beam monitors)</td>
<td>
<center>h6</center>
</td>
 
<td>
<center>HM05</center>
</td>
</tr>
 
<tr>
<td>userbits</td>
 
<td>
<center>h7</center>
</td>
 
<td>
<center>UBIT<span style=color:red>**</span></center>
</td>
</tr>
<tr><td colspan=3 style="font-weight:bold; text-align:center; background-color:#e6ffff;"> Total number of BNQR histograms: 7</td></tr>
 
 
<!-- Alpha (1h) -->
<tr><td colspan=3 style="font-weight:bold; text-align:center; background-color:#94b8b8;"> Experiment mode 1h (alpha) only</td></tr>
<tr style="background-color:#94b8b8;">
<td>Alpha1</td>
<td>
<center>h7</center>
</td>
 
<td>
<center>HM06</center>
</td>
</tr>
 
 
<tr style="background-color:#94b8b8;">
<td>Alpha2</td>
<td>
<center>h8</center>
</td>
 
<td>
<center>HM07</center>
</td>
</tr>
 
 
<tr style="background-color:#94b8b8;">
<td>Alpha3</td>
<td>
<center>h9</center>
</td>
 
<td>
<center>HM08</center>
</td>
</tr>
 
 
<tr style="background-color:#94b8b8;">
<td>Alpha4</td>
<td>
<center>h10</center>
</td>
 
<td>
<center>HM09</center>
</td>
</tr>
 
<tr style="background-color:#94b8b8;">
<td>userbits</td>
 
<td>
<center>h11</center>
</td>
 
<td>
<center>UBIT <span style=color:red>**</span></center>
</td>
</tr>
 
<tr><td colspan=4 style="font-weight:bold; text-align:center; background-color:#d1e0e0;"> Total number of BNQR histograms (Mode 1h Alpha): 11</td></tr>
</table>
 
;NOTE
:<span style=color:red>**</span> Userbit bank is always the final bank
 
 
=== Type 2 Histograms ===
 
For Type 2 (TD style), Midas histograms are built in the PPC frontend.
<p><font color="#FF0000">Histograms accumulate through the run</font> and are sent periodically
to be saved by the data logger [[BNMR: mdarc|mdarc]].
 
==== Scaler A BNMR only ====
The histograms built with data from Scaler A are shown in Table 7. Note that the fifth histogram (userbits) is built
in the frontend for BNMR Mode 2s only.
 
 
'''Table 7: Scaler A histograms '''  ({{bnmr}} only)
<table BORDER COLS=6 WIDTH=50% style="background-color: #e6e6ff;" NOSAVE >
<tr style="text-align:center;font-weight:bold">
<td>
Contents
</td>
 
<td>Helicity </td>
 
<td>
Bank Name
</td>
 
<td>
Histogram Name
</td>
</tr>
 
<tr style="text-align:center;">
<td>Back Scalers '''+'''</td>
 
<td>1</td>
 
<td>HIBP</td>
<td>B+</td>
</tr>
 
<tr style="text-align:center;">
<td>Front Scalers '''+'''</td>
 
<td>1</td>
 
<td>HIFP</td>
 
<td>F+</td>
</tr>
 
<tr style="text-align:center;">
<td>Back Scalers '''-'''</td>
 
<td>0</td>
 
<td>HIBN</td>
 
<td>B-</td>
</tr>
 
<tr style="text-align:center;">
<td>Front Scalers '''-'''</td>
 
<td>0</td>
 
<td>HIFN</td>
 
<td>F-</td>
 
<tr style="text-align:center;">
<td>Userbits</td>
 
<td>n/a</td>
 
<td>USER</td>
 
<td></td>
 
 
</tr>
</table>
 
==== Scaler B  BNMR and BNQR ====
The following histograms using data from Scaler B are sent out for {{bnmr}} and all {{bnqr}} modes except
for Sample/Reference and Alpha Modes. See
[[#BNQR Sample/Reference Mode|Sample/Reference histograms]] and [[BNQR Alpha Mode (2h)#Alpha Histograms]] for details.
<br>10 Histograms from Scaler B:
<br>Total histograms&nbsp; : 10 for <font color="#33CC00">BNQR</font>,
14 for <font color="#3366FF">BNMR</font>
<br>&nbsp;
 
'''Table 8: Scaler B histograms '''  ({{bnmr}} and {{bnqr}})
<table BORDER COLS=6 WIDTH=50% style="background-color: whitesmoke;" NOSAVE >
<tr style="text-align:center;font-weight:bold">
<td>
Contents
</td>
 
<td>Helicity </td>
 
<td>
<center>Scaler</center>
</td>
 
<td>
Bank Name
</td>
 
<td>
Histogram Name
</td>
</tr>
 
<tr style="text-align:center;">
<td>Reference Ticks</td>
<td>n/a</td>
 
<td>B</td>
 
<td>HMF1</td>
 
<td>Const</td>
</tr>
 
<tr style="text-align:center;">
<td>Fluorescence monitor</td>
 
<td>n/a</td>
 
<td>B</td>
 
<td>HMF2</td>
 
<td>FluM2</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Left '''+'''</td>
 
<td>1</td>
 
<td>B</td>
 
<td>HMLP</td>
 
<td>L+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Right '''+'''</td>
 
<td>1</td>
 
<td>B</td>
 
<td>HMRP</td>
 
<td>R+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Left '''-'''</td>
 
<td>0</td>
 
<td>b</td>
 
<td>HMLN</td>
 
<td>L-</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimater Right&nbsp; '''-'''</td>
 
<td>0</td>
 
<td>B</td>
 
<td>HMRN</td>
 
<td>R-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''+'''</td>
 
<td>1</td>
 
<td>B</td>
 
<td>HMBP</td>
<td>NBMB+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''+'''</td>
 
<td>1</td>
 
<td>B</td>
 
<td>HMFP</td>
 
<td>NBMF+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''-'''</td>
 
<td>0</td>
 
<td>B</td>
 
<td>HMBN</td>
 
<td>NBMB-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''-'''</td>
 
<td>0</td>
 
<td>B</td>
 
<td>HMFN</td>
 
<td>NBMF-</td>
</tr>
</table>
 
 
==== Scaler B BNQR Sample/Reference Mode ====
Some of the modes on BNQR can be run in sample/reference mode. An external signal is alternately turned on/off and the scaler data is sent to a different set of histograms depending on the state of the sample/reference signal.  This mode is not supported for {{bnmr}}.
 
'''Table 9a: Scaler B histograms '''  {{bnqr}}  sample/reference
<table BORDER COLS=6 WIDTH=50% style="background-color: #b3ffff;">
<tr style="text-align:center; font-weight:bold; background-color: #20b2aa;">
<td>
Contents
</td>
 
<td>Helicity </td>
 
<td>
<center>Sample/Ref</center>
</td>
 
<td>
Bank Name
</td>
 
<td>
Histogram Name
</td>
</tr>
 
<tr style="text-align:center;">
<td>Reference Ticks</td>
<td>n/a</td>
 
<td>n/a</td>
 
<td>HMF1</td>
 
<td>Const</td>
</tr>
 
<tr style="text-align:center;">
<td>Fluorescence monitor</td>
 
<td>n/a</td>
 
<td>n/a</td>
 
<td>HMF2</td>
 
<td>FluM2</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Left '''+'''</td>
 
<td>1</td>
 
<td>R</td>
 
<td>HMLP</td>
 
<td>L+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Right '''+'''</td>
 
<td>1</td>
 
<td>R</td>
 
<td>HMRP</td>
 
<td>R+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Left '''-'''</td>
 
<td>0</td>
 
<td>R</td>
 
<td>HMLN</td>
 
<td>L-</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimater Right&nbsp; '''-'''</td>
 
<td>0</td>
 
<td>R</td>
 
<td>HMRN</td>
 
<td>R-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''+'''</td>
 
<td>1</td>
 
<td>R</td>
 
<td>HMBP</td>
<td>NBMB+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''+'''</td>
 
<td>1</td>
 
<td>R</td>
 
<td>HMFP</td>
 
<td>NBMF+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''-'''</td>
 
<td>0</td>
 
<td>R</td>
 
<td>HMBN</td>
 
<td>NBMB-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''-'''</td>
 
<td>0</td>
 
<td>R</td>
 
<td>HMFN</td>
 
<td>NBMF-</td>
 
<!-- Sample -->
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>Polarimeter Left '''+'''</td>
 
<td>1</td>
 
<td>S</td>
 
<td>HMLP</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>Polarimeter Right '''+'''</td>
 
<td>1</td>
 
<td>S</td>
 
<td>HMRP</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>Polarimeter Left '''-'''</td>
 
<td>0</td>
 
<td>S</td>
 
<td>HMLN</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>Polarimater Right&nbsp; '''-'''</td>
 
<td>0</td>
 
<td>S</td>
 
<td>HMRN</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>&nbsp;Neutral Beam Backwards '''+'''</td>
 
<td>1</td>
 
<td>S</td>
 
<td>HMBP</td>
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>&nbsp;Neutral Beam Forwards '''+'''</td>
 
<td>1</td>
 
<td>S</td>
 
<td>HMFP</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>&nbsp;Neutral Beam Backwards '''-'''</td>
 
<td>0</td>
 
<td>S</td>
 
<td>HSBN</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#4dffd2;">
<td>&nbsp;Neutral Beam Forwards '''-'''</td>
 
<td>0</td>
 
<td>S</td>
 
<td>HSFN</td>
 
<td></td>
</tr>
</table>
 
 
 
 
 
==== Scaler B BNQR Alpha Mode (2h) ====
Alpha Mode (mode 2h) involves very long histograms with a very short bin width. To save space, histograms for the Reference Clock and Fluorescence Monitor are not saved. Furthermore, if the total number of bins requested for all histograms exceeds the maximum event size allowed by MIDAS, the histogram bin size for all histograms will be reduced to 16 bits from 32 (the default). The histograms will be sent out from the frontend in 4 chunks, and reassembled by the data logger (mdarc) before being saved. The histograms sent from the frontend in Alpha Mode are shown in Table 10. Alpha mode is not supported for {{bnmr}}.
 
'''Table 10: Scaler B histograms '''  {{bnqr}} Alpha Mode
<table BORDER COLS=6 WIDTH=50% style="background-color: #b3ffff;" NOSAVE >
<tr style="text-align:center;font-weight:bold; background-color: #20b2aa;">
<td>
Contents
</td>
 
<td>Helicity </td>
 
<td>
Bank Name
</td>
 
<td>
Histogram Name
</td>
</tr>
 
 
<tr style="text-align:center;">
<td>Polarimeter Left '''+'''</td>
 
<td>1</td>
 
<td>HMLP</td>
 
<td>L+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Right '''+'''</td>
 
<td>1</td>
 
<td>HMRP</td>
 
<td>R+</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimeter Left '''-'''</td>
 
<td>0</td>
 
<td>HMLN</td>
 
<td>L-</td>
</tr>
 
<tr style="text-align:center;">
<td>Polarimater Right&nbsp; '''-'''</td>
 
<td>0</td>
 
<td>HMRN</td>
 
<td>R-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''+'''</td>
 
<td>1</td>
 
<td>HMBP</td>
<td>NBMB+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''+'''</td>
 
<td>1</td>
 
<td>HMFP</td>
 
<td>NBMF+</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Backwards '''-'''</td>
 
<td>0</td>
 
<td>HMBN</td>
 
<td>NBMB-</td>
</tr>
 
<tr style="text-align:center;">
<td>&nbsp;Neutral Beam Forwards '''-'''</td>
 
<td>0</td>
 
<td>HMFN</td>
 
<td>NBMF-</td>
</tr>
 
 
 
<tr style="text-align:center;background-color:#94b8b8;">
<td>Alpha1'''+'''</td>
 
<td>1</td>
 
<td>HA0P</td>
 
<td></td>
</tr>
 
 
<tr style="text-align:center;background-color:#94b8b8;">
<td>Alpha2'''+'''</td>
 
<td>1</td>
 
<td>HA1P</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#94b8b8;">
<td>Alpha3'''+'''</td>
 
<td>1</td>
 
<td>HA2P</td>
 
<td></td>
</tr>
 
<tr style="text-align:center;background-color:#94b8b8;">
<td>Alpha4'''+'''</td>
 
<td>1</td>
 
<td>HA3P</td>
 
<td></td>
</tr>
 
 
<tr style="text-align:center;background-color:#94b8b8;">
<td>Alpha1'''-'''</td>
 
<td>0</td>
 
<td>HA0N</td>
 
<td></td>
</tr>


=== Histograms ===
Histograms are built by a combination of the [[BNMR:_frontend|frontend]] and the [[BNMR:_Data_Logging#Histograms|data logger]]. Various manipulations can be performed on the data read from the scalers, with different manipulations for Type 1 (TI/integral) and Type 2 (TD/time-differential) modes.


<tr style="text-align:center;background-color:#94b8b8;">
==== Type 1 histograms ====
<td>Alpha2'''-'''</td>
The final output of Type 1 (integral) runs are histograms with one bin per cycle/super-cycle. I.e. if the MCS has 100 bins per PPG cycle and we run for 20 cycles, the final histogram will be 20 bins long. In general all 100 time bins are summed together to create the final output bin. The final histogram is effectively an array of counts per cycle as the run progresses.


<td>0</td>
The '''frontend''' does very little manipulation to the data, and just sends the full data for each cycle to the MUD logger.


<td>HA1N</td>
The '''logger''' can perform a few manipulations on the data:
* Create separate histograms based on the helicity polarity, with <code>+</code> or <code>-</code> appended to the histogram title. If the helicity is <code>+</code> and the data for a cycle looks like <code>1,2,3,4</code>, <code>10</code> would be appended to <code>histo_name+</code> and 0 appended to <code>histo_name-</code>.
* Create separate histograms based on the user bits. This is currently quite specific, with hard-coded suffixes like <code>_frq0</code> and <code>_ref0</code> appended to the histogram titles. If the data for a cycle looks like <code>1,2,3,4</code> with corresponding user bits <code>0,2,0,2</code>, <code>4</code> would be appended to <code>histo_name_frq0</code> and 6 appended to <code>histo_name_ref0</code>
* Create separate histograms based on bin ranges. Some modes state that certain ranges of bins should be summed separately (e.g. a signal region and a background region). The configuration is generally set up by the RF calculator, which can set both the bin ranges and the suffixes to add to the histogram ranges.


<td></td>
==== Type 2 histograms ====
</tr>
The final output of Type 2 (differential) runs are histograms with one bin per time bin. I.e. if the MCS has 100 bins per PPG cycle and we run for 20 cycles, the final histogram will be 100 bins long.


<tr style="text-align:center;background-color:#94b8b8;">
The '''frontend''' can perform a few manipulations on the data:
<td>Alpha3'''-'''</td>
* Create separate histograms based on the helicity polarity.
* Create separate histograms based on the microwave sample/reference state (for some {{bnqr}} modes).


<td>0</td>
The '''logger''' does very little manipulation to the data, and just writes the banks it receives from the frontend as MUD histograms.


<td>HA2N</td>
=== Software scalers ===
The frontend can compute various numerical values based on the data read from the MCS. The values can be:
* Per-run or per-cycle
* Sums of one or more channels
* Ratios/asymmetries of two channels
* Specific or agnostic to a helicity polarity, microwave sample/reference state, user bit value


<td></td>
These values can be recorded in EPICS, in the ODB, and as a bank sent to the logger (called <code>HSCL</code>). Many of these values are shown on the status page of the experiment. The MUD logger only writes the values to file for type 2 runs (historical reasoning unknown).
</tr>


<tr style="text-align:center;background-color:#94b8b8;">
=== Configuration ===
<td>Alpha4'''-'''</td>


<td>0</td>
The frontend configuration is rather complex, but doesn't change often, so is done in the frontend code itself. This includes defining the midas bank names that will be used to send data to the logger.


<td>HA3N</td>
The MUD logging configuration is done via the ODB at {{Odbpath|path=/MUD Logging/Histos/Settings}}. This includes specifying what to do with each midas bank that the logger receives from the frontend. It is most easily edited using the [[BNMR:_Custom_Logging_page|logging webpage]].


<td></td>
[[Category:BNMR]]
</tr>
</table>

Latest revision as of 16:54, 29 April 2022

Introduction

The data from the bnmr or bnqr experiments largely consists of histogrammed scaler data. The scaler data are read from the Multichannel Scaler(s) SIS3801 (bnmr) or SIS3820 (bnqr). The scaler data is histogrammed and saved differently depending on whether the run is Type 1 or Type 2.

Hardware

Currently,

  • experiment bnmr has two SIS3801 scalers known as Scaler A and Scaler B
  • experiment bnqr has one SIS3820 scaler, Scaler B
NOTE
The sis3820 scaler is needed for bnqr alpha mode as it has a larger buffer and greater resolution.

BNMR

BNQR has two scalers (SIS3801E), Scaler A and Scaler B.

Scaler A

Table 1 : BNMR Scaler A Channels
Scaler Module Channel Contents
A SIS3801 1 Front scalers (16 segments summed in hardware)
2 Front scalers (16 segments summed in hardware)
Total number of real scaler inputs : 2

Scaler B

Input signals are not usually attached to the lowest two channels in Scaler B (Scaler Internal Clock and Fluorescence Monitor).

The data from the first input (Scaler Internal Clock) is used for testing as it should have a constant value in all bins. An external signal (e.g. pulser) is sometimes input to the Fluorescence Monitor input for testing. The data from these inputs is read out and histogrammed.

Table 2 : BNMR Scaler B Channels
Scaler Module Channel Contents
B SIS3801 1 Scaler Internal Clock (not connected)
2 Fluorescence Monitor (not used)
3,4 Polarimeter counters (2)
5,6,7,8 Neutral Beam Forwards counters (4)
9,10,11,12 Neutral Beam Backwards counters (4)
Total number of real scaler inputs : 12


BNQR

Scaler B

BNQR has only one scaler (SIS3820), Scaler B.

Input signals are not usually attached to the lowest two channels (Scaler Internal Clock and Flueorescence Monitor). The data from the first input (Scaler Internal Clock) is used for monitoring, as it should have a constant value in all bins. An external signal (e.g. pulser) is sometimes input to the Fluorescence Monitor input for testing. The data from these inputs is read out and histogrammed in all experimental modes except Mode 2h (Alpha mode).


Table 3 : BNQR Scaler B Channels
Scaler Module Channel Contents Scaler Channel Active
Non-alpha Modes * 1h ** 2h
B SIS3820 * 1 Scaler Internal Clock (not connected) Y Y N *
17 Fluorescence Monitor (not used) Y Y N *
18,19 Polarimeter counters (2) Y Y Y
20 Neutral Beam Forwards counter (summed in hardware) Y Y Y
21 Neutral Beam Backwards counter (summed in hardware) Y Y Y
22 Left.Alpha (ALPHA1) N Y Y
23 Right.Alpha (ALPHA2) N Y Y
24 Left.AlphaBar (ALPHA3) N Y Y
25 Right.AlphaBar (ALPHA4) N Y Y
Total number of real scaler inputs 6 10 8
NOTES

The highest four Scaler inputs are used for the Alpha Counters. These are ignored in all experimental modes except for

  • 1h * (i.e. experimental mode "1f" where the Alpha counters have been selected)
  • 2h ** (Alpha mode)

** In Alpha mode the two lowest scaler channels (see above) are ignored in order to save memory.

* SIS3820 module has ECL inputs 1-16, NIM 17-32. Therefore BNQR's input channel start at 17 (NIM).

Software

Scaler readout

The Scaler Modules contain a buffer (FIFO) for the data. This FIFO is larger in the SIS3820 module than the SIS3801, so the SIS3820 can buffer more data. During the PPG cycle, the scaler time bins collect data in turn as the PPG steps through the time bins (via PPG MCS Next output signal connected to Scaler LNE input). This data is stored in the Scaler FIFO. During the PPG cycle, the scaler data is read out periodically, ensuring that the FIFO does not become full.

The selected format of the scaler data is "24-bit", where the channel and user-bits are encoded in the top 8 bits of the 32-bit data word, and the data is in bits 0-23. See Manual for details.

Histograms

Histograms are built by a combination of the frontend and the data logger. Various manipulations can be performed on the data read from the scalers, with different manipulations for Type 1 (TI/integral) and Type 2 (TD/time-differential) modes.

Type 1 histograms

The final output of Type 1 (integral) runs are histograms with one bin per cycle/super-cycle. I.e. if the MCS has 100 bins per PPG cycle and we run for 20 cycles, the final histogram will be 20 bins long. In general all 100 time bins are summed together to create the final output bin. The final histogram is effectively an array of counts per cycle as the run progresses.

The frontend does very little manipulation to the data, and just sends the full data for each cycle to the MUD logger.

The logger can perform a few manipulations on the data:

  • Create separate histograms based on the helicity polarity, with + or - appended to the histogram title. If the helicity is + and the data for a cycle looks like 1,2,3,4, 10 would be appended to histo_name+ and 0 appended to histo_name-.
  • Create separate histograms based on the user bits. This is currently quite specific, with hard-coded suffixes like _frq0 and _ref0 appended to the histogram titles. If the data for a cycle looks like 1,2,3,4 with corresponding user bits 0,2,0,2, 4 would be appended to histo_name_frq0 and 6 appended to histo_name_ref0
  • Create separate histograms based on bin ranges. Some modes state that certain ranges of bins should be summed separately (e.g. a signal region and a background region). The configuration is generally set up by the RF calculator, which can set both the bin ranges and the suffixes to add to the histogram ranges.

Type 2 histograms

The final output of Type 2 (differential) runs are histograms with one bin per time bin. I.e. if the MCS has 100 bins per PPG cycle and we run for 20 cycles, the final histogram will be 100 bins long.

The frontend can perform a few manipulations on the data:

  • Create separate histograms based on the helicity polarity.
  • Create separate histograms based on the microwave sample/reference state (for some bnqr modes).

The logger does very little manipulation to the data, and just writes the banks it receives from the frontend as MUD histograms.

Software scalers

The frontend can compute various numerical values based on the data read from the MCS. The values can be:

  • Per-run or per-cycle
  • Sums of one or more channels
  • Ratios/asymmetries of two channels
  • Specific or agnostic to a helicity polarity, microwave sample/reference state, user bit value

These values can be recorded in EPICS, in the ODB, and as a bank sent to the logger (called HSCL). Many of these values are shown on the status page of the experiment. The MUD logger only writes the values to file for type 2 runs (historical reasoning unknown).

Configuration

The frontend configuration is rather complex, but doesn't change often, so is done in the frontend code itself. This includes defining the midas bank names that will be used to send data to the logger.

The MUD logging configuration is done via the ODB at /MUD Logging/Histos/Settings. This includes specifying what to do with each midas bank that the logger receives from the frontend. It is most easily edited using the logging webpage.