BTeV RICH Testbeam 2005


Chrenkov Ring

  1. The DAQ system.
  2. Channel mapping
  3. Data format
  4. Different studies and list of runs
  5. Scan plots
  6. Issues in data
  7. Offline analysis code

The BTeV RICH group had prototype gaseous RICH detector tested in an 120 GeV proton beam at FNAL (01/10/05-01/31/05). Full Cherenkov rings were recorded at various settings. This note is served mainly as a guide to offline analysis. It is arranged in this way: first a brief introduction to the DAQ system, then channel mapping followed by the format of data file, explanation of different studies, existing issues in data and solutions, and last the instruction on offline code. Other information can be found elsewhere.

The DAQ system

It is always wise to clear nomenclature issue at the beginning. For this purpose let me briefly describe the whole process of signal.

A proton travels through C4F8O gas in the RICH tank. It produces Cherenkov lights along its trajectory. Cherenkov photons are focused by a mirror downstream onto a MAPMT array, and produce analog electronic signals. The MAPMT tubes are mounted on baseboards which connect to front end hybrids(FEH). The analog signals from MAPMTs are converted into digital signal on FEHs. The digital hit signals are shipped to a DAQ computer via multiplexer (MUX) boards, sets of short and long cables and feed through (FT) boards. The DAQ computer in counting room houses 6 pairs of PCI based PTA (PCI Test Adaptor) and PMC (Programmable Mezzanine Card) boards. The PTA/PMC pairs process the hit signals, add unique numbers to identify different front end boards (plane ID). An incremental counting (BCO ID) of 16MHz clock is also added before hit signals on each PTA/PMC pair so that one can group hits from different PTA/PMC into events (event alignment). Part of cable connections and part IDs can be found in tb05_connection_1.gif and tb05_connection_2.gif.

The MAPMT array consists of 53 MAPMT tubes (A 54th tube was populated by not used). Each MAPMT tube has 16 cells (pixels) in a 4×4 array. Each baseboard can connect up to 16 MAPMT tubes. The mapping of cells and tubes is explained later. The baseboards also provides HV power to MAPMT tubes. The tubes are gain matched into three groups, connected to different power supplies with different voltages. For the grouping and cable connection between baseboards and FEHs please see Steve's plot. The final configuration is slightly different and will be explained later.

Each FEH processes analog signals from up to 128 channels, thus can serve up to 8 MAPMT tubes. Each hybrid connects to one multiplexer (MUX) board which also provides low voltage power. In total 12 FEHs are mounted and 10 of them are really used. Each PTA/PMC pair connects to 2 FEHs.

We have two DAQ computers: one PC with window OS, and the other with Linux. The window PC runs a Labview based program mainly for firmware development and debug. For normal data taking we use Linux machine runs a program coded in C++. The BCO header and hit data direct from PTA memory buffer, with addition of several control words, are written in a "raw data file" on hard disk for further study. The BCO header and hit data words are further processed offline, with hits from same physics event grouped together using the BCO header and other information. The event alignment also happened online for quality monitor, and the aligned events were written to a file for quick offline studies. The C++ based program is modified from "Pomone" package developed by Milano group mainly for BTeV pixel testbeam.

Channel mapping

The configuration of MAPMT tube in this test (see mapmt_layout_7.jpg, mapmt_layout_7.ps) is slightly different from what we had for beamtest 2004. Three MAPMT tubes are moved around to have better ring image.

In total 12 FEHs are used to read out all MAPMT tubes. Each FEH is assigned a plane ID from 1 to 12. In the data file only the plane ID and channel ID of FEH can be reconstructed. Thus a clear mapping between FEH channels and MAPMT cell locations is necessary. In order to clearly identify segments we denote each baseboard, α to δ from top row to bottom row and 1 to 4 from left to right looking from mirror. The connection between FEHs and the base boards are as listed in (tb05_connection_2.gif). Note that base board δ-1 has two FEHs connected to it. The bottom one corresponds to plane 9, which is not used. The other one that is not used is plane 1.

