From f224de6cf8ae9e16762551cea2315a2bb350d889 Mon Sep 17 00:00:00 2001 From: tkuhr Date: Thu, 1 Apr 2004 08:44:30 +0000 Subject: [PATCH] possibility to select equipments --- RAW/AliRawReader.cxx | 33 +++++++++++++++++++++++++++++++-- RAW/AliRawReader.h | 6 ++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/RAW/AliRawReader.cxx b/RAW/AliRawReader.cxx index c1f9cec3d23..57fc236081f 100644 --- a/RAW/AliRawReader.cxx +++ b/RAW/AliRawReader.cxx @@ -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; } diff --git a/RAW/AliRawReader.h b/RAW/AliRawReader.h index 9cf79fc0cac..68e88bc52de 100644 --- a/RAW/AliRawReader.h +++ b/RAW/AliRawReader.h @@ -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 -- 2.31.1