]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReader.cxx
Corrections for gcc 4.0
[u/mrichter/AliRoot.git] / RAW / AliRawReader.cxx
index ab714cbb15dd1287546437d090e492954c0888fb..7d91bc13bc80dc1621054a28bf6e66fc8058578d 100644 (file)
  * 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"
@@ -42,12 +43,14 @@ ClassImp(AliRawReader)
 
 
 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
@@ -56,12 +59,14 @@ AliRawReader::AliRawReader() :
 
 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
@@ -79,6 +84,7 @@ AliRawReader& AliRawReader::operator = (const AliRawReader& rawReader)
   fSelectMinEquipmentId = rawReader.fSelectMinEquipmentId;
   fSelectMaxEquipmentId = rawReader.fSelectMaxEquipmentId;
   fSkipInvalid = rawReader.fSkipInvalid;
+  fSelectEventType = rawReader.fSelectEventType;
 
   fErrorCode = rawReader.fErrorCode;
 
@@ -111,6 +117,14 @@ void AliRawReader::SelectEquipment(Int_t equipmentType,
   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)
@@ -130,6 +144,17 @@ Bool_t AliRawReader::IsSelected() const
   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)
 {