In file Chain.hh:

namespace events class Chain

Chain of event lists

Inheritance:


Public Fields

typedef std::vector <ListPtr> eventchain
Basic event chain type
typedef List::eventlist eventlist
Basic list type
typedef List::value_type value_type
Value type
typedef List::size_type size_type
Size type
typedef List::difference_type difference_type
Difference type
typedef List::reference reference
Reference type
typedef List::const_reference const_reference
Const reference type
typedef List::pointer pointer
Pointer type
typedef List::const_pointer const_pointer
Const pointer type
typedef Iterator iterator
Iterator
typedef ConstIterator const_iterator
Const iterator
typedef ReverseIterator reverse_iterator
Iterator
typedef ConstReverseIterator const_reverse_iterator
Const iterator

Public Methods

Chain ()
Default constructor
explicit Chain (const char* filename)
Constructor
Chain* Copy () const
Copy the event
bool AddList (const char* filename)
Add
bool AddList (const List& eventlist)
Add
List& GetList (int lnum)
Get
const List& GetList (int lnum) const
Get
bool RemoveList (int lnum)
Remove
int N () const
N
void Merge ()
Merge
bool Configure (const char* filename)
Configure
bool Save (const char* filename, int perfile = 0, int maxevents = -1) const
Save
bool Restore (const char* filename)
Restore
int Size () const
Size
bool Empty () const
Empty
bool operator== (const Chain& l) const
Equality
bool operator!= (const Chain& l) const
Equality
bool CheckOrder () const
Check order
void Swap (Chain& l)
Swap
iterator LowerBound (const Time& t)
Lower bound
const_iterator LowerBound (const Time& t) const
Lower bound
iterator UpperBound (const Time& t)
Upper bound
const_iterator UpperBound (const Time& t) const
Upper bound
iterator LowerBound (const Event& t)
Lower bound
const_iterator LowerBound (const Event& t) const
Lower bound
iterator UpperBound (const Event& t)
Upper bound
const_iterator UpperBound (const Event& t) const
Upper bound
void Sort ()
Sort
void Sort (const Function& func, bool ascending = true)
Sort
reference At (size_type idx)
At
const_reference At (size_type idx) const
At
reference operator[] (size_type idx)
Operator[]
const_reference operator[] (size_type idx) const
Operator[]
reference Front ()
Front
const_reference Front () const
Front
reference Back ()
Back
const_reference Back () const
Back
iterator Begin ()
Begin
const_iterator Begin () const
Begin
iterator End ()
End
const_iterator End () const
End
reverse_iterator RBegin ()
RBegin
const_reverse_iterator RBegin () const
RBegin
reverse_iterator REnd ()
REnd
const_reverse_iterator REnd () const
REnd
iterator Insert (const Event& event)
Insert
iterator Insert (iterator pos, const Event& event)
Insert
void Insert (iterator beg, iterator end)
Add
void PushBack (const Event& event)
PushBack
iterator Erase (iterator pos)
Erase
iterator Erase (iterator beg, iterator end)
Erase
void PopBack ()
PopBack
void Clear ()
Clear

Documentation

An event chain consists of a series of event lists. The idea is that for really large sets of events, multiple files are referenced through a chain. When they are needed, they are read in, worked on and discared as the analysis algorithm moves through the events of the chain.

An event chain contains events ordered by time with the oldest event being stored first. For efficiency reasons Chain provides algorithms which let you add events without checking that they are in correct orderer. In this case the user has to guarantee that the sort order is maintained, or call the Sort method afterwards.

typedef std::vector <ListPtr> eventchain
Basic event chain type

typedef List::eventlist eventlist
Basic list type

typedef List::value_type value_type
Value type

typedef List::size_type size_type
Size type

typedef List::difference_type difference_type
Difference type

typedef List::reference reference
Reference type

typedef List::const_reference const_reference
Const reference type

typedef List::pointer pointer
Pointer type

typedef List::const_pointer const_pointer
Const pointer type

typedef Iterator iterator
Iterator

typedef ConstIterator const_iterator
Const iterator

typedef ReverseIterator reverse_iterator
Iterator

typedef ConstReverseIterator const_reverse_iterator
Const iterator

Chain()
Creates an empty event chain.

explicit Chain(const char* filename)
Creats a event chain with one event list.

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

bool AddList(const char* filename)
Add an event list to the chain.

bool AddList(const List& eventlist)
Add an event list to the chain.

List& GetList(int lnum)
Get an event list of the chain.

const List& GetList(int lnum) const
Get an event list of the chain.

bool RemoveList(int lnum)
Remove an event list form the chain.

int N() const
Number of event lists.

void Merge()
Merge all event lists form the chain into one.

bool Configure(const char* filename)
Add the event lists specified in the configuration file. The configuration file must contain a list of files (one per line) each representing an event list. Lines starting with a UNIX comment letter are ignored.

bool Save(const char* filename, int perfile = 0, int maxevents = -1) const
Save the chain to the specified file(s). If a non-negative perfile is specified and if the number of events in the chain is larger than perfile, multiple files are created with a maximum of perfile events each. The file number is increased automatically until maxevents is reached or all events are processed.
Parameters:
filename - Name of file
perfile - Number of events per written file
maxevents - Maximum number of events written

bool Restore(const char* filename)
Restore a event chain with one event list from the spcified file.
Parameters:
filename - Name of file

int Size() const
Size of list (number of events in chain).

bool Empty() const
Empty list?

bool operator== (const Chain& l) const
Equality operator.

bool operator!= (const Chain& l) const
Inequality operator.

bool CheckOrder() const
Check if events are stored in proper time order.

void Swap(Chain& l)
Swap the list.

iterator LowerBound(const Time& t)
Lower bound

const_iterator LowerBound(const Time& t) const
Lower bound

iterator UpperBound(const Time& t)
Upper bound

const_iterator UpperBound(const Time& t) const
Upper bound

iterator LowerBound(const Event& t)
Lower bound

const_iterator LowerBound(const Event& t) const
Lower bound

iterator UpperBound(const Event& t)
Upper bound

const_iterator UpperBound(const Event& t) const
Upper bound

void Sort()
Sort the list by event time (the list will be merged first).

void Sort(const Function& func, bool ascending = true)
Sort the chain by the specified function in ascending or descending order (the chain will be merged first).

reference At(size_type idx)
At

const_reference At(size_type idx) const
At

reference operator[] (size_type idx)
Operator [].

const_reference operator[] (size_type idx) const
Operator [].

reference Front()
Front

const_reference Front() const
Front

reference Back()
Back

const_reference Back() const
Back

iterator Begin()
Begin

const_iterator Begin() const
Begin

iterator End()
End

const_iterator End() const
End

reverse_iterator RBegin()
RBegin

const_reverse_iterator RBegin() const
RBegin

reverse_iterator REnd()
REnd

const_reverse_iterator REnd() const
REnd

iterator Insert(const Event& event)
Insert an event to the list at its proper location.

iterator Insert(iterator pos, const Event& event)
Insert an event to the list at the specified location.

void Insert(iterator beg, iterator end)
Inserts a range of events.

void PushBack(const Event& event)
Inserts an event at the back.

iterator Erase(iterator pos)
Erase an event.

iterator Erase(iterator beg, iterator end)
Erase a rane of events.

void PopBack()
Removes an event from the back.

void Clear()
Clear the chain.


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++