General changes
- EMON provides common OKS schema for defining event sampling
parameters for the monitoring frameworks used in the TDAQ
environment (e.g. GNAM, Athena PT). OKS schema file is called daq/schema/emon.schema.xml and
defines 2 abstract classes - SamplingAddress
and SelectionCriteria
and SelectionParameters class
which inherits from both of them.
- All applications which are using EMON must be linked with 2
libraries:
libemon.so and libemon-dal.so.
C++ API changes
New Monitoring task API
- Both emon::SamplingAddress
and emon::SelectionCriteria
classes provide
constructors taking IPCPartition
and emon::dal::SelectionParametrs
objects
as parameters. This is the easiest way of creating them.
- There are 3 possible ways of creating an emon::SamplingAddress without using
OKS configuration:
Using this address a monitoring task
will be attached to a single sampler of the given name and type.
This address can be used to attach the
monitor to the list of samplers (defined by the given names) of the given type.
Using this address a monitoring task
will be attached to the number
of samplers of the given type.
- Creating an instance of emon::SelectionCriteria manually (not by
reading it from the OKS configuration) is now a bit tricky. Here is an
example:
unsigned int lvl1_type = ...;
std::vector<unsigned char> lvl1_bits;
lvl1_bits.push_back( 13 );
lvl1_bits.push_back( 131 );
std::string stream_type = "physics";
std::vector<std::string> stream_names;
stream_names.push_back( "electron" );
stream_names.push_back( "photon" );
emon::SelectionCriteria criteria(
lvl1_type,
emon::SmartBitValue( lvl1_bits, emon::logic::AND, emon::origin::BEFORE_VETO ),
emon::SmartStreamValue( stream_type, stream_names, emon::logic::OR ),
emon::StatusWord( ) );
Empty emon::StatusWord constructor will
create a value with the Ignore
flag set to true, i.e. it will
be ignored in the process of event selection.
- Global emon::select
function has been removed. Now in order to start receiving
events one has to create a new instance of emon::EventIterator class.
This class provides 2 constructors:
EventIterator( const IPCPartition & partition,
const SamplingAddress & address,
const SelectionCriteria & criteria,
size_t buffer_size = 100,
bool dispersion = false ) ;
EventIterator( const IPCPartition & partition,
const emon::dal::SamplingParameters & params )
;
The second constructor reads all the
necessary
parameters from the given DAL object.
New Event Sampler API
- Virtual functions startSampling
of both PushSamplingFactory
and PullSamplingFactory
classes do not have anymore emon::SamplingAddress
as their first parameter.
- An emon::SelectionCriteria object which is passed to those
functions as parameter
has the following structure:
m_lvl1_trigger_type.
m_value (unsigned char);
m_ignore (bool);
m_lvl1_trigger_bits.
m_bit_positions (std::vector<unsigned char>)
m_logic (enum emon::Logic { emon::logic::AND, emon::logic::OR, emon::logic::IGNORE })
m_origin (enum emon::Origin { emon::origin::BEFORE_PRESCALE, emon::origin::AFTER_PRESCALE, emon::origin::AFTER_VETO } )
m_stream_tags.
m_type (std::string);
m_names (std::vector<std::string>)
m_logic (enum emon::Logic { emon::logic::AND, emon::logic::OR, emon::logic::IGNORE })
m_status_word.
m_value (unsigned int);
m_ignore (bool);