In file Filter.hh:

class Filter

Defines an event filter

Inheritance:


Public Methods

[more]explicit Filter ()
Constructs an empty event filter
[more]explicit Filter (const char* pattern)
Constructors an event filter
[more]explicit Filter (const char* pattern, int index)
Constructors an event filter
[more]explicit Filter (const std::string& pattern, int index)
Constructors an event filter
[more]virtual Filter* Copy () const
Copy the event
[more]bool IsValid () const
Is valid?
[more]bool operator== (const Filter& filter) const
Equality operator
[more]bool operator!= (const Filter& filter) const
Inequality operator
[more]virtual bool Evaluate (const Argument& arg, bool& val) const
Evaluate
[more]void SetIndex (int index = -1)
Set event index
[more]int GetIndex () const
Get event index
[more]const char* GetPattern () const
Get event pattern
[more]bool SetPattern (const char* pattern)
Set event pattern
[more]bool SetPattern (const std::string& pattern)
Set event pattern

Public Members

[more]enum matchtype
matching criterium

Protected Methods

[more]bool Match (const Event* event) const
Match event against pattern


Inherited from Condition:

Public Methods

obool operator() (const Argument& arg, bool& val) const
obool operator() (const Event& event, bool& val) const
ostatic const Condition& True()
ostatic const Condition& False()

Protected Methods

oCondition& operator= (const Condition&)


Documentation

An event filter uses the type and the name information to select events. It supports wildcards and an event index.

Example:

    Filter ("sngl_Burst::*")
    Filter ("*::glitchMon")
    Filter ("GDS_Trigger::glitchMon")
    
The first example selects all burst events. The second example selects all events with name "glitchMon", whereas the third example selects events of type "GDS_Trigger" and name "glitchMon".

If a filter is specified without an index it gets applied to all event indices. Wildcards in form of "*" (asterix) and "?" (question mark) can be used--even so they may translate into inefficient string comparisons. Using just a "*" for one of the arguments is still efficient and no comparison is done at all.

An event index can be explicitly specified as part of the string or as a separate argument. Examples:

    Filter ("sngl_Burst::*[0]") && Filter ("GDS_Trigger::*", 1)
    
selects burst events from the first event stream and DMT triggers from the second one.

As with the column class a filter set can also be specified for events stored as event columns. The same notation applies. For example:

    Filter ("Event(1).sngl_Burst::*")
    Filter ("sngl_Burst::*(1)")
    
selects events which contain a burst event at column "Event(1)".

oenum matchtype
matching criterium

o kExact
Exact

o kAll
All

o kWildcard
Wildcard

oexplicit Filter()
Creates an event filter which rejects everything.

oexplicit Filter(const char* pattern)
Creates a new event filter based on the specified filter string.
Parameters:
pattern - Filter pattern

oexplicit Filter(const char* pattern, int index)
Creates a new event filter based on the specified filter string.
Parameters:
pattern - Filter pattern

oexplicit Filter(const std::string& pattern, int index)
Creates a new event filter based on the specified filter string.
Parameters:
pattern - Filter pattern

ovirtual Filter* Copy() const
Returns a copy of the event condition. This method must be overriden by all descendents.
Returns:
event copy

obool IsValid() const
Checks if this is a valid filter.
Returns:
true if valid

obool operator== (const Filter& filter) const
Equality operator (case insensitive)

obool operator!= (const Filter& filter) const
Inequality operator.

ovirtual bool Evaluate(const Argument& arg, bool& val) const
Evaluate the condition. This function must be overriden by descendents.
Parameters:
- arg Event argument list
val - Condition value (return)
Returns:
True if condition could be evaluated

ovoid SetIndex(int index = -1)
Set the event index.
Parameters:
index - Event index

oint GetIndex() const
Returns the event index.
Returns:
Event index

oconst char* GetPattern() const
Returns the filter pattern.
Returns:
Event filter name

obool SetPattern(const char* pattern)
Sets the filter pattern.
Parameters:
pattern - Filter pattern
Returns:
true if valid name is supplied

obool SetPattern(const std::string& pattern)
Sets the filter pattern.
Parameters:
pattern - Filter pattern
Returns:
true if valid name is supplied

obool Match(const Event* event) const
Match an event against the filter pattern.
Parameters:
event - Event to match
Returns:
true if filter matches event


This class has no child classes.
Author:
Written June 2001 by Masahiro Ito and Daniel Sigg
Version:
1.0

Alphabetic index HTML hierarchy of classes or Java


Please send questions and comments to zweizig_j@ligo-wa.caltech.edu