ICP  1
MuonDetectorCard.h
Go to the documentation of this file.
1 #ifndef MUONDETECTOR_CARD
2 #define MUONDETECTOR_CARD
3 
4 #include "detector_card.h"
5 
6 class MuonDetectorCard : public DetectorCard<DAE2DetCardPolicy>
7 {
8 public: // len is the number of 32 bit words to write
9  MuonDetectorCard(int position, ISISVME* vme, int* specmap_array, int specmap_len, DAEstatus& status);
10  int getNTimeChannels(isisU32_t* ntc, DAEstatus& status); // ntc
11  int setTimeChannels(isisU32_t* tcb, int ntc, DAEstatus& status);
12  int getTimeChannels(isisU32_t* tcb, int ntc, DAEstatus& status);
14  int programDAE1POSLUT(int crat[], int modn[], int mpos[],
15  int spec[], int ndet, int nperiods, int dae1persize, DAEstatus& status);
16  int programPOSLUT(int cards[], int dims[], int pos_start[],
17  int npos[], int spec[], int spec_step[], int nblocks,
18  int nperiods, int dae1persize, DAEstatus& status);
19  void printStatus(std::ostream& os, DAEstatus& status);
20  int readPOSLUT(DAEstatus& status);
21  int changePeriod(int period, DAEstatus& status);
22  virtual int resetCardState(DAEstatus& status);
23 
24 private:
26  int m_num_dims;
28  int m_dim_step;
29  int calculateModuleAndPosition(int dae2_spec, int& modn, int& mpos, DAEstatus& status);
30  int calculateSpectrum(int& dae2_spec, int modn, int mpos, DAEstatus& status);
31  int setTimeChannels32(isisU32_t* tcb, int ntc, DAEstatus& status);
32  int getTimeChannels32(isisU32_t* tcb, int ntc, DAEstatus& status);
33  int clockPulsesToMuonStepSize(int clock_pulses, DAEstatus& status);
34  int muonStepSizeToClockPulses(int step_size, DAEstatus& status);
35  bool isPowerOf2(int value);
36 };
37 
38 #endif /* MUONDETECTOR_CARD */
int calculateModuleAndPosition(int dae2_spec, int &modn, int &mpos, DAEstatus &status)
int getNTimeChannels(isisU32_t *ntc, DAEstatus &status)
int getTimeChannels32(isisU32_t *tcb, int ntc, DAEstatus &status)
int setTimeChannels32(isisU32_t *tcb, int ntc, DAEstatus &status)
unsigned long isisU32_t
Definition: isisvme_types.h:8
virtual int resetCardState(DAEstatus &status)
This emulates Kelvin Gascoyne&#39;s Clear.
int programPOSLUT(int cards[], int dims[], int pos_start[], int npos[], int spec[], int spec_step[], int nblocks, int nperiods, int dae1persize, DAEstatus &status)
int changePeriod(int period, DAEstatus &status)
int readPOSLUT(DAEstatus &status)
int clockPulsesToMuonStepSize(int clock_pulses, DAEstatus &status)
int programDAE1POSLUT(int crat[], int modn[], int mpos[], int spec[], int ndet, int nperiods, int dae1persize, DAEstatus &status)
int muonStepSizeToClockPulses(int step_size, DAEstatus &status)
bool isPowerOf2(int value)
is value expressable as 2^n for some integer n
void printStatus(std::ostream &os, DAEstatus &status)
int setTimeChannels(isisU32_t *tcb, int ntc, DAEstatus &status)
set of ntc+1 time channel boundaries in clock pulses (one pulse = 0.5ns)
int getTimeChannels(isisU32_t *tcb, int ntc, DAEstatus &status)
int m_dim_step
are dims numbered 0,1,2,3... or 0,2,4,6... etc.
int calculateSpectrum(int &dae2_spec, int modn, int mpos, DAEstatus &status)
int m_num_dims
totoal number of dims, not the highest dim number
MuonDetectorCard(int position, ISISVME *vme, int *specmap_array, int specmap_len, DAEstatus &status)