Using tests/cuts

Ole Hansen
Rev 1.1, 15 April 2004

Controlling data analysis flow with cuts

To define tests/cuts to be evaluated at each stage of the analysis, test definitions are placed in a plain-text input file, the "cut definition file". The file name must be given to the analyzer via a call to SetCutFile(). Example:
analyzer [24] THaAnalyzer* analyzer = new THaAnalyzer;
analyzer [25] analyzer->SetCutFile("demo.cuts")
The format of the file is illustrated in the following example:
# Demo cut definition file demo.cuts
#
Block: RawDecode

evtyp1            g.evtyp==1          // Event type 1 (=HRSR main trigger)
poshel            g.helicity==1
neghel            g.helicity==-1
goodhel           poshel||neghel
RawDecode_master  evtyp1

Block: Decode

NoisyU1           R.vdc.u1.nhit>50
NoisyV1           R.vdc.v1.nhit>50
NoisyU2           R.vdc.u2.nhit>50
NoisyV2           R.vdc.v2.nhit>50
NoisyVDC          NoisyU1||NoisyV1||NoisyU2||NoisyV2
EnoughShowerHits  R.sh.nhit>10
Decode_master     !NoisyVDC
If a test with the name "blockname"_master is defined (example "Decode_master"), then if this test is false for a given event, further analysis of that event will be skipped.

A summary of the test results is printed to the screen at the end of the analysis. A copy of the printout ("cut summary") can be written to a file if the name of the file is set via a call to SetSummaryFile() before starting the analysis.

See the "examples" directory and the Quickstart Guide for more examples.

Notes on the format of the definition file:

See also THaCutList::Load().

Using tests as conditions in THaOutput

Tests defined in the cut definition file as well as separately-defined tests can be used as conditions for filling histograms. For details, please see the documentation of THaOutput.

Programming information

Technical details about the test/cut classes and how to use them directly can be found the test/cut programming documentation.


Last modified: Thu Apr 15 12:17:23 EDT 2004

Maintained by Ole Hansen