In file Chain.hh:

class Chain

Chain of event lists

Inheritance:


Public Methods

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

Public Members

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


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.

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

otypedef List::eventlist eventlist
Basic list type

otypedef List::value_type value_type
Value type

otypedef List::size_type size_type
Size type

otypedef List::difference_type difference_type
Difference type

otypedef List::reference reference
Reference type

otypedef List::const_reference const_reference
Const reference type

otypedef List::pointer pointer
Pointer type

otypedef List::const_pointer const_pointer
Const pointer type

otypedef Iterator iterator
Iterator

otypedef ConstIterator const_iterator
Const iterator

otypedef ReverseIterator reverse_iterator
Iterator

otypedef ConstReverseIterator const_reverse_iterator
Const iterator

o Chain()
Creates an empty event chain.

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

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

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

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

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

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

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

oint N() const
Number of event lists.

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

obool 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.

obool 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

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

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

obool Empty() const
Empty list?

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

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

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

ovoid Swap(Chain& l)
Swap the list.

oiterator LowerBound(const Time& t)
Lower bound.

oconst_iterator LowerBound(const Time& t) const
Lower bound.

oiterator UpperBound(const Time& t)
Upper bound.

oconst_iterator UpperBound(const Time& t) const
Upper bound.

oiterator LowerBound(const Event& t)
Lower bound.

oconst_iterator LowerBound(const Event& t) const
Lower bound.

oiterator UpperBound(const Event& t)
Upper bound.

oconst_iterator UpperBound(const Event& t) const
Upper bound.

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

ovoid 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).

oreference At(size_type idx)
At.

oconst_reference At(size_type idx) const
At.

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

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

oreference Front()
Front.

oconst_reference Front() const
Front.

oreference Back()
Back.

oconst_reference Back() const
Back.

oiterator Begin()
Begin.

oconst_iterator Begin() const
Begin.

oiterator End()
End.

oconst_iterator End() const
End.

oreverse_iterator RBegin()
RBegin.

oconst_reverse_iterator RBegin() const
RBegin.

oreverse_iterator REnd()
REnd.

oconst_reverse_iterator REnd() const
REnd.

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

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

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

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

oiterator Erase(iterator pos)
Erase an event.

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

ovoid PopBack()
Removes an event from the back.

ovoid 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 HTML hierarchy of classes or Java


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