]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTProcessor.cxx
Added code to allow sending back of EventDoneData from the DoEvent methods of AliHLTP...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTProcessor.cxx
1 // $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
5  * ALICE Experiment at CERN, All rights reserved.                         *
6  *                                                                        *
7  * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
8  *                  Timm Steinbeck <timm@kip.uni-heidelberg.de>           *
9  *                  for The ALICE HLT Project.                            *
10  *                                                                        *
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  **************************************************************************/
19
20 /** @file   AliHLTProcessor.cxx
21     @author Matthias Richter, Timm Steinbeck
22     @date   
23     @brief  Base class implementation for HLT analysis components. */
24
25 #if __GNUC__>= 3
26 using namespace std;
27 #endif
28
29 #include "AliHLTProcessor.h"
30 #include <string.h>
31
32 /** ROOT macro for the implementation of ROOT specific class methods */
33 ClassImp(AliHLTProcessor)
34
35 AliHLTProcessor::AliHLTProcessor()
36
37   // see header file for class documentation
38   // or
39   // refer to README to build package
40   // or
41   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
42 }
43
44 AliHLTProcessor::~AliHLTProcessor()
45
46   // see header file for class documentation
47 }
48
49 int AliHLTProcessor::DoProcessing( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
50                             AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
51                             AliHLTUInt32_t& size,
52                             vector<AliHLTComponentBlockData>& outputBlocks,
53                             AliHLTComponentEventDoneData*& edd )
54 {
55   // see header file for class documentation
56   int iResult=0;
57   ReleaseEventDoneData();
58
59   iResult=DoEvent(evtData, blocks, trigData, outputPtr, size, outputBlocks);
60
61   edd = NULL;
62   AliHLTComponentEventDoneData* eddTmp = GetCurrentEventDoneData();
63   if (eddTmp) {
64     int ret = GetEventDoneData(eddTmp->fDataSize, &edd);
65     if (ret) {
66       HLTError( "Cannot get event done data of %u bytes for event %lu: %s (%d)", 
67                 eddTmp->fDataSize, evtData.fEventID, strerror(ret), ret );
68       return -ENOMEM;
69     }
70     edd->fStructSize = sizeof(AliHLTComponentEventDoneData);
71     edd->fDataSize = eddTmp->fDataSize;
72     edd->fData = reinterpret_cast<AliHLTUInt8_t*>(edd)+edd->fStructSize;
73     memcpy( edd->fData, eddTmp->fData, eddTmp->fDataSize );
74   }
75   return iResult;
76 }
77
78 int AliHLTProcessor::DoEvent( const AliHLTComponentEventData& evtData,
79                               const AliHLTComponentBlockData* /*blocks*/, 
80                               AliHLTComponentTriggerData& trigData,
81                               AliHLTUInt8_t* /*outputPtr*/, 
82                               AliHLTUInt32_t& size,
83                               vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
84 {
85   // we just forward to the high level method, all other parameters already
86   // have been stored internally
87   size=0;
88   return DoEvent(evtData, trigData);
89 }
90
91 int AliHLTProcessor::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
92 {
93   HLTFatal("no processing method implemented");
94   return -ENOSYS;
95 }