The
determination T0 or TDC pedestal
The time spectra and pulse heights can be checked
by using the codes
BASIC
and
SIMPLE_XY_CLUSTER.
The executable file is created by means of `make -f
make_basic',
then running this executable file with `
run_basic_ped' should be able to produce a histogram containing all
necessary information for determining the TDC pedestals. Before heading
down the bussiness of determining T0, one should check all the plots avaliable
in the histogram created, spoting any possible problem of cable swapping,
etc. For example, one can checked the plot of ADC cluster vs wire
for each foil layer and see if there is any offset as shown in
this plots
(top two are the problematic ones with cathode cables swapping in the same
foil layer, while bottom two are the ones after this problem is fixed.
Also shown
here are the cathode cable swaping between two different foil
layers. The cable swapping problem should be fixed before the calibration
work can go further. Detail correction can be found in below with
titles of "UTC map".
With all the available time spectra, one should be
able to get the TDC pedestal for each channel by means of a normal frequency
function
Amp*
FREQ((X-T0)/Sigma)
+ Noise
taking into account the noise contribution. To
do so, an executable file should be first created with `make -f
make_t0fit',
linking the codes
T0FIT,
FITARRAY,
LENSIG
and
KERROR.
Running this executable file with `
run_t0fit' to fit the time spectra produced above, wire by wire and
foil by foil. A calibration constant file
t0fit***.txt
can then be obtained. As shown in
this
typical t0fit plot , to avoid a possible uncertainty originating from
the TDC pedestal determination, the lower noise level, the more reliable
TDC pedestal determination. The created t0fit***.txt
should be checked before it can be provided for any further purpose. In
some case, a negative value may show up in the file t0fit***.txt,
indicating a fail fit to the T0 due to no entry or fewer entries in the
plot or a `hot' wire with a potential noise. One can do nothing but assign
a neighboring wire t0 value to this wire. More strictly, you can use more
Kmu2 events, if they are available, to solve the no-entry or few entry
problem.
The determination of the space
time relation
In the first step one needs to process the raw data
and remove all unnecessary information, in order to reduce the size of
the Kmu2 data file, because the STR finding needs an iterative procedure--a
time consuming job. A special code
DROPB
is thereby used. Creating an executable file with `make -f
make_dropb',
one can use `
run_dropb' to produce a compact data file called
run***.skim1.
Then the codes
FINDSTR,
WRITE_STR,
UTC_ABIN,
UTC_BOOK
and
TFITXY
are used to create an executable file with `make -f
make_findstr'.
The procedure of finding the STR will start by means of `run_findstr_ang',
which will use the TDC pedestal calibration file given above and perform
a seven-parameter polynomial fit to the space time relation for each layer
with left and right separation and four angle divisions as shown in
these
plots, giving a calibration file named findstr*.txt.
To improve this calibration, an iterative procedure will be strongly encouraged
to use with `run_findstr_ang_long',
in which the starting value can br the above findstr*.txt.
The last iteration will give a findstr*_6.txt
used as the standard calibration file. The space time relation is very
important in UTC track reconstruction. Before put it into CFM data base,
it is better to check the resolution variation with the cell fraction as
shown in
the
plots with good fit and
the
plots with bad fit . Since the seven-parameter
fit may not describe the STR very well, using the histogram and setting
a look-up table for STR can also be done. However, we can not find any
improvement on
the
muon momentum (the result from the look-up table is shown in dotted).
The ADC gain calibration
Once completing the TDC pedestal and the space time
relation calibration, the last calibration involving the UTC is the ADC
gain calibration. In practice, one needs the latest
t0fit***.txt
and
findstr*.txt calibration files. In the
first step, the ADC information should be filled into the histograms by
using `make -f
make_utc_nt',
linking the necessary codes
UTC_NT,
CALC_PATHLEN
and
CALC_PATHLEN_B0.
Using `
run_utc_nt', the histograms are thereby created.
To get the gain factors, all ADC information with respect to each wire
and foil in the histograms is fitted by using `make -f
make_adcgain'.
The called codes are
ADCGAIN,
FITGAUSS
and
TRUNCMEAN.
Then run run_adcgain,
performing a fit to the ADC information as shown in
these
plots. The calibration files anode wires and cathode foils are produced
with the names adcgain***_an.txt and
adcgain***_ca.txt.
Since there are some dead wires or strips in the used calibration sample,
it is likely that the ADCGAIN calibration can not be performed, giving
values like 1.0000 -1.0000. In this case, the best solution, of cause,
is to use another calibration sample if it is available. Otherwise, the
values from the neighboring wire/strip will be assigned to this channel.
Check for the calibration
Before all above calibration files can be in use, it is necessary to run
the test codes including
KINEMA,
RGSCIN,RD_TRK_ANAL,
MY_TRKPOS
and HBKINI,
using `make -f make_kinema'
and `
run_kinema' to process the KMU21 data. If the muon momentum (PTOT)
is centered around 235.5 MeV/c, and the momentum resolution is around 3
MeV/c, that will indicates a good UTC calibration.
Check the UTC MAP for anodes
From time to time, UTC cables are swapped during the maintenance period.
Once the above UTC calibration is done, a check should be conducted to
see if the UTC map is correct. Here is an example:
the
scatter plots of xy residual vs wire # show a gap at the common position
in each sub-layer. Since a check on the wire
TDC
and
ADC
occupancy (from the ntuple produced by running
run_basic_pedabove)
show no problem in these anode wires, these gaps should be regarded as
a result of using a wrong UTC map. Looking into the file for UTC mapping,
usually named as ut_map.****, one should be
able to find out the TDC cable for these gap and swap the cable as given
here.
And then, use the correct UTC map, redo the calibration until the gap is
gone as shown
here.
Since anode TDC and ADC readout the same preamp and postamp, when correcting
the TDC map, it is also needed to correct the corresponding ADC map, which
is usually named as
ua_map.****.
Check the UTC MAP for cathodes
The check of the cathode map is not so straightforward as we did for the
anode map, since a cathode hit cannot give a z position without knowing
the anode wire number in the adjacent layer. To spot the problem, one should
check the z residual vs strip number for each foil as shown
here
for single strip hit in the 5th foil layer. One can see there is a gap
covering strip number from 109 to 114. Also observed is the funny behavior
at strip number 48 and 56. By examining the cathode strip occupancy plots
for
ADC
and
TDC
(also from the ntuple created by running run_basic_ped
above), one finds no problem for these strips except for strip 48 and 56
with no ADC count. Since the gap covers 6 channels being consistent with
a single preamp configuration, the problem may arise from either the channels
order changed or swapped with other cable. Looking into the file for UTC
mapping, usually named as uc_map.**** for
cathode ADC and ut_map.**** for cathode TDC,
changing the maps, one can see if the gap is filled by using the new map.
For the problem shown above, we found it was swapped with a preamp cable
in the 6th foil layer. The corrected map as given
here.
After correcting the strip ADC and TDC maps, the
plot
of z residual vs strip number for single strip hit in the 5th foil
layer shows a normal distribution. In some case, one can debug the code
'utc_z_adc' and check all the strip hits. From the anode cell number, one
should be able to determine the expected z position for the studied strip.
Using the informatin from the code 'utc_setup', one may tell the correct
the strip map. It is noted that the z residual for the neighbor strip will
become worse when there is a dead strip as shown
the
above plot.
Install the calibration files
into CFM data base
The final step is install the above calibration into the calibration file
management (CFM) system. To do so, log in on bnlku9 as e787, setup kofia
and copy the calibration files to $CAL_DB. The naming convention for the
UTC stuff is
| Content |
File name |
| TDC pedestal |
ut_ped.nnnnn |
| Space time relation |
ut_sta.nnnnn |
| Anode ADC gain |
ua_gai.nnnnn |
| Cathode ADC gain |
uc_gai.nnnnn |
Usually nnnnn is set to 1 greater than
what is already in $CAL_DB. Start up CFM by typing `cfm'
and answer two questions
Do you want to READ or WRITE the CFM database
(R/W) ? w
Enter your user name: XXXXX
Update the database by
modify 35000:40000 ut ped 14
modify 35000:40000 ut sta 11
modify 35000:40000 ua gai 6
modify 35000:40000 uc gai 10
exit
The above example shows how the new calibration files are installed
for the run number ranging from 35000 to 40000.
When all are set, send a mail to e787.pass1@viper.princeton.edu and inform
people that the UTC calibration has been updated.