\hypertarget{HFC_8c}{
\section{HFC.c File Reference}
\label{HFC_8c}\index{HFC.c@{HFC.c}}
}
Heavy Ion Filter Code.  


{\tt \#include $<$XFC/HFC.h$>$}\par
{\tt \#include $<$XFC/HFC\_\-cfg.h$>$}\par
{\tt \#include $<$XFC/HFC\_\-status.h$>$}\par
{\tt \#include $<$EFC/EDM.h$>$}\par
{\tt \#include $<$EFC/EFC\_\-edsFw.h$>$}\par
{\tt \#include $<$EFC/EFC.h$>$}\par
{\tt \#include $<$HFC\_\-def.h$>$}\par
{\tt \#include $<$HFC\_\-resultDef.h$>$}\par
{\tt \#include $<$TOV.h$>$}\par
{\tt \#include $<$EDS/EDS\_\-fw.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-gem.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-gemLocate.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-dir.h$>$}\par
{\tt \#include $<$EDS/ECR\_\-cal.h$>$}\par
{\tt \#include $<$EDS/EDR\_\-cal.h$>$}\par
{\tt \#include $<$EDS/EDR\_\-calUnpack.h$>$}\par
{\tt \#include $<$CDM/CDM\_\-pubdefs.h$>$}\par
{\tt \#include $<$PBI/FFS.ih$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{HFC_8c_6fb91b294ccf8965bc88949a4e33d503}{
\#define \textbf{\_\-code}~EDM\_\-CODE}
\label{HFC_8c_6fb91b294ccf8965bc88949a4e33d503}

\item 
\hypertarget{HFC_8c_d5eb6fd7f4ead21c6957592c4ab3c0de}{
\#define \textbf{\_\-info}(...)}
\label{HFC_8c_d5eb6fd7f4ead21c6957592c4ab3c0de}

\item 
\hypertarget{HFC_8c_51bd585db625919309b0488c30f8f331}{
\#define \textbf{\_\-debug}(...)}
\label{HFC_8c_51bd585db625919309b0488c30f8f331}

\item 
\hypertarget{HFC_8c_d653594af099e48115992b6fa1d5cf93}{
\#define \textbf{\_\-display\_\-logcnt}(\_\-ncol, \_\-logcnt)}
\label{HFC_8c_d653594af099e48115992b6fa1d5cf93}

\item 
\hypertarget{HFC_8c_7faaa34fc36a03a84f01143f9e589b92}{
\#define \textbf{\_\-display\_\-failure}(\_\-ncol, \_\-msg)}
\label{HFC_8c_7faaa34fc36a03a84f01143f9e589b92}

\item 
\hypertarget{HFC_8c_bc85769c435f90e1e80db35e729bea18}{
\#define \textbf{\_\-display\_\-tolerance}(\_\-ncol, tolerance)}
\label{HFC_8c_bc85769c435f90e1e80db35e729bea18}

\item 
\hypertarget{HFC_8c_fcdad10812436be9b7418cb973640975}{
\#define \textbf{\_\-display\_\-energies}(\_\-ncol, \_\-ex0, \_\-ey0, \_\-ex1, \_\-threshold)}
\label{HFC_8c_fcdad10812436be9b7418cb973640975}

\item 
\hypertarget{HFC_8c_0d11142a878487d54d83859fb98911ce}{
\#define \textbf{\_\-display\_\-separator}(\_\-ncol, \_\-nbeg, \_\-code)}
\label{HFC_8c_0d11142a878487d54d83859fb98911ce}

\item 
\hypertarget{HFC_8c_466fdb833fbea0e5a6d5c3c04b867621}{
\#define \textbf{\_\-display\_\-values}(\_\-ncol, \_\-nbeg, \_\-cnt, \_\-e, \_\-threshold, \_\-n)}
\label{HFC_8c_466fdb833fbea0e5a6d5c3c04b867621}

\item 
\hypertarget{HFC_8c_7d0a89b10e4e4832d7bcf817d928a625}{
\#define \textbf{\_\-display\_\-layer\_\-title}(\_\-ncol, \_\-nbeg, \_\-cnt, \_\-name)}
\label{HFC_8c_7d0a89b10e4e4832d7bcf817d928a625}

\item 
\hypertarget{HFC_8c_6a32917d12104058eece9ded66f690bb}{
\#define \textbf{\_\-display\_\-tower\_\-title}(\_\-ncol, \_\-nbeg, \_\-itwr)}
\label{HFC_8c_6a32917d12104058eece9ded66f690bb}

\item 
\hypertarget{HFC_8c_4c8b0e6729427c6799e06c3262ce673f}{
\#define \textbf{\_\-display\_\-layer\_\-hits}(\_\-ncol, \_\-nx0, \_\-ny0, \_\-nx1, \_\-status)}
\label{HFC_8c_4c8b0e6729427c6799e06c3262ce673f}

\item 
\hypertarget{HFC_8c_61d2942cd4c7eed5d83114fb86403918}{
\#define \textbf{\_\-display\_\-title\_\-bar}(\_\-ixb)}
\label{HFC_8c_61d2942cd4c7eed5d83114fb86403918}

\item 
\hypertarget{HFC_8c_628d0d427746b0194a101f0c605756b3}{
\#define \textbf{\_\-regenerate\_\-title\_\-bar}()}
\label{HFC_8c_628d0d427746b0194a101f0c605756b3}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline int \hyperlink{HFC_8c_41c39220eb2b5d52c8cfe57706d196d0}{isVetoed} (unsigned int status, unsigned int vetoes)
\begin{CompactList}\small\item\em Checks whether any of the veto bits are up. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{HFC_8c_6a3796da34263f8b5809d1486b0b4b7f}{hfcFilter} (\hyperlink{struct__HFC}{HFC} $\ast$hfc, unsigned int pktBytes, EBF\_\-pkt $\ast$pkt, EBF\_\-siv siv, EDS\_\-fwIxb $\ast$ixb, unsigned int vetoes, \hyperlink{struct__HFC__result}{HFC\_\-result} $\ast$result)
\begin{CompactList}\small\item\em Determines the fate of 1 event. \item\end{CompactList}\item 
static int \hyperlink{HFC_8c_7a586c9a90f9a01397b0451d6570d4c4}{compileCfgPrms} (\hyperlink{struct__HfcCfgPrms}{HfcCfgPrms} $\ast$cfg, const HFC\_\-DB\_\-prms $\ast$prms)
\begin{CompactList}\small\item\em Compiles/commits the set of user defined parameters into the the configuration block. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_4b90aceea99ed21f2343cc134f1156a7}{HFC\_\-sizeof} (int cnt)
\begin{CompactList}\small\item\em Sizes the heavy ion filtering control structure. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_2a6c2bd39d3d6f3d39a5f10c90385c1b}{HFC\_\-cfgSizeof} (void)
\begin{CompactList}\small\item\em Sizes the heavy ion filtering configuration as it is used in the actual filtering progam. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_610a059315477fca9207ba12c701f09f}{HFC\_\-resultSizeof} (const \hyperlink{struct__HFC}{HFC} $\ast$hfc)
\begin{CompactList}\small\item\em Returns the size, in bytes, of one result vector. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_e43c5d71a4b0f5f2fb1bbd237159384a}{HFC\_\-cfgCompile} (\hyperlink{struct__HFC__cfg}{HFC\_\-cfg} $\ast$cfg, const HFC\_\-DB\_\-prms $\ast$prms)
\begin{CompactList}\small\item\em Implements the transformation of the configuration parameters as specified by the user, {\em cfg\/}, into the internal form, {\em ctlCfg\/}. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_1c134bb50f5ae32847a11dd44d45aba4}{HFC\_\-cfgSchemaCompile} (\hyperlink{struct__HFC__cfg}{HFC\_\-cfg} $\ast$cfg, const HFC\_\-DB\_\-schema $\ast$schema)
\begin{CompactList}\small\item\em Implements the transformation of the configuration parameters as specified by the user, {\em cfg\/}, into the internal form, {\em ctlCfg\/}. \item\end{CompactList}\item 
\hyperlink{struct__HFC__cfg}{HFC\_\-cfg} $\ast$ \hyperlink{HFC_8c_d8f533b98284ba251eee31e31a572082}{HFC\_\-cfgSet} (\hyperlink{struct__HFC}{HFC} $\ast$hfc, \hyperlink{struct__HFC__cfg}{HFC\_\-cfg} $\ast$cfg)
\begin{CompactList}\small\item\em Makes the specified internal representation of the configuration parameters the current active one. \item\end{CompactList}\item 
static int \_\-\_\-inline \hyperlink{HFC_8c_5af8d6780857c92100a53d62829a0604}{dir\_\-check} (int status, EBF\_\-dir $\ast$dir, int dir\_\-status)
\begin{CompactList}\small\item\em Check the directory status. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{HFC_8c_3b0ee40ba7629437c7323a79a0152382}{cal\_\-check} (const \hyperlink{struct__HfcCfgCal}{HfcCfgCal} $\ast$cfg, const EDR\_\-cal $\ast$cal, int status, int vetoes, \hyperlink{struct__HFC__result}{HFC\_\-result} $\ast$result)
\begin{CompactList}\small\item\em Does the CAL based checking of the CNO filter. \item\end{CompactList}\item 
int \hyperlink{HFC_8c_d826c4019674d8df0ae91078bbe2a074}{HFC\_\-filter} (\hyperlink{struct__HFC}{HFC} $\ast$hfc, unsigned int pktBytes, EBF\_\-pkt $\ast$pkt, EBF\_\-siv siv, EDS\_\-fwIxb $\ast$ixb, unsigned int vetoes, \hyperlink{struct__HFC__result}{HFC\_\-result} $\ast$result)
\begin{CompactList}\small\item\em Determines the fate of 1 event. \item\end{CompactList}\item 
unsigned int \hyperlink{HFC_8c_dd5b78a1083dfd782121763f4412fe72}{HFC\_\-fwNeeds} (void)
\begin{CompactList}\small\item\em Returns a bit mask of the EDS\_\-fw needs. \item\end{CompactList}\item 
unsigned int \hyperlink{HFC_8c_977c35e1f2615c6aef3c7907b52fd417}{HFC\_\-fwObjects} (void)
\begin{CompactList}\small\item\em Returns a bit mask of the EDS\_\-fw objects used by the heavy ion filter. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Heavy Ion Filter Code. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}
   CVS $Id: HFC.c,v 1.9 2012/11/30 18:05:29 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{HFC_8c_3b0ee40ba7629437c7323a79a0152382}{
\index{HFC.c@{HFC.c}!cal\_\-check@{cal\_\-check}}
\index{cal\_\-check@{cal\_\-check}!HFC.c@{HFC.c}}
\subsubsection[{cal\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int cal\_\-check (const {\bf HfcCfgCal} $\ast$ {\em cfg}, \/  const EDR\_\-cal $\ast$ {\em cal}, \/  int {\em status}, \/  int {\em vetoes}, \/  {\bf HFC\_\-result} $\ast$ {\em result})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{HFC_8c_3b0ee40ba7629437c7323a79a0152382}


Does the CAL based checking of the CNO filter. 

\begin{Desc}
\item[Returns:]The updated status value\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cfg}]The CNO CAL configuration cuts \item[{\em cal}]The unpacked CAL data \item[{\em status}]The status of the CNO filter to this point \item[{\em vetoes}]The bit mask of active vetoes \item[{\em result}]The result vector to fill out \end{description}
\end{Desc}


References \_\-HFC\_\-result::energies, \_\-HfcCfgCal::ethreshold, HFC\_\-STATUS\_\-M\_\-LYR\_\-COUNTS, HFC\_\-STATUS\_\-M\_\-LYR\_\-ENERGY, HFC\_\-STATUS\_\-M\_\-STAGE\_\-CAL\_\-ECHK, HFC\_\-STATUS\_\-M\_\-STAGE\_\-CAL\_\-LCHK, HFC\_\-STATUS\_\-M\_\-VETOED, ievt\_\-store, isVetoed(), \_\-HFC\_\-result::logcnt, \_\-HFC\_\-result::nl, \_\-HfcCfgCal::nmaxlogs, and \_\-HfcCfgCal::tolerance.

Referenced by hfcFilter().\hypertarget{HFC_8c_7a586c9a90f9a01397b0451d6570d4c4}{
\index{HFC.c@{HFC.c}!compileCfgPrms@{compileCfgPrms}}
\index{compileCfgPrms@{compileCfgPrms}!HFC.c@{HFC.c}}
\subsubsection[{compileCfgPrms}]{\setlength{\rightskip}{0pt plus 5cm}static int compileCfgPrms ({\bf HfcCfgPrms} $\ast$ {\em cfg}, \/  const HFC\_\-DB\_\-prms $\ast$ {\em prms})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{HFC_8c_7a586c9a90f9a01397b0451d6570d4c4}


Compiles/commits the set of user defined parameters into the the configuration block. 

\begin{Desc}
\item[Returns:]0 is success, -1 if failure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cfg}]The destination parameter configuration block \item[{\em prms}]The set of user configuration parameters \end{description}
\end{Desc}


References \_\-HfcCfgPrms::acd, \_\-HfcCfgPrms::cal, \_\-HfcCfgCal::ethreshold, \_\-HfcCfgCal::nmaxlogs, \_\-HfcCfgTkr::placeholder, \_\-HfcCfgAcd::placeholder, \_\-HfcCfgPrms::tkr, and \_\-HfcCfgCal::tolerance.

Referenced by HFC\_\-cfgCompile().\hypertarget{HFC_8c_5af8d6780857c92100a53d62829a0604}{
\index{HFC.c@{HFC.c}!dir\_\-check@{dir\_\-check}}
\index{dir\_\-check@{dir\_\-check}!HFC.c@{HFC.c}}
\subsubsection[{dir\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}static int \_\-\_\-inline dir\_\-check (int {\em status}, \/  EBF\_\-dir $\ast$ {\em dir}, \/  int {\em dir\_\-status})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{HFC_8c_5af8d6780857c92100a53d62829a0604}


Check the directory status. 

\begin{Desc}
\item[Returns:]Updated status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em status}]The status \item[{\em dir}]The directory \item[{\em dir\_\-status}]The directory status \end{description}
\end{Desc}


References HFC\_\-STATUS\_\-M\_\-ERR\_\-CTB, HFC\_\-STATUS\_\-M\_\-ERR\_\-DIR, HFC\_\-STATUS\_\-M\_\-VETOED, and not\_\-only\_\-tkr\_\-fifo\_\-overflow().

Referenced by hfcFilter().\hypertarget{HFC_8c_e43c5d71a4b0f5f2fb1bbd237159384a}{
\index{HFC.c@{HFC.c}!HFC\_\-cfgCompile@{HFC\_\-cfgCompile}}
\index{HFC\_\-cfgCompile@{HFC\_\-cfgCompile}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-cfgCompile}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-cfgCompile ({\bf HFC\_\-cfg} $\ast$ {\em cfg}, \/  const HFC\_\-DB\_\-prms $\ast$ {\em prms})}}
\label{HFC_8c_e43c5d71a4b0f5f2fb1bbd237159384a}


Implements the transformation of the configuration parameters as specified by the user, {\em cfg\/}, into the internal form, {\em ctlCfg\/}. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Successful \item[{\em -1}]Unrecognized or non-backwardly compatiable user configuration version number.\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cfg}]Filled in with the internal form of the configuration parameters \item[{\em prms}]The configuration parameters \end{description}
\end{Desc}


References compileCfgPrms(), and \_\-HFC\_\-cfg::prms.

Referenced by HFC\_\-cfgSchemaCompile().\hypertarget{HFC_8c_1c134bb50f5ae32847a11dd44d45aba4}{
\index{HFC.c@{HFC.c}!HFC\_\-cfgSchemaCompile@{HFC\_\-cfgSchemaCompile}}
\index{HFC\_\-cfgSchemaCompile@{HFC\_\-cfgSchemaCompile}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-cfgSchemaCompile}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-cfgSchemaCompile ({\bf HFC\_\-cfg} $\ast$ {\em cfg}, \/  const HFC\_\-DB\_\-schema $\ast$ {\em schema})}}
\label{HFC_8c_1c134bb50f5ae32847a11dd44d45aba4}


Implements the transformation of the configuration parameters as specified by the user, {\em cfg\/}, into the internal form, {\em ctlCfg\/}. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Successful \item[{\em -1}]Unrecognized or non-backwardly compatiable user configuration version number.\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cfg}]Filled in with the internal form of the configuration parameters \item[{\em schema}]The configuration schema \end{description}
\end{Desc}


References HFC\_\-cfgCompile(), and \_\-HFC\_\-cfg::prms.\hypertarget{HFC_8c_d8f533b98284ba251eee31e31a572082}{
\index{HFC.c@{HFC.c}!HFC\_\-cfgSet@{HFC\_\-cfgSet}}
\index{HFC\_\-cfgSet@{HFC\_\-cfgSet}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-cfgSet}]{\setlength{\rightskip}{0pt plus 5cm}{\bf HFC\_\-cfg}$\ast$ HFC\_\-cfgSet ({\bf HFC} $\ast$ {\em hfc}, \/  {\bf HFC\_\-cfg} $\ast$ {\em cfg})}}
\label{HFC_8c_d8f533b98284ba251eee31e31a572082}


Makes the specified internal representation of the configuration parameters the current active one. 

\begin{Desc}
\item[Returns:]Pointer to the current control configuration parameters\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hfc}]The heavy ion filter control structure \item[{\em cfg}]The internal representation of the configuration constants \end{description}
\end{Desc}


References \_\-HFC::cfg.\hypertarget{HFC_8c_2a6c2bd39d3d6f3d39a5f10c90385c1b}{
\index{HFC.c@{HFC.c}!HFC\_\-cfgSizeof@{HFC\_\-cfgSizeof}}
\index{HFC\_\-cfgSizeof@{HFC\_\-cfgSizeof}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-cfgSizeof}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-cfgSizeof (void)}}
\label{HFC_8c_2a6c2bd39d3d6f3d39a5f10c90385c1b}


Sizes the heavy ion filtering configuration as it is used in the actual filtering progam. 

\begin{Desc}
\item[Returns:]Returns the size of the heavy ion filtering configuration control structure\end{Desc}
\begin{Desc}
\item[]There are two different breeds of the filtering configuration structure. There are two reasons for this. The more familar is the configuration structure that the user fills in. This structure is meant to be convenient for the user, but not for the program. Some of the information in the user structure is transformed into data that the program will find more accessible.\end{Desc}
\begin{Desc}
\item[]The second reason is that by having a user configuration and an internal configuration, the two can evolve separately. If more parameters are added to the filter, they will find a home in the internal structure. At some time they may be exposed to the user. The correct course of action is to define a new version of the user configuration block. Since the version number is carried along with the configuration constants, the routine transforming the user configuration to its internal representation can evolve and can be made to handle older versions of the user configuration parameters with some degree of grace, at least giving some hope to backward compatibility.\end{Desc}
\begin{Desc}
\item[]The correct usage model is 

\begin{Code}\begin{verbatim}       ctlCfg = malloc (HFC_cfgSizeof ());
       status = HFC_cfgCompile (cfg, usrPrms);
       HFC_cfgSet (hfc, cfg);
\end{verbatim}
\end{Code}

\end{Desc}
\begin{Desc}
\item[Note:]Because the 'set routine just seeds a pointer to the user configuration, in the control structure. the user is free to swap it out with any other pre-prepared configuration. \end{Desc}
\hypertarget{HFC_8c_d826c4019674d8df0ae91078bbe2a074}{
\index{HFC.c@{HFC.c}!HFC\_\-filter@{HFC\_\-filter}}
\index{HFC\_\-filter@{HFC\_\-filter}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-filter}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-filter ({\bf HFC} $\ast$ {\em hfc}, \/  unsigned int {\em pktBytes}, \/  EBF\_\-pkt $\ast$ {\em pkt}, \/  EBF\_\-siv {\em siv}, \/  EDS\_\-fwIxb $\ast$ {\em ixb}, \/  unsigned int {\em vetoes}, \/  {\bf HFC\_\-result} $\ast$ {\em result})}}
\label{HFC_8c_d826c4019674d8df0ae91078bbe2a074}


Determines the fate of 1 event. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em $<$}]0, rejected \item[{\em ==0,undecided}]\item[{\em $>$}]0, accepted\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hfc}]The heavy ion filter control structure \item[{\em pktBytes}]The number of bytes in {\em pkt\/}, includes the packet header \item[{\em pkt}]The event data packet \item[{\em siv}]The packet's state information vector \item[{\em ixb}]The information exchange block \item[{\em vetoes}]The active vetoes \item[{\em result}]The filter result vector\end{description}
\end{Desc}
\begin{Desc}
\item[Overview]This acts as a wrapper of the actual filter. This is were the sampling logic is implemented by the use prescalers. A prescaler is defined by a pair of integers; one giving the current countdown value and the other giving the refresh value. When the countdown value reaches 0, the prescaler is said to expire.\end{Desc}
\begin{Desc}
\item[Types of prescaling]There are two kinds of samplings allow.\end{Desc}
\begin{enumerate}
\item Pass-thru sampling\item Individual veto sampling\end{enumerate}


\begin{Desc}
\item[Pass-Thru Sampling]Conceptually this is the easiest to understand. When the pass-thru prescaler expires, instead of using the normal veto mask, a 0 is used, effectively causing the filter to evaluate all its cuts but not allowing an cut to veto the event. While easy to understand, the event sample leaked through by this technique will be dominated by events that would normally have been rejected by the very early cuts.\end{Desc}
\begin{Desc}
\item[Individual Veto Sampling]This prescaler type allows to ignore the reject decision of each veto bit. While a bit harder to understand than the Pass-Thru Sampling, this technique allows one to tap a predetermined percentage of events failing at each cut. The hope is that one will be a statisitically meaningful sample of events that would have normally failed some of the later cuts in the filter. \end{Desc}


References hfcFilter().\hypertarget{HFC_8c_dd5b78a1083dfd782121763f4412fe72}{
\index{HFC.c@{HFC.c}!HFC\_\-fwNeeds@{HFC\_\-fwNeeds}}
\index{HFC\_\-fwNeeds@{HFC\_\-fwNeeds}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-fwNeeds}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HFC\_\-fwNeeds (void)}}
\label{HFC_8c_dd5b78a1083dfd782121763f4412fe72}


Returns a bit mask of the EDS\_\-fw needs. 

\begin{Desc}
\item[Returns:]A bit mask of the EDS\_\-fw needs\end{Desc}
\begin{Desc}
\item[Use]This value should be passed to EDS\_\-fwRegister when registering the filter. \end{Desc}


Referenced by hfc\_\-construct().\hypertarget{HFC_8c_977c35e1f2615c6aef3c7907b52fd417}{
\index{HFC.c@{HFC.c}!HFC\_\-fwObjects@{HFC\_\-fwObjects}}
\index{HFC\_\-fwObjects@{HFC\_\-fwObjects}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-fwObjects}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HFC\_\-fwObjects (void)}}
\label{HFC_8c_977c35e1f2615c6aef3c7907b52fd417}


Returns a bit mask of the EDS\_\-fw objects used by the heavy ion filter. 

\begin{Desc}
\item[Returns:]A bit mask of the EDS\_\-fw needs\end{Desc}
\begin{Desc}
\item[Use]This value should be passed to EDS\_\-fwRegister when registering the filter. \end{Desc}


Referenced by hfc\_\-construct().\hypertarget{HFC_8c_610a059315477fca9207ba12c701f09f}{
\index{HFC.c@{HFC.c}!HFC\_\-resultSizeof@{HFC\_\-resultSizeof}}
\index{HFC\_\-resultSizeof@{HFC\_\-resultSizeof}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-resultSizeof}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-resultSizeof (const {\bf HFC} $\ast$ {\em hfc})}}
\label{HFC_8c_610a059315477fca9207ba12c701f09f}


Returns the size, in bytes, of one result vector. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]size, in bytes, of one result vector\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hfc}]The configuration control structure \end{description}
\end{Desc}
\hypertarget{HFC_8c_4b90aceea99ed21f2343cc134f1156a7}{
\index{HFC.c@{HFC.c}!HFC\_\-sizeof@{HFC\_\-sizeof}}
\index{HFC\_\-sizeof@{HFC\_\-sizeof}!HFC.c@{HFC.c}}
\subsubsection[{HFC\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int HFC\_\-sizeof (int {\em cnt})}}
\label{HFC_8c_4b90aceea99ed21f2343cc134f1156a7}


Sizes the heavy ion filtering control structure. 

\begin{Desc}
\item[Returns:]Returns the size of the heavy ion filtering control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cnt}]Number of configurations to accommodate \end{description}
\end{Desc}
\hypertarget{HFC_8c_6a3796da34263f8b5809d1486b0b4b7f}{
\index{HFC.c@{HFC.c}!hfcFilter@{hfcFilter}}
\index{hfcFilter@{hfcFilter}!HFC.c@{HFC.c}}
\subsubsection[{hfcFilter}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int hfcFilter ({\bf HFC} $\ast$ {\em hfc}, \/  unsigned int {\em pktBytes}, \/  EBF\_\-pkt $\ast$ {\em pkt}, \/  EBF\_\-siv {\em siv}, \/  EDS\_\-fwIxb $\ast$ {\em ixb}, \/  unsigned int {\em vetoes}, \/  {\bf HFC\_\-result} $\ast$ {\em result})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{HFC_8c_6a3796da34263f8b5809d1486b0b4b7f}


Determines the fate of 1 event. 

\begin{Desc}
\item[Returns:]Status mask, if the\begin{itemize}
\item $<$ 0, reject\item = 0, no decision\item $>$ 0, accept\end{itemize}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hfc}]The heavy ion filter control structure \item[{\em pktBytes}]The number of bytes in {\em pkt\/}, includes the packet header \item[{\em pkt}]The event data packet \item[{\em siv}]The packet's state information vector \item[{\em ixb}]The information exchange block \item[{\em vetoes}]The list of active vetoes \item[{\em result}]The filter result vector \end{description}
\end{Desc}


References \_\-HFC\_\-result::beg, \_\-HfcCfgPrms::cal, \_\-HFC\_\-result::cal, cal\_\-check(), \_\-HFC::cfg, \_\-HFC\_\-result::chk, \_\-HFC\_\-result::dir, dir\_\-check(), \_\-HFC\_\-result::evtNum, \_\-HFC\_\-result::gem, HFC\_\-STATUS\_\-M\_\-ERR\_\-CAL, HFC\_\-STATUS\_\-M\_\-GEM\_\-NOCALLO, HFC\_\-STATUS\_\-M\_\-GEM\_\-NOCNO, HFC\_\-STATUS\_\-M\_\-GEM\_\-NOTKR, HFC\_\-STATUS\_\-M\_\-MULTI\_\-PKT, HFC\_\-STATUS\_\-M\_\-STAGE\_\-CAL, HFC\_\-STATUS\_\-M\_\-STAGE\_\-DIR, HFC\_\-STATUS\_\-M\_\-STAGE\_\-GEM, HFC\_\-STATUS\_\-M\_\-VETOED, ievt\_\-store, isVetoed(), \_\-HFC\_\-cfg::prms, \_\-HFC\_\-result::status, and tmr\_\-store.

Referenced by HFC\_\-filter().\hypertarget{HFC_8c_41c39220eb2b5d52c8cfe57706d196d0}{
\index{HFC.c@{HFC.c}!isVetoed@{isVetoed}}
\index{isVetoed@{isVetoed}!HFC.c@{HFC.c}}
\subsubsection[{isVetoed}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int isVetoed (unsigned int {\em status}, \/  unsigned int {\em vetoes})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{HFC_8c_41c39220eb2b5d52c8cfe57706d196d0}


Checks whether any of the veto bits are up. 

\begin{Desc}
\item[Returns:]Non-zero if the {\em status\/} bits contain any of the veto bits.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em status}]The current set of status bits \item[{\em vetoes}]The set of veto bits \end{description}
\end{Desc}


Referenced by cal\_\-check(), and hfcFilter().