%CMS Stuff that doesn't work yet
\documentclass{cmspaper}

%DOE progress report style that does work
%\documentstyle[epsfig,12pt]{article}
%\usepackage[dvips]{graphics}

\begin{document}

%==============================================================================
% title page for few authors

\begin{titlepage}

% select one of the following and type in the proper number:
   \cmsnote{2004/001}
%  \internalnote{2005/000}
%  \conferencereport{2005/000}
   \date{1 January 2004}

  \title{Trigger Studies for the CSC Muon System}

  \begin{Authlist}
    E.~Boyd, R.~Cousins, S.~Haapanen, J.~Hauser, M.~Healy,
    M.~v.d.~Mey, B.~Mohr, J.~Mumford, S.~Valouev, J.~Werner
%\Aref{a}
       \Instfoot{ucla}{University of California, Los Angeles}
    M.~Matveev, P.~Padley, J.~Roberts, G.~Veramendi
       \Instfoot{rice}{Rice University, Houston}
    D.~Acosta, A.~Drozdetski, B.~Scurlock, H.~Stoeck
       \Instfoot{florida}{University of Florida, Gainesville}
    B.~Bylsma, S.~Durkin, J.~Gilmore, J.~Gu, T.Y.~Ling
       \Instfoot{osu}{Ohio State University, Columbus}
  \end{Authlist}

% if needed, use the following:
%     \collaboration{CMS collaboration}
%     \Anotfoot{a}{On leave from prison}

%==============================================================================
  \begin{abstract}

The performance of the Compact Muon Solenoid (CMS) cathode strip chamber (CSC) 
trigger electronics was tested in the summer of 2003 in a test beam at CERN. 
A novel feature of the muon and pion beams was a 25 ns bunch structure similar 
to that of the LHC. Two CSCs were equipped with production on-chamber 
electronics and connected to near-final prototype off-chamber electronics. 
Both inputs and outputs of the CSC trigger electronics were recorded. 
The trigger algorithms were checked by a bit-for-bit comparison
between the output trigger data and a
detailed simulation of the trigger electronics run 
on the input trigger bits. 
The performance of the trigger electronics is presented as a function of 
CSC chamber high voltage, 
raw hit thresholds, 
particle rates,
and 
chamber angles.
These studies show that the 
design of the system is sound and will yield efficient muon triggering in 
CMS operation at the Large Hadron Collider.

%    This is a template written in LaTeX,
%    processed with {\it cmspaper.cls} document class.
%    It is based on the {\it cernart.cls} and {\it articlet.cls} classes.
%    The above information, Title and Abstract, should be readable on any 
%    computer and should be searchable on the information server. 
%    Therefore if the abstract or the title of your note contains Greek 
%    characters and mathematical symbols, please send to the CMS secretariat 
%    alternative versions which do not contain such characters.

  \end{abstract} 

% if needed, use the following:
%\conference{Presented at {\it Physics Rumours}, Coconut Island, April 1, 2005}
%\submitted{Submitted to {\it Physics Rumours}}
%\note{Preliminary version}
  
\end{titlepage}

\setcounter{page}{2}%JPP

%==============================================================================
% title page for many authors
%
%\begin{titlepage}
%  \internalnote{2005/000}
%  \title{CMS Technical Note Template}
%
%  \begin{Authlist}
%    A.~Author\Iref{cern}, B.~Author\Iref{cern}, C.~Author\IAref{cern}{a},
%    D.~Author\IIref{cern}{ieph}, E.~Author\IIAref{cern}{ieph}{b},
%    F.~Author\Iref{ieph}
%  \end{Authlist}
%
%  \Instfoot{cern}{CERN, Geneva, Switzerland}
%  \Instfoot{ieph}{Institute of Experimental Physics, Hepcity, Wonderland}
%  \Anotfoot{a}{On leave from prison}
%  \Anotfoot{b}{Now at the Moon}
%
%  \begin{abstract}
%    This is a template of a CMS paper, written in LaTeX,
%    processed with {\it cmspaper.sty} style.
%    It is based on the {\it cernart.sty} and {\it articlet.sty} styles.
%    There are two versions of the title page.
%    The current one is designed for many authors.
%    The one on the previous page is for few authors.
%    Just delete the one which you do not need.
%  \end{abstract} 
%  
%\end{titlepage}
%
%==============================================================================


\section{Introduction}

The CSC muon system of CMS \cite{CMS_MUON_TDR}
and the plan for reading out and triggering with this system 
\cite{CMS_TRIG_TDR}
have been described in detail elsewhere. 
The on-chamber electronics for the CSC muon system of CMS were previously 
studied extensively \cite{CMS_CSC_RESULTS,CSC_PRIM_1999},
and have now been mass-produced and installed on the CSC chambers. 
The performance of the associated off-chamber electronics 
needs to be extensively checked as well before their mass production begins.
In particular, 60 VME 9U-size electronics crates are mounted around the 
periphery of the endcap muon iron disks to handle local triggering and
readout for the 468-chamber CSC system of CMS. 
A test beam with LHC-like time structure was very useful for 
assuring proper operation under LHC conditions.
Key trigger goals for the CSC peripheral crate electronics 
at the summer 2003 test beam were to demonstrate that they:
\begin{enumerate}
\item Work well together as a system.
\item Trigger on muons with high efficiency.
\item Correctly identify the LHC bunch crossing with high probability.
\item Can handle the maximum particle rates expected at LHC. 
\end{enumerate}

