In file Column.hh:

class Column : public Function

Defines an event column

Inheritance:


Public Methods

Column ()
Default constructor
Column (const char* name)
Constructor
Column (const std::string& name)
Constructor
Column (const char* name, int eindex)
Constructor
Column (const Column& col)
Copy constructor
virtual ~Column ()
Denstructor
Column& operator= (const Column& col)
Assignment operator
virtual Column* Copy () const
Copy the event column
bool IsValid () const
Is valid?
virtual bool Get (const Event& event, Value& val) const
Get column value
virtual bool Set (Event& event, const Value& val)
Set column value
virtual const Event* GetEvent (const Argument& arg) const
Get column event
virtual const Event* GetEvent (const Argument& arg, int index) const
Get column event
virtual Event* GetEvent (Event& event)
Get column event
virtual const Event* GetEvent (const Event& event) const
Get column event
virtual bool Evaluate (const Argument& arg, Value& val) const
Column value
void SetName (const char* name)
Set column name
void SetName (const std::string& name)
Set column name
const char* GetName () const
Get column name
void SetIndex (int index)
Set event index
int GetIndex () const
Get event index
void ResetCache () const
Clear cache

Inherited from Function:

Public Methods

bool operator) (const Argument& arg, Value& val) const
bool operator) (const Event& event, Value& val) const

Documentation

An event column represents a column value of an event. The basic tag of a column is its name. The column class will look up the name in the column information list assciated with the event and extract the corresponding column value from the event data block.

A column name is typically just an ASCII string. Example:

    Column ("Time")
    
will pick up the even time. A column can also specifiy an event index--denoted by index brackets--which is used in a coincidence analysis to determine which event to use. Example:
    Column ("Time[1]") - Column ("Time[0]")
    
will calculate the time difference bewteen the two coincidence events.

A special case are columns which are themselves events. If one want to access the amplitude of an event column with name "Event(1)", one can simply specify:

    Column ("Event(1).Amplitutde")
    
For the above case a short for exists:
    Column ("Amplitutde(1)")
    
will be expanded to the same column amplitude value. The short form can be used if the name of the event column has a name of the format "Event(n)", with n an non-zero positive integer. The index 0 is reserved for the original event, i.e., "Amplitude(0)" and "Amplitue" correspond to identical columns.

Even so not a likely case, it is possible to have an event with an event column which contains yet another event column with its own event. These columns can be access through:

    Column ("Event(m).Event(n).Amplitutde")   or
    Column ("Event(m).Amplitutde(n)")         or
    Column ("Amplitutde(m,n)")                or
    Column ("Event(m,n).Amplitutde")
    
with m and n the event column indices of the original and the sub event, respectively. The first form is the canonical representation which is used for internal storage.

If an event column of an event with non-zero index has to be accessed, they can both be specified simultanously, but the index must be specifed last. For example:

    Column ("Event(1).Time[1]")
    Column ("Time(1)[1]")
    
represent the time of the event stored at column "Event(1)".

Column names can not contain the characters "[", "]", ".", "*" or "?". They should not contain "(", ")" unless they are of the event type and contain the string "Event". Using something like "Amplitude(1)" as a column name is confusing. In case such a name has been used, the column name specification has to be "Amplitude(1)." with a dot at the end. Using a double index in any column name is forbidden, i.e., "Amplitude(1,2)" is not allowed, nor is "Event(1,2)".

A column can also be used to access the column value of an event. If a series of events with identical column layout is processed, this is more efficient than calling the SetValue method of the event. The event SetValue method requires a string search in the column table for every access, whereas the column class uses a caching algorithm to increase performance. Example:

    // Create a new coincidence event from two events represented by
    // i->Current(0) and i->Current(1)
    Column col0 ("Event(0)");
    Column col1 ("Event(1)");
    Column ifo ("Ifo");
    // loop over events here
    for (; i != end; ++i) {
       Event ne ("Coincidence", "2");
       if (ne.IsValid()) {
          col0.Set (ne, i->Current(0));
          col1.Set (ne, i->Current(1));
          ne.SetTime (i->GetTime());
          Value ifo0, ifo1;
          ifo.Get (i->Current(0), ifo0); 
          ifo.Get (i->Current(1), ifo1);
          ifo.Set (ne, ifo0 | ifo1);
       }
    }
    

Column()
Creates an event column withou a name.

Column(const char* name)
Create an event column with the specified name. Allow automatic type conversion from const char*.
Parameters:
name - full name

Column(const std::string& name)
Create an event column with the specified name. Allow automatic type conversion from string.
Parameters:
name - full name

Column(const char* name, int eindex)
Create an event column with the specified name and event index.
Parameters:
name - column name only
eindex - Event index (for coincidence)

Column(const Column& col)
Copy constructor

virtual ~Column()
Destructs an event column.

Column& operator= (const Column& col)
Assignment operator

virtual Column* Copy() const
Returns a copy of the event column. This method must be overriden by all descendents.
Returns:
event copy

bool IsValid() const
Checks if this is a valid column.
Returns:
true if valid

virtual bool Get(const Event& event, Value& val) const
Returns the column value of the event.
Returns:
true if column exists
Parameters:
events - Event to pick column value from
val - Column value (return)

virtual bool Set(Event& event, const Value& val)
Sets the column value of the event.
Returns:
true if column exists and value could be set
Parameters:
events - Event for which to set column value
val - New column value

virtual const Event* GetEvent(const Argument& arg) const
Returns a pointer to the last event. This method returns the event which is used to pick the column. This is useful for Event which contains events (array index). For example:
          Column name            Returns
          Amplitude              current event
          Amplitude(1)           Event(1)
          Event(2)               Event(2)
          Event(2).Event(1).E    Event(2).Event(1)           
All array indices are resolved and the last event is returned. If the event column does not exists, NULL is returned.
Returns:
Event if exist

virtual const Event* GetEvent(const Argument& arg, int index) const
Returns a pointer to the "last" event. This method explicitly specifies the event index.
Returns:
Event if exist
Parameters:
arg - Event argument list
index - Event index

virtual Event* GetEvent(Event& event)
Returns a pointer to the last event. This method specifies the first event.
Returns:
Event if exist
Parameters:
event - Event

virtual const Event* GetEvent(const Event& event) const
Returns a pointer to the last event. This method specifies the first event.
Returns:
Event if exist
Parameters:
event - Event

virtual bool Evaluate(const Argument& arg, Value& val) const
Returns the column value of the specified event.
Returns:
true if column exists and event is of correct type
Parameters:
arg - Event argument list
val - Column value (return)

void SetName(const char* name)
Set the name of the column.

void SetName(const std::string& name)
Set the name of the column.

const char* GetName() const
Get the name of the column in its canonical representation.
Returns:
Name

void SetIndex(int index)
Set the event index.
Parameters:
index - Event index

int GetIndex() const
Gets the event index.
Returns:
Event index

void ResetCache() const
Clear the column cache.


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

alphabetic index hierarchy of classes


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


generated by doc++