RICH element ID and Channel Tag
Jianchun WANG
(Created: 07/01/98)
(Revised: 06/02/00)
Key word: crate, slot, ADC, channel, sector, quarter, chain, chip carrier, pad
Key variable: crate, slot, adc, channel, sector, quarter, chain, ccar, iphi, iz
Introduction
RICH detector for CLEO III upgrade has been installed. I wrote a page two years
ago to explain the nomenclature of the RICH elements. This is a revision. I describe
the element names and ID's which already appear in both online and offline
software.
Coordinates
As we all know, the beam at CLEO detector is east-west direction.
The +Z of CLEO detector as defined is consistent with the west direction
(West is the direction of the counting room with respect to the CLEO detector, in
case you cannot see the sun in the pit).
For the RICH detector, we had a extra Readout connection on western side,
and a HV connection on eastern side (The Readout connection is now used to
pulse the anode wires for Wire Pulse calibration, and the HV connection is used
to supply High Voltage to anode wires). In summary:
| +Z side: West (W), Counting room, Readout (R)
| | -Z side: East (E), High voltage (H)
|
|
The +X direction is South and +Y direction points upwards.
The phi direction is counter-clockwise looking from +Z side.
In the event display, the detector is unfolded with phi direction pointing up,
and Z direction to the right. This means that you are looking at RICH pads from
the Interaction Point (IP).
Chamber Elements
The RICH detector contains 30 sectors as shown in figure 1.
We increment the sector ID from 1 at phi=0 counter clockwise to 30
(Instead of starting with 0 which is easier for coding, the classic way
of starting with 1 is implemented for all ID).
So for each sector, the phi range it covers (in degree) is
| (sector - 1.5) * 12 to (sector - 0.5) * 12
|
|

Fig 1. RICH chamber sector ID, looking from +Z into IP.
Each sector has in total of 7680 pads distributed in a 320(z)*24(phi) array.
We will use variables iz(in z direction) and iphi(in phi direction)
to represent the pad ID and its location.
Looking from IP at RICH pads, as shown in Figure 2, iphi increases from 1 to 24
as phi increases. And iz increases from 1 to 320 as Z increases.

Fig 2. Pad ID and chip carrier ID and pad ID in one RICH sector looking from IP.
In principle, sector ID and pad ID define a unique address for each channel
on the RICH. In figure 2, we put numbers in the box, which will be used to represent
the chip carrier ID ccar. It will be explained later that this intermediate
variable ccar is useful in creating the whole pad map.
For each sector there are 60 chip carriers as shown in figure 2.
Each chip carrier connects to 128 pads in a 16*8 matrix.
When these chip carriers are connected to outside readout system, they
are grouped into 12 chains as shown in Figure 3.
Five neighboring chip carriers are linked to form one chain.
All channels of one chain are read out via one cable.