A schematic of the CSC on-chamber and peripheral crate 
electronics system is shown below in 
Figure~\ref{blockdiag}.
For each CSC chamber, 
the on-chamber electronics is connected to one pair of boards 
in a peripheral crate: a Trigger MotherBoard (TMB) module and a 
Data acquisition MotherBoard (DMB) module. 
Each crate services one trigger sector, i.e. 60$^o$ in muon stations 2-4
and 30$^o$ in muon station 1.
There are 9 TMB/DMB board pairs serving 9 CSC chambers in each crate.
Trigger data from each sector is collected by the Muon Port Card (MPC)
and sent by optical fiber to the CSC track finder.
Primarily the focus during the summer 2003 test beam studies was
on the DMB and TMB modules and their associated on-chamber electronics.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{13cm}{!}
	{\includegraphics{figures/csc_primitives.eps}}
    \caption{A block diagram of the electronics associated with each CSC 
	muon chamber of CMS. There are 9 TMB/DMB board pairs per crate
	(not shown).}
    \label{blockdiag}
  \end{center}
\end{figure}


A short explanation of the function of each of the modules that are 
shown in Figure 1 and that were used in the test beam studies follows: 

\begin{itemize}

\item
CFEB \cite{CMS_MUON_TDR,CFEB_RAD_2001,CFEB_1998} (Cathode Front-End Board):  
Contains sensitive amplifiers for 
cathode strip signals and creates parallel data and trigger data paths.  
The rise time of the cathode amplifiers is about 125~ns, and the fall
time is about 250~ns.
In the precision data path, analog charge information is stored in a 
switched capacitor array and subsequently 
digitized for readout upon receipt of a Level-1 trigger accept (L1A) signal. 
The digitized charge data are then sent to the DMB.
For the trigger data path, custom comparator 
ASICs\footnote{Application-Specific Integrated Circuit}
find the  muon position on each CSC layer to a precision of one half-strip 
by comparing cathode signals on adjacent strips \cite{COMP_TESTS_1999}.
If a strip signal exceeds a programmable threshold, after a delay for
signal peaking, that signal is compared to neighboring strips.
If the signal is larger than both neighbors, it is determined to be
the central strip in a cluster, and whether the track passed to the left or
the right of the center of that strip is determined by comparing
the signals adjacent strips on left and right. 
The half-strip bits are then sent to the TMB board. 
Each CFEB is attached to 96 cathode strips.
There are 3, 4, or 5 CFEBs per CSC chamber, depending on the type of
chamber.

\item
AFEB \cite{AFEB2001} (Anode Front-End Board): 
Contains a single 16-channel amplifier 
plus constant-fraction discriminator ASIC to digitize anode information. 
The hits are sent to the ALCT board. 
There are up to 42 AFEBs per CSC chamber.

\item
ALCT \cite{CMS_TRIG_TDR} (Anode Local Charged Track):  
There is one ALCT on each CSC chamber.
For the trigger, this module
finds patterns among the six layers of anode hits that look like a muon stub, 
and not background neutron-induced or other types of hits. 
It also time-aligns the anode hit information with the LHC clock, 
and determines the muon bunch crossing using a multiple-layer coincidence 
timing technique. 
Position and timing information for up to two anode LCT hit 
patterns (also called ALCTs) are sent to the TMB. 
For the data readout, the anode hits and the trigger hit patterns found are 
sent upon receipt of a level 1 trigger decision (L1A) to the TMB.

\item
TMB \cite{CMS_TRIG_TDR} (Trigger Mother Board):  
For the trigger, the TMB finds up to 
two cathode patterns, then requires a time coincidence between anode 
and cathode patterns.  
If a coincidence is found TMB combines the trigger information 
and sends the best two LCTs to the MPC using the more precise anode 
bunch crossing time. 
For the data readout, the TMB passes the anode ALCT information 
directly to the DMB, 
and sends in parallel the cathode comparator hits, cathode trigger patterns, 
and anode-cathode coincidence information to the DMB.

\item
MPC\cite{CMS_TRIG_TDR} (Muon Port Card):  
Collects LCTs from each of up to nine TMBs in a 
trigger sector and chooses the best three based on the muon stub quality.  
Sends this information to the CSC track finder system 
(Sector Processor, Sector Receiver).

\item
CCB\cite{CCB_2002} (Clock and Control Board):  Provides the interface of the 
CSC system with the CMS Trigger, Timing and Control (TTC) system.  
(***Need a reference here for the TTC system).
Distributes necessary signals for synchronized operation of a peripheral crate.

\item
DMB \cite{CMS_MUON_TDR} (Data acquisition Mother Board):  
Upon arrival of L1A, collects 
data from ALCT, TMB and CFEBs, containing ALCTs, CLCTs and analog 
cathode information from a single CSC.  Sends  this event information 
to the DDU.

\item
DDU***ref! (Detector-Dependant Unit):  Upon arrival of L1A, collects data from 
all DMBs in a CSC sector and sends the information through the 
global DAQ path. 
In the version present at the test beam, this module was read out via 
Gigabit Ethernet to a PCI card and from there to disk on a Linux computer.

\end{itemize}

%===========================================================================

\section{Test Beam Setup}

Two CSCs were equipped with production on-chamber electronics and connected 
to near-final prototype off-chamber electronics in the X5A test beam, 
which is a tertiary beam from CERN's SPS (400 GeV/c), providing a 
muon or pion beam of energy between 5 and 250 GeV. 
Collimators in the beam line allowed for control of the rate of particles.
An important feature of the muon and pion beams during part of the 
running time was a 25~ns bunch structure similar to that of the LHC. 
and 48 bunches were filled out of the SPS total of 924 
(the LHC has 3564 bunches). 
Within each bunch, particles arrived during a window 2.3~ns wide.
Particles were extracted during a 1.5-2.5~s spill out of a 16.8~s ramp cycle. 
Muon rates up to $\approx 10^4$ per spill and 
pion rates up to $\approx 10^6$ per spill were available.
The test beam setup is shown in Figure~\ref{tb03_pic}. 
The two CSCs were placed about a meter 
apart and nominally rotated $20\deg$ with respect to the perpendicular 
to the beam axis, 
and vertically oriented, so that the beam represented an LHC muon at 
$20\deg$ polar angle 
and infinite momentum. All parts of the diagram shown in 
Figure~\ref{blockdiag} were implemented, 
including the Muon Port Card (MPC) that collects trigger information about 
muon segments from all of the TMB modules in a peripheral crate.
The trigger electronics was set to form triggers from internal 
chamber information, 
but the readout was initiated by a three-fold coincidence of signals from 
the scintillator paddles of the beam hodoscope. 
The size of these paddles was approximately 10~cm on each side, 
well-matched to the size of the beam. The background rate of non-particle 
coincidences from this hodoscope was so low as to be unmeasured. 
The operation of the trigger electronics is checked by study of 
the data read out. 
A data block was created for every scintillator hodoscope coincidence.
In cases where no CSC information was available, a short header was
read out in order to obtain true efficiency measurements.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
%%    \epsfig{figure=figures/testbeam_setup_800.eps,width=4.0in}
%	{\includegraphics{figures/testbeam_setup_800.eps}}
	{\includegraphics{figures/tbsetup.eps}}
    \caption{
The summer 2003 CSC test beam setup. The beam line is vertical and 
passes through two CSC chambers that are mounted on the left 
(one is hidden behind the other). 
Blue cables run along the top from the on-chamber electronics to the 
right side where the peripheral crate electronics is located in a 
9U-height VME crate.  
The peripheral crate electronics is then read out through an optical 
fiber to a PCI card, and thence to disk in the data acquisition 
computer in the control room.
}
    \label{tb03_pic}
  \end{center}
\end{figure}

CSC event data is organized into three sub-categories: trigger anode data, 
trigger cathode plus anode/cathode time-coincidence data, and cathode 
precision charge-readout data. 
For each type of data, a time history of all channels is recorded. 

For anode data, the raw data hits are recorded every 25~ns clock cycle 
for 16 time bins starting approximately 2 clocks before the
typical muon arrival time.
Anode hits for a typical event are shown in Figure~\ref{alct_display}
for each chamber layer.
It can be seen that some hits are latched
on successive clocks.
This happens because in order to be absolutely sure to latch the
data, the discriminator outputs have been designed to last longer than the 
time between clock cycles, typically 30-35~ns.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
   {\includegraphics{figures/14nov03_alct_box.eps}}
    \caption{An event display showing the anode hits versus time and wire
             number for each chamber layer.}
    \label{alct_display}
  \end{center}
\end{figure}

