Commit 6375b258 authored by Paolo Baesso's avatar Paolo Baesso

Changed logic of the trigger helper: now a -1 input is not accounted for the…

Changed logic of the trigger helper: now a -1 input is not accounted for the purpose of the N/M majority count. Also changed documentation to reflect the change.
parent 95246510
......@@ -63,7 +63,7 @@ class MyPrompt(Cmd):
print (" Each input can be defined as ACTIVE (1), VETO (0) or DO-NOT-CARE (-1):\n")
print (" - ACTIVE: this input must be asserted for the TLU to generate a trigger.\n If M inputs are defined as ACTIVE, it is possible to require\n that at least N of them are asserted at the same time to have\n a valid TLU trigger.\n Typically, this is the setting to use for scintillators, pulsers, etc.\n")
print (" - VETO: when asserted, the TLU does not issue triggers.\n All VETO inputs must be deasserted in order to have any trigger.\n Use this if you have a INHIBIT signal.\n If you use the TLU SHUTTER functionality\n set the shutter input to VETO to avoid potential issues.\n")
print (" - DNC: the state of these inputs can be either asserted or deasserted.\n Note that only when asserted they contribute to the N/M calculation.\n This can be used for unconnected inputs.\n")
print (" - DNC: the state of these inputs can be either asserted or deasserted.\n They do not contribute to a valid trigger.\n This option can be used for inputs\n that must be timestamped but not take part in the trigger.\nheleda")
def do_readme(self, args):
print ("\n NOTE: this tool provides a quick and simple way to generate the\n configuration words for the TLU trigger.")
......@@ -116,7 +116,7 @@ class MyPrompt(Cmd):
"""Check element-wise but allows for 'do not care' elements"""
# Return 1 if all zeros match and at least "tolerance" ones match
# Return 0 in all other cases
areSame= 1
areSame= 0
matching=0
for iElement in range(len(request)):
if ((request[iElement]== 0) and (pattern[iElement]== 1)):
......@@ -125,8 +125,8 @@ class MyPrompt(Cmd):
return areSame
if ( (request[iElement]== 1) and (pattern[iElement]== 1) ):
matching= matching+1
if ( (request[iElement]== -1) and (pattern[iElement]== 1) ):
matching= matching+1
if ( (request[iElement]== -1) ):
matching= matching
if (matching >=tolerance):
areSame=1
return areSame
......
......@@ -130,13 +130,14 @@ To use the script:
\begin{itemize}
\item In the script folder, type \verb|Python trigger_configuration_helper|. This will open an interactive shell. The shell supports tab-autocompletion.
\item In the shell, type \verb|start|
\item For each of the LEMO trigger inputs, specify if the signal is to be considered ACTIVE or VETO. Active signals must be asserted to create a valid trigger. VETO signals must be de-asserted to create a valid signal. There is also the option to set an input as DO-NOT-CARE (DNC).\\
\item For each of the LEMO trigger inputs, specify if the signal is to be considered ACTIVE or VETO. Active signals must be asserted to create a valid trigger. VETO signals must be de-asserted to create a valid signal. There is also the option to set an input as DO-NOT-CARE (DNC): these inputs are not taken into account for the purpose of trigger generation but they are still time-stamped if asserted.\\
The DNC option can be useful if the user want to connect signals that are not part of the trigger generation but for which it is required to register the status and the time-stamp whenever a valid trigger is produced.\\
The VETO option should be used, for instance, for any inputs that is used as a shutter signal (see section~\ref{ch:shutter}).
\item If more than one active input is present, it is possible to configure the \gls{tlu} to generate a trigger if at least $N$ are asserted (as opposed to all of them). The shell will ask for the minimum number of ACTIVE signals that should be asserted, at the same time, to generate a valid trigger.
\item The shell will produce a list of all the configurations that will produce a valid trigger, followed by the two values to be written in the registers.
\item If the user is happy with those, they can just copy those values and use them to configure the \gls{tlu} for instance by including them in the EUDAQ configuration file. It is always possible to restart the procedure by typing \verb|start| again.
\item Please note that a VETO signal is always prioritized: if a VETO signal is asserted, the \gls{tlu} will not produce any trigger.
\item Also note that a DNC signal can only contribute to the minimum number of active inputs $N$ if asserted.
\item Also note that a DNC signal, even if asserted, does not contribute to the count of the minimum number of active inputs $N$.
\end{itemize}
\begin{alertinfo}{Warning}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment