SVT Data Access

What's new:

  • The whole page is new!!!(12/09/99)

  • Overall Description:

    Once the data is available, through files on the disk or the event pool, there are three stages in order to obtain the SVT data:

    Unpack the Data:
    This is accomplished throuh the class SVT_Reader, and some auxiliary classes that are part of the library StDaqLib.

    Make it available in the chain:
    The next step is to make the data available in the chain. The StDAQMaker handles this part, through the class StSVTReader.

    Create the interface to the data
    The interface to the data is defined by the class StSvtHybridData, which is filled in StSvtDaqMaker.

    Data Unpacker:

    Data in the Chain:

    After running the StDAQMaker, the data set "StDaqReader" is made available to the following makers. An object of the class StDAQReader and another one of the class StSVTReader must be instantiate as:
    St_DataSet *dataSet = GetDataSet("StDAQReader");
    StDAQReader *daqReader = (StDAQReader*)(dataSet->GetObject());
    StSVTReader *svtReader = daqReader->getSVTReader();
    Next, the data can be fetched through one of the methods of StSVTReader:
    int getAnodeList(int Barrel, int Ladder, int Wafer, int Hybrid, unsigned char *&anodeList);
    Fills (*anodeList[]) with the list of anode numbers containing hits. Returns number of anodes in (*anodeList)[] or negative if call fails
    int getSequences(int Barrel, int Ladder, int Wafer, int Hybrid, int Anode, int &nSeq, TPCSequence *&SeqData);
    Fills (*SeqData)[] along with the ADC buffers pointed to by (*SeqData)[] Set nSeq to the # of elements in the (*SeqData)[] array. Returns 0 if OK or negative if call fails.
    int getRawADC(int Barrel, int Ladder, int Wafer, int Hybrid, int Anode, int &nArray, unsigned char *&Array);
    Fills (*Array)[] with Raw data. Fills nArray with the # of elements in (*Array)[] (128 bytes / SVT). Returns 0 if OK or negative if call fails.
    This process is performed in StSvtDaqMaker. Any maker that needs to access the SVT data, must invoke tha data set "StSvtEvent" after running StSvtDaqMaker. Next, it is necessary to instantiate an object of the class StSvtEvent, as in the following lines: St_DataSet *dataSet = GetDataSet("StSvtEvent");
    StSvtEvent *svtEvent = (StSvtEvent*)(dataSet->GetObject());
    The data will be contained in svtEvent, a collection of StSvtHybridData objects.

    Data Interface:

    This is the only part relevant for the common user. The user macro (like bfc.C) must instantiate StSvtDaqMaker. The user code can access the data through the object StSvtEvent, which corresponds to a collection of StSvtHybridData objects. A description of these classes and their methods can be found here.

    Following is an example of a piece of code to get the ADC values for the entire SVT, once the pointer to StSvtEvent (in this case event) has been passed to the code: int barrelID, ladderID, waferID, hybridID;
    int anodeID, nAnodes, nSeq, iseq, time, status, indexHyb;
    int* anodelist = NULL;
    for (int ibarrel=0;ibarrel < event->getNumberOfBarrels();ibarrel++) {
    barrelID = ibarrel + 1;
    for (int iladder=0;iladder < event->getNumberOfLadders(ibarrel+1);iladder++) {
    ladderID = iladder + 1;
    for (int iwafer=0;iwafer < event->getNumberOfWafers(ibarrel+1);iwafer++) {
    waferID = iwafer + 1;
    for (int ihybrid=0;ihybrid < event->getNumberOfHybrids();ihybrid++) {
    hybridID = ihybrid + 1;
    indexHyb = event->getHybridIndex(barrelID, ladderID, waferID, hybridID);
    nAnodes = ((StSvtHybridData*)event->At(index_hyb))->getAnodeList(anodelist);
    for (int ianode=0;ianode < nAnodes;ianode++) {
    anodeID = anodelist[ianode];
    StSequence* Seq = NULL;
    nSeq = 0;
    status = ((StSvtHybridData*)event->At(index_hyb))->getSequences(anodeID,nSeq,Seq);
    for (iseq=0;iseq < nSeq;iseq++) {
    for (time=Seq[iseq].startTimeBin; time < Seq[iseq].startTimeBin+Seq[iseq].length; time++) {
    adc = Seq[iseq].firstAdc[time];
    cout << "Anode = " << anodeID << ", Time Bucket = " << time << ", ADC = " << adc << endl;

    Please send comments and suggestions to Marcelo Munhoz:

    (Last update: December 9, 1999)