fig 3. Chain formation and ID.
The sector is divided into 4 quarters, named from 1 to 4 along the Z axis. Each
quarter has 3 chains (e.g. H1,H2,H3), all connected to the
same rich data board. Therefore each sector requires 4 data boards.
Electronic Elements
There are 8 VME crates for the entire RICH readout.
Each crate contains 14 or 16 RICH readout data boards.
In total, there are 120 data boards.
Each data board connects to a quarter (3 chains) of one sector.
And 15 ADCs on the data board serve total 15 chip carriers
of these 3 chains.
The 8 VME crates are located at 4 corners at both ends of the detector.
Each upper crate connects to 7 sectors,
and each lower crate connects to 8 sectors via 20 ft long cables.
Please note that chains on each sector are connected to
closest crate on either end. Chains of quarter 1 and 2
connect to the east end.
And chains of quarter 3 and 4 connect to the west end.
The crates are 1 through 8 as listed in table 1.
Table 1: Summary of crates
| Crate | number of board | side | sectors |
| 1 | 14 | East | 2-8 |
| 2 | 14 | East | 9-15 |
| 3 | 16 | East | 16-23 |
| 4 | 16 | East | 24-30,1 |
| 5 | 14 | West | 2-8 |
| 6 | 14 | West | 9-15 |
| 7 | 16 | West | 16-23 |
| 8 | 16 | West | 24-30,1 |
|
Each data board has its ID programmed inside a 1K EPROM on the data board.
Since we may need to replace a data board when modification or repair is
needed, the data board ID connected to certain sector may change from
time to time. We don't want to change the Data Base so often. For this
reason, we use the crate-slot ID instead of the board ID to identify each
RICH data board.
The slot ID slot varies from 4 to 17 or 19.
On each board, there are 15 ADCs with ID's (adc) ranging from 1 to 15.
The channel ID (channel) will of course start at 1 and increment to 128.
Data Format and Channel Address
RICH data are formatted as follows:
| aaaa aaaa aaaa aaaa aaxx qqqq qqqq qqqq
|
|
The 12-bit ADC readout is represented as q,
the 18-bit address as a, and x indicates unused bits.
As we have 230,400 readout channels total, plus common mode information for 1800 ADC's,
we need to find an efficient and convenient way of channel addressing.
We used to use an address based on the electronic element.
This included 3 bits for crate, 4 bits for board,
4 bits for adc, and 7 bits for channel.
Together these elements constitute an 18-bit address.
As there are 15 ADC's instead of 16, one address of adc bits is free.
This address is used to indicate the ADC common mode (CM) information.
And channel bits used to indicate the ADC ID.
This method is convenient for testing electronic devices.
In standard DAQ, we use a detector element based address.
The advantage is that we can easily get the physics coordinates.
For most users, there is no need to worry about the RICH mapping.
The formal address is defined as:
| Channel address = (sector-1)*320*24 + (iz-1)*24 + iphi
| | ADC CM address = 230400 + (sector-1)*60 + ccar.
|
|
We use a continuous number starting from 1.
One may notice that we use iphi as the least significant address.
Swapping between iphi and iz would give better harmony with
a continuity between sectors.
The reason is that cluster formation becomes easier.
Map Conversion
Now we have two separate groups of element ID's:
the electronic readout element ID's: crate, board(slot), adc, and channel,
and the chamber element ID's: sector, iz , and iphi.
The channel address uses the chamber element, while the datum are collected in an order
order associated with electronic element. We need a conversion map between the electronic
element and the chamber element.
There are three files associated with this conversion mapping:
boardMap.dat
adcMap.dat
padMap.dat
They exist somewhere in cleo31 directory to generate the map database.
The boardMap.dat may differ from this standard one, if in future we
need to change the connection. The other two have no reason to change.
A quarter of a sector is connected to a slot
of a crate. The file "boardMap.dat" lists the relation between these two elements. The
board ID is also provided for future use. Its value does not affect the current
data base, and hence they are not correct this time.
The second file, "adcMap.dat", indicates how each ADC out of 15 in each data board
related to the chip carrier. A combination of Figure 4 and 2 is what the file
tries to describe. Please keep in mind that there are 4 data boards, each connected to
a quarter of the sector, divided along the z axis.

Fig 4. ADC's of the RICH data board as connected to chip carriers of one sector.
The last, and most complicated file is "padMap.dat". It describes which pad
of a sector (total: 320*24) connects to which channel of an already designated ADC.
Although there are some internal resemblances among chip carriers, the file
is organized to have one entry for each pad.
RICH Channel Tag Data Base
The RICH channel tags are generated using the 3 map conversion files mentioned above.
The data base has three variables in it.
The first variable indicate the electronic element address that the
channel tag is assigned to. It includes ID of
crate, slot, adc, and channel. They are packed as
| crate << 24 || slot << 16 || (adc-1)*128 + channel-1
|
|
The second variable is the channel address (tagging) to be assigned
(the tag in already shifted by 14 bits).
And the third is the crate ID where the data base will be loaded.
Send your comments to: J.C.Wang