PAASS
Software suite to Acquire and Analyze Data from Pixie16
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.

Definition at line 24 of file Places.hpp.

Constructor & Destructor Documentation

§ Place()

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

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

Parameters
[in]resetable: if the place resets automatically
[in]max_size: sets the maximum size of the fifo

Definition at line 30 of file Places.hpp.

Here is the call graph for this function:

§ ~Place()

virtual Place::~Place ( )
inlinevirtual

Default Destructor

Definition at line 36 of file Places.hpp.

Here is the call graph for this function:

Member Function Documentation

§ activate() [1/2]

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.

Definition at line 61 of file Places.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ activate() [2/2]

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

Definition at line 73 of file Places.hpp.

Here is the call graph for this function:

§ add_info_()

virtual void Place::add_info_ ( const EventData info)
inlineprotectedvirtual

Add information to the place

Parameters
[in]info: the information to add

Definition at line 205 of file Places.hpp.

Here is the caller graph for this function:

§ addChild()

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

Definition at line 37 of file Places.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ addParent_()

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

Definition at line 189 of file Places.hpp.

Here is the caller graph for this function:

§ check_()

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.

Here is the caller graph for this function:

§ checkChildren()

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

Definition at line 26 of file Places.cpp.

Here is the caller graph for this function:

§ checkParents()

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

Definition at line 15 of file Places.cpp.

Here is the caller graph for this function:

§ deactivate()

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.

Definition at line 81 of file Places.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ last()

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

Definition at line 140 of file Places.hpp.

Here is the caller graph for this function:

§ operator &&()

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

Definition at line 101 of file Places.hpp.

§ operator()()

virtual bool Place::operator() ( ) const
inlinevirtual
Returns
status of the place.

Definition at line 112 of file Places.hpp.

§ operator[]() [1/2]

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

Definition at line 125 of file Places.hpp.

§ operator[]() [2/2]

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

Definition at line 133 of file Places.hpp.

§ operator||()

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

Definition at line 107 of file Places.hpp.

§ report_()

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

Definition at line 197 of file Places.hpp.

Here is the caller graph for this function:

§ reset()

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.

Definition at line 97 of file Places.hpp.

Here is the caller graph for this function:

§ resetable()

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

Definition at line 168 of file Places.hpp.

Here is the caller graph for this function:

§ secondlast()

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

Definition at line 152 of file Places.hpp.

Here is the caller graph for this function:

§ status()

virtual bool Place::status ( ) const
inlinevirtual
Returns
status of the place. Function version of operator ()

Definition at line 117 of file Places.hpp.

Here is the caller graph for this function:

Field Documentation

§ children_

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

Definition at line 223 of file Places.hpp.

§ info_

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.

Definition at line 174 of file Places.hpp.

§ max_size_

unsigned Place::max_size_
protected

Fifo (info_) depth

Definition at line 183 of file Places.hpp.

§ parents_

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

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

Definition at line 228 of file Places.hpp.

§ resetable_

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

Definition at line 217 of file Places.hpp.

§ status_

bool Place::status_
protected

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

Definition at line 213 of file Places.hpp.


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