Each FEH has 128 channels with ID from 1 to 128. It can process analog signal from up to 8 MAPMT tubes. Thus a MAPMT is given an octet ID, shown as the second number in plot map_mapmt.gif. The first number corresponds to plane ID. The location, octet ID and plane ID (FEH ID) of each tube are listed in map_feh.dat file. Also listed is the orientation of the tube with respect to the channel ID. With this map file a more detailed FEH-channel to cell location map is easily generated as map_cell.dat (plot in map_cell.ps), which is used by offline analysis code.

Data format

Click following plots or tb05_format.pdf for reference.

When a PMC receives a trigger signal it generates a 32-bit trigger header including a 26-bit synchronized counting of 16 MHz clock (extended BCO count) which is used to align events between different PTA/PMC pairs. The PMC also passes trigger signal to FEHs.

If a FEH has hit data latched when it receives the trigger signal it ships out 12 14-bit words to PMC. The two least significant bits (LSB) of each word indicate data valid and hit data. The rest of first word is FEH BCO count. Each of the following 11 words contains hits from 12 channels, one bit to one channel. If there is no hit data latched no word is shipped, not even the FEH BCO count.

The PMC re-pack the data words from FEH into 11 hit data word, with FEH BCO count in each hit data word. Information also packed are the plane IDs indicating which FEH the data is from and word IDs indicating which 12 channels. Even if there is no hit from both FEHs connected to the PMC, it ships the trigger header.

The trigger header and hit data words are stored in one of the two EEPROMs on each PTA card. When one of 6 PTAs reports memory full all PTAs receive memory toggle commands and each dumps the memory into a sub-buffer. All 6 sub-buffers together form a superblock with a serial ID. Each sub-buffer is written to a raw data file as one block led by a superblock ID word and length of the block. The superblock ID and the trigger header is to be used to align events.

The raw data file is processed offline to generate a more sophisticated final data file for study of each event. The file contains a run header block at the beginning, run trailer block at the end, both contains general information of the run. In between there are event blocks. The endian issue is taken care of. A file of same format is also created by online program for monitor and quick offline study purpose.

Different studies and list of runs

Various tests that had been done are listed in Ray's summary. In this section a more detailed list is given. For a complete list of useful runs see the Run lists.