For cathode data, due to the relatively slow 
100~ns rise time of the amplifiers, the 
precision charge measurements are recorded only every two clocks (50~ns).
Either 8 or 16 time bins of precision charge measurement can be selected, 
starting approximately 250~ns before the peak charge is recorded.
Projections of the cathode data versus position and time
are shown for each of the CSC chamber layers in
Figure~\ref{clct_display}.
In the charge versus position projections (left side), the largest charge
recorded on each strip is plotted.
In the charge versus time projections (right side), the largest charge
recorded for each time bin is plotted.
One sees the typical 100~ns rise time 
and slightly longer fall time of the sensitive front-end 
strip amplifiers.
Also shown on these plots are half-strip trigger hits.
Cathode trigger hits are determined for the center of each cluster
to a precision of one half-strip by a 16-channel `Comparator' ASIC
that compares the voltage level out of the cathode amplifier
to a minimum threshold, and also compares the voltage levels 
on adjacent strips.
The cathode trigger hits are recorded every 25~ns clock cycle
in 7 time bins beginning approximately 2 samples 
(50~ns) before the peak charge.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
   {\includegraphics{figures/14nov03_clct_profile.eps}}
    \caption{An event display showing profiles of the cathode hit data
	     versus strip number (left) and time bin (right).}
    \label{clct_display}
  \end{center}
\end{figure}

An event display for both cathode and anode hits is shown
in Figure~\ref{clct_alct_display}. 
The cathode and anode
trigger data is shown as individual hits at the time at which the signals 
exceeded threshold. 
In the cathode display, the maximum cathode charge is shown for each
strip in red, the comparator $1/2$-strip bits are shown in blue,
and the position of the trigger pattern (defined at layer 3)
is shown in yellow.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
   {\includegraphics{figures/14nov03_clct_alct_profile.eps}}
    \caption{An event display showing the maximum cathode charge recorded on each strip
             (top) and the anode wires that recorded hits (bottom). 
	     The six layers of the CSC chambers are shown.}
    \label{clct_alct_display}
  \end{center}
\end{figure}

%===========================================================================

\section{Trigger Setup and Timing}

The first step in taking data is to time in the electronics system. 
A number of times need adjustment (this can be done either with cosmic 
ray hodoscope or test beam hodoscope triggers):

\begin{itemize}

\item
CFEB readout timing: a CLCT data-available signal from the TMB is 
sent through the DMB to the CFEBs. 
This signal freezes data in the CFEB switched capacitor arrays 
until a subsequent L1A arrives exactly 2.9~$\mu$s later. 
At the test beam, this is monitored using test points on the CFEB 
boards and adjusted by changing the CCB L1A delay setting. 
This adjustment requires an operating CSC chamber and an 
external (e.g. scintillator) muon trigger.

\item 
ALCT-TMB data transmission timing: data is multiplexed to 80 MHz 
in both directions between these boards. 
Two clock phases need adjustment for proper data transfer. 
The TMB supplies one main (transmit) clock for the ALCT board. 
To determine the proper phase of this clock, it is delayed in 1 ns steps 
using a PHOS4 delay ASIC chip (ref.) until ALCT output data is 
correctly latched at the TMB. 
In addition, some data is transferred from TMB to ALCT during 
normal operation, and in order that this data is received 
correctly at the ALCT a second (receive) clock phase is 
set using another PHOS4 delay chip channel. 
The TMB is read out through VME. 
This timing can be correctly adjusted without particles.

\item
CFEB comparator chip clock timing: the comparator chip 
clock on the CFEB is sent from the TMB. 
The phase of this clock determines whether the data is 
properly latched at the TMB. 
Fine timing to get optimal phase of this clock is adjusted by a 
scan across 25 PHOS4 delay settings. 
The quality of the timing is monitored by reading out the TMB through VME 
and counting the rate of 5-layer and 6-layer CLCT patterns. 
(A working CSC chamber and cosmic rays or test beam events are 
needed for this step).

\item
ALCT L1A delay setting: Once the ALCT is properly timed in, 
the ALCT L1A delay can be set.  
Events are taken at different L1A delay settings and the 
peak in ALCT efficiency is determined.

\item
TMB: L1A timed in (look at L1A window using internal logic scope 
and center by adjusting the window). 
Look at the "l1a\_pulse\_dsp" signal and make sure it is 
in the "l1a\_window\_dsp."   
Adjust the L1A pulse delay in VME address 74.  
Also look at the "alct\_vpf\_tp" pulse and make sure it 
is in the middle of the "clct\_window\_tp."  
Adjust the ALCT valid pattern pulse delay in VME address B2.

\item
Additional DMB timing: active FEB flags for ALCT and 
CLCT have to be timed in - direct signals on pins on DMB 
utility board (ugh!).

\item

Fine timing adjustment of ALCT delays: there is a fine delay setting
for the ALCT board which delays the signal before latching.
This is adjusted using test beam data until the efficiency for
finding the ALCT pattern is maximized for a single time bin,
as shown in Figure~\ref{alct_delay}.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
   {\includegraphics{figures/delaychipr.eps}}
    \caption{ALCT delay scans for chamber 1 (left) and chamber 2 (right).
	     The efficiency for identifying the `correct' bunch crossing
	     is shown versus the ALCT fine delay setting. 
	     (Settings 0-15 are available in $2.2$~ns steps.}
    \label{alct_delay}
  \end{center}
\end{figure}

Checks of BX crossings in various places?


\end{itemize}

%===========================================================================

\section{Data-taking Conditions}

Pions at 150 GeV.  Pion rates $10^4$ to $10^6$ per spill (?).
Muons spectrum?  Muon rate $10^3$ to $5\times10^3$ per spill (?).
Beam horizontal.  Chambers set up with HV from Bertan power supplies,
LV supplied to on-chamber electronics, cabling 
from chamber to peripheral crate electronics just as in the CMS
setup.
What else to say?  Information from CERN web page.


%===========================================================================

\section{Results}

\subsection{Digital Comparison of Pattern-finding Simulation to LCTs}
 
Raw hits, including time history, were recorded in the test beam
data stream for both anode and cathode.
These hits were fed into the official CMS Monte Carlo simulation of 
the ALCT-finding and CLCT-finding logic.
Results of this digital simulation were compared bit-for-bit against the 
ALCT and CLCT patterns that were found.
Initially, a large percentage of discrepancies were found,
but this was traced to inaccuracies in the Monte Carlo simulation
that were then fixed.

For ALCT pattern-finding, all but 0.0000x\% agree.
Disagreements were found in (what?).

For CLCT pattern-finding, all but 2.4\% agree.
Disagreements were found in those cases where trigger hits may have
occurred before the start of the time history for them.
Also, events were found containing two muon candidate tracks
in which the second-best muon was recorded
as the best, and vice versa.
This appears to be a bug in the firmware and is being investigated...
(*** update? ***)

%-----------------------------------------------------------------------------

\subsection{Trigger Primitives Efficiency}

*** Efficiency numbers for ALCT and CLCT finding: from logbook or from data runs?

*** High-rate pion test: include figures for ALCT rate versus pion rate and
CLCT rate versus pion rate.

%-----------------------------------------------------------------------------

\subsection{High Voltage and Threshold Scans}

Varying the CSC chamber high-voltage (HV) setting changes the average
pulse height by a factor of 2 for every 150 v change from nominal
settings around 3600 v (***check this***).
ALCT and CLCT efficiencies were studied as a function of HV.
Additionally, the CLCT efficiency was studied versus raw hits threshold.
These scans are shown in Figure~\ref{eff_hv}.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
%    {\rotatebox{270}
   {\includegraphics{figures/effvshighvoltage.eps}}
%}
    \caption{ALCT and CLCT efficiencies versus chamber high voltage.}
    \label{eff_hv}
  \end{center}
\end{figure}

