]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
possibility to select equipments
authortkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Apr 2004 08:44:30 +0000 (08:44 +0000)
committertkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Apr 2004 08:44:30 +0000 (08:44 +0000)
RAW/AliRawReader.cxx
RAW/AliRawReader.h

index c1f9cec3d23c4fec2efb5889a9caa97efdd7655e..57fc236081f39e57cbd6339cf11fb2ff7fead61a 100644 (file)
@@ -47,6 +47,9 @@ AliRawReader::AliRawReader() :
   fSelectDetectorID(-1),
   fSelectMinDDLID(-1),
   fSelectMaxDDLID(-1),
+  fSelectEquipmentType(-1),
+  fSelectMinEquipmentId(-1),
+  fSelectMaxEquipmentId(-1),
   fErrorCode(0)
 {
 // default constructor: initialize data members
@@ -60,6 +63,9 @@ AliRawReader::AliRawReader(const AliRawReader& rawReader) :
   fSelectDetectorID(rawReader.fSelectDetectorID),
   fSelectMinDDLID(rawReader.fSelectMinDDLID),
   fSelectMaxDDLID(rawReader.fSelectMaxDDLID),
+  fSelectEquipmentType(rawReader.fSelectEquipmentType),
+  fSelectMinEquipmentId(rawReader.fSelectMinEquipmentId),
+  fSelectMaxEquipmentId(rawReader.fSelectMaxEquipmentId),
   fErrorCode(0)
 {
 // copy constructor
@@ -86,7 +92,7 @@ AliRawReader& AliRawReader::operator = (const AliRawReader& rawReader)
 void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID)
 {
 // read only data of the detector with the given ID and in the given
-// range of DDLs (minDDLID <= DDLID < maxDDLID).
+// range of DDLs (minDDLID <= DDLID <= maxDDLID).
 // no selection is applied if a value < 0 is used.
 
   fSelectDetectorID = detectorID;
@@ -94,6 +100,18 @@ void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID)
   fSelectMaxDDLID = maxDDLID;
 }
 
+void AliRawReader::SelectEquipment(Int_t equipmentType, 
+                                  Int_t minEquipmentId, Int_t maxEquipmentId)
+{
+// read only data of the equipment with the given type and in the given
+// range of IDs (minEquipmentId <= EquipmentId <= maxEquipmentId).
+// no selection is applied if a value < 0 is used.
+
+  fSelectEquipmentType = equipmentType;
+  fSelectMinEquipmentId = minEquipmentId;
+  fSelectMaxEquipmentId = maxEquipmentId;
+}
+
 Bool_t AliRawReader::IsSelected() const
 {
 // apply the selection (if any)
@@ -103,9 +121,20 @@ Bool_t AliRawReader::IsSelected() const
     if (fMiniHeader->fDetectorID != fSelectDetectorID) return kFALSE;
     if ((fSelectMinDDLID >= 0) && (fMiniHeader->fDDLID < fSelectMinDDLID))
       return kFALSE;
-    if ((fSelectMaxDDLID >= 0) && (fMiniHeader->fDDLID >= fSelectMaxDDLID))
+    if ((fSelectMaxDDLID >= 0) && (fMiniHeader->fDDLID > fSelectMaxDDLID))
       return kFALSE;
   }
+
+  if (fSelectEquipmentType >= 0) {
+    if (GetEquipmentType() != fSelectEquipmentType) return kFALSE;
+    if ((fSelectMinEquipmentId >= 0) && 
+       (GetEquipmentId() < fSelectMinEquipmentId))
+      return kFALSE;
+    if ((fSelectMaxEquipmentId >= 0) && 
+       (GetEquipmentId() > fSelectMaxEquipmentId))
+      return kFALSE;
+  }
+
   return kTRUE;
 }
 
index 9cf79fc0cac442ac51956ac1d962f71fccfc47eb..68e88bc52de2a00b8480cfc80e7d0388d6aac76a 100644 (file)
@@ -16,6 +16,9 @@ class AliRawReader: public TObject {
 
     void             Select(Int_t detectorID, 
                            Int_t minDDLID = -1, Int_t maxDDLID = -1);
+    void             SelectEquipment(Int_t equipmentType, 
+                                    Int_t minEquipmentId = -1, 
+                                    Int_t maxEquipmentId = -1);
 
     virtual UInt_t   GetType() const = 0;
     virtual UInt_t   GetRunNumber() const = 0;
@@ -73,6 +76,9 @@ class AliRawReader: public TObject {
     Int_t            fSelectDetectorID;  // id of selected detector (<0 = no selection)
     Int_t            fSelectMinDDLID;    // minimal index of selected DDLs (<0 = no selection)
     Int_t            fSelectMaxDDLID;    // maximal index of selected DDLs (<0 = no selection)
+    Int_t            fSelectEquipmentType;  // type of selected equipment (<0 = no selection)
+    Int_t            fSelectMinEquipmentId; // minimal index of selected equipment (<0 = no selection)
+    Int_t            fSelectMaxEquipmentId; // maximal index of selected equipment (<0 = no selection)
 
     Int_t            fErrorCode;         // code of last error