]>
Commit | Line | Data |
---|---|---|
33daad3d | 1 | //-*- Mode: C++ -*- |
2 | ||
3 | // $Id: AliHLTJETAgent.cxx $ | |
4 | ||
5 | //************************************************************************** | |
6 | //* This file is property of and copyright by the ALICE HLT Project * | |
7 | //* ALICE Experiment at CERN, All rights reserved. * | |
8 | //* * | |
9 | //* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> * | |
10 | //* for The ALICE HLT Project. * | |
11 | //* * | |
12 | //* Permission to use, copy, modify and distribute this software and its * | |
13 | //* documentation strictly for non-commercial purposes is hereby granted * | |
14 | //* without fee, provided that the above copyright notice appears in all * | |
15 | //* copies and that both the copyright notice and this permission notice * | |
16 | //* appear in the supporting documentation. The authors make no claims * | |
17 | //* about the suitability of this software for any purpose. It is * | |
18 | //* provided "as is" without express or implied warranty. * | |
19 | //************************************************************************** | |
20 | ||
21 | /** @file AliHLTJETAgent.cxx | |
22 | @author Jochen Thaeder | |
23 | @date 13.02.2009 | |
24 | @brief Agent of the libAliHLTJET library | |
25 | */ | |
26 | ||
27 | #include <cassert> | |
28 | #include "AliHLTJETAgent.h" | |
29 | #include "AliHLTConfiguration.h" | |
30 | #include "AliHLTOUT.h" | |
31 | ||
32 | // component header file | |
33 | #include "AliHLTJETConeJetComponent.h" | |
fdc39952 | 34 | #include "AliHLTJETAnalysisComponent.h" |
33daad3d | 35 | |
36 | #ifdef HAVE_FASTJET | |
37 | #include "AliHLTJETFastJetComponent.h" | |
38 | #endif | |
39 | ||
40 | ||
41 | ||
42 | /** global instance for agent registration */ | |
43 | AliHLTJETAgent gAliHLTJETAgent; | |
44 | ||
45 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
46 | ClassImp(AliHLTJETAgent) | |
47 | ||
48 | /* | |
49 | * --------------------------------------------------------------------------------- | |
50 | * Constructor / Destructor | |
51 | * --------------------------------------------------------------------------------- | |
52 | */ | |
53 | ||
54 | // ################################################################################# | |
55 | AliHLTJETAgent::AliHLTJETAgent() | |
56 | : | |
57 | AliHLTModuleAgent("JET"), | |
58 | fRawDataHandler(NULL) { | |
59 | // see header file for class documentation | |
60 | // or | |
61 | // refer to README to build package | |
62 | // or | |
63 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
64 | } | |
65 | ||
66 | // ################################################################################# | |
67 | AliHLTJETAgent::~AliHLTJETAgent() { | |
68 | // see header file for class documentation | |
69 | } | |
70 | ||
71 | /* | |
72 | * --------------------------------------------------------------------------------- | |
73 | * | |
74 | * --------------------------------------------------------------------------------- | |
75 | */ | |
76 | ||
77 | // ################################################################################# | |
78 | Int_t AliHLTJETAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/, | |
79 | AliRawReader* /*rawReader*/, | |
80 | AliRunLoader* /*runloader*/) const { | |
81 | // see header file for class documentation | |
82 | return 0; | |
83 | } | |
84 | ||
85 | // ################################################################################# | |
86 | const Char_t* AliHLTJETAgent::GetReconstructionChains(AliRawReader* /*rawReader*/, | |
87 | AliRunLoader* /*runloader*/) const { | |
88 | // see header file for class documentation | |
89 | ||
90 | return ""; | |
91 | } | |
92 | ||
93 | // ################################################################################# | |
94 | const Char_t* AliHLTJETAgent::GetRequiredComponentLibraries() const { | |
95 | // see header file for class documentation | |
96 | return ""; | |
97 | } | |
98 | ||
99 | // ################################################################################# | |
100 | Int_t AliHLTJETAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const { | |
101 | // see header file for class documentation | |
102 | ||
103 | assert(pHandler); | |
104 | if (!pHandler) return -EINVAL; | |
105 | ||
106 | pHandler->AddComponent(new AliHLTJETConeJetComponent); | |
fdc39952 | 107 | pHandler->AddComponent(new AliHLTJETAnalysisComponent); |
33daad3d | 108 | #ifdef HAVE_FASTJET |
109 | pHandler->AddComponent(new AliHLTJETFastJetComponent); | |
110 | #endif | |
111 | ||
112 | return 0; | |
113 | } | |
114 | ||
115 | /* | |
116 | * --------------------------------------------------------------------------------- | |
117 | * | |
118 | * --------------------------------------------------------------------------------- | |
119 | */ | |
120 | ||
121 | // ################################################################################# | |
122 | AliHLTModulePreprocessor* AliHLTJETAgent::GetPreprocessor() { | |
123 | // see header file for class documentation | |
124 | return NULL; | |
125 | } | |
126 | ||
127 | /* | |
128 | * --------------------------------------------------------------------------------- | |
129 | * | |
130 | * --------------------------------------------------------------------------------- | |
131 | */ | |
132 | ||
133 | // ################################################################################# | |
134 | Int_t AliHLTJETAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/, | |
135 | AliHLTUInt32_t /*spec*/, | |
136 | AliHLTOUTHandlerDesc& /*desc*/) const { | |
137 | // see header file for class documentation | |
138 | ||
139 | // Handlers for JET data. | |
140 | /* | |
141 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginJETSDD)) { | |
142 | desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId()); | |
143 | HLTInfo("module %s handles data block type %s specification %d (0x%x)", | |
144 | GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec); | |
145 | return 1; | |
146 | } | |
147 | */ | |
148 | return 0; | |
149 | } | |
150 | ||
151 | // ################################################################################# | |
152 | AliHLTOUTHandler* AliHLTJETAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/, | |
153 | AliHLTUInt32_t /*spec*/) { | |
154 | /* | |
155 | // see header file for class documentation | |
156 | if (dt==(kAliHLTDataTypeJet|kAliHLTDataOriginANY)) { | |
157 | // use the default handler | |
158 | if (!fRawDataHandler) { | |
159 | fRawDataHandler=new AliHLTOUTSDDRawDataHandler; | |
160 | } | |
161 | return fRawDataHandler; | |
162 | } | |
163 | */ | |
164 | return NULL; | |
165 | } | |
166 | ||
167 | // ################################################################################# | |
168 | Int_t AliHLTJETAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) { | |
169 | // see header file for class documentation | |
170 | if (pInstance==NULL) return -EINVAL; | |
171 | ||
172 | /** | |
173 | if (pInstance==fRawDataHandler) { | |
174 | delete fRawDataHandler; | |
175 | fRawDataHandler=NULL; | |
176 | return 0; | |
177 | } | |
178 | ||
179 | delete pInstance; | |
180 | */ | |
181 | return 0; | |
182 | } | |
183 | ||
184 | /* | |
185 | int AliHLTJETAgent::AliHLTOUTSDDRawDataHandler::ProcessData(AliHLTOUT* pData) | |
186 | { | |
187 | // see header file for class documentation | |
188 | if (!pData) return -EINVAL; | |
189 | static int errorCount=0; | |
190 | const int maxErrorCount=10; | |
191 | AliHLTComponentDataType dt=kAliHLTVoidDataType; | |
192 | AliHLTUInt32_t spec=kAliHLTVoidDataSpec; | |
193 | int iResult=pData->GetDataBlockDescription(dt, spec); | |
194 | if (iResult>=0) { | |
195 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginJETSDD)) { | |
196 | int ddlOffset=256;//AliDAQ::DdlIDOffset("JETSDD"); | |
197 | int numberOfDDLs=24;//AliDAQ::NumberOfDdls("JETSDD"); | |
198 | int ddlNo=0; | |
199 | for (;ddlNo<32 && ddlNo<numberOfDDLs; ddlNo++) { | |
200 | if (spec&(0x1<<ddlNo)) break; | |
201 | } | |
202 | if (ddlNo>=32 || ddlNo>=numberOfDDLs) { | |
203 | HLTError("invalid specification 0x%08x: can not extract DDL id for data block %s", spec, AliHLTComponent::DataType2Text(dt).c_str()); | |
204 | iResult=-ENODEV; | |
205 | } else if (spec^(0x1<<ddlNo)) { | |
206 | iResult=-EEXIST; | |
207 | HLTError("multiple links set in specification 0x%08x: can not extract DDL id for data block %s", spec, AliHLTComponent::DataType2Text(dt).c_str()); | |
208 | } else { | |
209 | iResult=ddlOffset+ddlNo; | |
210 | } | |
211 | } else { | |
212 | if (errorCount++<10) { | |
213 | HLTError("wrong data type: expecting %s, got %s; %s", | |
214 | AliHLTComponent::DataType2Text(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginJETSDD).c_str(), | |
215 | AliHLTComponent::DataType2Text(dt).c_str(), | |
216 | errorCount==maxErrorCount?"suppressing further error messages":""); | |
217 | } | |
218 | iResult=-EFAULT; | |
219 | } | |
220 | } | |
221 | return iResult; | |
222 | } | |
223 | */ |