Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

TApi Class Reference

The Root interface to SCTAPI. More...

#include <TApi.h>

Inheritance diagram for TApi:

TObject

Public Member Functions

 TApi (int initDebug=0)
 Constructor.

 ~TApi ()
 Destructor.

void initialiseAll (int runNumber)
 Initialise all the Rods and modules found in the configuration.

void shutdownAll ()
 Shutdown everything.

void setRunNumber (int newRun)
 Change the run number.

void setScanNumber (int newScan)
 Change the scan number.

void echo (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int length, long *data)
 Using a primitive, send some data to the ROD.

void loadConfiguration ()
 Load configuration from the "configuration database".

void configureBOC (unsigned int partition, unsigned int crate, unsigned int rod)
 Reset BOC configuration.

void awaitResponse (unsigned int partition, unsigned int crate, unsigned int rod, int timeout=5)
 Wait for a ROD to finish a primlist.

unsigned long * getResponse (unsigned int partition, unsigned int crate, unsigned int rod)
 Get a response from the rod.

unsigned long * getResponse (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long *length)
 Get a response from the rod.

bool getRodMessage (unsigned int partition, unsigned int crate, unsigned int rod, char *buffer, int &length)
 Get a message from a ROD text buffer Returns whether the action was completed.

void flashLED (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long slaveNumber, long period=1000, long flashes=10)
 This creates its own primitive list and sends it to a slave DSP on the ROD.

void status ()
Int_t dspBlockDump (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber)
 Dump contents of a block of DSP memory to cout.

Int_t dspBlockDumpFile (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber, const char *filename)
 Dump contents of a block of DSP memory to a file.

unsigned long * dspBlockRead (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber, long *length)
 Read data.

int dspBlockWrite (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long *buffer, unsigned long dspAddress, long numWords, long dspNumber)
 Write a block of memory to a ROD DSP.

unsigned long readRodStatusReg (unsigned int partition, unsigned int crate, unsigned int rod, long regNumber)
 Read one ROD Status Register via HPI.

unsigned long readRodCommandReg (unsigned int partition, unsigned int crate, unsigned int rod, long regNumber)
 Read one ROD Command Register via HPI.

unsigned long dspSingleRead (unsigned int partition, unsigned int crate, unsigned int rod, const unsigned long dspAddr, long dspNumber)
 Read a single 32b word from MasterDSP SDRAM via HPI.

void dspSingleWrite (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long dspAddr, unsigned long value, long dspNumber)
 Write a single 32b word to MasterDSP SDRAM via HPI.

void createDebugPrimList ()
 Create a prim list.

void addDebugPrimList (unsigned long length, long index, long id, long version, unsigned long *body)
 Insert a primitive in a prim list.

void sendDebugPrimList (unsigned int partition, unsigned int crate, unsigned int rod)
 Send the previously created prim list.

void sendDebugSlavePrimList (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int slave, bool await, bool response)
 Send prim list to slave.

unsigned long * retrieveModule (UINT32 mid)
 Return the module configuration data for the required module.

UINT32 findModule (string sn)
UINT32 findModule (INT32 mur, INT32 module)
 Return unique identifier for mur/module.

UINT32 findBarrelModule (INT32 barrel, INT32 row, INT32 number)
 Return unique identifer from barrel geometry.

UINT32 findEndcapModule (INT32 disk, INT32 ring, INT32 number)
 Return unique identifer from endcap geometry.

void getABCDModule (UINT32 bank)
 Get all modules from ROD to memory.

void getABCDModule (UINT32 mid, UINT32 bank)
 Get module from ROD to memory.

void setABCDModule (UINT32 mid, UINT32 bank)
 Set module config in ROD bank.

void sendABCDModule (UINT32 mid, UINT32 bank, UINT32 type=2)
void modifyABCDMask (UINT32 mid, UINT32 *mask)
 Modify mask of module in online configuration.

void modifyABCDTrims (UINT32 mid, UINT8 *trims)
 Modify trims of module in online configuration.

