ALIROOT-5600 - skip non-participating detector modules
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataSource.cxx
CommitLineData
421b7534 1// $Id$
2
c515df4c 3//**************************************************************************
4//* This file is property of and copyright by the *
5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8//* for The ALICE HLT Project. *
9//* *
10//* Permission to use, copy, modify and distribute this software and its *
11//* documentation strictly for non-commercial purposes is hereby granted *
12//* without fee, provided that the above copyright notice appears in all *
13//* copies and that both the copyright notice and this permission notice *
14//* appear in the supporting documentation. The authors make no claims *
15//* about the suitability of this software for any purpose. It is *
16//* provided "as is" without express or implied warranty. *
17//**************************************************************************
421b7534 18
c515df4c 19/// @file AliHLTDataSource.cxx
20/// @author Matthias Richter
21/// @date
22/// @brief Base class implementation for HLT data source components.
23///
421b7534 24
25#include "AliHLTDataSource.h"
26
b22e91eb 27/** ROOT macro for the implementation of ROOT specific class methods */
421b7534 28ClassImp(AliHLTDataSource)
29
30AliHLTDataSource::AliHLTDataSource()
c515df4c 31{
32 // Base class of HLT data source components.
33 // The class provides a common interface for the implementation of HLT data
34 // source components.
35 // Source components do not consume any input consequently the processing
36 // function is called 'GetEvent'.
421b7534 37}
38
39AliHLTDataSource::~AliHLTDataSource()
40{
c515df4c 41 // destructor
421b7534 42}
43
c515df4c 44void AliHLTDataSource::GetInputDataTypes( AliHLTComponentDataTypeList& list)
2d7ff710 45{
c515df4c 46 // default method as source components do not consume input
2d7ff710 47 list.clear(); // there are no input data types
48}
49
50
3cde846d 51int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
48abe484 52 const AliHLTComponentBlockData* blocks,
8ede8717 53 AliHLTComponentTriggerData& trigData,
421b7534 54 AliHLTUInt8_t* outputPtr,
55 AliHLTUInt32_t& size,
c515df4c 56 AliHLTComponentBlockDataList& outputBlocks,
8ede8717 57 AliHLTComponentEventDoneData*& edd )
421b7534 58{
c515df4c 59 // Processing method, calls child's GetEvent
421b7534 60 int iResult=0;
421b7534 61 if (evtData.fBlockCnt > 0) {
48abe484 62 int unknown=-1;
ac192d4d 63 for (unsigned int block=0; block<evtData.fBlockCnt; block++) {
48abe484 64 if (blocks[block].fDataType==kAliHLTDataTypeSOR ||
42a6dea2 65 blocks[block].fDataType==kAliHLTDataTypeEOR ||
3baf1595 66 blocks[block].fDataType==kAliHLTDataTypeEvent ||
f5423244 67 blocks[block].fDataType==kAliHLTDataTypeRunType ||
3baf1595 68 blocks[block].fDataType==kAliHLTDataTypeComponentStatistics ||
69 blocks[block].fDataType==kAliHLTDataTypeComponentTable ||
70 blocks[block].fDataType==kAliHLTDataTypeECSParam) {
48abe484 71 continue;
72 }
73 unknown=block;
74 break;
75 }
f5423244 76 static int warningCount=0;
77 if (unknown>=0 && warningCount++<5) {
48abe484 78 HLTWarning("Data source component skips input data blocks: first unknown block %s",
79 DataType2Text(blocks[unknown].fDataType).c_str());
457ec821 80 }
81 }
48abe484 82 iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks);
83 HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult);
421b7534 84 edd = NULL;
85 return iResult;
86}
a655eae3 87
88int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
298ef463 89 AliHLTComponentTriggerData& trigData,
90 AliHLTUInt8_t* /*outputPtr*/,
53f79557 91 AliHLTUInt32_t& size,
c515df4c 92 AliHLTComponentBlockDataList& /*outputBlocks*/ )
a655eae3 93{
94 // we just forward to the high level method, all other parameters already
95 // have been stored internally
53f79557 96 size=0;
a655eae3 97 return GetEvent(evtData, trigData);
98}
99
298ef463 100int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
a655eae3 101{
c515df4c 102 // default method: one of GetEvent methods must be implemented
a655eae3 103 HLTFatal("no processing method implemented");
104 return -ENOSYS;
105}