next up previous contents
Next: Capturing Data from Other Up: Defining Your Own N-tuples Previous: Defining N-tuple Variables   Contents

An Second Example NTPR Bank

The example NTPR above is part of the standard NTPR. It generates at most one entry per event. Below is another example that looks at PMT hits:-

 
 
*DO   NTPR  200  -i(25I 1F 3I -H)     #.   NTuPl Request
#.
20*0                    #.   Database Header  (to be defined)
#.
#.      User Data.
#.
3*0                     #.   3 Reserved words (don't touch!).
1                       #.   Enable flag: =0 Disable, =1 Enable.
5000                    #.   Primary allocation (not critical).
-999999.                #.   "Undefined" value.
1                       #.   Discard partial entry: =0 No, =1 Yes.
1                       #.   Scan D/S: =0 No, =1 Yes.
0                       #.   Call NTP_PACK_USER: =0 No, =1 Yes
' mcpmtd; '             #.   Ntuple name.
#.
#.      There now come a series of field entries.
#.
#.   Variable     Function        Parameter(s)
#.    Name
#.
' class    float_equals    MCVX+$KMCVX_CLS;               '
' pmt      float_equals    MCVX-$KMCVX_MCPM+$KMCPM_NUM;   '
' ehit     equals          MCVX-$KMCVX_MCTKI+$KMCTK_ENE;  '
#.
'  END_OF_NTUPLE; '     #.  This marks the end of the ntuple.
In this example the data structure is scanned and the class of every vertex is recorded along with the number of the PMT it hit and the total incident track energy. If the vertex isn't a PMT hit then the variable pmt is undefined which results in the entry being discarded.



sno Guest Acct 2009-09-09