* provided "as is" without express or implied warranty. *
**************************************************************************/
+/* $Id$ */
+
///////////////////////////////////////////////////////////////////////////////
-//
-// This is the base class for reading raw data and providing
-// information about digits
-//
-// The derived classes, which operate on concrete raw data formats,
-// should implement
-// - ReadHeader to read the next (data/equipment) header
-// - ReadNextData to read the next raw data block (=1 DDL)
-// - ReadNext to read a given number of bytes
-// - several getters like GetType
-//
-// Sequential access to the raw data is provided by the methods
-// ReadHeader, ReadNextData, ReadNextInt, ReadNextShort, ReadNextChar
-//
-// If only data from a specific detector (and a given range of DDL numbers)
-// should be read, this can be achieved by the Select method.
-// Several getter provide information about the current event and the
-// current type of raw data.
-//
+///
+/// This is the base class for reading raw data.
+///
+/// The derived classes, which operate on concrete raw data formats,
+/// should implement
+/// - ReadHeader to read the next (data/equipment) header
+/// - ReadNextData to read the next raw data block (=1 DDL)
+/// - ReadNext to read a given number of bytes
+/// - several getters like GetType
+///
+/// Sequential access to the raw data is provided by the methods
+/// ReadHeader, ReadNextData, ReadNextInt, ReadNextShort, ReadNextChar
+///
+/// If only data from a specific detector (and a given range of DDL numbers)
+/// should be read, this can be achieved by the Select method.
+/// Several getters provide information about the current event and the
+/// current type of raw data.
+///
///////////////////////////////////////////////////////////////////////////////
#include "AliRawReader.h"
AliRawReader::AliRawReader() :
+ fRequireHeader(kTRUE),
fHeader(NULL),
fCount(0),
fSelectEquipmentType(-1),
fSelectMinEquipmentId(-1),
fSelectMaxEquipmentId(-1),
fSkipInvalid(kFALSE),
+ fSelectEventType(-1),
fErrorCode(0)
{
// default constructor: initialize data members
AliRawReader::AliRawReader(const AliRawReader& rawReader) :
TObject(rawReader),
+ fRequireHeader(rawReader.fRequireHeader),
fHeader(rawReader.fHeader),
fCount(rawReader.fCount),
fSelectEquipmentType(rawReader.fSelectEquipmentType),
fSelectMinEquipmentId(rawReader.fSelectMinEquipmentId),
fSelectMaxEquipmentId(rawReader.fSelectMaxEquipmentId),
fSkipInvalid(rawReader.fSkipInvalid),
+ fSelectEventType(rawReader.fSelectEventType),
fErrorCode(0)
{
// copy constructor
fSelectMinEquipmentId = rawReader.fSelectMinEquipmentId;
fSelectMaxEquipmentId = rawReader.fSelectMaxEquipmentId;
fSkipInvalid = rawReader.fSkipInvalid;
+ fSelectEventType = rawReader.fSelectEventType;
fErrorCode = rawReader.fErrorCode;
fSelectMaxEquipmentId = maxEquipmentId;
}
+void AliRawReader::SelectEvents(Int_t type)
+{
+// read only events with the given type.
+// no selection is applied if a value < 0 is used.
+
+ fSelectEventType = type;
+}
+
Bool_t AliRawReader::IsSelected() const
{
// apply the selection (if any)
return kTRUE;
}
+Bool_t AliRawReader::IsEventSelected() const
+{
+// apply the event selection (if any)
+
+ if (fSelectEventType >= 0) {
+ if (GetType() != (UInt_t) fSelectEventType) return kFALSE;
+ }
+
+ return kTRUE;
+}
+
Bool_t AliRawReader::ReadNextInt(UInt_t& data)
{