#include <CCAENV830.h>
Public Types | |
enum | _TriggerMode { Disabled, Random, Periodic } |
typedef enum CCAENV830::_TriggerMode | TriggerMode |
Public Member Functions | |
CCAENV830 (int slot, int crate=0, bool geo=true, unsigned long base=0) throw (STD(string)) | |
~CCAENV830 () | |
int | getCrate () const |
int | getSlot () const |
int | getModuleType () const |
int | getFirmware () const |
int | getSerial () const |
void | setCrate (int crate) |
void | setSlot (int slot) |
void | setModuleType (int type) |
void | setFirmware (int fwRev) |
void | Enable (int nChannel) throw (STD(string)) |
void | Disable (int nChannel) throw (STD(string)) |
void | SetEnableMask (int nMask) |
void | SetDwellTime (int n400ns) |
void | SetTriggerMode (TriggerMode mode) throw (STD(string)) |
void | SetWide () |
void | SetNarrow () |
void | EnableHeader () |
void | DisableHeader () |
void | FPClearsMEB (bool state) |
void | EnableAutoReset () |
void | DisableAutoReset () |
bool | isDataReady () |
bool | isAlmostFull () |
bool | isFull () |
bool | isGlobalDready () |
bool | isGlobalBusy () |
void | Reset () |
void | Clear () |
void | Trigger () |
void | SetTriggerCounter (int n) |
void | SetAlmostFullLevel (int n) |
int | GetMEBEventCount () |
int | ReadEvent (void *pBuffer) |
int | ReadEvent (DAQWordBufferPtr &rBufferPtr) |
int | ReadEvent (DAQWordBuffer &rBuffer, int nOffset) |
int | ReadCounter (int nChannel) |
Protected Member Functions | |
void | ComputeEventSize () |
void | MapModule () throw (STD(string)) |
void | InitModule () |
void | UnmapModule () |
Private Member Functions | |
CCAENV830 (const CCAENV830 &rhs) | |
CCAENV830 & | operator= (const CCAENV830 &rhs) |
int | operator== (const CCAENV830 &rhs) const |
int | operator!= (const CCAENV830 &rhs) const |
Private Attributes | |
int | m_nCrate |
int | m_nSlot |
int | m_nEventLength |
int | m_nBase |
CVmeModule * | m_pModule |
int | m_nModuleType |
int | m_nSerialno |
int | m_nFirmware |
bool | m_fGeo |
Definition at line 315 of file CCAENV830.h.
typedef enum CCAENV830::_TriggerMode CCAENV830::TriggerMode |
CCAENV830::CCAENV830 | ( | int | slot, | |
int | crate = 0 , |
|||
bool | geo = true , |
|||
unsigned long | base = 0 | |||
) | throw (STD(string)) |
Make a new CCAENV830 module. This involves:
slot | (in): The slot number the adc is in. If the module is run in Geo address mode, this slot is used to open the initial map. Otherwise it is programmed into the module Geo register. | |
crate | (in): The VME crate the module lives in. This defaults to zero. | |
geo | (in): A flag that defaults to true.. .when true, the module will be used in geographical address mode for initialization purposes. | |
base | (in): If geo is false, this must be the module base address as set in it's rotary switches. |
Definition at line 353 of file CCAENV830.cpp.
CCAENV830::~CCAENV830 | ( | ) |
CCAENV830::CCAENV830 | ( | const CCAENV830 & | rhs | ) | [private] |
int CCAENV830::operator== | ( | const CCAENV830 & | rhs | ) | const [private] |
int CCAENV830::operator!= | ( | const CCAENV830 & | rhs | ) | const [private] |
int CCAENV830::getCrate | ( | ) | const [inline] |
int CCAENV830::getSlot | ( | ) | const [inline] |
int CCAENV830::getModuleType | ( | ) | const [inline] |
int CCAENV830::getFirmware | ( | ) | const [inline] |
int CCAENV830::getSerial | ( | ) | const [inline] |
void CCAENV830::setCrate | ( | int | crate | ) | [inline] |
void CCAENV830::setSlot | ( | int | slot | ) | [inline] |
void CCAENV830::setModuleType | ( | int | type | ) | [inline] |
void CCAENV830::setFirmware | ( | int | fwRev | ) | [inline] |
void CCAENV830::Enable | ( | int | nChannel | ) | throw (STD(string)) |
Enable an individual channel of the module:
nChannel | (in): Number of channel to turn on [0-31]. |
Definition at line 392 of file CCAENV830.cpp.
References GetLong, and ThrowIfBadChannel().
void CCAENV830::Disable | ( | int | nChannel | ) | throw (STD(string)) |
Disable an individual channel of the module:
nChannel | (in): Number of channel to turn on [0-31] |
Definition at line 406 of file CCAENV830.cpp.
References GetLong, and ThrowIfBadChannel().
void CCAENV830::SetEnableMask | ( | int | nMask | ) |
Set the module enable register. This sets the state of all the channel enables according to the mask parameter.
nMask | (in): Mask of channel enables. |
Definition at line 421 of file CCAENV830.cpp.
References ComputeEventSize(), and PutLong.
Referenced by InitModule().
void CCAENV830::SetDwellTime | ( | int | n400ns | ) |
Set the dwell time. In periodic trigger mode, this is the length of time the module counts between latching triggers.
n400ns | [in]: The number of 400ns clock ticks to count between periodic triggers. |
Definition at line 440 of file CCAENV830.cpp.
References PutLong.
void CCAENV830::SetTriggerMode | ( | CCAENV830::TriggerMode | mode | ) | throw (STD(string)) |
Set the trigger mode:
mode | (in): The desired trigger mode. This can be one of:
|
Definition at line 458 of file CCAENV830.cpp.
References CSRAcqDisable, CSRAcqMode, CSRAcqPeriodic, CSRAcqRandom, GetShort, PutShort, and ThrowIntString().
Referenced by InitModule().
void CCAENV830::SetWide | ( | ) |
Set the scaler readout format to wide mode. This drops channel labelling information off the event... it then becomes the user's responsibility to know which channel is which in the otput stream. Use with caution, and only if 26 bits of scaler information is not sufficient.
Definition at line 489 of file CCAENV830.cpp.
void CCAENV830::SetNarrow | ( | ) |
Set the scaler readout format to narrow mode. This adds channel labelling information to each channel. It is best used when you have enabled a noncontiguous set of channels and the counts range of 26 bits is adequate for your application. Note that 26 bits gives somewhat more than 64Million counts before overflowing.
Definition at line 501 of file CCAENV830.cpp.
References CSRFormat, and PutShort.
Referenced by InitModule().
void CCAENV830::EnableHeader | ( | ) |
Enable the inclusion of a scaler header. When this feature is turned on, the scaler will include header information that includes:
Definition at line 515 of file CCAENV830.cpp.
References ComputeEventSize(), CSRHeader, and PutShort.
Referenced by InitModule().
void CCAENV830::DisableHeader | ( | ) |
Disable the inclusion of a scaler header. When this feature is turned off, only the bare scaler channels will be read.
Definition at line 525 of file CCAENV830.cpp.
References ComputeEventSize(), CSRHeader, and PutShort.
void CCAENV830::FPClearsMEB | ( | bool | state | ) |
Controls the action of the front panel clear depending on the parameter:
state | (bool in):
|
Definition at line 540 of file CCAENV830.cpp.
References CSRFPClear, and PutShort.
Referenced by InitModule().
void CCAENV830::EnableAutoReset | ( | ) |
Enables automatic reset of the scalers on trigger. When this mode is set, each trigger clears the scalers after latching them.
Definition at line 556 of file CCAENV830.cpp.
References CSRAutoClr, and PutShort.
Referenced by InitModule().
void CCAENV830::DisableAutoReset | ( | ) |
Disables automatic reset of scalers on trigger. When this mode is set, triggers do not clear scalers after latching them.
Definition at line 566 of file CCAENV830.cpp.
References CSRAutoClr, and PutShort.
bool CCAENV830::isDataReady | ( | ) |
Checks the data ready bit in the status register.
Definition at line 587 of file CCAENV830.cpp.
References GetShort, and STATUSDready.
Referenced by ReadEvent().
bool CCAENV830::isAlmostFull | ( | ) |
Checks the almost full bit in the module status register. This bit is normally used if the scaler is used in multi-event mode.
Definition at line 604 of file CCAENV830.cpp.
References GetShort, and STATUSAFull.
bool CCAENV830::isFull | ( | ) |
Checks the full bit in the status register. This bit is set when there is insufficient space in the MEB to allow the storage of the module's worst case event (33 longs). When the full bit is set, the module will no longer accept triggers until this condition is cleared either by reading data from the MEB or by clearing the MEB.
Definition at line 622 of file CCAENV830.cpp.
References GetShort, and STATUSFull.
bool CCAENV830::isGlobalDready | ( | ) |
Checks the global data ready bit. This is bit is set when the front panel control connector is bussed with other modules and at least one module on the bus has it's Dready set. In pure CAEN module systems, this can be used as a trigger condition.
Definition at line 639 of file CCAENV830.cpp.
References GetShort, and STATUSGDready.
bool CCAENV830::isGlobalBusy | ( | ) |
Checks the Global busy bit. The use of the global busy bit depends on whether or not the front panel control connector is bussed with other modules.
Definition at line 656 of file CCAENV830.cpp.
References GetShort, and STATUSGBusy.
void CCAENV830::Reset | ( | ) |
Resets the module. A reset restores the power up configuration of the module with the exception of:
Definition at line 672 of file CCAENV830.cpp.
References PutShort.
Referenced by InitModule().
void CCAENV830::Clear | ( | ) |
Peforms a software clear:
Definition at line 684 of file CCAENV830.cpp.
References PutShort.
Referenced by InitModule().
void CCAENV830::Trigger | ( | ) |
Provides a vme trigger fo the module Note that for this to have any effect, the module must be in random trigger mode.
Definition at line 693 of file CCAENV830.cpp.
References PutShort.
void CCAENV830::SetTriggerCounter | ( | int | n | ) |
Sets the current value of the trigger counter. When the header is enabled, the trigger counter appears in each event header.
n | (int in): New value of the trigger counter. |
Definition at line 705 of file CCAENV830.cpp.
References PutLong.
void CCAENV830::SetAlmostFullLevel | ( | int | n | ) |
Set the current almost full value.
n | (int in): The bottom 16 bits of this value are set as the almost full level. |
Definition at line 716 of file CCAENV830.cpp.
References PutShort.
int CCAENV830::GetMEBEventCount | ( | ) |
Get the total number of events in the MEB. This only means something if the module is not busy!!!!
Definition at line 725 of file CCAENV830.cpp.
References GetShort.
int CCAENV830::ReadEvent | ( | void * | pBuffer | ) |
Read Event: Reads the next event from the MEB. To do this we must:
pBuffer | (void* out): The buffer into which the event will be read. This must be at least m_nEventLength long. |
Definition at line 903 of file CCAENV830.cpp.
References GetLong, isDataReady(), m_nBase, m_nEventLength, and m_pModule.
Referenced by ReadEvent().
int CCAENV830::ReadEvent | ( | DAQWordBufferPtr & | rBufferPtr | ) |
Read an event: A local buffer is created into which the event is read using the ReadEvent(void* pBuffer) member. This is then transferred into a DAQWordBuffer via a DAQWordBufferPtr.
rBufferPtr | (DAQWordBufferPtr& rBufferPtr out): The daq buffer into which data are transferred. |
Definition at line 938 of file CCAENV830.cpp.
References m_nEventLength, and ReadEvent().
int CCAENV830::ReadEvent | ( | DAQWordBuffer & | rBuffer, | |
int | offset | |||
) |
Read an event: A local buffer is created into which the event is read using the ReadEvent(void*) member. THis is then transferred into a DAQBuffer via a DAQWordBuffer and an offest.
rBuffer | (DAQWordBuffer& out): The buffer into which the data are transferred. | |
Offset | (int in): The offset into the buffer (in words) at which the data transfer will be made. |
Definition at line 968 of file CCAENV830.cpp.
References m_nEventLength, and ReadEvent().
int CCAENV830::ReadCounter | ( | int | nChannel | ) |
Read an individual instantaneous scaler channel.
nChannel | (int in): Number of channel to read must be in the range [0,31]. |
string | If nChannel is invalid, an explanatory string exception is thrown. |
Definition at line 992 of file CCAENV830.cpp.
void CCAENV830::ComputeEventSize | ( | ) | [protected] |
Figure out how many longwords are in an event. This value is the sum of:
Definition at line 862 of file CCAENV830.cpp.
References CSRHeader, GetLong, GetShort, and m_nEventLength.
Referenced by DisableHeader(), EnableHeader(), and SetEnableMask().
void CCAENV830::MapModule | ( | ) | throw (STD(string)) [protected] |
Map the vme module. This involves:
The CAEN Modules use the addressing convention that the Geographical VME address is slot << 19. We use the convention that these modules are then remapped to slot << 24.
Definition at line 746 of file CCAENV830.cpp.
References CVmeModule::a32d32, ADEREnable, CAENV830_PROMBASE, CVmeModule::geo, GetProm, GetShort, m_fGeo, m_nBase, m_nCrate, m_nFirmware, m_nModuleType, m_nSerialno, m_nSlot, m_pModule, PutShort, and ThrowIntString().
void CCAENV830::InitModule | ( | ) | [protected] |
Setup a module. The default setup is:
Definition at line 836 of file CCAENV830.cpp.
References Clear(), EnableAutoReset(), EnableHeader(), FPClearsMEB(), Random, Reset(), SetEnableMask(), SetNarrow(), and SetTriggerMode().
void CCAENV830::UnmapModule | ( | ) | [protected] |
Destroy any memory map held on the module:
Definition at line 877 of file CCAENV830.cpp.
References m_pModule.
Referenced by ~CCAENV830().
int CCAENV830::m_nCrate [private] |
int CCAENV830::m_nSlot [private] |
int CCAENV830::m_nEventLength [private] |
int CCAENV830::m_nBase [private] |
CVmeModule* CCAENV830::m_pModule [private] |
Definition at line 331 of file CCAENV830.h.
Referenced by MapModule(), ReadEvent(), and UnmapModule().
int CCAENV830::m_nModuleType [private] |
Definition at line 332 of file CCAENV830.h.
Referenced by getModuleType(), MapModule(), and setModuleType().
int CCAENV830::m_nSerialno [private] |
int CCAENV830::m_nFirmware [private] |
Definition at line 334 of file CCAENV830.h.
Referenced by getFirmware(), MapModule(), and setFirmware().
bool CCAENV830::m_fGeo [private] |