Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
titleTranslator C++ do not translate example - with logging
#include "Translator/doNotTranslate.h"

// define user Module,

virtual void event(Event &evt, Env &env) {
 Translator::doNotTranslateEvent(evt, std::string("the beam energy is to low"));
}

...

For more information on event filtering with logging, see the function doNotTranslate and the example class TestDoNotTranslate.  Using this function will cause a group 'filtered' to be created in each CalibCycle where events are filtered.  The filtered group will include the datasets 'time' (with the even id's) of the filtered events and a 'data' dataset with the log messages.

On the Python side (or the C++ side) a module can call the functions skip() or stop() during event handling to skip translation, or finish translation. However a record of what was filtered is not written to the hdf5 file.

Filtering Types

The psana.cfg file accepts a number of parameters that will filter out sets of psana types.  For example setting

...