%CLCT efficiency versus HV and comparator threshold is shown in
%Figure~\ref{eff_hv_clct}.
%
%\begin{figure}[hbtp]
%  \begin{center}
%    \resizebox{15cm}{!}
%    {\rotatebox{270}
%   {\includegraphics{figures/FinalCLCTeff.eps}}}
%    \caption{CLCT efficiency versus chamber high voltage and 
%	     comparator threshold setting.}
%    \label{eff_hv_clct}
%  \end{center}
%\end{figure}

%-----------------------------------------------------------------------------

\subsection{Bunch Crossing Identification}

Bunch crossing counters were reset by the TTC system after every orbit.
After timing in, Figure~\ref{bunches} shows that there were 48 filled 
bunches out of each orbit 924 clocks long.  The distribution of 
bunches with muons seen by the scintillator hodoscope (top)
is entirely consistent with the distribution of muons as seen by
the ALCT bunch identification logic.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
   {\includegraphics{figures/full_bxn.eps}}
    \caption{Bunch crossing with muon particles within the orbit containing
             924~bunch crossings.  On the top is shown the bunch crossings
	     identified with the scintillator hodoscope.
	     On the bottom is shown the bunch crossings as identified
	     by the ALCT circuitry.}
    \label{bunches}
  \end{center}
\end{figure}


Figure 8. The time of arrival of the muon, as seen by the cathode 
trigger, in clock ticks with respect to the "LHC bunch 0".
Then BX efficiency:

Figure 9. Difference in time of the arrival of the muon (in 25 ns clock ticks) 
between the anode (ALCT) and cathode (CLCT) trigger circuitry and the 
timing from the scintillator hodoscope.

%-----------------------------------------------------------------------------

\subsection{Trigger Primitives Position Resolution}

Position of CLCT key half-strip numbers found in chamber 1 
versus chamber 2 is shown in Figure~\ref{clct_key_vs_key}.
Both chambers were mounted with their midlines horizontal, but the
area of the beam is slightly off-center.
Nonetheless, there should be good correlation of position between
the chambers.
The data show that the CLCT positions found are well-correlated, although
some small percentage of the events contain 
hits at large angles from 2nd muon tracks.


\begin{figure}[hbtp]
  \begin{center}
    \resizebox{13cm}{!}
   {\includegraphics{figures/chamber_corr.eps}}
    \caption{The CLCT `key' half-strip found in the two chambers plotted
	     against each other.  The top plot shows all half-strips (0-159),
	     while the bottom plot zooms in on the position where the beam
	     is defined by the scintillator hodoscope.}
    \label{clct_key_vs_key}
  \end{center}
\end{figure}

*** At this point it would be great to compare the half-strip position
in chamber 1 to the vertical position in chamber 2, as given by
Stan's precision fitting code.
Presumably the angles of the muons don't vary as much as the
vertical intercepts (since the chambers are much closer to each
other than the distance from chamber 1 to the point of muon production).
Therefore, the precision fitting code should be used to define an
intercept, not a slope, which will have a large uncertainty since
the path length within a chamber is only about 15~cm.

One could do this for the angle scans as well.
Presumably when all the patterns are di-strip patterns, the resolution
will be 4x worse or so.
One can also look at the resolutions for half-strip versus di-strip
patterns at the angles where there are both present.
Since we dramatically preferred half-strip over di-strip patterns,
this could give interesting insight into whether this was a good
thing to do. ***

%-----------------------------------------------------------------------------

\subsection{Chamber Angle Scans}

Efficiencies to find CLCT half-strip and di-strip patterns
versus chamber rotation angle $\phi_b$
are shown in Figure~\ref{clct_eff_vs_phi_b}.
The overall efficiency for finding any CLCT, which is the sum
of half-strip and di-strip efficiencies, is also shown.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/efficiency_1100zz.eps}}
}
    \caption{CLCT efficiency versus rotation angle $\phi_b$.} 
    \label{clct_eff_vs_phi_b}
  \end{center}
\end{figure}


Chamber angle scans were done by tilting the chamber about a horizontal axis,
which corresponds in CMS to varying the muon `bend' angle ($\phi_b$).
During these scans,
the polar angle ($\theta$) of the chamber was held fixed at $20^o$.
Chamber qualities are defined as the number of layers with hits on the
pattern minus three, i.e. a quality=3 pattern has the maximum possible
six hits.
Chamber patterns are ordered so that patterns 1 and 7 represent the extreme
bend angles, while pattern 4 represents a straight-through pattern.

%----------------------------------------------------------------------------
For chamber angles $\phi_b=0^o$ (and $\phi_b=10^o$), 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_0_10},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
One sees that with the chamber at $\phi_b=0^o$, i.e. vertical, 
nearly all of the events are found as straight-through half-strip
patterns, with a majority being 6-hit patterns. 

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi0.0.eps}}
}
%   {\includegraphics{figures/phi10_0_normqualpat_1100.eps}}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angle
	     $\phi_b=0^o$.} 
    \label{clct_patqual_0_10}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-2.5^o$ and $\phi_b=+2.5^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_2p5},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At this angle, most of the events are found as half-strip patterns, but
most are displaced from the straight-through central pattern.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi2.5.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-2.5^o$ (top) and $\phi_b=+2.5^o$ (bottom).} 
    \label{clct_patqual_2p5}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-5^o$ and $\phi_b=+5^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_5},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
