Reading of Raw Data

The reading of raw data is separated in two tasks. The first task is to read the raw data stored in different formats into memory and to provide access to the payloads. The raw reader classes take care of this task. The second task is the interpretation of the detector specific raw data. A raw stream class for each type of detector raw data is provided for this purpose.

Raw Reader Classes

The base class AliRawReader defines the interface for the access to raw data. Methods like ReadHeader, ReadNextData or ReadNextInt read the next header, the next payload or the next word from the raw data. They return kFALSE if no more data is available for the current event. To go back to the beginning of the raw data of the current event the method Reset can be called. Several getter methods provide information about the current data, like the type, the DDL ID or the size. With the Select method the raw reader can be instructed to read only data of a given detector and a given range of DDLs. When the NextEvent method is called the raw reader goes to the beginning of the next event. It returns kFALSE if no more events are available. The RewindEvents method resets the raw reader to the beginning of the raw data source. After RewindEvents was called the NextEvent method has to be invoked to go to the first event. Events of a given type can be selected with the method SelectEvents.

There are three classes derived fom AliRawReader. One for each raw data container format.

DDL files can be read with the class AliRawReaderFile. The default constructor provides access to the raw data in the current directory. A second constructor with a string as argument can by used to specify a different directory. Both constructors can take an event number as additional optional argument.

An object of type AliRawReaderDate can be used to access raw data in DATE format. It is constructed with a pointer to a DATE event in memory or with the file name of a DATE file. In the second case the constructor can take an additional optional argument specifying the event number. This class can only be used if it was compiled on a system where DATE is installed (or at least the required header files are present and the appropriate environment variables are set). The DATE installation is described in the DATE manual.

The class AliRawReaderRoot provides access to raw data in ROOT format. There is one constructor taking a pointer to an AliRawEvent object in memory and one constructor with a file name of a ROOT raw data file as argument. Again the second constructor can take an additional optional argument specifying the event number.

Raw Stream Classes

The raw stream classes provide access to the digits information in the detector specific raw data payload. The name of the detector specific classes is usually Ali RawStream with being the name of the detector. The raw stream classes are iterators over the digits stored in the raw data. They are constructed with an AliRawReader as argument. This raw reader they use to access the raw data payload. The method Next sets the iterator to the next digit. Several getters provide information about the current digit. The kind of information and the implementation of the raw stream classes depends on the type of detector and its specific raw data format.

But the raw stream classes are independent of container format of the raw data because they only use the virtual interface of the AliRawReader class as illustrated in the figure below.

Reading Raw Data Flow chart