Derived class for DDAS event segments.
More...
#include <CMyEventSegment.h>
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() [1/2]
| CMyEventSegment::CMyEventSegment |
( |
CMyTrigger * |
trig, |
|
|
CExperiment & |
exp |
|
) |
| |
Construct from trigger object and experiment.
- Parameters
-
| 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:
◆ CMyEventSegment() [2/2]
| CMyEventSegment::CMyEventSegment |
( |
| ) |
|
Default constructor.
- Note
- For unit testing purposes only!
◆ ~CMyEventSegment()
| CMyEventSegment::~CMyEventSegment |
( |
| ) |
|
◆ boot()
Load firmware and boot the modules.
- Parameters
-
| type | The boot type (boot mask) passed to the system booter (default = SystemBooter::FullBoot). |
- Exceptions
-
| CDDASException | If the system is initialized and fails to exit before attempting to boot again. |
◆ clear()
| void CMyEventSegment::clear |
( |
| ) |
|
|
virtual |
◆ disable()
| void CMyEventSegment::disable |
( |
| ) |
|
|
virtual |
◆ getCrateID()
| int CMyEventSegment::getCrateID |
( |
| ) |
const |
|
inline |
Get the crate ID value from the configuration.
- Returns
- The crate ID.
◆ getModuleChannelCount()
| unsigned short CMyEventSegment::getModuleChannelCount |
( |
unsigned int |
mod | ) |
|
|
inline |
Get the channel count in a given module.
- Parameters
-
- Returns
- The channel count of that module.
- Note
- Throws if module index is out of range.
◆ getNumberOfModules()
| size_t CMyEventSegment::getNumberOfModules |
( |
| ) |
|
|
inline |
Get the number of modules in the crate.
- Returns
- Number of modules.
◆ getStatistics()
| std::pair< size_t, size_t > CMyEventSegment::getStatistics |
( |
| ) |
|
|
inline |
Get the cumulative and current run statistics.
- Returns
- Cumulative and current run stats as a std::pair.
◆ initialize()
| void CMyEventSegment::initialize |
( |
| ) |
|
|
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).
- Note
- This is not threadsafe as C++ does not require getenv to be thread-safe.
- Todo:
- (ASC 1/25/24): An old comment from (I bet) RF: "paging through
the global **environ is probably thread-safe however I'm pretty sure at
this point in time there's no other thread doing a getenv()."
◆ onBegin()
| void CMyEventSegment::onBegin |
( |
| ) |
|
|
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.
◆ onEnd()
| virtual void CMyEventSegment::onEnd |
( |
CExperiment * |
pExperiment | ) |
|
|
inlinevirtual |
Just return. Sorting is offloaded into its own process.
◆ onResume()
| void CMyEventSegment::onResume |
( |
| ) |
|
|
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.
◆ read()
| size_t CMyEventSegment::read |
( |
void * |
rBuffer, |
|
|
size_t |
maxBytes |
|
) |
| |
|
virtual |
Read data from the modules following a valid trigger.
- Parameters
-
| [in,out] | rBuffer | Read data into this buffer. |
| [in] | maxBytes | Max bytes of data we can stuff in the buffer. |
- Returns
- Number of 16-bit words in the ring item body.
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.
◆ synchronize()
| void CMyEventSegment::synchronize |
( |
| ) |
|
Perform clock synchronization.
- Exceptions
-
| 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.
The documentation for this class was generated from the following files: