MIDAS
Loading...
Searching...
No Matches
v1720CONET2.hxx
Go to the documentation of this file.
1/*****************************************************************************/
10#ifndef V1720_HXX_INCLUDE
11#define V1720_HXX_INCLUDE
12
13#include <iostream>
14#include <sstream>
15#include <iomanip>
16#include <assert.h>
17
18extern "C" {
19#include "CAENComm.h"
20#include "ov1720drv.h"
21}
22#include "midas.h"
23
36{
37private:
38#if SIMULATION
39 int _handle, _board;
40#else
41 int _handle,
46#endif
47
52
53public:
54 int verbose;
58
59
71 // Hard code the two fp_* settings to alway on (Alex 21/2/13)
72 // DWORD fp_io_ctrl; //!< 0x811C@[31.. 0]
74 // DWORD fp_lvds_io_ctrl; //!< 0x81A0@[31.. 0]
75 // BOOL trigger_positive_pulse; //!< 0x8000@[ 6]
76 // WORD pre_record_zs; //!< 0x1n24@[31..16]
77 // WORD post_record_zs; //!< 0x1n24@[15.. 0]
84 static const char *config_str[];
85
86#if SIMULATION
87 v1720CONET2(int board);
88#else
89 v1720CONET2(int feindex, int link, int board, int moduleID);
90#endif
92
105
106 int SetODBRecord(HNDLE h, void(*cb_func)(INT,INT,void*));
107 int InitializeForAcq();
108 bool IsConnected();
109 bool IsRunning();
110 std::string GetName();
113 return _settings_touched;
114 }
115 void SetSettingsTouched(bool t) {
117 }
118 int GetHandle() { return _handle; }
119#if SIMULATION
120 int GetBoard() { return _board; }
121 int GetModuleID() { return _board; }
122#else
123 int GetModuleID() { return _moduleID; }
124 int GetLink() { return _link; }
125 int GetBoard() { return _board; }
126 int GetFEIndex() { return _feindex; }
127#endif
128
129 //Utilities
130 // int mNCh;
131 // uint32_t mChMap[8];
141 BOOL IsZLEData();
142 void fillQtBank(char * aDest, uint32_t * aZLEData, int aModule);
143};
144
145#endif // V1720_HXX_INCLUDE
~v1720CONET2()
Destructor for the module object.
std::string GetName()
Get short string identifying the module's index, link and board number.
void SetSettingsTouched(bool t)
int _link
Optical link number.
bool _settings_loaded
ODB settings loaded.
CAENComm_ErrorCode WriteReg(DWORD, DWORD)
Write to 32-bit register.
BOOL IsZLEData()
Get ZLE setting.
CAENComm_ErrorCode SendTrigger()
Send a software trigger to the board.
int InitializeForAcq()
Initialize the hardware for data acquisition.
CAENComm_ErrorCode ChannelConfig(uint32_t)
Control data acquisition.
void fillQtBank(char *aDest, uint32_t *aZLEData, int aModule)
Fill Qt Bank.
int _handle
Device handler.
int GetModuleID()
returns unique module ID
int _moduleID
Unique module ID.
bool _settings_touched
ODB settings touched.
int GetBoard()
returns board number
CAENComm_ErrorCode SetupPreset(int)
Setup board registers using preset (see ov1720.c:ov1720_Setup())
CAENComm_ErrorCode ReadReg(DWORD, DWORD *)
Read 32-bit register.
CAENComm_ErrorCode Disconnect()
Disconnect the board through the optical link.
CAENComm_ErrorCode Poll(DWORD *)
Poll Event Stored register.
CAENComm_ErrorCode AcqCtl(uint32_t)
Control data acquisition.
int GetHandle()
returns device handler
static const char * config_str[]
Configuration string for this module. (ODB: /Equipment/[eq_name]/Settings/[board_name]/)
CAENComm_ErrorCode StartRun()
Start data acquisition.
BOOL mZLE
true if ZLE (Zero-length encoding) is enabled on all channels
CAENComm_ErrorCode StopRun()
Start data acquisition.
int _feindex
Frontend index number.
HNDLE GetODBHandle()
returns ODB handle
int GetFEIndex()
returns frontend index
int GetLink()
returns optical link number
CAENComm_ErrorCode ReadEvent(DWORD *, int *)
Read event buffer.
bool IsRunning()
Get run status.
void getChannelConfig(DWORD aChannelConfig)
Get data type and ZLE configuration.
int SetODBRecord(HNDLE h, void(*cb_func)(INT, INT, void *))
Set the ODB record for this module.
bool IsConnected()
Get connected status.
bool GetSettingsTouched()
HNDLE _odb_handle
ODB handle.
bool _running
Run in progress.
struct v1720CONET2::V1720_CONFIG_SETTINGS config
instance of config structure
int _board
Module/Board number.
CAENComm_ErrorCode Connect()
Connect the board through the optical link.
unsigned int DWORD
Definition mcstd.h:51
INT HNDLE
Definition midas.h:132
DWORD BOOL
Definition midas.h:105
int INT
Definition midas.h:129
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Settings structure for this v1740 module.
DWORD threshold[8]
0x1n80@[11.. 0]
DWORD nbouthreshold[8]
0x1n84@[11.. 0]
INT zs_threshold[8]
0x1n24@[31.. 0]
DWORD channel_config
0x8000@[19.. 0]
DWORD zs_nsamp[8]
0x1n28@[31.. 0]
DWORD dac[8]
0x1n98@[15.. 0]
DWORD channel_mask
0x8120@[ 7.. 0]
INT buffer_organization
0x800C@[ 3.. 0]
DWORD trigger_source
0x810C@[31.. 0]
DWORD trigger_output
0x8110@[31.. 0]
DWORD post_trigger
0x8114@[31.. 0]
INT setup
Initial board setup mode number.