Next: Recording and Accessing Event
Up: Overview
Previous: The Problem
Contents
The solution, as implemented by TCA, is to sequentially read a time-ordered
n-tuple file and look for correlations by try to associate pairs of events
within a sliding time gate. Currently TCA can only process a single n-tuple
file - to concatenate file for now you will have to use the PAW command
NTUPLE/HMERGE. Possible future developments in this area include:-
- Concatenation of multiple input files.
- Parallel input of different types of input file.
- On-line running. The idea is that ANL and TCA would run in the same
job, with ANL storing an n-tuple into the event structure and TCA collecting
it from there.
You have to describe to TCA:-
- Two types of events, called PRIMARY and SECONDARY. The names are not
much more than convenient labels, for example, depending on what you want to
do, a primary can come before or after a secondary (or both!).
- A time gate i.e. a time window centred on the primary within which the
secondary must appear.
- Rules about the relationship between them. For example you might
require that the distance between their fitted vertices must not exceed some
distance.
- Which parts of the primary and secondary you want to record in a new
n-tuple each time an association is found.
TCA proceeds as follows:-
- It reads the first event from the input n-tuple into a buffer.
- It reads and buffers further events so that, relative to the first event,
the time gate is full.
- It looks for associations between the first event as a primary, and
other events in the buffer as secondaries.
- Each time an association is found an output n-tuple entry is generated.
- Once all possible associations with the first event have been tested,
it moves on to the second event and updates the buffer.
- The process repeats, with old events dropping out of the buffer and fresh
ones entering so as to maintain the time gate, until all events are processed.
To illustrate the way TCA is used, suppose you have an n-tuple with the
following 5 variables:-
- TIME
- The current absolute time. Actually we need 4 words to describe
this but we will return to this point in 7.2
- NHIT
- Number of PMT hits.
- X, Y, Z
- Fitted X, Y, Z.
and further suppose you are looking for a process with the following
characteristics:-
- A primary is an event with
60 hits.
- A secondary is an event with
20 hits.
- A secondary occurs within 100cm of the primary.
- A secondary occurs between 100 microsec before to 500 microsec after the
primary.
Most of this specification is recorded in a TCAR (TCA Request) bank which has a
form that is identical to the NTPR. However, unlike the NTPR, there can only
be one TCAR active at any time. The TCAR serves two purposes:-
- To define the terms primary and secondary and the rules for association.
- To define what elements of the primary and secondary are recorded in the
compound output n-tuple.
A TCA request to look for the type of process described above could be:-
nhits1 equals nhits_1: 60. 999999.;
nhits2 equals nhits_2: 20. 999999.;
_dist distance x_1, x_2: 0. 100.;
time1 equals time_1;
There are several points to note:-
So far we have not placed the most important restriction on the association,
namely the time gate. This is done with the command:-
$TCA_TIME_GATE -100000 500000
which requires the secondary to be no more than 100000 nsec before to
500000 nsec after the primary. You might be wondering why the time constraint
is not applied in the same way as the space constraint i.e. with something
like:-
_del_time1 difference time_1,time_2: -100000 500000 ;
for an answer you will have to wait until section 7.2
Careful use of lines that help define primaries and secondaries can save both
time and buffer space. For example, if an event fails the primary tests, TCA
won't waste time checking associations in which that event plays the role of
primary. If an event fails as both a primary and a secondary, TCA saves
buffer space by not storing it at all.
TCA operation requires two types of bank: TCAR which holds requests and TCAC
which controls the way TCA operates. The contents of TCAR has already been
briefly described. The TCAC bank provides default for the way TCA operates
and can be overridden by symbolic commands. For example, the command
$TCA_TIME_GATE
updates words in the TCAC bank.
Currently TCA only combines pairs of events. However the notation was chosen
to make it easy to extend to higher multiplicities and this will be done if
there is sufficient demand.
Next: Recording and Accessing Event
Up: Overview
Previous: The Problem
Contents
sno Guest Acct
2009-09-09