3 ///**************************************************************************
4 // * This file is property of and copyright by the *
5 // * ALICE Experiment at CERN, All rights reserved. *
7 // * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 // * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
9 // * for The ALICE HLT Project. *
11 // * Permission to use, copy, modify and distribute this software and its *
12 // * documentation strictly for non-commercial purposes is hereby granted *
13 // * without fee, provided that the above copyright notice appears in all *
14 // * copies and that both the copyright notice and this permission notice *
15 // * appear in the supporting documentation. The authors make no claims *
16 // * about the suitability of this software for any purpose. It is *
17 // * provided "as is" without express or implied warranty. *
18 // **************************************************************************
20 /// @file AliHLTProcessor.cxx
21 /// @author Matthias Richter, Timm Steinbeck
23 /// @brief Base class implementation for HLT analysis components.
26 #include "AliHLTProcessor.h"
31 /** ROOT macro for the implementation of ROOT specific class methods */
32 ClassImp(AliHLTProcessor)
34 AliHLTProcessor::AliHLTProcessor()
36 , fpDebugCounters(NULL)
40 AliHLTProcessor::~AliHLTProcessor()
43 if (fpDebugCounters) delete fpDebugCounters;
47 int AliHLTProcessor::DoProcessing( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
48 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
50 AliHLTComponentBlockDataList& outputBlocks,
51 AliHLTComponentEventDoneData*& edd )
53 // Processing method, calls child's DoEvent
55 ReleaseEventDoneData();
57 iResult=DoEvent(evtData, blocks, trigData, outputPtr, size, outputBlocks);
60 AliHLTComponentEventDoneData* eddTmp = GetCurrentEventDoneData();
62 int ret = GetEventDoneData(eddTmp->fDataSize, &edd);
64 HLTError( "Cannot get event done data of %u bytes for event %lu: error (%d)",
65 eddTmp->fDataSize, evtData.fEventID, ret );
68 edd->fStructSize = sizeof(AliHLTComponentEventDoneData);
69 edd->fDataSize = eddTmp->fDataSize;
70 edd->fData = reinterpret_cast<AliHLTUInt8_t*>(edd)+edd->fStructSize;
71 memcpy( edd->fData, eddTmp->fData, eddTmp->fDataSize );
73 // 2009-12-07 want to make this switchable, but this first needs some
74 // extension in the online framework to change the log level settings
75 // in the component while running
76 if (false/*CheckFilter(kHLTLogDebug)*/) {
77 if (!fpDebugCounters) {
78 fpDebugCounters=new AliHLTProcessorCounters;
80 if (fpDebugCounters) {
81 int wordCnt=edd->fDataSize/4;
82 AliHLTUInt32_t* buffer=reinterpret_cast<AliHLTUInt32_t*>(edd->fData);
84 while (word<wordCnt) {
85 switch (buffer[word]) {
87 fpDebugCounters->fReadoutFilter++;
88 word+=1+buffer[word+1]*4;
91 fpDebugCounters->fMonitoringFilter++;
92 word+=1+buffer[word+1]*4;
95 fpDebugCounters->fMonitoringEvent++;
98 fpDebugCounters->fMismatch++;
104 static UInt_t lastTime=0;
106 if (time.Get()-lastTime>1) {
108 HLTImportant("EventDoneData size %d: readout %d, monitoring filter %d, monitoring event %d, format error %d",
109 edd->fDataSize, fpDebugCounters->fReadoutFilter, fpDebugCounters->fMonitoringFilter, fpDebugCounters->fMonitoringEvent, fpDebugCounters->fMismatch);
110 for (int i=0; i< wordCnt; ) {
112 for (int j=0; j<4 && i<wordCnt; j++) {
113 TString number; number.Form("0x%08x ", buffer[i++]);
116 HLTImportant(" %s", message.Data());
125 int AliHLTProcessor::DoEvent( const AliHLTComponentEventData& evtData,
126 const AliHLTComponentBlockData* /*blocks*/,
127 AliHLTComponentTriggerData& trigData,
128 AliHLTUInt8_t* /*outputPtr*/,
129 AliHLTUInt32_t& size,
130 AliHLTComponentBlockDataList& /*outputBlocks*/ )
132 // we just forward to the high level method, all other parameters already
133 // have been stored internally
135 return DoEvent(evtData, trigData);
138 int AliHLTProcessor::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
140 // default method: one of DoEvent methods must be implemented
141 HLTFatal("no processing method implemented");