PAASS
Software suite to Acquire and Analyze Data from Pixie16
Unpacker Class Reference

#include <Unpacker.hpp>

Inheritance diagram for Unpacker:
Collaboration diagram for Unpacker:

Public Member Functions

 Unpacker ()
 Default constructor. More...
 
virtual ~Unpacker ()
 Destructor. More...
 
size_t GetMaxModule ()
 Return the maximum module read from the input file. More...
 
unsigned int GetNumRawEvents ()
 Return the number of raw events read from the file. More...
 
double GetEventWidth ()
 Return the width of the raw event window in pixie16 clock ticks. More...
 
double GetFirstTime ()
 Return the time of the first fired channel event. More...
 
double GetEventStartTime ()
 Get the start time of the current raw event. More...
 
double GetEventStopTime ()
 Get the stop time of the current raw event. More...
 
double GetRealStartTime ()
 Get the time of the first xia event in the raw event. More...
 
double GetRealStopTime ()
 Get the time of the last xia event in the raw event. More...
 
bool IsRunning ()
 Return true if the scan is running and false otherwise. More...
 
bool SetDebugMode (bool state_=true)
 Toggle debug mode on / off. More...
 
double SetEventWidth (double width_)
 Set the width of events in pixie16 clock ticks. More...
 
void InitializeDataMask (const std::string &firmware, const unsigned int &frequency)
 
ScanInterfaceSetInterface (ScanInterface *interface_)
 Set the address of the scan interface used for file operations. More...
 
bool ReadSpill (unsigned int *data, unsigned int nWords, bool is_verbose=true)
 
void Write ()
 
void Stop ()
 
void Run ()
 

Protected Member Functions

virtual void ProcessRawEvent (ScanInterface *addr_=NULL)
 Pointer to an object derived from ScanInterface. More...
 
virtual void RawStats (XiaData *event_, ScanInterface *addr_=NULL)
 
int ReadBuffer (unsigned int *buf)
 

Protected Attributes

XiaListModeDataMask mask_
 
double eventWidth
 
bool debug_mode
 The width of the raw event in pixie clock ticks (8 ns). More...
 
bool running
 True if debug mode is set. More...
 
std::vector< std::deque< XiaData * > > eventList
 True if the scan is running. More...
 
std::deque< XiaData * > rawEvent
 The list of all events in a spill. More...
 
ScanInterfaceinterface
 The list of all events in the event window. More...
 

Private Member Functions

void TimeSort ()
 The time of the last xia event in the raw event. More...
 
bool BuildRawEvent ()
 
bool AddEvent (XiaData *event_)
 
void ClearEventList ()
 
void ClearRawEvent ()
 
bool GetFirstTime (double &time)
 
bool IsEmpty ()
 

Private Attributes

std::vector< XiaData * > decodedList_
 Vector containing the list of channels decoded from. More...
 
unsigned int TOTALREAD
 
unsigned int maxWords
 Maximum number of data words to read. More...
 
unsigned int numRawEvt
 Maximum number of data words for revision D. More...
 
unsigned int channel_counts [MAX_PIXIE_MOD+1][MAX_PIXIE_CHAN+1]
 The total count of raw events read from file. More...
 
double firstTime
 Counters for each channel in each module. More...
 
double eventStartTime
 The first recorded event time. More...
 
double realStartTime
 The start time of the current raw event. More...
 
double realStopTime
 The time of the first xia event in the raw event. More...
 

Detailed Description

Definition at line 33 of file Unpacker.hpp.

Constructor & Destructor Documentation

§ Unpacker()

Unpacker::Unpacker ( )

Default constructor.

Definition at line 219 of file Unpacker.cpp.

§ ~Unpacker()

Unpacker::~Unpacker ( )
virtual

Destructor.

Definition at line 240 of file Unpacker.cpp.

Here is the call graph for this function:

Member Function Documentation

§ AddEvent()

bool Unpacker::AddEvent ( XiaData event_)
private

Push an event into the event list.

Parameters
[in]event_The XiaData to push onto the back of the event list.
Returns
True if the XiaData's module number is valid and false otherwise.

Definition at line 132 of file Unpacker.cpp.

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

§ BuildRawEvent()

bool Unpacker::BuildRawEvent ( )
private

Scan the time sorted event list and package the events into a raw event with a size governed by the event width.

Returns
True if the event list is not empty and false otherwise.

Definition at line 44 of file Unpacker.cpp.

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

§ ClearEventList()

void Unpacker::ClearEventList ( )
private

Clear all events in the spill event list. WARNING! This method will delete all events in the event list. This could cause seg faults if the events are used elsewhere.

