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

#include <UtkUnpacker.hpp>

Inheritance diagram for UtkUnpacker:
Collaboration diagram for UtkUnpacker:

Public Member Functions

 UtkUnpacker ()
 Default constructor that does nothing in particular. More...
 
 ~UtkUnpacker ()
 Default destructor that deconstructs the DetectorDriver singleton. More...
 
- Public Member Functions inherited from Unpacker
 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 ()
 

Private Member Functions

void ProcessRawEvent (ScanInterface *addr_=NULL)
 Process all events in the event list. More...
 
void InitializeDriver (DetectorDriver *driver, DetectorLibrary *detlib, clock_t &start)
 Initializes the DetectorLibrary and DetectorDriver. More...
 
void PrintProcessingTimeInformation (const clock_t &start, const clock_t &now, const double &eventTime, const unsigned int &eventCounter)
 Prints information about time spent processing to the screen. More...
 
virtual void RawStats (XiaData *event_, DetectorDriver *driver, ScanInterface *addr_=NULL)
 Add an event to generic statistics output. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Unpacker
virtual void RawStats (XiaData *event_, ScanInterface *addr_=NULL)
 
int ReadBuffer (unsigned int *buf)
 
- Protected Attributes inherited from Unpacker
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...
 

Detailed Description

A class that is derived from Unpacker that defines what we are going to do with all of the events that are built by the Unpacker class. We only define a single class (ProcessRawEvent) and overload the RawStats class to take a pointer to a DetectorDriver instance. The rest of the virtual methods in the parent are used as default.

Definition at line 20 of file UtkUnpacker.hpp.

Constructor & Destructor Documentation

§ UtkUnpacker()

UtkUnpacker::UtkUnpacker ( )
inline

Default constructor that does nothing in particular.

Definition at line 23 of file UtkUnpacker.hpp.

Here is the call graph for this function:

§ ~UtkUnpacker()

UtkUnpacker::~UtkUnpacker ( )

Default destructor that deconstructs the DetectorDriver singleton.

The only thing that we do here is call the destructor of the DetectorDriver. This will ensure that the memory is freed for all of the initialized detector and experiment processors and that information about the amount of time spent in each processor is output to the screen at the end of execution.

Definition at line 30 of file UtkUnpacker.cpp.

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

Member Function Documentation

§ InitializeDriver()

void UtkUnpacker::InitializeDriver ( DetectorDriver driver,
DetectorLibrary detlib,
clock_t &  start 
)
private

Initializes the DetectorLibrary and DetectorDriver.

Parameters
[in]driverA pointer to the DetectorDriver that we're using.
[in]detlibA pointer to the DetectorLibrary that we're using.
[in]startThe time that we called this method.

First we initialize the DetectorLibrary, which reads the Map node in the XML configuration file. Then we initialize DetectorDriver and check that everything went all right with DetectorDriver::SanityCheck(). If the sanity check fails then we will terminate the program, if things went well then we will warn the user about it and continue. If there is an error parsing the DetectorDriver node in the XML file it will show up as a General Exception here. This can be extremely useless sometimes... Expand the types of exceptions handled so that we can make the diagnostic information more useful for the user.

Definition at line 172 of file UtkUnpacker.cpp.

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

§ PrintProcessingTimeInformation()

void UtkUnpacker::PrintProcessingTimeInformation ( const clock_t &  start,
const clock_t &  now,
const double &  eventTime,
const unsigned int &  eventCounter 
)
private

Prints information about time spent processing to the screen.

Parameters
[in]startThe time that we started processing data (buffer 0)
[in]nowWhat time it is now
[in]eventTimeThe time of the current event
[in]eventCounterWhat event we are currently processing.

Spits out some useful information about the analysis time, what timestamp that we are currently on and information about how long it took us to get to this point. One should note that this does not contain all of the information that was present in PixieStd.cpp::hissub_. Some of that information is not available or just not that relevant to us.

Definition at line 211 of file UtkUnpacker.cpp.

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

§ ProcessRawEvent()

void UtkUnpacker::ProcessRawEvent ( ScanInterface addr_ = NULL)
privatevirtual

Process all events in the event list.

Parameters
[in]addr_Pointer to a ScanInterface object.

This method initializes the DetectorLibrary and DetectorDriver classes so that we can begin processing the events. We take special action on the first event so that we can handle somethings poperly. Then we processes all channels in the event that we have not been told to ignore. The rejection regions that are defined in the XML file are used here to ignore chunks of data. We also make some calls to various other private methods to plot useful spectra and output processing information to the screen. Remove the conversion from XiaData to ChanEvent, these two classes are effectively identical. This is referenced in issue #

Add back in the processing for the dtime.

Reimplemented from Unpacker.

Definition at line 44 of file UtkUnpacker.cpp.

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

§ RawStats()

void UtkUnpacker::RawStats ( XiaData event_,
DetectorDriver driver,
ScanInterface addr_ = NULL 
)
privatevirtual

Add an event to generic statistics output.

Parameters
[in]event_Pointer to the current XIA event.
[in]driverPointer to the DetectorDriver class that we're using.
[in]addr_Pointer to a ScanInterface object.

This method plots information about the running time of the program, the hit spectrum, and the scalars for each of the channels. The two runtime spectra are critical when we are trying to debug potential data losses in the system. These spectra print the total number of counts in a given (milli)second of time.

Definition at line 140 of file UtkUnpacker.cpp.

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

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