#include <CAENcard.h>
Public Types | |
enum | _ChainMember { NotInChain, FirstInChain, LastInChain, IntermediateInChain } |
typedef enum CAENcard::_ChainMember | ChainMember |
Public Member Functions | |
CAENcard (int slotNum=-1, int crateNum=0, bool fGeo=true, long nBase=0) | |
'normal' constructor. | |
CAENcard (const CAENcard &card) | |
Copy Constructor. | |
CAENcard & | operator= (const CAENcard &card) |
Assignment involves mapping. | |
~CAENcard () | |
Destructor. | |
int | getPhysicalCrate () const |
int | getSlot () const |
bool | isGeo () const |
unsigned long | getBase () const |
int | getSerial () const |
int | getHardwareRev () const |
int | cardType () |
Return module Id of card. | |
int | getFirmware () |
return hardware firmware rev. | |
int | getCrate () |
Gets the module's crate number. | |
void | setCrate (int crateNum) |
Set the crate id register. | |
void | setThreshold (int ch, int threshold) |
Changes the card threshold. | |
void | setThresholdVoltage (int ch, double voltage) |
Set 785 adc threshold from volts. | |
void | keepUnderThresholdData () |
Allow retentionof under-thresholds. | |
void | discardUnderThresholdData () |
Discards under threshold chans. | |
void | keepOverflowData () |
Keep channels above overflow value. | |
void | discardOverflowData () |
Discard channels below overflow value. | |
void | keepInvalidData () |
Keep conversions in the midst of reset. | |
void | discardInvalidData () |
Discard data in midst of reset. | |
void | emptyEnable () |
Enable header/trailer if gate but no conv. | |
void | emptyDisable () |
reverse of the above. | |
void | commonStart () |
If TDC, use in common start mode. | |
void | commonStop () |
IF TDC use in common stop mode. | |
void | setRange (int range) |
If TDC Set range (from 140 to 1200 ns). | |
void | setPedestalCurrent (int ped) |
IF Qdc set pedestal curent. | |
void | cardOff () |
void | cardOn () |
Disable card. Enable card. | |
void | channelOff (int ch) |
Disable a channel. | |
void | channelOn (int ch) |
Enable a channel. | |
void | resetEventCounter () |
Set event number -> 0. | |
void | clearData () |
Clear any buffered event data. | |
void | reset () |
Soft power up up reset. | |
bool | dataPresent () |
TRUE if data is ready to be read. | |
bool | gdataPresent () |
bool | Busy () |
bool | gBusy () |
bool | MEBFull () |
bool | MEBEmpty () |
int | readEvent (void *buf) |
Read event into 'ordinary' buffer. | |
int | readEvent (DAQWordBuffer &wbuf, int offset) |
Read event to daq word buffer. | |
int | readEvent (DAQWordBufferPtr &wp) |
Read event into daq word buffer. | |
int | readEvent (DAQDWordBuffer &dwbuf, int offset) |
Read event into daq long buf. | |
int | readEvent (DAQDWordBufferPtr &dwp) |
Read event into daq long buf. | |
void | setIped (int value) |
IF qdc set pedestal current. | |
int | getIped () |
void | setFastClearWindow (int n) |
If qdc set pedestal current. Set fast clear window width. | |
void | enableSmallThresholds () |
Enable small thresholds. | |
void | disableSmallThresholds () |
Disable small thresholds. | |
void | SetCBLTChainMembership (int cbltaddr, ChainMember where) |
set up cblt. | |
void | ClearStatistics () |
Clear the statistics counters. | |
int | InvalidTrailerCount () |
int | ChannelsTooBigCount () |
int | ChannelsTooSmallCount () |
int | EventCount () |
Protected Member Functions | |
void | DestroyCard () |
Destroy a card memory map. | |
void | slotInit () |
Bring a card into being. | |
void | MapCard () |
Map the card's memory. | |
Protected Attributes | |
int | m_nSlot |
vme virtual slot number. | |
int | m_nCrate |
VME crate number housing the module. | |
bool | m_fGeo |
True if geo addressing. | |
unsigned long | m_nBase |
Base physical VME address in crate. | |
CVmeModule * | m_pModule |
long | m_nCardType |
Type of card (filled in at MapCard). | |
void * | m_nFd |
File desc. open on VME. | |
int | m_nSerialno |
Serial number of card. | |
int | m_nHardwareRev |
Hardware revision level. | |
bool | m_fSmallThresholds |
True if small threshold mode. | |
int | m_nInvalidTrailers |
How many invalid trailers. | |
int | m_nChancountHigh |
How many channel counts high. | |
int | m_nChancountLow |
How many channel counts low. | |
int | m_nEvents |
How many events read. | |
unsigned short | m_nFirmware |
Firmware rev level. | |
Private Member Functions | |
void | Bitset1 (short mask) |
Set a mask in the bit set 1 register. | |
void | Bitclear1 (short mask) |
Set a mask in the bit clear 1 register. | |
void | Bitset2 (short mask) |
Set a mask i the bit set 2 register. | |
void | Bitclear2 (short mask) |
set a mask in the bit clear 2 register. | |
void | ReadBufferBlock (int *pDest, Int_t size) |
This is a support class for the CAEN V775,785,792 digitizers. the code is based on initial work by Chris Maurice. It is also possible to place individual cards into a CAENchain. Placing cards in a chain allows them to be read out using the Chain block transfer readout. For large systems this can be faster than using program controlled readout. If you are using the modules in multi-event mode, it is your resopnsibility to re-assemble events after readout.
The class supports construction for use either with or without support for geographical addressing.
Note that for now, copy construction will involve the creation of a new memory map and is therefore discouraged.
Definition at line 78 of file CAENcard.h.
typedef enum CAENcard::_ChainMember CAENcard::ChainMember |
Definition at line 80 of file CAENcard.h.
CAENcard::CAENcard | ( | int | slotNum = -1 , |
|
int | crateNum = 0 , |
|||
bool | Geo = true , |
|||
long | nBase = 0 | |||
) |
'normal' constructor.
Constructs a CAEN card. The card can be addressed either geographically or via base addres switches. If geographical addressing is used, the slot value comes from the card position in the crate. Otherwise it is programmed by the slotNum parameter.
slotNum | This specifies the slot in the VME crate in which the module resides. If Geo is true, the module in that slot of the crate will be initialized. If Geo is false, the module at physical address nBase will be initialized and its virtual slot number set to slotNum. | |
crateNum | The crate number in which the module lives. This selects which of the VME crates the module is in. VME crate numbers can be determined using the cratelocator utility. The crate number is also programmed into the crate register so that the module crate field in the data stream is correct. | |
Geo |
| |
nBase | long [in] The base address of the module. Only has meaning if the Geo parameter is false. |
Definition at line 613 of file CAENcard.cpp.
References slotInit().
CAENcard::CAENcard | ( | const CAENcard & | card | ) |
Copy Constructor.
Copy constructor: Constructs a new card from an existing card object. A new map is established to the card for this object. The card is not re-initialized, but remains in the state defined by the existing card.
card | The card to copy. |
Definition at line 636 of file CAENcard.cpp.
References MapCard().
CAENcard::~CAENcard | ( | ) |
Destructor.
Destructor. The card memory is unmapped.
Definition at line 726 of file CAENcard.cpp.
References DestroyCard().
Assignment involves mapping.
Assignment operator. This card is destroyed, and replaced with a copy of the card described by card. this is not initialized, but remains in the state defined by the rhs of the assignment.
card | The CAENcard value to assign to the target of the assignment (this). |
Definition at line 658 of file CAENcard.cpp.
References DestroyCard(), m_fGeo, m_nBase, m_nCrate, m_nSlot, and MapCard().
int CAENcard::getPhysicalCrate | ( | ) | const [inline] |
int CAENcard::getSlot | ( | ) | const [inline] |
bool CAENcard::isGeo | ( | ) | const [inline] |
unsigned long CAENcard::getBase | ( | ) | const [inline] |
int CAENcard::getSerial | ( | ) | const [inline] |
int CAENcard::getHardwareRev | ( | ) | const [inline] |
int CAENcard::cardType | ( | ) |
Return module Id of card.
Get the card type. At initialization time, a short-lived map is made to the device configuration ROM and the card type is read and stored in m_nCardType. This function just returns that value:
Definition at line 737 of file CAENcard.cpp.
References m_nCardType.
Referenced by commonStart(), commonStop(), discardInvalidData(), getIped(), keepInvalidData(), setPedestalCurrent(), setRange(), and slotInit().
int CAENcard::getFirmware | ( | ) |
return hardware firmware rev.
Return the firmware revision info:
Definition at line 1684 of file CAENcard.cpp.
References m_nFirmware, m_pModule, CVmeModule::peekw(), and ShortOffset.
Referenced by readEvent().
int CAENcard::getCrate | ( | ) |
Gets the module's crate number.
See setCrate for more information. This function reads the virtual crate register. To get the physical crate address use getPhysicalCrate()
Definition at line 773 of file CAENcard.cpp.
References m_pModule, CVmeModule::peekw(), pModule(), and ShortOffset.
void CAENcard::setCrate | ( | int | crateNum | ) |
Set the crate id register.
Each module has a crate number register that can be programmed with a virtual VME crate number. The constructor defaults this to the physical VME crate number passed in. If it's more convenient to reprogram this to be a virtual crate number this function does the trick.
crateNum | (int [in]): New virtual crate numger. |
Definition at line 754 of file CAENcard.cpp.
References m_pModule, CVmeModule::peekw(), pModule(), CVmeModule::pokew(), and ShortOffset.
Referenced by slotInit().
void CAENcard::setThreshold | ( | int | ch, | |
int | threshold | |||
) |
Changes the card threshold.
This function programs the modules thresholds. When the ADC is triggered, the peaks sensed are compared against their per channel thresholds. If below, the peak is not digitized, and supressed from the readout, unless keepUnderThresholdData has been enabled.
This function programs the threshold for a single channel or sets all channels to a common threshold. The kill bit (channel disable) is preserved.
Performing a hardware reset will clear the thresholds, but no hardware default values defined. The constructor does set all thresholds to reasonable defaults, however.
ch | (int [in]): The channel on which to set the threshold. Use a value of -1 to set the threshold of all channels on the card. | |
threshold | (int [in]): The low 8-bits of this value are used to set the threshold on the desired channels. |
Definition at line 810 of file CAENcard.cpp.
References KILLBIT, m_pModule, CVmeModule::peekw(), pModule(), CVmeModule::pokew(), and ShortOffset.
Referenced by setThresholdVoltage(), and slotInit().
void CAENcard::setThresholdVoltage | ( | int | ch, | |
double | voltage | |||
) |
Set 785 adc threshold from volts.
Set the threshold given a voltage.
ch | (int [in]): The channel on which to set the threshold. Use a value of -1 to set the threshold of all channels on the card. | |
voltage | (double [in]): The approximate voltage to which the threshold is to be set. The conversion has a resolution of approximately 0.016 volts. |
Definition at line 847 of file CAENcard.cpp.
References m_fSmallThresholds, and setThreshold().
void CAENcard::keepUnderThresholdData | ( | ) |
Allow retentionof under-thresholds.
Enables the retension of data that is under the threshold. 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.
Definition at line 864 of file CAENcard.cpp.
References Bitset2(), and KEEPTHRESH.
void CAENcard::discardUnderThresholdData | ( | ) |
Discards under threshold chans.
This setting is cleared if reset() is called. The default value is to dicard the under threshold conversions.
Definition at line 873 of file CAENcard.cpp.
References Bitclear2(), and KEEPTHRESH.
void CAENcard::keepOverflowData | ( | ) |
Keep channels above overflow value.
Enables the retension of data that overflows the digitizer's dynamic range. This setting is cleared by a reset() call, or a call to discardOverflowData.
Definition at line 884 of file CAENcard.cpp.
void CAENcard::discardOverflowData | ( | ) |
Discard channels below overflow value.
This setting is cleared if reset() is called. The default value is to discard the conversions that result in an overflow.
Definition at line 894 of file CAENcard.cpp.
References Bitclear2(), and KEEPOVER.
void CAENcard::keepInvalidData | ( | ) |
Keep conversions in the midst of reset.
Instructs a tdc to keep invalid data. Invalid data are stops received in the middle of reset operations, and are only applicable to V775 modules.
a | string exception if the module is not a V775 |
Definition at line 908 of file CAENcard.cpp.
References Bitset2(), cardType(), and KEEPINVALID.
void CAENcard::discardInvalidData | ( | ) |
Discard data in midst of reset.
Instructs a tdc to discard any invalid data (see keepInvalidData).
a | string exception if the module is not a V775 |
Definition at line 925 of file CAENcard.cpp.
References Bitclear2(), cardType(), and KEEPINVALID.
void CAENcard::emptyEnable | ( | ) |
Enable header/trailer if gate but no conv.
Enable the production of a header/trailer if the module was gated but had no channels with valid conversions. (e.g. set the EMPTY bit in the BIS2 register.
Definition at line 942 of file CAENcard.cpp.
References Bitset2(), and EMPTY.
Referenced by CCAENChain::lastModuleEmptyEnable().
void CAENcard::emptyDisable | ( | ) |
reverse of the above.
Disable the production of header/trailer if the module was gated but had no channels with valid conversions This is the power up default. (clear the EMPTY bit in the BIC2 register.
Definition at line 953 of file CAENcard.cpp.
References Bitclear2(), and EMPTY.
Referenced by CCAENChain::lastModuleEmptyDisable().
void CAENcard::commonStart | ( | ) |
If TDC, use in common start mode.
Sets a TDC to common start mode. In this mode, time is measured beginning with the common gate input (start) and ended for each channel by the individual channel input pulses (stops).
string | indicating the module is not a 775 tdc if it is some other module. |
Definition at line 969 of file CAENcard.cpp.
References Bitclear2(), cardType(), and COMMONSTOP.
Referenced by slotInit().
void CAENcard::commonStop | ( | ) |
IF TDC use in common stop mode.
Definition at line 990 of file CAENcard.cpp.
References Bitset2(), cardType(), COMMONSTOP, and m_pModule.
void CAENcard::setRange | ( | int | range | ) |
If TDC Set range (from 140 to 1200 ns).
Sets the conversion range of a V775 tdc. The range is between 140 and 1200ns represented as follows:
Values outside this range are illegal. The constructor defaults the range to 140ns.
range | (int [in]): A raw value used to set the range on the TDC with. |
string | exception containing explanatory text if:
|
Definition at line 1023 of file CAENcard.cpp.
References cardType(), m_pModule, CVmeModule::pokew(), ShortOffset, and Registers::TDCRange.
Referenced by slotInit().
void CAENcard::setPedestalCurrent | ( | int | ped | ) |
IF Qdc set pedestal curent.
Set the current injection pedestals for a V792 qdc. Qdc's operate by storing input current on a capacitor. The capacitor has some leakage current that is normally negligible, however, this leakage current can become significant for integration widths that are long. The V792 qdc has a high high precision constant current source that can inject a compensating current into the cap. during the gate period. This function sets the amount of current injected.
ped | (int [in]): A raw value to set the pedestal current on the QDC with. |
string | exception if this is not a V792 module. |
Definition at line 1067 of file CAENcard.cpp.
References cardType(), m_pModule, CVmeModule::pokew(), QDCIPedestal, and ShortOffset.
Referenced by setIped().
void CAENcard::cardOff | ( | ) |
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.
Definition at line 1094 of file CAENcard.cpp.
void CAENcard::cardOn | ( | ) |
Disable card. Enable card.
Sets a card to online (undoes the effects of a cardOff).
Definition at line 1103 of file CAENcard.cpp.
References Bitclear2(), and OFFLINE.
void CAENcard::channelOff | ( | int | ch | ) |
Disable a channel.
The kill bit in the threshold memory for the channel is set without destroying the threshold values. Call clearData() to ensure that all data in the event buffer reflects this change.
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.
ch | (int [in]): The channel to suppress. A value of -1 indicates that all channels will be supressed. |
Definition at line 1127 of file CAENcard.cpp.
References KILLBIT, m_pModule, CVmeModule::peekw(), CVmeModule::pokew(), and ShortOffset.
void CAENcard::channelOn | ( | int | ch | ) |
Enable a channel.
The kill bit in the threshold memory for the channel is cleared without destroying the threshold values. Call clearData() to ensure that all data in the event buffer reflects this change. An overflow, under threshold, or invalid data condition can still cause the channel to be supressed.
ch | (int [in]): The channel to unsuppress. A value of -1 indicates that all channels will be unsupressed. |
Definition at line 1165 of file CAENcard.cpp.
References KILLBIT, m_pModule, CVmeModule::peekw(), CVmeModule::pokew(), and ShortOffset.
Referenced by slotInit().
void CAENcard::resetEventCounter | ( | ) |
Set event number -> 0.
Clear the module event counter.
Definition at line 1194 of file CAENcard.cpp.
References m_pModule, CVmeModule::pokew(), and ShortOffset.
void CAENcard::clearData | ( | ) |
Clear any buffered event data.
Clear the module's multievent data buffers. This requires setting and clearing the clear data bit:
Definition at line 1213 of file CAENcard.cpp.
References Bitclear2(), Bitset2(), and CLEARDATA.
void CAENcard::reset | ( | ) |
Soft power up up reset.
Peforms a soft reset on the module using the reset bit of the BitSet/Clear1 registers.
Definition at line 1234 of file CAENcard.cpp.
References Bitclear1(), Bitset1(), and RESET.
Referenced by slotInit().
bool CAENcard::dataPresent | ( | ) |
TRUE if data is ready to be read.
Definition at line 1248 of file CAENcard.cpp.
References DREADY, m_pModule, CVmeModule::peekw(), ShortOffset, and Registers::Status1.
Referenced by readEvent().
bool CAENcard::gdataPresent | ( | ) |
Return true if global data ready is set in SR1
Definition at line 1796 of file CAENcard.cpp.
References GDREADY, m_pModule, CVmeModule::peekw(), ShortOffset, and Registers::Status1.
bool CAENcard::Busy | ( | ) |
Return true if this module is busy.
Definition at line 1811 of file CAENcard.cpp.
References BUSY, m_pModule, CVmeModule::peekw(), ShortOffset, and Registers::Status1.
bool CAENcard::gBusy | ( | ) |
Return true if the global busy is set (at least one module in the set of modules with bussed busys is busy).
Definition at line 1826 of file CAENcard.cpp.
References GBUSY, m_pModule, CVmeModule::peekw(), ShortOffset, and Registers::Status1.
bool CAENcard::MEBFull | ( | ) |
Return true if the module's MEB is completely full.
Definition at line 1840 of file CAENcard.cpp.
References m_pModule, CVmeModule::peekw(), ShortOffset, SR2FULL, and Registers::Status2.
bool CAENcard::MEBEmpty | ( | ) |
Return true if the module's MEB is empty.
Definition at line 1854 of file CAENcard.cpp.
References m_pModule, CVmeModule::peekw(), ShortOffset, SR2EMPTY, and Registers::Status2.
int CAENcard::readEvent | ( | void * | buf | ) |
Read event into 'ordinary' buffer.
Read a single event from a module into a user buffer.
buf | (int* [out]): A pointer to local memory that has already been allocated. Should be at least 34 * 4 = 136 bytes to hold the header, footer, and 32 channels of data. |
Definition at line 1271 of file CAENcard.cpp.
References dataPresent(), getFirmware(), m_nChancountHigh, m_nChancountLow, m_nEvents, m_nInvalidTrailers, ReadBuffer, ReadBufferBlock(), and swaplong.
Referenced by readEvent().
int CAENcard::readEvent | ( | DAQWordBuffer & | wbuf, | |
int | offset | |||
) |
Read event to daq word buffer.
Read a single event from the module into a DAQ system buffer:
wbuf | A DAQWordBuffer object to put data in. When using the standard readout skeleton this object is created for you. | |
offset | The position that the data should be written to. This may be necessary to avoid overwriting other data in the DAQWordBuffer. |
Definition at line 1331 of file CAENcard.cpp.
References readEvent().
int CAENcard::readEvent | ( | DAQWordBufferPtr & | wp | ) |
Read event into daq word buffer.
read data into a buffer pointer.
wp | A DAQWordBufferPtr object. |
Definition at line 1362 of file CAENcard.cpp.
References readEvent().
int CAENcard::readEvent | ( | DAQDWordBuffer & | dwbuf, | |
int | offset | |||
) |
Read event into daq long buf.
Read an event into a double word buffer object. For now, the event is first read into a local buffer and then transferred into the daq buffer.
dwbuf | A DAQDWordBuffer object to put data in. | |
offset | The position that the data should be written to. This is necessary to avoid overwriting other data in the DAQDWordBuffer. |
Definition at line 1397 of file CAENcard.cpp.
References readEvent().
int CAENcard::readEvent | ( | DAQDWordBufferPtr & | dwp | ) |
Read event into daq long buf.
Reads an event into a buffer pointed to by a DAQDWordBufferObject. Dword is assumed to be 32 bits wide.
wp | A pointer to a DAQDWordBuffer object. |
Definition at line 1422 of file CAENcard.cpp.
References readEvent().
void CAENcard::setIped | ( | int | value | ) |
IF qdc set pedestal current.
Set an iped value.
channel | - Channel to set. | |
value | - New value for pedestal only bottom 8 bits are used. |
Definition at line 1445 of file CAENcard.cpp.
References setPedestalCurrent().
int CAENcard::getIped | ( | ) |
Return the value of an Iped register.
channel | - Channel to get. |
Definition at line 1453 of file CAENcard.cpp.
References cardType(), m_pModule, QDCIPedestal, and ShortOffset.
void CAENcard::setFastClearWindow | ( | int | n | ) |
If qdc set pedestal current. Set fast clear window width.
Set the fast clear window width.
n | (int [in]): the value to program in the FCLRWindow register. |
Definition at line 1701 of file CAENcard.cpp.
References Registers::FCLRWindow, m_pModule, CVmeModule::pokew(), and ShortOffset.
void CAENcard::enableSmallThresholds | ( | ) |
Enable small thresholds.
Enable the small threshold mode. In this mode, the threshold is shifted by only 1 bit to the left before being applied to the data word. See disableSmallThresholds to turn this off. The module default state on creation is small thresholds disabled.
Note that the threshold registers will not be modified as a result of this call.
Definition at line 1722 of file CAENcard.cpp.
References Bitset2(), m_fSmallThresholds, and STEPTHR.
void CAENcard::disableSmallThresholds | ( | ) |
Disable small thresholds.
Disable the small threshold mode. In this mode, the threshold is shifted by 4 bits to the left before being applied to the data word. See enableSmallThresholds to turn this on. The default state on creation is small thresohlds enabled.
Note that the threshold registers will not be modified as a result of this call.
Definition at line 1739 of file CAENcard.cpp.
References Bitclear2(), m_fSmallThresholds, and STEPTHR.
void CAENcard::SetCBLTChainMembership | ( | int | cbltaddr, | |
CAENcard::ChainMember | where | |||
) |
set up cblt.
Set up a card's chain membership.
cbltaddr | (int in) : The top 8 bits of the A24 address at which the chain will be recognized. | |
where | (ChainMember in): Where in the chain the module lives:
|
Definition at line 1760 of file CAENcard.cpp.
References CTL1BERRENA, FirstInChain, IntermediateInChain, LastInChain, m_pModule, MCSTFIRST, MCSTLAST, NotInChain, CVmeModule::pokew(), and ShortOffset.
void CAENcard::ClearStatistics | ( | ) |
Clear the statistics counters.
Cleare the internal statistics maintained by the object.
Definition at line 1868 of file CAENcard.cpp.
References m_nChancountHigh, m_nChancountLow, m_nEvents, and m_nInvalidTrailers.
int CAENcard::InvalidTrailerCount | ( | ) |
From time to time these modules are observed to not supply a trailer in the event stream. This function returns the number of times this has happened since the last call to ClearStatistics
Definition at line 1882 of file CAENcard.cpp.
References m_nInvalidTrailers.
int CAENcard::ChannelsTooBigCount | ( | ) |
From time to time these modules are observed to give a header with a channel count larger than the actual number of channels read before either a trailer or an invalid word is read. This function returns the number of times this has happened since the last call to ClearStatistics
Definition at line 1894 of file CAENcard.cpp.
References m_nChancountHigh.
int CAENcard::ChannelsTooSmallCount | ( | ) |
From time to time these modules are observed to return more data than indicated by the channel count in their header. This function returns the number of times this happened since the last call to ClearStatistics
Definition at line 1905 of file CAENcard.cpp.
References m_nChancountLow.
int CAENcard::EventCount | ( | ) |
Returns the number of events read with data ready set since the last time ClearStatistics was called.
Definition at line 1914 of file CAENcard.cpp.
References m_nEvents.
void CAENcard::DestroyCard | ( | ) | [protected] |
Destroy a card memory map.
Unmap the card. This is a required part of several operations including:
Definition at line 1669 of file CAENcard.cpp.
References CAEN_REGISTERSIZE, m_nFd, and m_pModule.
Referenced by operator=(), and ~CAENcard().
void CAENcard::slotInit | ( | ) | [protected] |
Bring a card into being.
This function:
Initializes it to a standard, well defined state.
The card location is assumed to already have been set up in the member variables (except for m_pModule which is filled in by the call to MapCard).
string | - If there were problems a string exception is thrown with the string containing the reason for the problem. |
Definition at line 688 of file CAENcard.cpp.
References cardType(), channelOn(), commonStart(), m_nCrate, MapCard(), reset(), setCrate(), setRange(), and setThreshold().
Referenced by CAENcard().
void CAENcard::MapCard | ( | ) | [protected] |
Map the card's memory.
Given the values in
string | describing why the function failed. |
Definition at line 1483 of file CAENcard.cpp.
References CVmeModule::a32d32, Bitset1(), ROM::BoardId, ROM::BoardIdLSB, ROM::BoardIdMSB, CAEN_REGISTERSIZE, CAEN_ROMOFFSET, CAEN_ROMSIZE, CVmeModule::geo, m_fGeo, m_nBase, m_nCardType, m_nCrate, m_nFd, m_nHardwareRev, m_nSerialno, m_nSlot, m_pModule, CVmeModule::peekw(), CVmeModule::pokew(), ROM::Revision, SELADDR, ROM::SerialLSB, ROM::SerialMSB, ShortOffset, and VME_CRATE_SIZE.
Referenced by CAENcard(), operator=(), and slotInit().
void CAENcard::Bitset1 | ( | short | mask | ) | [private] |
Set a mask in the bit set 1 register.
Set a mask in the bit set 1 register.
mask | (short [in]): the mask to set. |
Definition at line 1924 of file CAENcard.cpp.
References Registers::BitSet1, m_pModule, CVmeModule::pokew(), and ShortOffset.
void CAENcard::Bitclear1 | ( | short | mask | ) | [private] |
Set a mask in the bit clear 1 register.
Set a mask in the bit clear 1 register.
mask | (short [in]): the mask to set |
Definition at line 1939 of file CAENcard.cpp.
References Registers::BitClear1, m_pModule, CVmeModule::pokew(), and ShortOffset.
Referenced by reset().
void CAENcard::Bitset2 | ( | short | mask | ) | [private] |
Set a mask i the bit set 2 register.
Set a mask in the bit 2 set register.
Definition at line 1952 of file CAENcard.cpp.
References Registers::BitSet2, m_pModule, CVmeModule::pokew(), and ShortOffset.
Referenced by cardOff(), clearData(), commonStop(), emptyEnable(), enableSmallThresholds(), keepInvalidData(), keepOverflowData(), and keepUnderThresholdData().
void CAENcard::Bitclear2 | ( | short | mask | ) | [private] |
set a mask in the bit clear 2 register.
Set a mask in the bit clear 2 register.
mask | (short [in]): The mask to set. |
Definition at line 1967 of file CAENcard.cpp.
References Registers::BitClear2, m_pModule, CVmeModule::pokew(), and ShortOffset.
Referenced by cardOn(), clearData(), commonStart(), disableSmallThresholds(), discardInvalidData(), discardOverflowData(), discardUnderThresholdData(), and emptyDisable().
void CAENcard::ReadBufferBlock | ( | int * | pDest, | |
Int_t | nLongs | |||
) | [private] |
Utility to read a block of data from the data buffer (FIFO). This is mainly here to optimize non mapped VME interfaces.
pDest | - Pointer to the destination. | |
nLongs | - Number of longs to read. |
Definition at line 568 of file CAENcard.cpp.
References LongOffset, m_pModule, ReadBuffer, CVmeModule::readl(), and swaplong.
Referenced by readEvent().
int CAENcard::m_nSlot [protected] |
vme virtual slot number.
Definition at line 88 of file CAENcard.h.
Referenced by getSlot(), MapCard(), and operator=().
int CAENcard::m_nCrate [protected] |
VME crate number housing the module.
Definition at line 89 of file CAENcard.h.
Referenced by getPhysicalCrate(), MapCard(), operator=(), and slotInit().
bool CAENcard::m_fGeo [protected] |
True if geo addressing.
Definition at line 90 of file CAENcard.h.
Referenced by isGeo(), MapCard(), and operator=().
unsigned long CAENcard::m_nBase [protected] |
Base physical VME address in crate.
Definition at line 91 of file CAENcard.h.
Referenced by getBase(), MapCard(), and operator=().
CVmeModule* CAENcard::m_pModule [protected] |
Definition at line 95 of file CAENcard.h.
Referenced by Bitclear1(), Bitclear2(), Bitset1(), Bitset2(), Busy(), channelOff(), channelOn(), commonStop(), dataPresent(), DestroyCard(), gBusy(), gdataPresent(), getCrate(), getFirmware(), getIped(), MapCard(), MEBEmpty(), MEBFull(), ReadBufferBlock(), resetEventCounter(), SetCBLTChainMembership(), setCrate(), setFastClearWindow(), setPedestalCurrent(), setRange(), and setThreshold().
long CAENcard::m_nCardType [protected] |
Type of card (filled in at MapCard).
Definition at line 97 of file CAENcard.h.
Referenced by cardType(), and MapCard().
void* CAENcard::m_nFd [protected] |
File desc. open on VME.
Definition at line 98 of file CAENcard.h.
Referenced by DestroyCard(), and MapCard().
int CAENcard::m_nSerialno [protected] |
Serial number of card.
Definition at line 99 of file CAENcard.h.
Referenced by getSerial(), and MapCard().
int CAENcard::m_nHardwareRev [protected] |
Hardware revision level.
Definition at line 100 of file CAENcard.h.
Referenced by getHardwareRev(), and MapCard().
bool CAENcard::m_fSmallThresholds [protected] |
True if small threshold mode.
Definition at line 101 of file CAENcard.h.
Referenced by disableSmallThresholds(), enableSmallThresholds(), and setThresholdVoltage().
int CAENcard::m_nInvalidTrailers [protected] |
How many invalid trailers.
Definition at line 102 of file CAENcard.h.
Referenced by ClearStatistics(), InvalidTrailerCount(), and readEvent().
int CAENcard::m_nChancountHigh [protected] |
How many channel counts high.
Definition at line 103 of file CAENcard.h.
Referenced by ChannelsTooBigCount(), ClearStatistics(), and readEvent().
int CAENcard::m_nChancountLow [protected] |
How many channel counts low.
Definition at line 104 of file CAENcard.h.
Referenced by ChannelsTooSmallCount(), ClearStatistics(), and readEvent().
int CAENcard::m_nEvents [protected] |
How many events read.
Definition at line 105 of file CAENcard.h.
Referenced by ClearStatistics(), EventCount(), and readEvent().
unsigned short CAENcard::m_nFirmware [protected] |