NSCL DDAS
12.1-001
Support for XIA DDAS at FRIB
|
Derived class for DDAS event segments. More...
#include <CMyEventSegment.h>
Public Member Functions | |
CMyEventSegment (CMyTrigger *trig, CExperiment &exp) | |
Construct from trigger object and experiment. More... | |
CMyEventSegment () | |
Default constructor. More... | |
~CMyEventSegment () | |
Destructor. More... | |
virtual void | initialize () |
Initialize the modules recording data in this segment. More... | |
virtual size_t | read (void *rBuffer, size_t maxwords) |
Read data from the modules following a valid trigger. More... | |
virtual void | disable () |
Nothing to disable. More... | |
virtual void | clear () |
Nothing to clear. More... | |
virtual void | onBegin () |
Manage run start operation. More... | |
virtual void | onResume () |
Manage run resume operation. More... | |
virtual void | onEnd (CExperiment *pExperiment) |
Just return. Sorting is offloaded into its own process. More... | |
size_t | GetNumberOfModules () |
Get the number of modules in the crate. More... | |
int | GetCrateID () const |
Get the crate ID value from the configuration. More... | |
void | synchronize () |
Perform clock synchronization. More... | |
void | boot (DAQ::DDAS::SystemBooter::BootType=DAQ::DDAS::SystemBooter::FullBoot) |
Load firmware and boot the modules. More... | |
std::pair< size_t, size_t > | getStatistics () |
Get the cumulative and current run statistics. More... | |
Derived class for DDAS event segments.
The event segment reads out a logical chunk of an experiment. In the DDAS case, data from a single crate (single source ID). An experiment may consist of multiple crates arranged in a CCompoundEventSegment container.
CMyEventSegment::CMyEventSegment | ( | CMyTrigger * | trig, |
CExperiment & | exp | ||
) |
Construct from trigger object and experiment.
trig | Pointer to the DDAS trigger. |
exp | Reference to the experiment the event segment comes from. |
Initialize the system, load the configuration and expected event lengths from the cfgPixie16.txt and modevtlen.txt files, boot the system and initialize the trigger.
In FRIBDAQ 12.0+, the external clock readout is merged into the standard readout framework. The constructor determines whether or not the external clock is enabled for each module the by checking the value of the corresponding bit in the Pixie CSRA register in that module's channel 0.
Failure to properly construct an event segment occurs if:
There are a mix of external and internal clocks enabled on the same crate.
CMyEventSegment::CMyEventSegment | ( | ) |
Default constructor.
CMyEventSegment::~CMyEventSegment | ( | ) |
Destructor.
void CMyEventSegment::boot | ( | DAQ::DDAS::SystemBooter::BootType | type = DAQ::DDAS::SystemBooter::FullBoot | ) |
Load firmware and boot the modules.
type | The boot type (boot mask) passed to the system booter (default = SystemBooter::FullBoot). |
CDDASException | If the system is initialized and fails to exit before attempting to boot again. |
|
virtual |
Nothing to clear.
|
virtual |
Nothing to disable.
int CMyEventSegment::GetCrateID | ( | ) | const |
Get the crate ID value from the configuration.
|
inline |
Get the number of modules in the crate.
|
inline |
Get the cumulative and current run statistics.
|
virtual |
Initialize the modules recording data in this segment.
Initialize unless there is an INFINITY_CLOCK environment variable with the value "YES" or the firmware has been loaded recently (no system exit).
|
virtual |
Manage run start operation.
Begin the list mode run with NEW_RUN (= 1) run mode. If the start fails, display the return value of Pixie16StartListModeRun() and the error code text.
|
virtual |
Just return. Sorting is offloaded into its own process.
|
virtual |
Manage run resume operation.
Resume the list mode run with RESUME_RUN (= 0) run mode. If the resume fails, display the return value of Pixie16StartListModeRun and the error code text.
|
virtual |
Read data from the modules following a valid trigger.
[in,out] | rBuffer | Read data into this buffer. |
[in] | maxBytes | Max bytes of data we can stuff in the buffer. |
Pixie has triggered. There are greater than EXTFIFO_READ_THRESH words in the output FIFO of a particular Pixie module. Read out all modules.
This loop finds the first module that has at least one event in it since the trigger fired. We read the minimum of all complete events and the number of complete events that fit in that buffer (note that ) each buffer will also contain the module type word. Note as well that modules count words in uint32_t's but maxBytes is in uint16_t's.
void CMyEventSegment::synchronize | ( | ) |
Perform clock synchronization.
CDDASException | If we fail to talk properly to the module while setting the clock synchronization parameters. |
More or less straight from the XIA Pixie SDK docs: configure the system to run synchronously through the backplane by setting Pixie module parameters. Synchronous running means that the last module ready to take data starts the run in all modules and the first module to end the run stops the run in all modules (SYNCH_WAIT = 1). In synchronous mode, all run timers are cleared at the start of a new run (IN_SYNCH = 0). Once the run has started, IN_SYNCH is automatically set to 1.
Removed from initialize() so that this can be called via a command. See the CSyncCommand class for details.