The setting of the electronics, HV, and trigger windows changes for different tests. The MAPMTs are gain matched into 3 groups and applied different HV. They are listed as HV1 (planes 1, 2, 3, 5), HV2 (planes 4, 6, 8, 9, 10) and HV3 (planes 7, 11, 12). The nominal HV settings are HV1=800, HV2=750 and HV3=700V respectively. The trigger window is set to be 1000 ns or 500 ns for most tests. The nominal values of electronic bias DACs are THR(threshold)=121, Vfp=161, Vfs=163 and Vrc=213. If not specifically stated the bias DACs are set to nominal values.

  1. Light leakage test: The light tightness of the the RICH enclosure is much better than last beamtest. The new DAQ system is also less sensitive to random light leakage due to the triggering scheme. The two runs recorded in this test are 823 with lights in the beam hall on, and 824 with most of the lights switched off. The settings are: All HV=1000V, THR=123, Vfp=158, Vfd=165 and trigger window of 1000 ns.
  2. Observation of the first ring: While there is beam and the scintillation coincidence trigger was still under testing we took a short run, 836, with an 1K Hz pulser source as trigger to the DAQ. We observed the first ring ( first_ring.jpg , first_ring.ps ). In this run there are two Cherenkov ring events with 43 and 49 hits respectively. The settings are All HV=700V, THR=123, Vfp=158, Vfs=165 and trigger window of 1000 ns.
  3. HV scan 1 with beam: This is to determine the nominal operating voltages. We scanned HV between 500 - 950 V at steps of 50V. The runs (847 - 854) were taken with THR=123, trigger window of 1000 ns. They were analyzed briefly to determine plateau as shown in
    1. hv_11_nhits.jpg , hv_11_nhits.ps : average number of raw pixel hits per event.
    2. hv_11_nclus.jpg , hv_11_nclus.ps : average number of cluster hits per event.
    3. hv_11_csize.jpg , hv_11_csize.ps : average size of clusters.
    We use cluster hits instead of pixel hits to rid of cross-talk effect. Any adjacent channels that have hits are grouped in one cluster. A cluster hit is treated as one photon. Due that the geometry location of each MAPMT cell/pixel is correlated with channel ID, this treatment is not totally correct. On the top and bottom of the ring, ie planes 2, 3, 10 and 11, a cluster may be from two or more photon. We also count average number of clusters without background rejection. For determination of nominal setting, however, this treatment is precise enough. From number of clusters and cluster size plots we decided that HV1=800, HV2=750 and HV3=700 is an ideal setting.
  4. Threshold scan 1 with beam: With nominal HV setting and trigger window of 1000 ns we scanned threshold from 103 - 126 step of 2. We also took runs without beam for couple of thresholds. Similar to that of HV scan runs we checked number of clusters vs threshold and decided to use 121 as nominal THR (threshold DAC) setting. But for most of rest studies we also took data at THR=105.
    1. th_61_nhits.jpg , th_61_nhits.ps : average number of raw pixel hits per event.
    2. th_61_nclus.jpg , th_61_nclus.ps : average number of cluster hits per event.
    3. th_61_csize.jpg , th_61_csize.ps : average size of clusters.
    4. th_61_cs_feh.jpg , th_61_cs_feh.ps : average size of clusters on each FEH.
  5. Trigger window study: This is to study how the width of trigger window affects the data taking. We took data with and without beam and varied trigger window width between 25 ns to 1250 ns.
  6. Trigger delay study: This is to test different delays in the Firmware of FEH. The delay was tested between 1 to 6 clocks in the beam with trigger window 500 ns. The nominal value of the delay is 6 clock.
  7. Firmware test: Run ID is 963, inside beam with 500 ns trigger window. The purpose is unknown to me.
  8. HV scan 2 with beam: This is a refined HV scan with step 25 V and large amount of data at each points. The threshold is set to be 121 and 105, trigger window 500 ns. At three points including the nominal HV setting we took data at different time to study stability.
  9. HV scan 3, anti-beam: This scan has same setting as HV scan 2. But the trigger uses anti-coincidence with scintillation counters while beam is on. It is to study the background in beam condition. But I would not be surprised to see Cherenkov rings.
  10. Beam intensity: This is to test how the beam intensity affects the data taking. The trigger window is set to 500 ns. The intensity was changed from ~6K/spill to ~70K/spill.
  11. HV scan 4, no beam: This scan has same setting as HV scan 2. It is to study the background without beam. We use a noise source at about 1 KHz to trigger the DAQ.
  12. HV scan 5, pulser: This scan has same setting as HV scan 2. But there is no beam, instead the LED pulser is enabled by 1 KHz pulse generator. The same pulse was sent to trigger the DAQ. This is to study the cross talk. Since there is no Cherenkov rings it is much easier especially for planes 2, 3, 10 and 11 which are on top or bottom of the configuration ring.
  13. Threshold scan 2, pulser: This scan has same setting as threshold scan 1. There is no beam but LED pulser. It is to study cross talk effect.
  14. Mirror adjustment: The mirror was adjusted at the beginning of the testbeam runs so that the MAPMT array could cover Cherenkov ring better. With improved gas purity the mirror needs to be adjusted further. The runs are taken with different thresholds and HV settings to have better Cherenkov ring plots ( accum_1112.jpg , accum_1112.ps ).

Scan plots

