HITFINDER SWITCHES


HIT_SW table

Here, I list the switches used by the hitfinder (the HIT_SW table in TAS), and their default values.

Since we are mostly concerned with the new hitfinder, I do not describe here switches that apply only to the old hitfinder, but just list them.

Because TAS3 is not yet stable, no new switches have been added to HIT_SW, and all switches for the new hitfinder are being kept in HIT_SW.UNDERSHOOT (which controls switches special to new hitfinder) and HIT_SW.LPRT. (which controls the mode of running the new hitfinder) for now.

Switches currently in E895 Hitfinder
Switch Setting Comment
amplt
2
old
camac_trig
0
camac filtering switch (off)
degug
0
old
decon
1	
old
deconx
1	
old
distn
1	
apply (1) or don't apply (0) distortion correction.
Not yet implemented in new algorithm!
error
0	
old
fmthd
1	
historical format switch.  If >0, "new"(current) format assumed
gapmax
10	
old
globl
0	
old (used for graphical debugging)
init
1	
initialization flag for hitfinder - just keep it 1
lprt
0	
**** see below **** 
phase
0	
apply (.ne.0) or do not (.eq.0) TPC phase from CAMAC table
printf
-5	
sets amount of to-screen diagnostic output
pshdc
1	
old
simul
0	
running with real data (0) or fsim (.ne.0)
t0_corr
1	
apply (1) or not (0) t0 correction
time_buckets
160	
# time buckets
track
0	
used in fsim mode only
trff
2	
old
attn
0.9000000	
old
bfield
1.000000 
magnetic field (T)
discr
20.00000  
old
driftv
5.500000  
drift velocity (cm/us)
hv
10000.00  
TPC high voltage (V)
laser
0.   
just keep it 0
merge
1.000000   
old
noise
4.000000   
ADC noise
phoff
756.0000   
phase offset of TPC
pkvl
3.000000   
old *** but will soon be implemented in new
press
760.0000   
atmospheric pressure
satur
0.    
old
sig1
1.600000  
old
sig1_hi
3.000000  
old
sig1_lo
1.000000  
old
sig2
2.400000  
old
sig2_hi
5.000000  
old
sig2_lo
1.200000  
old
softw
1.000000  
basically obsolete.. keep it 1
temp
293.0000  
temperature (K)
undershoot
-50.00000 
old *** and new -- see below 
ydel
1425.000  
trigger delay (ns)
yoff
-34.60000 
distance from anode plane to magnet center (cm)


OK, for a couple of the switches above, I said see below, so here you are. Because of virtual tas fluctuations, I have not added any switches to the hit_sw table. Instead, I use two of the old ones. In the near future, when tas3 is stable, I will make new switches with names that more appropriately reflect the functionality of the switch.

1) HIT_SW.LPRT

This switch was used by the old hitfinder to allow one to print out some diagnostics, and had become obsolete.
Modes of the new hitfinder:
value of lprtimodeDescription
-99
0
Cluster/peakfinding and LOCAL peakfitting for hit x,y,z.
Area=amplitude
-100
1
Cluster/peakfinding and LOCAL peakfitting for hit x,y,z.
Area of hit (i.e. dE/dx) derived from GLOBAL fit of
cluster pattern varying amplitude.
-104
5
Cluster/peakfinding and GLOBAL fitting of cluster patterns
done, using crossing angles (from tracker) as initial guesses
for crossing angles.
-105
6
Cluster/peakfinding and GLOBAL fitting of cluster patterns
done, using crossing angles (from tracker) kept fixed in fit.
-109
10
Cluster/peakfinding and GLOBAL fitting of cluster patterns
done, assuming NO information from tracker.
-119
20
NO cluster/peakfinding done (no hits found).  Just outputs
2d pixel data for each row to an ASCII file.

Notes:

modes 0,1,10:

Modes 0 and 1 are "first pass" modes. That is, the hitfinder is acting on the raw pixel data before the tracker has seen it. In both cases, all clusters are found, and peaks within the cluster patterns are found. The positions of the hits associated with these peaks are obtained from fits to *pixels around the peak only*, ignoring the presence of other peaks (i.e. a LOCAL fit, not a GLOBAL fit). In mode 1, an additional step of doing a global fit (i.e. fitting the full pixel pattern) while varying the amplitude only of each hit is done. This should improve dE/dx resolution over mode 0, but not spatial resolution.

Mode 10 is also a "first pass" mode, but not one that I had envisioned using as the default. Here, a GLOBAL fit to the whole cluster pattern is done, varying all parameters associated with each hit. If one wants to *fit* the full 2-dimensional pixel pattern for a cluster with N peaks (hits) in it, then one has 5*N parameters to vary in the fit; for each hit, these are: x, y, amplitude, alpha, lambda, where alpha and lambda are the crossing angles of the track as it crosses the padrow. This mode should be extremely slow.

modes 5,6

It is possible that one would like to do a two-step "hit-track-hit-track" pass through the data to obtain maximum tracking precision. The reason is that the shapes of the pixel patterns depend on the crossing angles of the tracks that created them. These angles are not known by the hitfinder a-priori.

As we have said, to globally fit the cluster pattern, we must have 5*N parameters, which is a LOT, especially for N>2. So, it would be nice to know something about alpha and lambda.

Modes 5 and 6 above are therefore "second-pass" modes. The hitfinder has gone through the data once (in a "first-pass" mode), and the tracker has come along and found tracks, filling in the crossing angle information into the hits table for each hit. This infomation is then used either as an initial guess for alpha and lambda, which are then allowed to vary in the fit (mode 5), or are kept fixed, reducing the number of degrees of freedom to only 3*N (mode 6).

All modes are implemented, but real testing has only been done with modes 0 and 1. I would like to try the other modes too.


2) HIT_SW.UNDERSHOOT:

This switch was used by the old hitfinder algorithm, but is essentially obsolete. It was used to reject "negative" pulses. Its default value is -50.

UNDERSHOOT is REAL*4. I have a variable INTEGER*4 ISWITCHES, which is filled by ISWITCHES=INT(HIT_SW.UNDERSHOOT).

Here is the bit encoding of ISWITCHES (bit 0 is the least significant bit (LSB)).

Bit encoding in iswitches
bitIf bit is 1
0
Make (and keep in paw) some 2-d histograms of pixel patterns
on a padrow.
1
Calculate RMS_pad and RMS_time and output them to a file for
use in training the triage cut (see below).
2
Perform triage cut (see below) to decide whether to search
for multiple peaks in a cluster pattern.
3
If in "second pass", keep only those hits that were used by
tracker in "first pass"-- not currently implemented.
4
If in "first pass", do NOT store pixels/clusters for use in
"second pass".  (see below)
10-20
= Max # peaks in a cluster before we try to break up the cluster
into subclusters. (see below).

NOTES:

bit 0

bit 0 is just for my use to make some histograms to look at. Feel free to make the histos too, but don't do it for multiple events, or else you could run out of memory.

bits 1 and 2

After finding all cluster patterns in a padrow, the next step is to look for multiple peaks in the cluster pattern, and do some sort of peak significance test to see if they are "good" peaks. This is very effective, but cpu-intensive. It turns out that for most clusters, it is clear right away that the multi-peak finder will only find one peak. One can make a very fast decision about this based on the second moment of the cluster pattern in the pad and time direction (RMS_pad and RMS_time); this cut is called a "triage cut," and must be tuned to the data.

In order to tune the cut, one can turn on bit 1 (bit 0 = LSB) and get an ASCII file of # peaks found, and the second moment. I have done this already, and the appropriate cut values for the triage cut are hard-wired into the code now (I will make this a switch later).

In order to make use of the cut, turn on bit 2. In normal operation, you should always have bit 2 on (and bit 1 off).

bit 4

We have discussed the possibility of doing a "two pass" operation. In the first pass, we find hits, then use them in tracking. It is cpu-wasting to re-find the same clusters and hits in the second hitfinding pass, so the new hitfinder saves the info about clusters in the first pass, for use in the second pass. Compared to re-finding the hits, this saves time. However, if you do not *intend* to do a second pass, it is a waste of time to bother saving the info at all (it takes quite a bit of time, actually, because the data is packed to save memory).

So, if you do not intend to do a second pass, turn on bit 4.

bits 10-20

About bits 10-20: We have said several times that global fitting of a cluster requires variation of 5*Nhits parameters. In the E895 data it is not unusual to have 100 hits in a cluster!! Therefore, in order to process these clusters before the millenium, an algorithm is implemented that iteratively raises the threshold to break off smaller clusters (mostly from the edge of the "mother" cluster) until all clusters have Nhits .le. some maximum number. This maximum number is set by the bits 10-20.

The cluster-breaking mechanism discussed above is also cpu-intensive, so it is wise to skip it if you don't need it. Therefore, if you do NOT INTEND to do global fitting of the cluster (i.e. mode 5,6,10) either in this pass or the second pass, then set this maximum number high (1024). If you DO INTEND to do global fitting, then set it to something like 4.

Switches to be implemented

This is a functional beta version. There is still functionality I will implement, and some switchable stuff that is currently hardwired.

I have more or less optimized these cuts and hardwired what I think are best, but will make them switches in case I or anyone else wants to to explore them further. I will do this when tas3 is operational.

Switches to be implemented
SwitchFunctionality
peak-to-valley ratio
this is the 2-dimensional
"hit significance test" cut
triage cut values
see discussion above
electron rejection
we make lots of delta electrons in the TPC, which
spiral down to the padplane and basically "kill"
the time buckets in pads below where the delta
was made.  Pattern recognition exists in the code
to eliminate these buckets.  It is currently
hardwired "on".
step size for cluster breaking
we discussed that prior to deconvolution
(global fitting), big clusters are broken into
smaller ones.  This switch sets the "granularity"
with which the cluster-breaking is done (obviously
it also affects the speed).


Back to E895 Hitfinder Main Page