#include <CAENcard.h>
Public Methods | |
CAENcard (int slotNum=0, int crateNum=0) | |
Standard constructor. SlotNum is required to create a valid card, crateNum is not. More... | |
CAENcard (const CAENcard &card) | |
Another constructor. Allows a card to be created using another card. More... | |
CAENcard & | operator= (const CAENcard &card) |
The card being assigned to has the destructor called on it and the value of the other argument assigned to it. More... | |
~CAENcard () | |
Reference counted destructor. The cards are not de-allocated until there are no references to them. More... | |
int | cardType () |
Returns the module number of the card in the slot. More... | |
void | setCrate (int crateNum) |
Sets the crate value that appears in the header of each data event. More... | |
int | getCrate () |
Returns an integer containing the current crate value. More... | |
void | setThreshold (int ch, int threshold) |
Changes the raw 12-bit threshold value on any card. More... | |
int | setThresholdVoltage (int ch, double voltage) |
Sets the threshold on the 785 ADC based upon the specified voltage value. More... | |
void | keepUnderThresholdData () |
Allows conversions that resulted in under threshold values to be retained. More... | |
void | discardUnderThresholdData () |
Instructs the module to discard all under threshold conversions. (default). More... | |
void | keepOverflowData () |
Allows conversions that resulted in an overflow to be kept. More... | |
void | discardOverflowData () |
Instructs the module to discard all conversions that overflow. (default). More... | |
int | keepInvalidData () |
Allows conversions that take place while the TDC is reseting to be kept. More... | |
int | discardInvalidData () |
Instructs the module to discard all conversions performed while the TDC is reseting. (default). More... | |
int | commonStart () |
Sets the TDC to run in common start mode. More... | |
int | commonStop () |
Sets the TDC to run in common stop mode. More... | |
int | setRange (int range) |
Sets the range on a TDC (from 140 to 1200 ns). More... | |
int | setPedestalCurrent (int ped) |
Sets the pedestal current and resolution on a QDC. More... | |
void | cardOff () |
Prevents the card from performing convertions until cardOn() or reset() is called. More... | |
void | cardOn () |
Puts the card into online mode. (default) This function is not needed unless cardOff() has been previously called. More... | |
void | channelOff (int ch) |
Prevents the module from saving any conversions for the specified channel in the event buffer. More... | |
void | channelOn (int ch) |
Makes sure that the module can save conversions for the specified channel. More... | |
void | resetEventCounter () |
Resets the value in the event counter to zero. More... | |
void | clearData () |
Clears all data from the event buffer and usually the event counter, too (if not in "count all triggers" mode). More... | |
void | reset () |
Clears all data from the buffer and clears most settings (they are set to default values by the card)v. More... | |
int | dataPresent () |
A simple test to see if there is data in the event buffer. More... | |
int | readEvent (void *buf) |
Reads one event from the event buffer (if data is present) and returns the number of BYTES read into the buffer. More... | |
int | readEvent (DAQWordBuffer &wbuf, int offset) |
Reads one event from the event buffer (if data is present) and returns the number of 16-BIT WORDS read into the buffer. More... | |
int | readEvent (DAQWordBufferPtr &wp) |
Reads one event from the event buffer (if data is present) and returns the number of 16-BIT WORDS read into the buffer. More... | |
int | readEvent (DAQDWordBuffer &dwbuf, int offset) |
Reads one event from the event buffer (if data is present) and returns the number of 32-BIT DWORDS read into the buffer. More... | |
int | readEvent (DAQDWordBufferPtr &dwp) |
Reads one event from the event buffer (if data is present) and returns the number of 32-BIT DWORDS read into the buffer. More... | |
Protected Methods | |
int | slotInit (int slotNum, int crateNum) |
Called by the constructor to initialize a card in a given slot. (should probably be broken into multiple functions...). More... | |
void | destruct () |
Called by the destructor to free the resources associated with an allocated card. More... | |
Protected Attributes | |
int | slot |
This is the only member varaiable that is created with each instance of the class. More... | |
Static Protected Attributes | |
CAENcrate | crate [VME_CRATE_SIZE+1] |
This member holds all of the information on the current instances of CAENcards. More... | |
Friends | |
class | CAENchain |
Allows multiple contiguous cards to be accessed as one object. | |
bool | operator< (const CAENcard &, const CAENcard &) |
Compares the slot numbers to determine if the first is less. More... |
Please note that these drivers have not yet been tested with the V792 QDC as I do not have access to one. Also, currently the initializer checks to see if the card is board version 3 or 4 and bios version 3 or 5. The drivers have only been tested with these versions of the cards. We recommend, however, that you ask your dealer to upgrade your cards to the latest bios revision as we have noticed issues with a version 3 card.
So far no adverse effects have been noticed if the optimize option is used on the compiler, so optimize away!
If you have a specific question or request email Chris Maurice at <maurice@nscl.msu.edu> and I will do my best to help.
|
Standard constructor. SlotNum is required to create a valid card, crateNum is not.
Once the card is verified to be in the slot, one of the supported types, and if it is not currently referenced by another instance then it is reset to clear any previous settings. Also, the thresholds are also set to default values and the TDC is set to common-start mode. |
|
Another constructor. Allows a card to be created using another card.
|
|
Reference counted destructor. The cards are not de-allocated until there are no references to them. The reference count of the slot number is decreased and then the destruct() function is called. If the reference count is less than one then the items in CAENcard::crate[slot] are destroyed. (memory map unmapped, file descriptor closed, status set to uninitialized) |
|
Prevents the card from performing convertions until cardOn() or reset() is called. This function forces the module into offline mode so that no new data is produced. Data may still be present in the event buffer, however. This setting is cleared when reset() is called. |
|
Puts the card into online mode. (default) This function is not needed unless cardOff() has been previously called. The event buffer may still have data in it from events that were converted before cardOff() was called. This setting is cleared when reset() is called. |
|
Returns the module number of the card in the slot.
|
|
Prevents the module from saving any conversions for the specified channel in the event buffer.
The kill bit is not cleared by clearData() or reset(). Performing a hardware reset will clear the values, but there is no default value defined. The constructor does ensure that all channels are on, however. |
|
Makes sure that the module can save conversions for the specified channel.
The kill bit is not cleared by clearData() or reset(). Performing a hardware reset will clear the values, but there is no default value defined. The constructor does ensure that all channels are on, however. |
|
Clears all data from the event buffer and usually the event counter, too (if not in "count all triggers" mode). No settings on the module are altered by this call. |
|
Sets the TDC to run in common start mode.
|
|
Sets the TDC to run in common stop mode.
|
|
A simple test to see if there is data in the event buffer.
|
|
Called by the destructor to free the resources associated with an allocated card. The calling function for this function must decrement value of CAENcard::crate[slot].refCount before calling this function (if appropriate). The memory map and file descriptor associated with this slot will be released and closed, respectively. The status of the slot is then set to be uninitialized. |
|
Instructs the module to discard all conversions performed while the TDC is reseting. (default).
|
|
Instructs the module to discard all conversions that overflow. (default). This setting is cleared if reset() is called. The default value is to dicard the conversions that result in an overflow. |
|
Instructs the module to discard all under threshold conversions. (default). This setting is cleared if reset() is called. The default value is to dicard the under threshold conversions. |
|
Returns an integer containing the current crate value.
This value is not cleared by a call to dataClear(), but is cleared by a call to reset(). |
|
Allows conversions that take place while the TDC is reseting to be kept.
|
|
Allows conversions that resulted in an overflow to be kept. Any conversions that result in an overflow condition cause the overflow bit to be set in the channel data. This setting is cleared when reset() is called. |
|
Allows conversions that resulted in under threshold values to be retained. Any under threshold data that is kept in the event buffer has the under-threshold bit set in the channel data. This setting is cleared when reset() is called. |
|
The card being assigned to has the destructor called on it and the value of the other argument assigned to it.
|
|
Reads one event from the event buffer (if data is present) and returns the number of 32-BIT DWORDS read into the buffer.
Under normal conditions the readEvent(DAQDWordBuffer& dwbuf, int offset) fuction is much easier and intuitive to use. |
|
Reads one event from the event buffer (if data is present) and returns the number of 32-BIT DWORDS read into the buffer.
|
|
Reads one event from the event buffer (if data is present) and returns the number of 16-BIT WORDS read into the buffer.
Under normal conditions the readEvent(DAQWordBuffer& wbuf, int offset) fuction is much easier and intuitive to use. |
|
Reads one event from the event buffer (if data is present) and returns the number of 16-BIT WORDS read into the buffer.
|
|
Reads one event from the event buffer (if data is present) and returns the number of BYTES read into the buffer.
|
|
Clears all data from the buffer and clears most settings (they are set to default values by the card)v. This call does not change the threshold values or any of the settings that might disrupt communication with the module. This call does set the module to discard under threshold, overflow, and invalid data. Also the crate value is set to zero. Finally, the range, pedestal current, and start mode are all set to default values which are, unfortunately, not specified by the documentation. |
|
Resets the value in the event counter to zero. Only the event counter (present in the End Of Block of every event) is affected by this call. |
|
Sets the crate value that appears in the header of each data event. This eight-bit value is set when the board is initialized (default value is zero). The value appears in the header of each event sent back from the card and is only useful to differentiate between the data from different cards. This value is cleared by a call to reset(). |
|
Sets the pedestal current and resolution on a QDC.
|
|
Sets the range on a TDC (from 140 to 1200 ns).
|
|
Changes the raw 12-bit threshold value on any card.
This function preserves the state of the kill bit in threshold memory so that it does not "turn on" any channels that have had channelOff() called on them. Thresholds are not cleared by clearData() or reset(). Performing a hardware reset will clear the thresholds, but there are no default values defined. The constructor does set all thresholds to reasonable defaults, however. |
|
Sets the threshold on the 785 ADC based upon the specified voltage value.
|
|
Called by the constructor to initialize a card in a given slot. (should probably be broken into multiple functions...).
|
|
Compares the slot numbers to determine if the first is less. Not likely to be of any use except to allow the cards to be used in an STL class. |
|
This member holds all of the information on the current instances of CAENcards. The array holds a reference counted list of all of the currently initialized cards. index zero, aka. crate[0], is used to specify that the instance of a CAENcard has not been initialized to a slot (ie. a NULL CAENcard). Only one array is created no matter how many of the instances of the class are created, so any instances that are created with the same slot number will reference the the same physical card and the same entry in the crate array. |
|
This is the only member varaiable that is created with each instance of the class.
This variable is used as a reference into the static CAENcrate instance crate. It holds the reference counted information needed to access the card. |