Returns
Nothing.

Definition at line 151 of file Unpacker.cpp.

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

§ ClearRawEvent()

void Unpacker::ClearRawEvent ( )
private

Clear all events in the raw event list. WARNING! This method will delete all events in the event list. This could cause seg faults if the events are used elsewhere.

Returns
Nothing.

Definition at line 161 of file Unpacker.cpp.

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

§ GetEventStartTime()

double Unpacker::GetEventStartTime ( )
inline

Get the start time of the current raw event.

Definition at line 54 of file Unpacker.hpp.

§ GetEventStopTime()

double Unpacker::GetEventStopTime ( )
inline

Get the stop time of the current raw event.

Definition at line 57 of file Unpacker.hpp.

§ GetEventWidth()

double Unpacker::GetEventWidth ( )
inline

Return the width of the raw event window in pixie16 clock ticks.

Definition at line 48 of file Unpacker.hpp.

§ GetFirstTime() [1/2]

double Unpacker::GetFirstTime ( )
inline

Return the time of the first fired channel event.

Definition at line 51 of file Unpacker.hpp.

§ GetFirstTime() [2/2]

bool Unpacker::GetFirstTime ( double &  time)
private

Get the minimum channel time from the event list.

Parameters
[out]timeThe minimum time from the event list in system clock ticks.
Returns
True if the event list is not empty and false otherwise.

Definition at line 169 of file Unpacker.cpp.

§ GetMaxModule()

size_t Unpacker::GetMaxModule ( )
inline

Return the maximum module read from the input file.

Definition at line 42 of file Unpacker.hpp.

§ GetNumRawEvents()

unsigned int Unpacker::GetNumRawEvents ( )
inline

Return the number of raw events read from the file.

Definition at line 45 of file Unpacker.hpp.

§ GetRealStartTime()

double Unpacker::GetRealStartTime ( )
inline

Get the time of the first xia event in the raw event.

Definition at line 60 of file Unpacker.hpp.

§ GetRealStopTime()

double Unpacker::GetRealStopTime ( )
inline

Get the time of the last xia event in the raw event.

Definition at line 63 of file Unpacker.hpp.

§ InitializeDataMask()

void Unpacker::InitializeDataMask ( const std::string &  firmware,
const unsigned int &  frequency 
)
inline

Definition at line 74 of file Unpacker.hpp.

Here is the call graph for this function:

§ IsEmpty()

bool Unpacker::IsEmpty ( )
private

Check whether or not the eventList is empty.

Returns
True if the eventList is empty, and false otherwise.

Definition at line 187 of file Unpacker.cpp.

§ IsRunning()

bool Unpacker::IsRunning ( )
inline

Return true if the scan is running and false otherwise.

Definition at line 66 of file Unpacker.hpp.

§ ProcessRawEvent()

void Unpacker::ProcessRawEvent ( ScanInterface addr_ = NULL)
protectedvirtual

Pointer to an object derived from ScanInterface.

Process all events in the event list.

Parameters
[in]addr_Pointer to a ScanInterface object. Unused by default.
Returns
Nothing.

Reimplemented in scopeUnpacker, UtkUnpacker, and skeletonUnpacker.

Definition at line 199 of file Unpacker.cpp.

Here is the caller graph for this function:

§ RawStats()

virtual void Unpacker::RawStats ( XiaData event_,
ScanInterface addr_ = NULL 
)
inlineprotectedvirtual

Add an event to generic statistics output.

Parameters
[in]event_Pointer to the current XIA event. Unused by default.
[in]addr_Pointer to a ScanInterface object. Unused by default.
Returns
Nothing.

Reimplemented in scopeUnpacker, and skeletonUnpacker.

Definition at line 133 of file Unpacker.hpp.

Here is the call graph for this function:

§ ReadBuffer()

int Unpacker::ReadBuffer ( unsigned int *  buf)
protected

Called form ReadSpill. Scan the current spill and construct a list of events which fired by obtaining the module, channel, trace, etc. of the timestamped event. This method will construct the event list for later processing.

Parameters
[in]bufPointer to an array of unsigned ints containing raw buffer data.
[out]bufLenThe number of words in the buffer.
Returns
The number of XiaDatas read from the buffer.

Called form ReadSpill. Scan the current spill and construct a list of events which fired by obtaining the module, channel, trace, etc. of the timestamped event. This method will construct the event list for later processing.

Parameters
[in]buf: Pointer to an array of unsigned ints containing raw buffer data.
Returns
The number of XiaDatas read from the buffer.