void modifyABCDVar (UINT32 typ, FLOAT32 var)
 Modify variable of all modules in online configuration.

void modifyABCDVar (UINT32 mid, UINT32 typ, FLOAT32 var)
 Modify variable of module in online configuration.

void modifyABCDVar (UINT32 mid, UINT32 c, UINT32 typ, FLOAT32 var)
 Modify variable of one chip of module in online configuration.

void modifyBOCParam (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel, unsigned int type, unsigned int val)
 Modify a BOC variable.

void defaultScan (int type)
 Do a scan (hardcoded for testing).

void tidyHistogramming ()
 Tidy up just in case things got left behind.

void doScan (TScanDef scan)
 Carry out the scan defined by scan.

void doRawScan (TScanDef scan, int delay, bool configure=true, bool clkBy2=false)
 Scan returning histograms of raw data.

void sendTrigger (unsigned int partition, unsigned int crate, unsigned int rod, TTrigger trig)
 Send one trigger to the currently configured modules.

void printABCDModule (int mid)
 Uses the sctConf method.

void printABCDRodModule (int mid, int bank)
 Uses the sctConf method.

void printBOCSetup (unsigned int partition, unsigned int crate, unsigned int rod)
 Print BOC setup of all channels.

void printBOCRegisters (unsigned int partition, unsigned int crate, unsigned int rod)
 Print all BOC registers.

void rawData (unsigned int partition, unsigned int crate, unsigned int rod, int delay, int units, bool setMask=true, TTrigger trig=TTrigger())
 Print raw link data.

char * probe (unsigned int partition, unsigned int crate, unsigned int rod, signed int harness=-1)
 Probe channels on a ROD to find out what's there.

char * probeWithTrigger (unsigned int partition, unsigned int crate, unsigned int rod, TTrigger trig, signed int harness=-1)
 Probe channels on a ROD to find out what's there.

void bocHistogram (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int samples, unsigned int numLoops)
 Print "BOC Histogram".

void rodMode (unsigned int partition, unsigned int crate, unsigned int rod, int mode, int flag, int fifoSetup, int nBins, int delay, int message)
 Do something to the rod mode!

