Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Place Class Referenceabstract

A pure abstract class to define a "place" for correlator. More...

#include <Places.hpp>

Inheritance diagram for Place:
Collaboration diagram for Place:

Public Member Functions

 Place (bool resetable=true, unsigned max_size=2)
 
virtual ~Place ()
 
virtual void addChild (Place *child, bool coin=true)
 
virtual bool checkChildren (Place *child)
 
virtual bool checkParents (Place *child)
 
virtual void activate (EventData &info)
 
virtual void activate (double time)
 
virtual void deactivate (double time)
 
virtual void reset ()
 
virtual bool operator&& (const Place &right) const
 
virtual bool operator|| (const Place &right) const
 
virtual bool operator() () const
 
virtual bool status () const
 
virtual EventDataoperator[] (unsigned index)
 
virtual EventData operator[] (unsigned index) const
 
virtual EventData last ()
 
virtual EventData secondlast ()
 
virtual bool resetable () const
 

Data Fields

std::deque< EventDatainfo_
 

Protected Member Functions

virtual void check_ (EventData &info)=0
 
virtual void addParent_ (Place *parent)
 
virtual void report_ (EventData &info)
 
virtual void add_info_ (const EventData &info)
 

Protected Attributes

unsigned max_size_
 
bool status_
 
bool resetable_
 
std::vector< std::pair< Place *, bool > > children_
 
std::vector< Place * > parents_
 

Detailed Description

A pure abstract class to define a "place" for correlator.

A place has physical or abstract meaning, might be a detector, a condition or a group of detectors.

Constructor & Destructor Documentation

Place::Place ( bool  resetable = true,
unsigned  max_size = 2 
)
inline

C'tor. By default the Place is resetable, and internal fifo remebers only current and previous event.

Parameters
[in]resetable: if the place resets automatically
[in]max_size: sets the maximum size of the fifo
virtual Place::~Place ( )
inlinevirtual

Default Destructor

Member Function Documentation

virtual void Place::activate ( EventData info)
inlinevirtual

Activates Place and reports to the parent if place was not active, always saves event data to the fifo.

Parameters
[in]info: the info to use for the activation

Reimplemented in PlaceCounter, PlaceThreshold, and PlaceLazy.

virtual void Place::activate ( double  time)
inlinevirtual

Simplified activation for counter-like detectors, without need of creating EventData object outside.

Parameters
[in]time: the time for the activation
virtual void Place::add_info_ ( const EventData info)
inlineprotectedvirtual

Add information to the place

Parameters
[in]info: the information to add
virtual void Place::addChild ( Place child,
bool  coin = true 
)
virtual

Defines 'child' of place. A child will report any changes of its status to parent. Parent will change its status depending on status of children but parent status will not affect status of children.

Parameters
[in]child: defines a place as the child of another
[in]coin: sets if child is coincident or not
virtual void Place::addParent_ ( Place parent)
inlineprotectedvirtual

Adds parent to the list. User should be able to call addChild function only. The addParent function should be called by addChild.

Parameters
[in]parent: the parent to add
virtual void Place::check_ ( EventData info)
protectedpure virtual

Pure virutal function. The check function should decide how to change status depending on the status of children. Should be implemented in a derived class.

Parameters
[in]info: data to use for the check

Implemented in PlaceAND, PlaceOR, PlaceCounter, PlaceThresholdOR, PlaceThreshold, and PlaceDetector.

virtual bool Place::checkChildren ( Place child)
virtual

Checks is child is already listed among children. In case it is, False value is returned.

Parameters
[in]child: the child to be checked
Returns
true if not listed
virtual bool Place::checkParents ( Place child)
virtual

Checks is child is its own parent or his parent parent ( uptree) etc. In such a case False is returned.

Parameters
[in]child: the child to check
Returns
true if child is not its own parent
virtual void Place::deactivate ( double  time)
inlinevirtual

Changes status to false. Only time and status change is recorded in fifo.

Parameters
[in]time: the time at which to set the place

Reimplemented in PlaceCounter, and PlaceLazy.

virtual EventData Place::last ( )
inlinevirtual

Easy access to last (current) element of fifo. If fifo is empty time=-1 event is returned

Returns
The last EventData entry in the fifo
virtual bool Place::operator&& ( const Place right) const
inlinevirtual
Returns
Logical AND operator for two Places.
Parameters
[in]right: the place to use for comparison
virtual bool Place::operator() ( ) const
inlinevirtual
Returns
status of the place.
virtual EventData& Place::operator[] ( unsigned  index)
inlinevirtual

Easy access to stored data in fifo, notice at() function used (raises exception).

Parameters
[in]index: the index of the data to get from the fifo
Returns
event data in fifo
virtual EventData Place::operator[] ( unsigned  index) const
inlinevirtual

Easy access to stored data in fifo, notice at() function used (raises exception).

Parameters
[in]index: the index to get from the fifo
Returns
data in fifo
virtual bool Place::operator|| ( const Place right) const
inlinevirtual
Returns
Logical OR operator for two Places.
Parameters
[in]right: the place to use for comparison
virtual void Place::report_ ( EventData info)
inlineprotectedvirtual

Reports change of status to parents. Calls check() function for all the parents.

Parameters
[in]info: the information to report
virtual void Place::reset ( )
inlinevirtual

Changes status to false without storing correlation data or reporting to parents. Use only when ending current event. For deactivation occuring due to physical conditions of the system use deactivate() method.

Reimplemented in PlaceCounter.

virtual bool Place::resetable ( ) const
inlinevirtual

Returns true if place should automatically deactivate after the end of event and false if place should stay in current state as long as deactivating signal is explicitly send.

Returns
true if place is resetable automatically
virtual EventData Place::secondlast ( )
inlinevirtual

Easy access to the second to last element of fifo. If fifo has only one event, time=-1 event is returned.

Returns
Second to last event data
virtual bool Place::status ( ) const
inlinevirtual
Returns
status of the place. Function version of operator ()

Field Documentation

std::vector< std::pair<Place*, bool> > Place::children_
protected

Vector keeping a list of children on which status of the Place depends. Place* is a pointer to the downstream place, bool describes relation (true for coincidence-like, false for anti-coincidence).

std::deque<EventData> Place::info_

Pythonic style private field. Use it if you must, but perhaps you should not. Stores information on past events in a given Place.

unsigned Place::max_size_
protected

Fifo (info_) depth

std::vector<Place*> Place::parents_
protected

Vector keeping a list of parents to whom the change of status should be reported.

bool Place::resetable_
protected

Indicates if place should be reseted after end of event (true) or if should persist until status is changed explicitly (false).

bool Place::status_
protected

Status is true if given place is in active state (e.g. detector recorded an event).


The documentation for this class was generated from the following file: