\hypertarget{ASC_8h}{
\section{ASC.h File Reference}
\label{ASC_8h}\index{ASC.h@{ASC.h}}
}
ACD Software Rate Counters, interface file. 



This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=85pt]{ASC_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__ASC__cno}{\_\-ASC\_\-cno}
\begin{CompactList}\small\item\em Accumulates the counts for the CNO vector. \item\end{CompactList}\item 
struct \hyperlink{struct__ASC__patterns}{\_\-ASC\_\-patterns}
\begin{CompactList}\small\item\em Accumulates the pattern counts for one ACD FREE board channel. \item\end{CompactList}\item 
struct \hyperlink{struct__ASC__list}{\_\-ASC\_\-list}
\begin{CompactList}\small\item\em The ACD vector counts for each of the 32 ACD readout channels is in a list. \item\end{CompactList}\item 
struct \hyperlink{struct__ASC__cnts}{\_\-ASC\_\-cnts}
\begin{CompactList}\small\item\em Statistics for each of the 4 lists. \item\end{CompactList}\item 
struct \hyperlink{struct__ASC__counters}{\_\-ASC\_\-counters}
\begin{CompactList}\small\item\em All ACD counts. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{ASC_8h_a0}{
typedef \hyperlink{struct__ASC__cno}{\_\-ASC\_\-cno} \hyperlink{ASC_8h_a0}{ASC\_\-cno}}
\label{ASC_8h_a0}

\begin{CompactList}\small\item\em Typedef for the struct {\em \hyperlink{struct__ASC__cno}{\_\-ASC\_\-cno}\/}. \item\end{CompactList}\item 
typedef \hyperlink{struct__ASC__patterns}{\_\-ASC\_\-patterns} \hyperlink{ASC_8h_a1}{ASC\_\-patterns}
\begin{CompactList}\small\item\em Typedef for the struct {\em \hyperlink{struct__ASC__patterns}{\_\-ASC\_\-patterns}\/}. \item\end{CompactList}\item 
typedef \hyperlink{struct__ASC__list}{\_\-ASC\_\-list} \hyperlink{ASC_8h_a2}{ASC\_\-list}
\begin{CompactList}\small\item\em Typedef for struct {\em ASC\_\-list\/}. \item\end{CompactList}\item 
\hypertarget{ASC_8h_a3}{
typedef \hyperlink{struct__ASC__cnts}{\_\-ASC\_\-cnts} \hyperlink{ASC_8h_a3}{ASC\_\-cnts}}
\label{ASC_8h_a3}

\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__ASC__cnts}{\_\-ASC\_\-cnts}. \item\end{CompactList}\item 
typedef enum \hyperlink{ASC_8h_a24}{\_\-ASC\_\-SUMMARY} \hyperlink{ASC_8h_a4}{ASC\_\-SUMMARY}
\begin{CompactList}\small\item\em Typedef for enum \_\-ASC\_\-SUMMARY. \item\end{CompactList}\item 
typedef \hyperlink{struct__ASC__counters}{\_\-ASC\_\-counters} \hyperlink{ASC_8h_a5}{ASC\_\-counters}
\begin{CompactList}\small\item\em Typedef for struct {\em ASC\_\-counters\/}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{ASC_8h_a24}{\_\-ASC\_\-SUMMARY} \{ \par
\hyperlink{ASC_8h_a24a6}{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-OKAY} =  0, 
\par
\hyperlink{ASC_8h_a24a7}{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-ERR} =  1, 
\par
\hyperlink{ASC_8h_a24a8}{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-MISS} =  2, 
\par
\hyperlink{ASC_8h_a24a9}{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-OKAY} =  3, 
\par
\hyperlink{ASC_8h_a24a10}{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-ERR} =  4, 
\par
\hyperlink{ASC_8h_a24a11}{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-MISS} =  5, 
\par
\hyperlink{ASC_8h_a24a12}{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-OKAY} =  6, 
\par
\hyperlink{ASC_8h_a24a13}{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-ERR} =  7, 
\par
\hyperlink{ASC_8h_a24a14}{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-MISS} =  8, 
\par
\hyperlink{ASC_8h_a24a15}{ASC\_\-SUMMARY\_\-RSVD\_\-9} =  9, 
\par
\hyperlink{ASC_8h_a24a16}{ASC\_\-SUMMARY\_\-RSVD\_\-10} =  10, 
\par
\hyperlink{ASC_8h_a24a17}{ASC\_\-SUMMARY\_\-RSVD\_\-11} =  11, 
\par
\hyperlink{ASC_8h_a24a18}{ASC\_\-SUMMARY\_\-RSVD\_\-12} =  12, 
\par
\hyperlink{ASC_8h_a24a19}{ASC\_\-SUMMARY\_\-RSVD\_\-13} =  13, 
\par
\hyperlink{ASC_8h_a24a20}{ASC\_\-SUMMARY\_\-RSVD\_\-14} =  14, 
\par
\hyperlink{ASC_8h_a24a21}{ASC\_\-SUMMARY\_\-RSVD\_\-15} =  15
 \}