Definition at line 210 of file Unpacker.cpp.

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

§ ReadSpill()

bool Unpacker::ReadSpill ( unsigned int *  data,
unsigned int  nWords,
bool  is_verbose = true 
)

ReadSpill is responsible for constructing a list of pixie16 events from a raw data spill. This method performs sanity checks on the spill and calls ReadBuffer in order to construct the event list.

Parameters
[in]dataPointer to an array of unsigned ints containing the spill data.
[in]nWordsThe number of words in the array.
[in]is_verboseToggle the verbosity flag on/off.
Returns
True if the spill was read successfully and false otherwise.

Revision specific, so move to ReadBuffData

Definition at line 253 of file Unpacker.cpp.

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

§ Run()

void Unpacker::Run ( )
inline

Run the scan. Unused by default.

Returns
Nothing.

Definition at line 106 of file Unpacker.hpp.

§ SetDebugMode()

bool Unpacker::SetDebugMode ( bool  state_ = true)
inline

Toggle debug mode on / off.

Definition at line 69 of file Unpacker.hpp.

§ SetEventWidth()

double Unpacker::SetEventWidth ( double  width_)
inline

Set the width of events in pixie16 clock ticks.

Definition at line 72 of file Unpacker.hpp.

§ SetInterface()

ScanInterface* Unpacker::SetInterface ( ScanInterface interface_)
inline

Set the address of the scan interface used for file operations.

Definition at line 81 of file Unpacker.hpp.

Here is the call graph for this function:

§ Stop()

void Unpacker::Stop ( )
inline

Stop the scan. Unused by default.

Returns
Nothing.

Definition at line 101 of file Unpacker.hpp.

§ TimeSort()

void Unpacker::TimeSort ( )
private

The time of the last xia event in the raw event.

Scan the event list and sort it by timestamp.

Returns
Nothing.

Scan the event list and sort it by timestamp.

Returns
Nothing.

Definition at line 34 of file Unpacker.cpp.

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

§ Write()

void Unpacker::Write ( )

Write all recorded channel counts to a file.

Returns
Nothing.

Definition at line 424 of file Unpacker.cpp.

Here is the caller graph for this function:

Field Documentation

§ channel_counts

unsigned int Unpacker::channel_counts[MAX_PIXIE_MOD+1][MAX_PIXIE_CHAN+1]
private

The total count of raw events read from file.

Definition at line 153 of file Unpacker.hpp.

§ debug_mode

bool Unpacker::debug_mode
protected

The width of the raw event in pixie clock ticks (8 ns).

Definition at line 114 of file Unpacker.hpp.

§ decodedList_

std::vector<XiaData*> Unpacker::decodedList_
private

Vector containing the list of channels decoded from.

Definition at line 147 of file Unpacker.hpp.

§ eventList

std::vector<std::deque<XiaData*> > Unpacker::eventList
protected

True if the scan is running.

Definition at line 117 of file Unpacker.hpp.

§ eventStartTime

double Unpacker::eventStartTime
private

The first recorded event time.

Definition at line 156 of file Unpacker.hpp.

§ eventWidth

double Unpacker::eventWidth
protected

Definition at line 112 of file Unpacker.hpp.

§ firstTime

double Unpacker::firstTime
private

Counters for each channel in each module.

Definition at line 155 of file Unpacker.hpp.

§ interface

ScanInterface* Unpacker::interface
protected

The list of all events in the event window.

Definition at line 120 of file Unpacker.hpp.

§ mask_

XiaListModeDataMask Unpacker::mask_
protected

Definition at line 109 of file Unpacker.hpp.

§ maxWords

unsigned int Unpacker::maxWords
private

Maximum number of data words to read.

Definition at line 150 of file Unpacker.hpp.

§ numRawEvt

unsigned int Unpacker::numRawEvt
private

Maximum number of data words for revision D.

Definition at line 151 of file Unpacker.hpp.

§ rawEvent

std::deque<XiaData*> Unpacker::rawEvent
protected

The list of all events in a spill.

Definition at line 118 of file Unpacker.hpp.

§ realStartTime

double Unpacker::realStartTime
private

The start time of the current raw event.

Definition at line 158 of file Unpacker.hpp.

§ realStopTime

double Unpacker::realStopTime
private

The time of the first xia event in the raw event.

Definition at line 159 of file Unpacker.hpp.

§ running

bool Unpacker::running
protected

True if debug mode is set.

Definition at line 115 of file Unpacker.hpp.

§ TOTALREAD

unsigned int Unpacker::TOTALREAD
private

Definition at line 149 of file Unpacker.hpp.


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