void standardRegisterDump (unsigned int partition, unsigned int crate, unsigned int rod)
void lasersOff ()
 For extra safety (don't use with lots of modules connected.

void decodeEvent (unsigned int partition, unsigned int crate, unsigned int rod, int sl, int index, bool extFlag=false, bool errorType=false)
 Print decoded event.

void setDebugLevel (unsigned int level)
 Higher means more messages.

unsigned int getDebugLevel ()
 Get the current debug level.

void debugStepHistogram ()
void debugContinueHistogram ()
void freeTriggers (unsigned int partition, unsigned int crate, double freq)
 Freq is rounded to the nearest power of 10 between .01 and 100k Hz.

void stopTriggers (unsigned int partition, unsigned int crate)
 Stop the TIM generating regular triggers.

void timL1A (unsigned int partition, unsigned int crate)
 Tell the TIM to send an L1A.

void timCalL1A (unsigned int partition, unsigned int crate, int delay)
 Tell TIM to send Cal + L1A.

void requestHardReset (UINT32 mid)
void printHex (UINT32 num, int width)
 Naughty CINT (or linux or something...).


Private Member Functions

int initialiseRod (unsigned int partition, unsigned int crate, unsigned int rod)
 Proxy for Crate.

int initialiseModule (string module)
 Load module configuration from database Send module configuration to ROD.


Private Attributes

SctApi::SctApiworker
 The worker that implements the functions.


Detailed Description

The Root interface to SCTAPI.

This class is processed to generate a Root dictionary that means it can be used from Root. This is basically a proxy for the SctApi class, all methods on it are delegated to an instance of the SctApi class which is created on construction.

A secondary purpose of this class is to extract the public interface from the SctApi class. This means that this class should be capable of doing anything it is necessary to do using the SctApi class, and also serves the purpose of testing the abstraction from the underlying RodModule classes and exceptions.

Definition at line 158 of file TApi.h.


Constructor & Destructor Documentation

TApi::TApi int    initDebug = 0
 

Constructor.

TApi::~TApi  
 

Destructor.


Member Function Documentation

void TApi::addDebugPrimList unsigned long    length,
long    index,
long    id,
long    version,
unsigned long *    body
 

Insert a primitive in a prim list.

void TApi::awaitResponse unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    timeout = 5
 

Wait for a ROD to finish a primlist.

void TApi::bocHistogram unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    samples,
unsigned int    numLoops
 

Print "BOC Histogram".

void TApi::configureBOC unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Reset BOC configuration.

void TApi::createDebugPrimList  
 

Create a prim list.

void TApi::debugContinueHistogram  
 

void TApi::debugStepHistogram  
 

void TApi::decodeEvent unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    sl,
int    index,
bool    extFlag = false,
bool    errorType = false
 

Print decoded event.

void TApi::defaultScan int    type
 

Do a scan (hardcoded for testing).

void TApi::doRawScan TScanDef    scan,
int    delay,
bool    configure = true,
bool    clkBy2 = false
 

Scan returning histograms of raw data.

void TApi::doScan TScanDef    scan
 

Carry out the scan defined by scan.

Int_t TApi::dspBlockDump unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber
 

Dump contents of a block of DSP memory to cout.

Int_t TApi::dspBlockDumpFile unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber,
const char *    filename
 

Dump contents of a block of DSP memory to a file.

unsigned long* TApi::dspBlockRead unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber,
long *    length
 

Read data.

int TApi::dspBlockWrite unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long *    buffer,
unsigned long    dspAddress,
long    numWords,
long    dspNumber
 

Write a block of memory to a ROD DSP.

unsigned long TApi::dspSingleRead unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
const unsigned long    dspAddr,
long    dspNumber
 

Read a single 32b word from MasterDSP SDRAM via HPI.

void TApi::dspSingleWrite unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long    dspAddr,
unsigned long    value,
long    dspNumber
 

Write a single 32b word to MasterDSP SDRAM via HPI.

void TApi::echo unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    length,
long *    data
 

Using a primitive, send some data to the ROD.

Expect an output.

UINT32 TApi::findBarrelModule INT32    barrel,
INT32    row,
INT32    number
 

Return unique identifer from barrel geometry.

UINT32 TApi::findEndcapModule INT32    disk,
INT32    ring,
INT32    number
 

Return unique identifer from endcap geometry.

UINT32 TApi::findModule INT32    mur,
INT32    module
 

Return unique identifier for mur/module.

UINT32 TApi::findModule string    sn
 

Parameters:
sn Module serial number
Returns:
The unique identifier, BAD_MODULE if not found

void TApi::flashLED unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long    slaveNumber,
long    period = 1000,
long    flashes = 10
 

This creates its own primitive list and sends it to a slave DSP on the ROD.

Period given in ms

void TApi::freeTriggers unsigned int    partition,
unsigned int    crate,
double    freq
 

Freq is rounded to the nearest power of 10 between .01 and 100k Hz.

void TApi::getABCDModule UINT32    mid,
UINT32    bank
 

Get module from ROD to memory.

void TApi::getABCDModule UINT32    bank
 

Get all modules from ROD to memory.

unsigned int TApi::getDebugLevel  
 

Get the current debug level.

unsigned long* TApi::getResponse unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long *    length
 

Get a response from the rod.

unsigned long* TApi::getResponse unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Get a response from the rod.

bool TApi::getRodMessage unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
char *    buffer,
int &    length
 

Get a message from a ROD text buffer Returns whether the action was completed.

void TApi::initialiseAll int    runNumber
 

Initialise all the Rods and modules found in the configuration.

int TApi::initialiseModule string    module [private]
 

Load module configuration from database Send module configuration to ROD.

Return 0 for success

int TApi::initialiseRod unsigned int    partition,
unsigned int    crate,
unsigned int    rod
[private]
 

Proxy for Crate.

Return 0 for success

void TApi::lasersOff  
 

For extra safety (don't use with lots of modules connected.

void TApi::loadConfiguration  
 

Load configuration from the "configuration database".

void TApi::modifyABCDMask UINT32    mid,
UINT32 *    mask
 

Modify mask of module in online configuration.

void TApi::modifyABCDTrims UINT32    mid,
UINT8 *    trims
 

Modify trims of module in online configuration.

void TApi::modifyABCDVar UINT32    mid,
UINT32    c,
UINT32    typ,
FLOAT32    var
 

Modify variable of one chip of module in online configuration.

void TApi::modifyABCDVar UINT32    mid,
UINT32    typ,
FLOAT32    var
 

Modify variable of module in online configuration.

void TApi::modifyABCDVar UINT32    typ,
FLOAT32    var
 

Modify variable of all modules in online configuration.

void TApi::modifyBOCParam unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    channel,
unsigned int    type,
unsigned int    val
 

Modify a BOC variable.

void TApi::printABCDModule int    mid
 

Uses the sctConf method.

void TApi::printABCDRodModule int    mid,
int    bank
 

Uses the sctConf method.

void TApi::printBOCRegisters unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Print all BOC registers.

void TApi::printBOCSetup unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Print BOC setup of all channels.

void TApi::printHex UINT32    num,
int    width
 

Naughty CINT (or linux or something...).

char* TApi::probe unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
signed int    harness = -1
 

Probe channels on a ROD to find out what's there.

char* TApi::probeWithTrigger unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
TTrigger    trig,
signed int    harness = -1
 

Probe channels on a ROD to find out what's there.

void TApi::rawData unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    delay,
int    units,
bool    setMask = true,
TTrigger    trig = TTrigger()
 

Print raw link data.

unsigned long TApi::readRodCommandReg unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    regNumber
 

Read one ROD Command Register via HPI.

unsigned long TApi::readRodStatusReg unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    regNumber
 

Read one ROD Status Register via HPI.

void TApi::requestHardReset UINT32    mid
 

unsigned long* TApi::retrieveModule UINT32    mid
 

Return the module configuration data for the required module.

void TApi::rodMode unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    mode,
int    flag,
int    fifoSetup,
int    nBins,
int    delay,
int    message
 

Do something to the rod mode!

void TApi::sendABCDModule UINT32    mid,
UINT32    bank,
UINT32    type = 2
 

Parameters:
mid Unique identifier of the module to send
bank Configuration bank in the ROD
type How much configuration to transmit

void TApi::sendDebugPrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Send the previously created prim list.

void TApi::sendDebugSlavePrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    slave,
bool    await,
bool    response
 

Send prim list to slave.

void TApi::sendTrigger unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
TTrigger    trig
 

Send one trigger to the currently configured modules.

void TApi::setABCDModule UINT32    mid,
UINT32    bank
 

Set module config in ROD bank.

void TApi::setDebugLevel unsigned int    level
 

Higher means more messages.

void TApi::setRunNumber int    newRun
 

Change the run number.

void TApi::setScanNumber int    newScan
 

Change the scan number.

void TApi::shutdownAll  
 

Shutdown everything.

void TApi::standardRegisterDump unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

void TApi::status  
 

void TApi::stopTriggers unsigned int    partition,
unsigned int    crate
 

Stop the TIM generating regular triggers.

void TApi::tidyHistogramming  
 

Tidy up just in case things got left behind.

void TApi::timCalL1A unsigned int    partition,
unsigned int    crate,
int    delay
 

Tell TIM to send Cal + L1A.

void TApi::timL1A unsigned int    partition,
unsigned int    crate
 

Tell the TIM to send an L1A.


Field Documentation

SctApi::SctApi* TApi::worker [private]
 

The worker that implements the functions.

Definition at line 461 of file TApi.h.


The documentation for this class was generated from the following file:
Generated on Mon Dec 15 19:37:12 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3