# File: conditional_Secondaries.mac # Brief: Macro showing how to use the secondaries Nhits conditional processor in a RAT macro. # # Date: 2015-11-13 # Contact: J R Wilson # Revisions: # # This macro demonstrates how to use secondaries nhit conditional processor # in a RAT macro to scan through existing rootfile and output a smaller one # syntax: rat -i input_file.root -o output_file.root conditional_Ecut.mac # # If there is a second event with nhits > fmaxNhits OKFALSE is returned and the # event it not written to file. /rat/inroot/load_default /run/initialize # BEGIN EVENT LOOP # Conditionally output the event to file only if secondaryNhitsCut is true /rat/proc/if secondaryNhitsCut # IF /rat/procset nhit 100 /rat/proclast outroot # output the events to file /rat/proc/endif # END IF # END EVENTLOOP /rat/inroot/read # Read the events in from file exit