\begin{CompactList}\small\item\em Enumerates the entries in the summary statistics block. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{ASC_8h_a22}{ASC\_\-clear} (\hyperlink{struct__ASC__counters}{ASC\_\-counters} $\ast$counters)
\begin{CompactList}\small\item\em Clears the specified statistics counters. \item\end{CompactList}\item 
int \hyperlink{ASC_8h_a23}{ASC\_\-accumulate} (\hyperlink{struct__ASC__counters}{ASC\_\-counters} $\ast$counters, const unsigned int $\ast$edata, int esize)
\begin{CompactList}\small\item\em Accumulate the counters for the specified event. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
ACD Software Rate Counters, interface file. 

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


\footnotesize\begin{verbatim}    CVS $Id: ASC.h,v 1.1.1.1 2005/12/01 21:55:31 ebacho Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[SYNOPSIS]Defines the the interface for controlling the ACD software rate counters\end{Desc}


\subsection{Typedef Documentation}
\hypertarget{ASC_8h_a5}{
\index{ASC.h@{ASC.h}!ASC_counters@{ASC\_\-counters}}
\index{ASC_counters@{ASC\_\-counters}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-counters]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__ASC__counters}{ASC\_\-counters}}}
\label{ASC_8h_a5}


Typedef for struct {\em ASC\_\-counters\/}. 

\begin{Desc}
\item[Note:]See the documentation of the enum \_\-ASC\_\-SUMMARY for an explanation of the summary statistics block.\end{Desc}
\hypertarget{ASC_8h_a2}{
\index{ASC.h@{ASC.h}!ASC_list@{ASC\_\-list}}
\index{ASC_list@{ASC\_\-list}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-list]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__ASC__list}{ASC\_\-list}}}
\label{ASC_8h_a2}


Typedef for struct {\em ASC\_\-list\/}. 

The trick here is in defining what is meant by {\em each possible readout channel\/}. This problem stems from the fact that there are a variety of representations of the ACD data.\begin{enumerate}
\item At the detector level there are 97 tiles and ribbons, with 2 ends each.\item At the FREE board electronics level there are 12 FREE boards each with 18 channels.\item At the GEM level, there are 4 x 32 bits words with each bit representing 2 channels. The decision here is to go wih the most inclusive definition and then provide mapping functions to recast the data into the other to forms.\end{enumerate}


The most inclusive is the GEM level, representing a total of 256 channels vs 216 FREE board channels vs 194 detector channels.\hypertarget{ASC_8h_a1}{
\index{ASC.h@{ASC.h}!ASC_patterns@{ASC\_\-patterns}}
\index{ASC_patterns@{ASC\_\-patterns}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-patterns]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__ASC__patterns}{ASC\_\-patterns}}}
\label{ASC_8h_a1}


Typedef for the struct {\em \hyperlink{struct__ASC__patterns}{\_\-ASC\_\-patterns}\/}. 

Associated with either ACD tile or ribbon are 5 discriminator bits.

\begin{enumerate}
\item PHA Accept Discriminator side A\item PHA Accept Discriminator side B\item Hit or LO Discriminator, side A\item Hit or LO Discriminator, side B\item Veto Discriminator, from the GEM\end{enumerate}


These bits can be arranged to form a 5 bit number.



\footnotesize\begin{verbatim}     +----+----+----+----+----+
     |  V | Hb | Ha | Pb | Pa |
     +----+----+----+----+----+
  \end{verbatim}
\normalsize


For each ACD tile, this is a number from 0-31, inclusive. This structure contains the 32 bit accumulations for this vector.\hypertarget{ASC_8h_a4}{
\index{ASC.h@{ASC.h}!ASC_SUMMARY@{ASC\_\-SUMMARY}}
\index{ASC_SUMMARY@{ASC\_\-SUMMARY}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-SUMMARY]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{ASC_8h_a4}{ASC\_\-SUMMARY}}}
\label{ASC_8h_a4}