Scan Settings Scan curves Comment
Number of raw hits Number of clusters Cluster size
High Voltage Trigger window = 1000 ns
THR=123, beam
hv_11_nhits.jpg
hv_11_nhits.ps
hv_11_nclus.jpg
hv_11_nclus.ps
hv_11_csize.jpg
hv_11_csize.ps
Nominal HV setting determined
in this scan
Trigger window = 500 ns
THR=121, beam
hv_21_nhits.jpg
hv_21_nhits.ps
hv_21_nclus.jpg
hv_21_nclus.ps
hv_21_csize.jpg
hv_21_csize.ps
yy
Trigger window = 500 ns
THR=105, beam
hv_22_nhits.jpg
hv_22_nhits.ps
hv_22_nclus.jpg
hv_22_nclus.ps
hv_22_csize.jpg
hv_22_csize.ps
yy
Trigger window = 500 ns
THR=121, anti-beam
hv_31_nhits.jpg
hv_31_nhits.ps
hv_31_nclus.jpg
hv_31_nclus.ps
hv_31_csize.jpg
hv_31_csize.ps
yy
Trigger window = 500 ns
THR=105, anti-beam
hv_32_nhits.jpg
hv_32_nhits.ps
hv_32_nclus.jpg
hv_32_nclus.ps
hv_32_csize.jpg
hv_32_csize.ps
yy
Trigger window = 500 ns
THR=121, no beam
hv_41_nhits.jpg
hv_41_nhits.ps
hv_41_nclus.jpg
hv_41_nclus.ps
hv_41_csize.jpg
hv_41_csize.ps
yy
Trigger window = 500 ns
THR=105, no beam
hv_42_nhits.jpg
hv_42_nhits.ps
hv_42_nclus.jpg
hv_42_nclus.ps
hv_42_csize.jpg
hv_42_csize.ps
yy
Trigger window = 500 ns
THR=121, pulser
hv_51_nhits.jpg
hv_51_nhits.ps
hv_51_nclus.jpg
hv_51_nclus.ps
hv_51_csize.jpg
hv_51_csize.ps
yy
Threshold Trigger window = 1000 ns
HV=800/750/700, beam
th_61_nhits.jpg
th_61_nhits.ps
th_61_nclus.jpg
th_61_nclus.ps
th_61_csize.jpg
th_61_csize.ps
yy
Trigger window = 1000 ns
HV=800/750/700, no beam
th_62_nhits.jpg
th_62_nhits.ps
th_62_nclus.jpg
th_62_nclus.ps
th_62_csize.jpg
th_62_csize.ps
yy
Trigger window = 1000 ns
HV=800/750/700, pulser
th_71_nhits.jpg
th_71_nhits.ps
th_71_nclus.jpg
th_71_nclus.ps
th_71_csize.jpg
th_71_csize.ps
Runs are not good.
Trigger window HV=800/750/700
THR=121, beam
wd_81_nhits.jpg
wd_81_nhits.ps
wd_81_nclus.jpg
wd_81_nclus.ps
wd_81_csize.jpg
wd_81_csize.ps
yy
HV=800/750/700
THR=121, no beam
wd_82_nhits.jpg
wd_82_nhits.ps
wd_82_nclus.jpg
wd_82_nclus.ps
wd_82_csize.jpg
wd_82_csize.ps
yy
Trigger delay Trigger window = 500 ns, beam
HV=800/750/700, THR=121
td_91_nhits.jpg
td_91_nhits.ps
td_91_nclus.jpg
td_91_nclus.ps
td_91_csize.jpg
td_91_csize.ps
yy
Beam intensity Trigger window = 500 ns, beam
HV=800/750/700, THR=121
it_a1_nhits.jpg
it_a1_nhits.ps
it_a1_nclus.jpg
it_a1_nclus.ps
it_a1_csize.jpg
it_a1_csize.ps
yy

Issues in data

There are issues in the raw. Here is a list and current solutions.
  1. Due to the existence of phase difference between clocks on different PMCs, the BCO ID maybe different for the same event on different PMCs. The difference is smaller than 2. In event alignment this is taken into account.
  2. The memory block dumped from PTA may miss trigger header, Although the new PTA firmware are supposed to fix this problem. In this case the hit words at the beginning are skipped until there is a trigger header.
  3. Due to different time delays in memory toggling, memory blocks from different PTA contain not exactly the same amount of events. In event filtering any events that does not have trigger headers from all PTAs are rejected.
  4. In some of high intensity runs and pulser runs, one header may have too many hit words follows. Ideal case one header is expected to be followed by 0, 11, or 22 words. Currently any event with total number of hit words from all 6 PTAs more than 500 is rejected before the final data file. In the final data file there are still events with number of hit words more than it should have. This is to study the source of this problem. Further action is to be decided.
  5. Sometimes the trigger header from master PTA is totally screwed up. It stays at the same value all the time. Thus one can not align events. The source is unknown. In this case only a reboot can cure the problem. The events written in the raw data file with this problem are rejected. One exception is the threshold pulser runs when we had very tight schedule. The runs, however, are to study the crosstalk within each FEH, which is not affected by this feature. We thus keep these runs (1098, 1099, 1105,1106, 1108, 1109).
  6. More are coming.