While the events are still found as half-strip patterns, these patterns
have reached the edges of the fully half-strip acceptance (patterns 1 and 7).

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi5.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-5^o$ (top) and $\phi_b=+5^o$ (bottom).} 
    \label{clct_patqual_5}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-7.5^o$ and $\phi_b=7.5^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_7p5},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
Again, the events are still found as half-strip patterns but at the
edges of the fully half-strip acceptance (patterns 1 and 7).

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi7.5.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-7.5^o$ (top) and $\phi_b=+7.5^o$ (bottom).} 
    \label{clct_patqual_7p5}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angle $\phi_b=+10^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_10},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
Angle $\phi_b=-10^0$ data was found to be corrupt (***or some such***).

*** What to say about this plot, for instance:?
Again, the events are still found as half-strip patterns but at the
edges of the fully half-strip acceptance (patterns 1 and 7). ***

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi10.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angle
	     $\phi_b=+10^o$ (bottom).} 
    \label{clct_patqual_10}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-15^o$ and $\phi_b=+15^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_15},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At these angles, the patterns are not fully within the half-strip
envelope.
Since the CLCT algorithm for choosing patterns prefers all half-strip
patterns with two or more layers to all di-strip patterns having
even 6 layers,
the muon tracks are still found predominantly 
as half-strip patterns, but with much
reduced quality, predominantly 2-hit or 3-hit patterns.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi15.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-15^o$ (top) and $\phi_b=+15^o$ (bottom).} 
    \label{clct_patqual_15}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-20^o$ and $\phi_b=+20^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_20},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At these angles, the muon tracks make patterns which is mostly
beyond the half-strip acceptance with even two or three layers,
and are found predominantly as di-strip patterns of high quality, 
although at the edge of the di-strip acceptance (patterns 1 and 7).

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi20.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-20^o$ (top) and $\phi_b=+20^o$ (bottom).} 
    \label{clct_patqual_20}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-25^o$ and $\phi_b=+25^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_25},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At these angles, the muon tracks make patterns which are totally
beyond the half-strip acceptance with even two or three layers,
and are found almost always as di-strip patterns, although at the
edge of the di-strip acceptance (patterns 1 and 7).

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi25.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-25^o$ (top) and $\phi_b=+25^o$ (bottom).} 
    \label{clct_patqual_25}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For chamber angles $\phi_b=-30^o$ and $\phi_b=+30^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_30},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At these angles, the muon tracks make patterns which are slightly beyond
the di-strip acceptance.  
Therefore, the patterns found are at the edges of the di-strip pattern
acceptance (patterns 1 and 7).  
The quality of these tracks is also somewhat degraded, with most
patterns found as quality 2 (5-hit) patterns.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi30.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-30^o$ (top) and $\phi_b=+30^o$ (bottom).} 
    \label{clct_patqual_30}
  \end{center}
\end{figure}

%-----------------------------------------------------------------------

For a chamber angle $\phi_b=-35^o$ and $\phi_b=+35^o$, 
the distributions of qualities versus pattern numbers for
the found patterns 
are shown in Figure~\ref{clct_patqual_35},
with half-strip patterns shown on the left and di-strip patterns
shown on the right.
At these angles, the muon tracks make patterns which are well beyond the
di-strip acceptance.
The patterns found are at the edges of the di-strip pattern acceptance
(patterns 1 and 7), and the qualities are seriously degraded, with
most patterns found as quality 1 (4-hit) patterns.

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{15cm}{!}
{\rotatebox{270}
   {\includegraphics{figures/scatphi35.0.eps}}
}
    \caption{CLCT qualities versus pattern numbers, for half-strip patterns
	     (left) and di-strip patterns (right), for rotation angles
	     $\phi_b=-35^o$ (top) and $\phi_b=+35^o$ (bottom).} 
    \label{clct_patqual_35}
  \end{center}
\end{figure}


\section{Conclusions}

The peripheral crate electronics performed well at the summer 2003 test beam.
Reliability was good, operations were handled remotely,
and performance met expectations.  Specifically:
\begin{itemize}
\item
The efficiencies for finding trigger primitives were high.
At rates much higher than seen at the LHC, the CLCT efficiency begins to drop.
\item
There was a range of HV operation over which the efficiencies were high.
\item
The position resolution was good.
\item
Cathode patterns and qualities varied with muon angle as expected.
\item
Further improvements are expected in the next generation 
\end{itemize}