Typedef for enum \_\-ASC\_\-SUMMARY. 

\begin{Desc}
\item[Summary Statistics Block]The summary statistics block consists of 16 32-bit entries to accumulate statistics. Only the first 9 are currently defined. These 9 entries map out a 3 x 3 grid. The 2 axis stand for the condition of the AEM and GEM contribution. A contribution can exist in one of 3 states\end{Desc}
\begin{itemize}
\item Present and okay\item Present and in error, i.e. contribution found, but data in correct\item Missing, i.e. contribution not found.\end{itemize}


\begin{Desc}
\item[]Each event will increment only one of these entries. The total number of events seen is thus the sum of all 9 entries. The counters will be accumulated only for events with a block present and not in error. Note that events with only a GEM contributor or only an AEM contributor will be accumulated into the statistics counters iff the contributor's is not in error. Naturally one expects most entries to be in the both present and okay category.\end{Desc}
\begin{Desc}
\item[Note:]Currently there is no way a GEM contribution can be present but in error. Consequently these entries should be 0. The locations will be maintained if one discovers that such a category is possible.\end{Desc}


\subsection{Enumeration Type Documentation}
\hypertarget{ASC_8h_a24}{
\index{ASC.h@{ASC.h}!_ASC_SUMMARY@{\_\-ASC\_\-SUMMARY}}
\index{_ASC_SUMMARY@{\_\-ASC\_\-SUMMARY}!ASC.h@{ASC.h}}
\subsubsection[\_\-ASC\_\-SUMMARY]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{ASC_8h_a24}{\_\-ASC\_\-SUMMARY}}}
\label{ASC_8h_a24}


