// $Id$ //************************************************************************** //* This file is property of and copyright by the * //* ALICE Experiment at CERN, All rights reserved. * //* * //* Primary Authors: Matthias Richter * //* for The ALICE HLT Project. * //* * //* 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. * //************************************************************************** /// @file AliHLTOUTHandlerDetectorDDL.cxx /// @author Matthias Richter /// @date 2008-09-09 /// @brief HLTOUT handler returning equipment id from data type and spec. /// #include "AliHLTOUTHandlerDetectorDDL.h" #include "AliHLTOUT.h" #include "AliHLTDAQ.h" /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTOUTHandlerDetectorDDL) AliHLTOUTHandlerDetectorDDL::AliHLTOUTHandlerDetectorDDL(const char* detector, AliHLTComponentDataType dt) : fDDLOffset(-1), fNumberOfDDLs(-1), fDt(dt) { // A default handler class for DDL raw data redirection handlers. // // This class implements an AliHLTOUTHandlerEquId which extracts the // equipment Id from the bit pattern in the specification. All detectors // with up to 32 DDL links follow this convention. The bit no in the // data specification word corresponds to the DDL number within the // sub-detector. fDDLOffset=AliHLTDAQ::DdlIDOffset(detector); fNumberOfDDLs=AliHLTDAQ::NumberOfDdls(detector); } AliHLTOUTHandlerDetectorDDL::~AliHLTOUTHandlerDetectorDDL() { // destructor } int AliHLTOUTHandlerDetectorDDL::ProcessData(AliHLTOUT* pData) { // extract the ddl no from the data specification of the data // block and return it // negative error code if failed if (!pData) return -EINVAL; if (fDDLOffset<0 || fNumberOfDDLs<0) return -ENODEV; static int errorCount=0; const int maxErrorCount=10; AliHLTComponentDataType dt=kAliHLTVoidDataType; AliHLTUInt32_t spec=kAliHLTVoidDataSpec; int iResult=pData->GetDataBlockDescription(dt, spec); if (iResult>=0 && dt!=kAliHLTVoidDataType && spec!=kAliHLTVoidDataSpec) { if (dt==fDt) { int ddlNo=0; for (;ddlNo<32 && ddlNo=32 || ddlNo>=fNumberOfDDLs) { HLTError("invalid specification 0x%08x: can not extract DDL id for data block %s", spec, AliHLTComponent::DataType2Text(dt).c_str()); iResult=-ENODEV; } else if (spec^(0x1<