NSCL DDAS 12.2-009
Support for XIA DDAS at FRIB
CMyEventSegment.h
Go to the documentation of this file.
1
6#ifndef CMYEVENTSEGMENT_H
7#define CMYEVENTSEGMENT_H
8
9#include <CEventSegment.h>
10
11#include <vector>
12
13#include <Configuration.h>
14#include <SystemBooter.h>
15
21const int MAX_MODULES_PER_CRATE = 13;
22
23class CMyTrigger;
24class CExperiment;
25
35class CMyEventSegment : public CEventSegment {
36private:
39 unsigned int m_modRevBitMSPSWord[MAX_MODULES_PER_CRATE];
42 double m_modClockCal[MAX_MODULES_PER_CRATE];
44 bool m_systemInitialized;
45 bool m_firmwareLoadedRecently;
46 CMyTrigger *m_pTrigger;
47 CExperiment *m_pExperiment;
48
49 // Statistics:
50
51 size_t m_nCumulativeBytes;
52 size_t m_nBytesPerRun;
53
54public:
60 CMyEventSegment(CMyTrigger *trig, CExperiment &exp);
65 CMyEventSegment(); // For unit testing only!!
68
70 virtual void initialize();
77 virtual size_t read(void *rBuffer, size_t maxwords);
79 virtual void disable();
81 virtual void clear();
82
84 virtual void onBegin();
86 virtual void onResume();
88 virtual void onEnd(CExperiment *pExperiment) { return; };
89
94 size_t getNumberOfModules() { return m_config.getNumberOfModules(); }
101 unsigned short getModuleChannelCount(unsigned int mod) {
102 return m_config.getModuleChannelCount(mod);
103 }
108 int getCrateID() const { return m_config.getCrateId(); }
109
115 void synchronize();
116
124 void boot(
126
131 std::pair<size_t, size_t> getStatistics() {
132 return std::pair<size_t, size_t>(m_nCumulativeBytes, m_nBytesPerRun);
133 }
134};
135
136#endif
const int MAX_MODULES_PER_CRATE
A full crate is 13 modules.
Definition: CMyEventSegment.h:21
Defines a class for storing system configuration information.
Defines a class to manage the booting process for DDAS.
Derived class for DDAS event segments.
Definition: CMyEventSegment.h:35
~CMyEventSegment()
Destructor.
virtual void disable()
Nothing to disable.
Definition: CMyEventSegment.cpp:290
int getCrateID() const
Get the crate ID value from the configuration.
Definition: CMyEventSegment.h:108
unsigned short getModuleChannelCount(unsigned int mod)
Get the channel count in a given module.
Definition: CMyEventSegment.h:101
void synchronize()
Perform clock synchronization.
Definition: CMyEventSegment.cpp:362
virtual void onBegin()
Manage run start operation.
Definition: CMyEventSegment.cpp:304
virtual void onEnd(CExperiment *pExperiment)
Just return. Sorting is offloaded into its own process.
Definition: CMyEventSegment.h:88
virtual void onResume()
Manage run resume operation.
Definition: CMyEventSegment.cpp:330
std::pair< size_t, size_t > getStatistics()
Get the cumulative and current run statistics.
Definition: CMyEventSegment.h:131
CMyEventSegment()
Default constructor.
void boot(DAQ::DDAS::SystemBooter::BootType=DAQ::DDAS::SystemBooter::FullBoot)
Load firmware and boot the modules.
Definition: CMyEventSegment.cpp:380
virtual void clear()
Nothing to clear.
Definition: CMyEventSegment.cpp:294
virtual void initialize()
Initialize the modules recording data in this segment.
Definition: CMyEventSegment.cpp:190
size_t getNumberOfModules()
Get the number of modules in the crate.
Definition: CMyEventSegment.h:94
virtual size_t read(void *rBuffer, size_t maxwords)
Read data from the modules following a valid trigger.
Definition: CMyEventSegment.cpp:209
Trigger class for DDAS.
Definition: CMyTrigger.h:23
Store the system configuration information needed by Readout.
Definition: Configuration.h:88
unsigned short getModuleChannelCount(size_t mod)
Get the number of channels in a module.
Definition: Configuration.cpp:92
size_t getNumberOfModules() const
Return the number of modules in the crate.
Definition: Configuration.h:131
int getCrateId() const
Return the crate id value.
Definition: Configuration.h:121
BootType
An enum for boot type masks, legacy flags.
Definition: SystemBooter.h:40
@ FullBoot
Full boot with firmware load.
Definition: SystemBooter.h:41