Enumerates the entries in the summary statistics block. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{ASC_SUMMARY_AEM_OKAY_GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-OKAY}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_OKAY_GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-OKAY}}\item[{\em 
\hypertarget{ASC_8h_a24a6}{
ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-OKAY}
\label{ASC_8h_a24a6}
}]Both present and okay \index{ASC_SUMMARY_AEM_OKAY_GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-ERR}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_OKAY_GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-ERR}}\item[{\em 
\hypertarget{ASC_8h_a24a7}{
ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-ERR}
\label{ASC_8h_a24a7}
}]Both present, GEM in error \index{ASC_SUMMARY_AEM_OKAY_GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-MISS}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_OKAY_GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-MISS}}\item[{\em 
\hypertarget{ASC_8h_a24a8}{
ASC\_\-SUMMARY\_\-AEM\_\-OKAY\_\-GEM\_\-MISS}
\label{ASC_8h_a24a8}
}]Only AEM present \index{ASC_SUMMARY_AEM_ERR__GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-OKAY}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_ERR__GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-OKAY}}\item[{\em 
\hypertarget{ASC_8h_a24a9}{
ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-OKAY}
\label{ASC_8h_a24a9}
}]Both present, AEM in error \index{ASC_SUMMARY_AEM_ERR__GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-ERR}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_ERR__GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-ERR}}\item[{\em 
\hypertarget{ASC_8h_a24a10}{
ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-ERR}
\label{ASC_8h_a24a10}
}]Both present and in error \index{ASC_SUMMARY_AEM_ERR__GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-MISS}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_ERR__GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-MISS}}\item[{\em 
\hypertarget{ASC_8h_a24a11}{
ASC\_\-SUMMARY\_\-AEM\_\-ERR\_\-\_\-GEM\_\-MISS}
\label{ASC_8h_a24a11}
}]Only AEM present, but in error \index{ASC_SUMMARY_AEM_MISS_GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-OKAY}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_MISS_GEM_OKAY@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-OKAY}}\item[{\em 
\hypertarget{ASC_8h_a24a12}{
ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-OKAY}
\label{ASC_8h_a24a12}
}]Only GEM present \index{ASC_SUMMARY_AEM_MISS_GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-ERR}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_MISS_GEM_ERR@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-ERR}}\item[{\em 
\hypertarget{ASC_8h_a24a13}{
ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-ERR}
\label{ASC_8h_a24a13}
}]Only GEM present, but in error \index{ASC_SUMMARY_AEM_MISS_GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-MISS}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_AEM_MISS_GEM_MISS@{ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-MISS}}\item[{\em 
\hypertarget{ASC_8h_a24a14}{
ASC\_\-SUMMARY\_\-AEM\_\-MISS\_\-GEM\_\-MISS}
\label{ASC_8h_a24a14}
}]Both missing \index{ASC_SUMMARY_RSVD_9@{ASC\_\-SUMMARY\_\-RSVD\_\-9}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_9@{ASC\_\-SUMMARY\_\-RSVD\_\-9}}\item[{\em 
\hypertarget{ASC_8h_a24a15}{
ASC\_\-SUMMARY\_\-RSVD\_\-9}
\label{ASC_8h_a24a15}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_10@{ASC\_\-SUMMARY\_\-RSVD\_\-10}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_10@{ASC\_\-SUMMARY\_\-RSVD\_\-10}}\item[{\em 
\hypertarget{ASC_8h_a24a16}{
ASC\_\-SUMMARY\_\-RSVD\_\-10}
\label{ASC_8h_a24a16}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_11@{ASC\_\-SUMMARY\_\-RSVD\_\-11}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_11@{ASC\_\-SUMMARY\_\-RSVD\_\-11}}\item[{\em 
\hypertarget{ASC_8h_a24a17}{
ASC\_\-SUMMARY\_\-RSVD\_\-11}
\label{ASC_8h_a24a17}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_12@{ASC\_\-SUMMARY\_\-RSVD\_\-12}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_12@{ASC\_\-SUMMARY\_\-RSVD\_\-12}}\item[{\em 
\hypertarget{ASC_8h_a24a18}{
ASC\_\-SUMMARY\_\-RSVD\_\-12}
\label{ASC_8h_a24a18}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_13@{ASC\_\-SUMMARY\_\-RSVD\_\-13}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_13@{ASC\_\-SUMMARY\_\-RSVD\_\-13}}\item[{\em 
\hypertarget{ASC_8h_a24a19}{
ASC\_\-SUMMARY\_\-RSVD\_\-13}
\label{ASC_8h_a24a19}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_14@{ASC\_\-SUMMARY\_\-RSVD\_\-14}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_14@{ASC\_\-SUMMARY\_\-RSVD\_\-14}}\item[{\em 
\hypertarget{ASC_8h_a24a20}{
ASC\_\-SUMMARY\_\-RSVD\_\-14}
\label{ASC_8h_a24a20}
}]Reserved for future use \index{ASC_SUMMARY_RSVD_15@{ASC\_\-SUMMARY\_\-RSVD\_\-15}!ASC.h@{ASC.h}}\index{ASC.h@{ASC.h}!ASC_SUMMARY_RSVD_15@{ASC\_\-SUMMARY\_\-RSVD\_\-15}}\item[{\em 
\hypertarget{ASC_8h_a24a21}{
ASC\_\-SUMMARY\_\-RSVD\_\-15}
\label{ASC_8h_a24a21}
}]Reserved for future use \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{ASC_8h_a23}{
\index{ASC.h@{ASC.h}!ASC_accumulate@{ASC\_\-accumulate}}
\index{ASC_accumulate@{ASC\_\-accumulate}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-accumulate]{\setlength{\rightskip}{0pt plus 5cm}int ASC\_\-accumulate (\hyperlink{struct__ASC__counters}{ASC\_\-counters} $\ast$ {\em counters}, const unsigned int $\ast$ {\em edata}, int {\em esize})}}
\label{ASC_8h_a23}


Accumulate the counters for the specified event. 

\begin{Desc}
\item[Returns:]Status indicating the event was successfully processed (0) or a non-zero number indicating the event was not successfully processed.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em counters}]Pointer to the counters to increment \item[{\em edata}]Pointer to the event data \item[{\em esize}]The event size, in units of bytes. This is used as a consistency check in the unpacking.\end{description}
\end{Desc}
\hypertarget{ASC_8h_a22}{
\index{ASC.h@{ASC.h}!ASC_clear@{ASC\_\-clear}}
\index{ASC_clear@{ASC\_\-clear}!ASC.h@{ASC.h}}
\subsubsection[ASC\_\-clear]{\setlength{\rightskip}{0pt plus 5cm}void ASC\_\-clear (\hyperlink{struct__ASC__counters}{ASC\_\-counters} $\ast$ {\em counters})}}
\label{ASC_8h_a22}


Clears the specified statistics counters. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em counters}]The statistics counters to be cleared\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]Currently this is a NON-interlocked operation.\end{Desc}
