Vetra - Gaudi application for Velo data decoding

    Vetra - pre release version of second edition of software which is dedicated to decoding non-zero suppressed data for new 1MHz read-out strategy. Present test version is v2r0. The v2r0 Vetra needs to run VeloTELL1Alg v3r1 package. The software is not available to public use yet. However the private version of the software is installed on lhcbvelo account.

12/04/06 To run the Vetra one needs to perform:
- after the logon on the lhcbvelo account execute: LHCb v20r2 to set up the LHCb environment (this is mandatory!)
- change directory: cd cmtuser/Velo/Vetra/v2r0/cmt
- check up dependencies: cmt config (not necessary but recommended)
- set up environment variables: source setup.csh
- clean the binaries directory (optional, sometimes needed after code updates): gmake bin clean
- build the executables: gmake (optional, see above remark)
- run the test version: vetraTest

    The current version of the software decodes multi TELL1 banks from RawEvent. The banks are identified by the names defined inside the LHCb::RawBank class. Vetra is meant to cope with VeloFull bank (contains non-zero suppressed data), VeloPedestals bank (contains pedestal values calculated for each strip and send out once for 1000 events) and finally with ErrorBank (optional sutructure, the bank is sent out if any problem occured during the data pre-processing on the TELL1 board).

    During the last ACDC exercise partial readout of seven sensors has been tested. Each sensor is represented as single raw bank. Each such bank contains three sections with data and one ODIN bank. Inside the LHCb::RawEvent one can get access to the banks via pointers to the data body of the bank. After decoding root file, called vetra.root, is created. The file contains histograms with decoded ADCs samples plotted against chip channel and histograms with decoded pedestals also plotted against the channels. Decoded ADCs values are used to initialize VeloDigit objects that are stored inside VeloDigits container accessible at TES at location VeloDigitLocation::Default.

28/04/06

    The latest version of the Vetra package and related VeloTELL1Alg package have been installed on lhcbvelo account. The main change is that there is no VeloDigits container available after decoding sequence. Insted of the one big container decoded data are stored using DecodedData object. The object is suitable to keep decoded ADC samples, decoded pedestals as well as ADC headers. The DecodedData is derived from KeyedObject templated class and it is possible to store the objects of the type in TES and use as input for algorithms subsequent to decoding routines. There are several locations defined inside DecodedData:
- ADCs (to store decoded ADC samples)
- Pedestals (to store decoded Pedestals)
- ADCHeaders (with objects contain decoded ADC headers)
All decoding is decoupled from user routines (low level minitoring and TELL1 algorithms) and encapsulated inside two algorithms: PrepareVeloFullRawBuffer.h and DecodeVeloFullRawBuffer. Both algorithms are members of the BufferReadSeq sequence. Output of the second one algorithm are decoded ADCs, pedestals (if present) and decoded ADC headers, accessible at locations listed above. The EvtInfos container is also produced and stored in TES. EvtInfo object contains so called Event Info sections that are appended to data sending for each PPFPGA (so each bank that contains data form one sensor has four Event Info sections).

    Access to decoded data is described in example algorithm called ALinkReader. Inside the algorithm one can find two routines dedicated to read data both from all sensors from tested setup or single one.

How to get the decoded data

To get the decoded data one can use dedicated interface (in fact this is implemented as configurable overloaded subscripting operator inside DecodedData object). For instance to get the decoded ADC samples:
- get decoded ADCs container from TES:
    DecodedDatas* m_decodedADCs=get<DecodedDatas>(DecodedDataLocation::ADCs);
- get DecodedData object correspond to one read-out sensor:
    DecodedDatas::const_iterator sensIt;
    dataVec ALink;
    cdatIt aLinkIt;
       for(sensIt=m_decodedADCs->begin(); sensIt!=m_decodedADCs->end(); sensIt++){
          DecodedData* adcData=(*sensIt);
          const int TELL1No=adcData->key();
          EvtInfo* anInfo=m_evtInfos->object(TELL1No);
             for(int ALinkCounter=0; ALinkCounter<NumberOfALinks; ALinkCounter++){
                ALink=(*adcData)[ALinkCounter];
                // do something with the data
             }
       }
    The basic unit of the decoded data is returned by line ALink=(*adcData)[ALinkCounter] what correspond to 32 channels (this so called Analog Link) stored inside STL vector container. All common definition used throughout decoding algorithms are defined inside DecodeCore namespace. So one can find there definitions of dataVec and cdatIt. All bit shifts and bit masks are defined inside VeloFullConf namespace along with parameters used to describe non-zero suppressed data format. For further details please see ALinkReader algorithm.

Latest version of the Vetra and TELL1 algorithms packages:
Vetra application, VeloTELL1Alg package.
To run the Vetra on your PC/account just download the above two tar gzipped archives and untar them under ~cmtuser/Velo/Vetra and ~cmtuser/Velo/VeloTELL1Alg branches respectively. Set up the LHCbEnv v20r2 and next do standard chain of commands:
0) first you need to getpack and build the DAQ/MDF package (converters service)
1) cmt config
2) source setup.csh (or setup.sh)
3) gmake bin clean (only after rebuilding)
4) gmake
To run the Vetra just type in, from Vetra/cmt directory, vetraTest to change the options modify options/VetraTest.opts file.

    Examples of decoded data

         

    Decoded data for single sensor (all 2048 channels)

         

    Decoded test pulses (64 channels)