Offline analysis code

The data files are copied to /cdat04/btev_rich/tb05/SORT which can be analysed on hepsu01-3 machines. A copy of basic codes is in /cdat04/btev_rich/tb05/WORK/tb_050307.tar. Here is a quick start example to display two events. More information and functions is introduced following this example and can also be found in
offline.pdf.

  1. Login to hepsu03 and change default (cd) to location where you want your working directory be.
  2. Un-tar tb_050307.tar file. This will create a directory tb_anal.
     tar -xvf /cdat04/btev_rich/tb05/WORK/tb_050307.tar
  3. Compile the source code
    cd tb_anal/src
    gmake
    cd ..
    
  4. Run the program and display first two events.
    ./rich_tb
    display
    help
    next
    display
    event
    hits
    quit
    
Note that the excutive programs is rich_tb. The running of this program is controlled by a namelist file rich_tb.nml. Here is an explanation on what the control parameters are.
Parameters Function
data_in_file(1) Input data file, multiple files are supported.
data_out_file Output data file, default: SORT_xxxxx.dat or ANAL_xxxxx.dat.
hbk_out_file Histogram file, default: run_xxxxx.hbk.
map_file Channel ID to geometry conversion file.
hot_file Noise channel file.
max_evts Maximum number of events to be studied, 0 for all.
ncycle Cycle to dump an event, default:0 for no dump.
nskip Number of events to skip.
dump_opt Option in event dump, default: 0 for interactive dump.
drop_feh(1) Control removal of a FEH if value = 1.
max_hit_cut Maximum number of hits allowed, default: no cut.
min_hit_cut Minimum number of hits allowed, default: no cut.
max_feh_cut Maximum number of FEHs with hits allowed, default: no cut.
min_feh_cut Minimum number of FEHs with hits allowed, default: no cut.
runid_new Run ID, only useful in raw data study.

To look into details of each event, one can set parameter ncycle=1 and dump_opt=0. The program prompts for command. The commands and explanations are listed in the table. Abbreviation is accepted providing there is no ambiguity, eg, hi, not h, for hit. One integer parameter following the command may be used in some cases.

Command Explanation
help List all options.
next Continue with next event.
quit Stop the run.
raw Dump raw data block.
event Print event information.
hit Print all hits.
display Display the event (follows by no number, or value>10000) or a histogram (followed by histogram ID), note ID=3000 is accumulative hit plot till current event.
ps Display and generate an eps file (tmp.eps).
skip Set number of events to be skipped.
cycle Set dump cycle, default: 0 and no more dump.

The source codes in tb_anal/src directory are mostly written in FORTRAN with interface to C functions. Below is a list of files in this directory. The most interesting one to user is hit_hfill.F where the information are saved in histograms and ntuple.

File name Brief explanation
GNUmakefile Make file for "gmake".
display_2d.F Interactively display 2D event hits, accumulative hit map and other histograms.
dump.F Interactively dump event, and hit information.
histo_init.F Initialization of hbook/hplot environment.
hit_hfill.F Fill hits into histograms and CWN ntuple.
lowcase_string.F Convert string into lower case.
read_cell_map.F Read in FEH channel ID to MAPMT cell geometry location.
read_event.F Read in one event.
read_hot_cell.F Read in hot cell map.
read_namelist.F Read in control namelist in rich_tb.nml.
read_run_header.F Read header block of a run.
rich_tb.F The main program that controls everything.
rich_to_channel_id.F Convert a MAPMT cell ID into an ID that BTeV_RICH package understands.
sort_raw.F Study raw data file, select good events and align events.
string_contain.F Check if the string contains certain substring.
testbeam_dio.c C code that read in data file and decode event hits.
user_trigger.F User defined trigger, mainly to select event for dump.
write_event.F Write out aligned events.
write_run_header.F Write out run header in raw data study.
write_run_trailer.F Write out run footer in raw data study.


Send your comment to JC.