]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/ITS/AliHLTITSAgent.cxx
adding the ITS library agent with handler of {DDLRAW :ITS } data blocks in HLTOUT...
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSAgent.cxx
CommitLineData
dafa46c6 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//* 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//**************************************************************************
18
19/** @file AliHLTITSAgent.cxx
20 @author Matthias Richter
21 @date 25.08.2008
22 @brief Agent of the libAliHLTITS library
23*/
24
25#include <cassert>
26#include "AliHLTITSAgent.h"
27#include "AliHLTConfiguration.h"
28
29// header files of library components
30
31// header file of the module preprocessor
32
33// raw data handler of HLTOUT data
34#include "AliHLTOUTHandlerEquId.h"
35
36/** global instance for agent registration */
37AliHLTITSAgent gAliHLTITSAgent;
38
39/** ROOT macro for the implementation of ROOT specific class methods */
40ClassImp(AliHLTITSAgent)
41
42AliHLTITSAgent::AliHLTITSAgent()
43 :
44 AliHLTModuleAgent("ITS"),
45 fRawDataHandler(NULL)
46{
47 // see header file for class documentation
48 // or
49 // refer to README to build package
50 // or
51 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
52}
53
54AliHLTITSAgent::~AliHLTITSAgent()
55{
56 // see header file for class documentation
57}
58
59int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
60 AliRawReader* /*rawReader*/,
61 AliRunLoader* /*runloader*/) const
62{
63 // see header file for class documentation
64 return 0;
65}
66
67const char* AliHLTITSAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
68 AliRunLoader* /*runloader*/) const
69{
70 // see header file for class documentation
71
72 return "";
73}
74
75const char* AliHLTITSAgent::GetRequiredComponentLibraries() const
76{
77 // see header file for class documentation
78 return "";
79}
80
81int AliHLTITSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
82{
83 // see header file for class documentation
84 assert(pHandler);
85 if (!pHandler) return -EINVAL;
86 //pHandler->AddComponent(new ...);
87
88 return 0;
89}
90
91AliHLTModulePreprocessor* AliHLTITSAgent::GetPreprocessor()
92{
93 // see header file for class documentation
94 return NULL;
95}
96
97int AliHLTITSAgent::GetHandlerDescription(AliHLTComponentDataType dt,
98 AliHLTUInt32_t spec,
99 AliHLTOUTHandlerDesc& desc) const
100{
101 // see header file for class documentation
102
103 // Handlers for ITS raw data. Even though there are 3 detectors
104 // everything is handled in one module library and one HLTOUT handler.
105 // This assumes that the data blocks are sent with data type
106 // {DDL_RAW :ITS } and the equipment id as specification
107 // The default behavior of AliHLTOUTHandlerEquId is used.
108 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITS)) {
109 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
110 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
111 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
112 return 1;
113 }
114 return 0;
115}
116
117AliHLTOUTHandler* AliHLTITSAgent::GetOutputHandler(AliHLTComponentDataType dt,
118 AliHLTUInt32_t /*spec*/)
119{
120 // see header file for class documentation
121 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITS)) {
122 // use the default handler
123 if (!fRawDataHandler) {
124 fRawDataHandler=new AliHLTOUTHandlerEquId;
125 }
126 return fRawDataHandler;
127 }
128 return NULL;
129}
130
131int AliHLTITSAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
132{
133 // see header file for class documentation
134 if (pInstance==NULL) return -EINVAL;
135
136 if (pInstance==fRawDataHandler) {
137 delete fRawDataHandler;
138 fRawDataHandler=NULL;
139 return 0;
140 }
141
142 delete pInstance;
143 return 0;
144}