Some improvements can be forseen:
\begin{itemize}
\item
The logic that orders the CLCT patterns preferred all half-strip
patterns over all di-strip patterns.  This was done in order to save
space in the FPGA that performs the logic.  In the next generation
of TMB, a newer, larger FPGA allows us to order the patterns 
by a better algorithm.
\item
The ALCT produces `ghosts', i.e. second muon stubs, in adjacent wire
groups or in adjacent time bins.  It is highly desirable to put in
logic that removes such ghosts.
\end{itemize}

With these modest changes to the trigger hardware, the CSC trigger
electronics used at the 2003 test beam will be ready to handle the job
of muon triggering for the CMS detector at the LHC.

\begin{itemize}
\item
{\bf (Silja) Patterns versus angles in the (?,?b) scans: plot 
versus ?b at the different ? settings:}
\item CLCT and ALCT efficiency
\item CLCT pattern
\item CLCT and ALCT pattern quality
\item (unassigned) Plot CLCT pattern quality versus various trigger 
thresholds (solve a mystery of missing triggers).
\item (Erin project 1) Plot differences between LCTs and the digi LCTs 
that are simulated from the raw hits readout:
\item ALCT discrepancies
\item CLCT discrepancies
\item Study any discrepancies found versus conditions we changed 
(particle rate, high voltage, angles, etc.)
\item {\bf (Brian) look at logic scope data:}
\item Look at the timing of trigger signals.
\item Look at timing versus drift delay.
\item {\bf (Erin project 2) Look at high voltage scan data 
(gain of chamber changes quite a bit). Plot versus high voltage:}
\item CLCT and ALCT efficiency 
\item Do we get more di-strip patterns at lower voltages?
\item Do other quantities change?
\item {\bf (Matt) Look at comparator threshold data. Plot versus threshold:}
\item CLCT efficiency.
\item CLCT pattern number.
\item Other quantities?
\item Look at runs that changed ALCT delay settings in synchronized 
and unsynchronized beam data, plot:
\item efficiency of ALCT bunch crossing. Maximize the statistics.
\item Look at runs with various particle rates, plot versus particle rate:
* CLCT and ALCT efficiency.
* Cathode and Anode raw hits readout efficiency.
* CLCT and ALCT pattern qualities.
* CLCT pattern number.
\end{itemize}

Another list (from original goals list):

\begin{itemize}
\item Measure the efficiency for ALCT and CLCT on straight-through tracks. 
\item Study, check and measure the ALCT-CLCT matching efficiency
\item Measure ALCT BX identification efficiency and learn how to adjust BXN clock 
with respect to ALCT timing to maximize this efficiency. This is crucial
for us to use the ALCT BXN distribution to match the time-gaps 
with thetime-structure beam.
\item Verify that trigger primitives sent correctly to the MPC.
\end{itemize}

A more comprehensive list is:
\begin{enumerate}
\item Single-chamber test goals:
\begin{itemize}
\item Measure the scintillator trigger purity - how?
\item Measure the efficiency for ALCT on straight-through tracks.
\item Measure the efficiency for CLCT on straight-through tracks.
\item Study the ALCT BX identification efficiency: we wish to get the 
correct BX on 99% or more of the events. 
Measure the ALCT delay settings needed on different ends of the chamber. 
Study the time distribution of the ALCT BX versus the scintillator trigger BX.
\item Understand what the width of the CLCT time window needs to be in 
order to match ALCT, is it +-1 BX or does it need to be wider?
\item Measure the overall chamber trigger efficiency, i.e. requiring 
ALCT*CLCT*(correct BX).
\item Vary the pretrigger threshold (currently 2 for ALCT, 4 for CLCT) and 
measure the resulting ALCT-scintillator and ALCT-CLCT relative timing, 
i.e. make histograms of delta(BX). The ALCT delay chip settings will 
have to be changed slightly if the ALCT pretrigger threshold is changed.
\item Measure the efficiency for CLCT versus phi angle. 
Study how the patterns vary with angle. (Is this well described 
by the Monte Carlo simulation?)
\item Measure the efficiency for ALCT versus theta angle to 
map out the envelope for high efficiency. 
(Is this well described by the Monte Carlo simulation?)
\item The efficiency for CLCT should not vary much with theta angle, 
verify that this is true. Likewise, the efficiency for 
ALCT should not vary much with phi angle, verify this.
\item Measure efficiencies versus chamber HV.
\item Measure timing versus chamber HV.
\item Measure the rate dependence of efficiencies (and timing?).
\end{itemize}

\item Two-chamber test goals:

\begin{itemize}
\item Check the relative ALCT timing between the two chambers. 
Is it consistent with the rate of BX misidentification for 
the chambers individually?
\item Measure the 2-chamber "global" ALCT*CLCT trigger efficiency.
\item Check the BX numbers match in the readout at all stages 
(ALCT, TMB, DMB, DDU).
\item Measure position and angular resolution.
\item Make sure that the readout of 2 chambers do not interfere 
with each other (all data present and valid).
\end{itemize}
\end{enumerate}

\subsection{Subsection}

This is an example of subsection

\subsubsection{Subsubsection}

This is an example of subsubsection

\section{Document layout}

\subsection{Page size, margins and fonts}

Use only very standard PostScript fonts: 
%    \begin{center}
      \begin{tabular}{|l|ccc|} \hline
         LaTeX name & roman & sansserif & typewriter \\
         PostScript name & Times & Helvetica & Courrier \\ \hline
      \end{tabular}
%    \end{center}

  European A4 paper size is 210 mm x 297 mm (8.3" x 11.7").
  American paper is 6 mm (0.2") wider and 18 mm (0.7") shorter, 
  thus it has 216 mm x 279 mm (8.5" x 11.0").
  In this template we have set the LATEX page style parameters as follows:
{\small \begin{verbatim}
  \hoffset and \voffset are reset to 0
  \oddsidemargin, \evensidemargin and \marginparwidth = 25mm
  \marginparsep is set equal to \baselineskip
  \topmargin=20mm, \headheight=0, \headsep=0
  \footskip=6mm
  \textwidth=16cm
  \textheight is set to NN\baselineskip, where NN is 57, 51 or 46 ....
\end{verbatim} }

  These settings lead to margins, measured from the edge of the physical page, 
  as listed in Tab.~\ref{tab:page_layout}.
  In this table "foot" is the space left below the page number (footer).

  The paper size used in generating the PostScript file is defined by 
  the {\em -t papertype} option in {\em dvips} 
  where {\em papertype} stands for {\em a4} or {\em letter}.

  \begin{table}[htb]
    \caption{Page layout for A4 and US letter formats.}
    \label{tab:page_layout}
    \begin{center}
      \begin{tabular}{|l|ccccc|ccccc|} \hline
               & \multicolumn{5}{c|}{mm} & \multicolumn{5}{c|}{inches} \\ 
        margin & left & right & top & bottom & foot &
                 left & right & top & bottom & foot \\ \hline
        A4 & 25 & 25 & 20 & 34 & 28 & 1.0 & 1.0 & 0.8 & 1.3 & 0.9 \\
        US letter   & 25 & 31 & 20 & 16 & 10 & 1.0 & 1.2 & 0.8 & 0.6 & 0.4 \\ \hline
      \end{tabular}
    \end{center}
  \end{table}

\subsection{Tables, figures}

Small tables can be inside the text in a fixed place, as the table with
the font names above. Bigger tables should be defined as floating bodies
and have a caption and label as Tab.~\ref{tab:page_layout} above.

Figures can be inserted as EPS files using package {\em graphics},
automaticaly called by {\em cmspaper.cls}.
Specifying both width and height forces both dimensions to be changed.
If one of the dimensions is omitted the aspect ratio is preserved.
If no one is given, the size is taken from the {\em \%\%BoundingBox}
(see examples in Fig.~\ref{fig:ex1} and \ref{fig:ex2}).

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{3cm}{!}{\includegraphics{cmslogo.eps}}
    \caption{Figure inserted by 
      \tt $\backslash$resizebox\{3cm\}\{!\}\{$\backslash$includegraphics\{cmslogo.eps\}\}.}
    \label{fig:ex1}
  \end{center}
\end{figure}

\begin{figure}[hbtp]
  \begin{center}
    \resizebox{5cm}{1cm}{\includegraphics{cmslogo.eps}}
    \caption{Figure inserted by 
       \tt $\backslash$resizebox\{5cm\}\{1cm\}\{$\backslash$includegraphics\{cmslogo.eps\}\}.}
    \label{fig:ex2}
  \end{center}
\end{figure}

%Quite often it is convenient to place 2 figures side by side as a single
%floating body. An environment {\em 2figures} is provided for that
%(see Fig.~\ref{fig:ex3} and \ref{fig:ex4}).

%\begin{2figures}{hbtp}
%  \resizebox{\linewidth}{0.5\linewidth}{\includegraphics{cmslogo.eps}} &
%  \resizebox{\linewidth}{0.5\linewidth}{\includegraphics{cmslogo.eps}} \\
%%  \resizebox{\linewidth}{!}{\includegraphics{cmslogo.eps}} &
%%  \resizebox{\linewidth}{!}{\includegraphics{cmslogo.eps}} \\
%  \caption{The left figure}
%  \label{fig:ex3} &
%  \caption{The right figure}
%  \label{fig:ex4} \\
%\end{2figures}

%------------------------------------------------------------------------------

\section{Submitting a note}

Please follow the rules and procedures defined on the CMSDOC server, or request them by e-mail to:\begin{center} {\em cmsnotes@cmsdoc.cern.ch} \end{center}

\begin{thebibliography}{9}

  \bibitem {CMS_MUON_TDR} {\bf CERN-LHCC-97-32}, Dec. 1997,
    The CMS Collaboration,
    {\em "CMS, the Compact Muon Solenoid. Muon Technical Design Report"}.

  \bibitem {CMS_TRIG_TDR} {\bf CERN-LHCC-2000-038}, Dec. 2000,
    The CMS Collaboration,
    {\em "CMS.  The TRIDAS Project. Technical Design Report, Vol. 1:
     The Trigger Systems."}.

  \bibitem {CMS_CSC_RESULTS} {\bf Nucl. Instrum. Meth. A494:504-508}, 
    2002, D. Acosta {\it et al.},
    {\em "Design Features and Test Results of the CMS Endcap Muon Chambers."}.

  \bibitem {CSC_PRIM_1999} 
    {\bf Snowmass 1999, Electronics for LHC Experiments, 304-308}, Sep. 1999,
    J. Hauser,
    {\em "Primitives for the CMS Cathode Strip Muon Trigger."}.

  \bibitem {CFEB_RAD_2001} 
    {\bf Nucl. Instrum. Meth. A471:340-347}, 2001,
    R. Breedon {\it et al.},
    {\em "Results of Radiation Tests of the Cathode Front-End Board for
          CMS Endcap Muon Chambers."}.

  \bibitem {CFEB_1998} 
    {\bf Rome 1998, Electronics for LHC Experiments, 262-266}, Sep. 1998,
    T.Y.~Ling,
    {\em "Front End Electronics of the CMS Endcap Muon System."}.

  \bibitem {COMP_TESTS_1999} 
    {\bf Nucl. Instrum. Meth. A425:92-105}, 1999,
    M.M.~ Baarmand {\it et al.},
    {\em "Spatial Resolution Attainable With Cathode Strip Chambers 
         at the Trigger Level."}.

  \bibitem {AFEB2001} 
    {\bf Stockholm 2001, Electronics for LHC Experiments, 190-194}, Sep. 2001,
    N. Bondar {\it et al.},
    {\em "Anode Front-End Electronics for the Cathode Strip Chambers
          of the CMS Endcap Muon Detector."}.

  \bibitem {CCB_2002} 
    {\bf Colmar 2002, Electronics for LHC Experiments, 359-362}, Sep. 2002,
    M.~Matveev {\it et al.},
    {\em "The Clock and Control Board for the Cathode Strip Chamber Trigger
          and DAQ Electronics at the CMS Experiment."}.

\end{thebibliography}
 

\end{document}
