// @(#) $Id$ // Author: Constantin Loizides //*-- Copyright © ALICE HLT Group #include "AliHLTRootTypes.h" #include "AliHLTStandardIncludes.h" #include "AliHLTLogging.h" #include "AliHLTDDLRawReader.h" #if __GNUC__ >= 3 using namespace std; #endif /************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /** \class AliHLTDDLRawReader
//_____________________________________________________________
// AliHLTDDLRawReader (taken from the offline AliROOT code,
// original authors: D.Favretto and A.K.Mohanty)
//
// This is the base class for reading ddl raw data 
// and providing information about digits
*/ ClassImp(AliHLTDDLRawReader) AliHLTDDLRawReader::AliHLTDDLRawReader() { fMiniHeader = NULL; fCount = 0; fSelectDetectorID = -1; fSelectMinDDLID = -1; fSelectMaxDDLID = -1; } AliHLTDDLRawReader::~AliHLTDDLRawReader() { } void AliHLTDDLRawReader::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). // no selection is applied if a value < 0 is used. fSelectDetectorID = detectorID; fSelectMinDDLID = minDDLID; fSelectMaxDDLID = maxDDLID; } Bool_t AliHLTDDLRawReader::IsSelected() const { // apply the selection (if any) if (fSelectDetectorID >= 0) { if (fMiniHeader->fDetectorID != fSelectDetectorID) return kFALSE; if ((fSelectMinDDLID >= 0) && (fMiniHeader->fDDLID < fSelectMinDDLID)) return kFALSE; if ((fSelectMaxDDLID >= 0) && (fMiniHeader->fDDLID >= fSelectMaxDDLID)) return kFALSE; } return kTRUE; } Bool_t AliHLTDDLRawReader::CheckMiniHeader() const { // check the magic number of the mini header if ((fMiniHeader->fMagicWord[2] != 0x12) || (fMiniHeader->fMagicWord[1] != 0x34) || (fMiniHeader->fMagicWord[0] != 0x56)) { LOG(AliHLTLog::kError,"AliHLTDDLRawReader::CheckMiniHeader","MH") <<"DDL mini header has wrong magic word!"<