Arithmetic DQFs return floating point numbers.
Table 6.1 lists all available Arithmetic DQFs. There follows here a set of notes to go with that table.
Note: The PMT coordinate system has the Z axis along the axis of symmetry pointing towards the front of the PMT. The origin is within the PMT, approximately 17cm below the front face of the concentrator.
' num_mctk nzbank MCVX-$KMCVX_MCTK; 'will store the number of tracks at the vertex. Unlike other DQFs, if the address of the bank is 0, it will not be treated as an undefined parameter, so counting banks in an empty linear chain will give a zero.
' d_tfit time_difference MCVX+$KMCVX_TIM,FTTV+$KFTXV_T; 'gives the time difference between the fitted time (from the time fitter) and a vertex time. This function passes its arguments as the first two arguments to the utility routine TIME_DIFFERENCE. Please consult that routine to see exactly what pairs of times can be compared and what assumptions are made when computing time differences.
' time_jdy ntime EV+$KEV_JDY; ' ' time_sec reserved ; ' ' time_msec reserved ; ' ' time_nsec reserved ; '
and NTIME returns:-
If two parameters are supplied the first should be the Global trigger time and the second parameter is a dummy (just used to signal that the 50MHz clock is being used). For example:-
' time_jdy ntime EV+$KEV_GTR,0; ' ' time_sec reserved ; ' ' time_msec reserved ; ' ' time_nsec reserved ; '
In this case NTIME returns:-
This second form can be useful when analysing some of the early data, if the 10MHz clock was not running. The format can be recognised as the first word is negative. It is a minus the processed event number and can be used to provide protection against one rollover; assuming that events are processed in time order. NTIME_DIFFERENCE can accepts both formats, but they must not be mixed within a single call.
' dtime ntime_difference time_jdy_1, time_jdy_2;'
' drxsun dirsun EV+$KEV_JDAY; ' ' drysun reserved; ' ' drzsun reserved; '
' thresh ccc_info $CCC_THRESH, pmt+$KPMT_PIN; ' ' thresh_z ccc_info $CCC_THRESH_ZERO, pmt+$KPMT_PIN; ' ' status ccc_info $CCC_STATUS, pmt+$KPMT_PIN; ' ' hv ccc_info $CCC_HV, pmt+$KPMT_PIN; ' ' tube_ok ccc_info $CCC_TUBE_ON_LINE, pmt+$KPMT_PIN; ' ' chan_ok ccc_info $CCC_CHAN_ON_LINE, pmt+$KPMT_PIN; 'where symbol table mnemonics are used to specify the type. Their meanings are as follows:-
Mode | Mnemonic | Data returned |
1 | CCC_THRESH | 8-bit discriminator setting |
5 | CCC_THRESH_ZERO | 8-bit discriminator zero |
3 | CCC_STATUS | 4 byte status. See ccc_info.for |
6 | CCC_HV | 8-bit high voltage. |
7 | CCC_TUBE_ON_LINE | = 0 if PMT offline, = 1 if on-line |
8 | CCC_CHAN_ON_LINE | = 0 if channel offline, = 1 if on-line |
The full status returned by CCC_STATUS is 4 bytes long and hence cannot be converted to floating without precision loss, so only one byte is returned. By default this is byte 0, the crate byte, although others can be selected by supplying a third parameter. Example:-
' cra_stat ccc_info $CCC_STATUS, pmt+$KPMT_PIN, 0; ' ' car_stat ccc_info $CCC_STATUS, pmt+$KPMT_PIN, 1; ' ' cha_stat ccc_info $CCC_STATUS, pmt+$KPMT_PIN, 2; ' ' pmt_stat ccc_info $CCC_STATUS, pmt+$KPMT_PIN, 3; '
' rec_no record_number ; '
' six multiply 2.,3.; '
' run_time run_time; 'By default is stores the number in single precision, but supplying a parameter, whose value is immaterial, it produces a double precision result:-
' run_time run_time, 1; ' ' Run_tim2 reserved; 'This is not generally useful in an n-tuple, as PAW only knows about single precision floating point numbers in row-wise n-tuples, but is used by the Random Access Analyser (see section 8.1).
' lcn map_ccc_lcn PMT+$KPMT_PIN; '
' impct_p impact_parameter MCVX+$KMCVX_PSX, MCTK+$KMCTK_DRX; 'For this example, this will give a measure of the asymettry of the Cherenkov cone for the particle given in the MCVX bank. A large impact parameter means the cone is skewed; a small impact parameter means the hit pattern should be circular. This is useful number for things like muon tracks, where the impact parameter is the only parameter that can break spherical symmetry.
E.g.:-
' shell_x track_extrap MCVX+$KMCVX_PSX, MCTK+$KMCTK_DRX 900;' ' shell_y reserved; ' ' shell_z reserved; 'This will give the X,Y,Z coordinates of a point along the track direction with a distance 900 cm from the origin. This is useful for finding things like the position a high-energy muon leaves a spherical region (assuming a straight track), given only it's intial vertex.
' two divide 6., 3.; 'If the absolute value of the result exceeds 1.e+30 the result is set undefined.
par ft_unc fttv; perp reserved
If there is no fit direction (ie no ftxt) then the dqf will return undefined, so it will not bomb the code if used with the quad fitter for example. If the covariance matrix is not defined by the fitter, then the result will be unpredicatble. (It will not be zero unless the ftxv bank is lifted with initialization to zero of bank contents; it is up to fitter authors to define this.)
Currently only FTT supports this option, although it would be straight-foward to add to any time-based fitter.
data_set data_splitter 3;
is equivalent to
data_set data_splitter;
The DQF returns an integer indicating to which data set the current event belongs. For example a user defined filter that splits the data into 3 sets and only allows events in data set 1 to pass would look like this:-
$enable_test 1 $define_test 1 $no_scan $define_test 1 $line_1 'data_set data_splitter 3; ' $define_test 1 $line_2 'test eq data_set,1.; '
Assuming that the user (or default) has specified that the data should be split into 3 sets then the code works in the following way:-
First the code grabs the time stamp of the current event, then, using the start and end times of the current run, it splits the runs into 3 consecutive time bins and works out which time bin the current event sits in. There then follows a mapping from time bin to data set. Currently the algorithm for doing this is to add the run number to the time bin and call the result "shifted_bin" and then to calculate 1 + MOD(shifted_bin, 3). The result of this is the data set to which the current event has been assigned.
The time bins do get pseudorandomly rearranged into data sets, but in such a way that consecutive run numbers just have their time bins cyclically permuted by one step relative to each other. This could be changed in future if it is not considered sufficiently random. The important point is that the mapping is deterministic - an event assigned to data set 2 by a SNOMAN run will always be assigned to data set 2 by any other SNOMAN job.
' year bits_10 EV+$KEV_DTE,4,4; ' ' month bits_10 EV+$KEV_DTE,2,2; ' ' day bits_10 EV+$KEV_DTE,0,2; '
In the above example the year, month and day are extracted from EV's local date stamp.
Number of parameters: 0
This function returns summary information on the detector configuration from the DQXX banks. The information is returned as an 6-element array of real values:
Element Description
1. # of crates operational (operational == present, receiving GTs, online, and HV .ne. 0)
2. # of slots operational (operational == crate, MB, PMTICs, DCs all present, eCPU readout enabled, relays all on)
3. # of relays on
4. # of channels with 100ns trigger enabled
5. # of channels with sequencer enabled
6. # of channels with HV on (HV on == PMTIC channel resistor present and relay on and crate HV .ne. 0)
Example of use as part of an ntuple definition:
#. Variable Function Parameter(s) #. Name #. ' ncrates config_info; ' ' nslots reserved;' ' nrelays reserved;' ' n100ns reserved;' ' nseq reserved;' ' nch_hvon reserved;' ' END_OF_NTUPLE; ' #. This marks the end of the ntuple.
Note, if number of crates operational is zero, the rest of the values default to zero. A likely cause of this condition is if the correct DQXX bank is not found in the database.