20 template <
class DetCardPolicy>
46 template <
class DetCardPolicy>
57 virtual int readHistogramMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
58 virtual bool readHistogramMemoryWrapped(
unsigned long start,
isisU32_t* buffer, uint32_t len,
DAEstatus& status) = 0;
59 virtual int writeHistogramMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
61 virtual int clearHistogramMemoryStart(
DAEstatus& status) = 0;
62 virtual bool isClearHistogramMemoryComplete(
DAEstatus& status) = 0;
63 virtual int readPOSLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
64 virtual int writePOSLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
65 virtual int clearPOSLUTMemory(
DAEstatus& status,
unsigned long start = 0,
int len = 65536) = 0;
66 virtual int readTCGLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
67 virtual int writeTCGLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status) = 0;
68 virtual int readDescriptorTimeBinLimitRegister(
isisU32_t* value,
DAEstatus& status) = 0;
69 virtual int writeDescriptorTimeBinLimitRegister(
isisU32_t value,
DAEstatus& status) = 0;
76 virtual int readSpectrum(
int spec,
isisU32_t* buffer,
int nbuffer,
DAEstatus& status) = 0;
77 virtual int readDAE1Spectrum(
int dae1_spec,
isisU32_t* buffer,
int nbuffer,
DAEstatus& status) = 0;
78 virtual int readDAE1Spectra(
isisU32_t* buffer,
int nbuffer,
const int spec_to_crpt_offset[],
int spec_start,
int nspec,
int period,
int persize,
DAEstatus& status) = 0;
82 virtual int programDAE1POSLUT(
int crat[],
int modn[],
int mpos[],
83 int spec[],
int ndet,
int nperiods,
int dae1persize,
DAEstatus& status) = 0;
84 virtual int findDAE1Spectrum(
int dae1_spectrum,
DAEstatus& )
const = 0;
85 virtual int findDAE2Spectrum(
int dae2_spectrum,
DAEstatus& )
const = 0;
86 virtual const int* getDAE2SpecMap() = 0;
87 virtual int readAllDAE1Spectra(
isisU32_t* buffer,
int nbuffer,
const int spec_to_crpt_offset[],
int persize,
DAEstatus& status) = 0;
88 virtual int programPOSLUT(
int cards[],
int dims[],
int pos_start[],
89 int npos[],
int spec[],
int spec_step[],
int nblocks,
90 int nperiods,
int dae1persize,
DAEstatus& status) = 0;
92 virtual void printStatus(std::ostream& os,
DAEstatus& status) = 0;
93 virtual void printSpecmap(std::ostream& os) = 0;
94 virtual void printTimeChannels(std::ostream& os,
int start = 0,
int end = -1) = 0;
95 virtual void printPOSLUT(std::ostream& os,
DAEstatus& status) = 0;
96 virtual int readPOSLUT(
DAEstatus& status) = 0;
97 virtual unsigned long memorySize() = 0;
98 virtual int loadDAE2SpecmapFromArray(
int* array,
int len,
DAEstatus& status) = 0;
99 virtual int saveDAE2SpecmapToArray(
int* array,
int offset,
int len,
DAEstatus& status) = 0;
100 virtual int changePeriod(
int period,
DAEstatus& status) = 0;
101 virtual int changeNumberOfPeriods(
int nperiod,
DAEstatus& status) = 0;
102 virtual int setPeriodType(
bool hardware_periods,
bool single_daq_period,
DAEstatus& status) = 0;
105 virtual int disableDIMVetos(
DAEstatus& status) = 0;
106 virtual int clearVetoOccurredFlag(
DAEstatus& status) = 0;
110 virtual int clearTotalCountsRegister(
DAEstatus& status) = 0;
113 virtual int fillWithTestPattern(
unsigned long pattern,
DAEstatus& status) = 0;
114 virtual int checkTestPattern(
unsigned long pattern,
DAEstatus& status) = 0;
115 virtual int whichVeto(std::ostream& os,
DAEstatus& status) = 0;
117 virtual int setEventCollectionMode(
bool enable,
DAEstatus& status) = 0;
120 virtual uint32_t getNewEvents(
isisU32_t* buffer, uint32_t maxlen, uint64_t& num_unread,
122 virtual uint64_t nNewEventWords(
DAEstatus& status) = 0;
123 virtual void updateDAEEventLastRead(
DAEstatus& status) = 0;
124 virtual isisU32_t getLastAddressRead() = 0;
125 virtual void setLastAddressRead(
isisU32_t addr) = 0;
126 virtual int eventSourceID()
const = 0;
127 virtual int highspec()
const = 0;
132 virtual int enableVeto(DetectorCardVeto veto,
DAEstatus& status) = 0;
133 virtual int disableVeto(DetectorCardVeto veto,
DAEstatus& status) = 0;
134 virtual bool isVetoEnabled(DetectorCardVeto veto,
DAEstatus& status) = 0;
135 virtual bool hasVetoOccurred(DetectorCardVeto veto,
DAEstatus& status) = 0;
136 virtual int printVetoStatus(std::ostream& os,
bool triggered_only,
DAEstatus& status) = 0;
137 virtual int resetCardState(
DAEstatus& status) = 0;
138 virtual void setCardMode(DetectorCardMode mode) = 0;
141 template <
class DetCardPolicy>
158 DelayedFrameSync=0x8,
EventMode=0x10, Muon32Channel=0x20 };
168 int readHistogramMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
169 bool readHistogramMemoryWrapped(
unsigned long start,
isisU32_t* buffer, uint32_t len,
DAEstatus& status);
170 int writeHistogramMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
172 int clearHistogramMemoryStart(
DAEstatus& status);
173 bool isClearHistogramMemoryComplete(
DAEstatus& status);
174 int readPOSLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
175 int writePOSLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
176 int clearPOSLUTMemory(
DAEstatus& status,
unsigned long start = 0,
int len = 65536);
177 int readTCGLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
178 int writeTCGLUTMemory(
unsigned long start,
isisU32_t* buffer,
int len,
DAEstatus& status);
188 int readDAE1Spectrum(
int dae1_spec,
isisU32_t* buffer,
int nbuffer,
DAEstatus& status);
189 int readDAE1Spectra(
isisU32_t* buffer,
int nbuffer,
const int spec_to_crpt_offset[],
int spec_start,
int nspec,
int period,
int persize,
DAEstatus& status);
193 virtual int programDAE1POSLUT(
int crat[],
int modn[],
int mpos[],
194 int spec[],
int ndet,
int nperiods,
int dae1persize,
DAEstatus& status);
198 int readAllDAE1Spectra(
isisU32_t* buffer,
int nbuffer,
const int spec_to_crpt_offset[],
int persize,
DAEstatus& status);
199 virtual int programPOSLUT(
int cards[],
int dims[],
int pos_start[],
200 int npos[],
int spec[],
int spec_step[],
int nblocks,
201 int nperiods,
int dae1persize,
DAEstatus& status);
203 virtual void printStatus(std::ostream& os,
DAEstatus& status);
204 void printSpecmap(std::ostream& os);
205 void printTimeChannels(std::ostream& os,
int start = 0,
int end = -1);
206 void printPOSLUT(std::ostream& os,
DAEstatus& status);
207 virtual int readPOSLUT(
DAEstatus& status);
209 int loadDAE2SpecmapFromArray(
int* array,
int len,
DAEstatus& status);
210 int saveDAE2SpecmapToArray(
int* array,
int offset,
int len,
DAEstatus& status);
211 virtual int changePeriod(
int period,
DAEstatus& status);
212 virtual int changeNumberOfPeriods(
int nperiod,
DAEstatus& status);
213 virtual int setPeriodType(
bool hardware_periods,
bool single_daq_period,
DAEstatus& status);
217 int clearVetoOccurredFlag(
DAEstatus& status);
221 int clearTotalCountsRegister(
DAEstatus& status);
224 int fillWithTestPattern(
unsigned long pattern,
DAEstatus& status);
225 int checkTestPattern(
unsigned long pattern,
DAEstatus& status);
226 int whichVeto(std::ostream& os,
DAEstatus& status);
231 uint32_t getNewEvents(
isisU32_t* buffer, uint32_t maxlen, uint64_t& num_unread,
233 uint64_t nNewEventWords(
DAEstatus& status);
234 void updateDAEEventLastRead(
DAEstatus& status);
242 int enableVeto(DetectorCardVeto veto,
DAEstatus& status);
243 int disableVeto(DetectorCardVeto veto,
DAEstatus& status);
244 bool isVetoEnabled(DetectorCardVeto veto,
DAEstatus& status);
245 bool hasVetoOccurred(DetectorCardVeto veto,
DAEstatus& status);
246 int printVetoStatus(std::ostream& os,
bool triggered_only,
DAEstatus& status);
247 virtual int resetCardState(
DAEstatus& status);
248 void setCardMode(DetectorCardMode mode);
254 int printVetoStatus(DetectorCardVeto veto, std::ostream& os,
bool triggered_only,
DAEstatus& status);
255 uint32_t getVetoMask(DetectorCardVeto veto);
256 const char* getVetoName(DetectorCardVeto veto);
260 int recreateDAE1Specmap(
DAEstatus& status);
261 int setPeriodSize(
int per_size,
DAEstatus& status);
262 int setPeriodCounter(
int period,
DAEstatus& status);
267 virtual int programDAE1POSLUTDataDae(
DAEstatus& status);
int findDAE1Spectrum(int dae1_spectrum, DAEstatus &) const
DetectorCardRegisters< DetCardPolicy > m_reg
int enable(bool choice, isisU32_t mask, DAEstatus &status, bool little_endian=false)
unsigned long m_memsize
histogram memory in bytes
set for event mode, clear for histogram mode
isisU32_t getLastAddressRead()
int findDAE2Spectrum(int dae2_spectrum, DAEstatus &) const
std::string daeDevice() const
int allVetoesInHeader(bool choice, DAEstatus &status)
CRITICAL_SECTION m_critical
std::vector< int > m_dae1specmap
dae2spec = m_dae1specmap[dae1spec]
EventModeRegister(DAE2Card< DetCardPolicy > *card)
int m_nperiods
number of software/DAQ periods
int m_highspec
highest DAE2 spectrum used
void setLastAddressRead(isisU32_t addr)
isisU16_t m_wrap_counter
number of times memory wrapped in event mode
unsigned getHeaderType(DAEstatus &status)
unsigned setHeaderType(unsigned val, DAEstatus &status)
int eventMode(DAEstatus &status)
int setBits(isisU32_t mask, bool preserve, DAEstatus &status, bool little_endian=false)
isisU32_t read(DAEstatus &status, bool little_endian=false, bool retry=true)
int m_dae1persize
number of dae1 spectra in a period
int storeVetodData(bool choice, DAEstatus &status)
bit assignmments for DAE2DetCardPolicy::DCEVNTMD
set to store events for all frames, clear to only store events for good frames
DetectorCard< DetCardPolicy > MyDetectorCard
int eventSourceID() const
isisU32_t m_last_address_read
last memory addess read in event mode
int m_dae2persize
number of spectra in a dae2 period
int enable64bitEvents(DAEstatus &status)
int clearBits(isisU32_t mask, DAEstatus &status, bool little_endian=false)
std::string daeDevice() const
int m_hardware_periods
are we using hardware periods?
static const int NOSPECTRUM
DetectorCardRegisters(DAE2Card< DetCardPolicy > *dc)
EventModeRegister< DetCardPolicy > event_reg
static const int SPECTRUM_PLACEHOLDER
unsigned long memorySize()
isisU32_t * m_poslut
temp workspace for POSLUT programming
std::vector< int > m_dae2specmap
dae1spec = m_dae2specmap[dae2spec]
const int * getDAE2SpecMap()
set to enable 64bit events, clear to enable 32 bit events
int eventMode(bool choice, DAEstatus &status)
set to store all received vetos in header, clear to only store enabled vetos in header ...
int enable32bitEvents(DAEstatus &status)
virtual ~DetectorCardIntf()