]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/OfflineInterface/AliHLTMUONAgent.cxx
Adding cluster finder component which integrates offline algorithms with online HLT.
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONAgent.cxx
CommitLineData
d1ff7c16 1/**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
6253e09b 18///
19/// @file AliHLTMUONAgent.cxx
20/// @author Artur Szostak <artursz@iafrica.com>
887a669c 21/// @date 28 May 2007
6253e09b 22/// @brief Implementation of the AliHLTMUONAgent class.
23///
d1ff7c16 24
25#include "AliHLTMUONAgent.h"
887a669c 26#include "AliHLTMUONConstants.h"
6253e09b 27#include "AliHLTMUONRecHitsSource.h"
28#include "AliHLTMUONTriggerRecordsSource.h"
887a669c 29#include "AliHLTMUONDigitPublisherComponent.h"
6253e09b 30#include "AliHLTMUONRootifierComponent.h"
31#include "AliHLTMUONHitReconstructorComponent.h"
32#include "AliHLTMUONTriggerReconstructorComponent.h"
33#include "AliHLTMUONMansoTrackerFSMComponent.h"
c9537879 34#include "AliHLTMUONDecisionComponent.h"
649ab027 35#include "AliHLTMUONESDMaker.h"
0528e93a 36#include "AliHLTMUONEmptyEventFilterComponent.h"
dba14d7d 37#include "AliHLTMUONDataCheckerComponent.h"
17d68f2a 38#include "AliHLTMUONClusterFinderComponent.h"
94135365 39#include "AliHLTOUTHandlerChain.h"
352670bf 40#include "AliRawReader.h"
d1ff7c16 41#include "AliRunLoader.h"
887a669c 42#include "TSystem.h"
43#include "TString.h"
d1ff7c16 44
6253e09b 45// The single global instance of the dimuon HLT agent.
46AliHLTMUONAgent AliHLTMUONAgent::fgkInstance;
d1ff7c16 47
94135365 48AliHLTOUTHandlerChain AliHLTMUONAgent::fgkESDMakerChain("libAliHLTMUON.so chains=dHLT-make-esd");
49AliHLTOUTHandlerChain AliHLTMUONAgent::fgkRootifyDumpChain("libAliHLTMUON.so chains=dHLT-rootify-and-dump");
50
51
d1ff7c16 52ClassImp(AliHLTMUONAgent);
53
54
626bfcc1 55AliHLTMUONAgent::AliHLTMUONAgent() : AliHLTModuleAgent("MUON")
d1ff7c16 56{
6253e09b 57 ///
58 /// Default constructor.
59 ///
d1ff7c16 60}
61
62AliHLTMUONAgent::~AliHLTMUONAgent()
63{
6253e09b 64 ///
65 /// Default destructor.
66 ///
d1ff7c16 67}
68
887a669c 69const char* AliHLTMUONAgent::GetReconstructionChains(AliRawReader* rawReader,
70 AliRunLoader* runloader
d1ff7c16 71 ) const
72{
6253e09b 73 ///
74 /// Inherited from AliHLTModuleAgent.
75 /// Returns the top processing chain configurations for local event
76 /// reconstruction.
77 /// @param rawReader [in] AliRoot rawreader instance.
78 /// @param runloader [in] AliRoot runloader
79 /// @return string containing the top configurations separated by blanks.
80 ///
887a669c 81 /// If rawReader is not NULL then the standard dHLT chain is run taking
82 /// data from raw DDL data. Otherwise runloader is checked and if it is
83 /// not NULL then a dHLT chain is run with input data from digits.
6253e09b 84
887a669c 85 if (rawReader != NULL)
86 {
352670bf 87 // Check if there is any data from the tracker and trigger.
88 bool dataFromTracker = false;
89 bool dataFromTrigger = false;
90 rawReader->Select("MUONTRK", 0, 19);
91 for (Int_t i = 0; i < 20; i++)
92 {
93 if (rawReader->ReadHeader()) dataFromTracker = true;
94 }
95 rawReader->Select("MUONTRG", 0, 1);
96 for (Int_t i = 0; i < 2; i++)
97 {
98 if (rawReader->ReadHeader()) dataFromTrigger = true;
99 }
100 rawReader->RewindEvents();
101
102 // If raw data was found for our detector then select the
103 // appropriate chain.
104 if (dataFromTracker and dataFromTrigger)
105 return "dHLT-sim-fromRaw";
887a669c 106 }
352670bf 107
108 if (runloader != NULL)
887a669c 109 {
352670bf 110 if (runloader->GetLoader("MUONLoader") != NULL)
111 return "dHLT-sim";
887a669c 112 }
352670bf 113
114 return "";
d1ff7c16 115}
116
117const char* AliHLTMUONAgent::GetRequiredComponentLibraries() const
118{
6253e09b 119 ///
120 /// Inherited from AliHLTModuleAgent.
121 /// Returns a list of libraries which the configurations registered by
122 /// this module agent depend on.
123 /// @return list of component libraries as a blank-separated string.
124 ///
125
887a669c 126 // List of libraries that we depend on.
127 static const char* libs[] =
128 {
129 "libCore.so",
130 "libCint.so",
131 "libGraf.so",
132 "libRIO.so",
133 "libNet.so",
134 "libHist.so",
135 "libMatrix.so",
136 "libMathCore.so",
137 "libMinuit.so",
138 "libTree.so",
139 "libGraf3d.so",
140 "libGpad.so",
141 "libPhysics.so",
142 "libGui.so",
143 "libProofPlayer.so",
144 "libProof.so",
145 "libThread.so",
146 "libGeom.so",
887a669c 147 "libEG.so",
148 "libTreePlayer.so",
149 "libXMLIO.so",
150 "libVMC.so",
151 "libESD.so",
152 "libCDB.so",
153 "libSTEERBase.so",
154 "libSTEER.so",
155 "libGui.so",
156 "libRAWDatasim.so",
157 "libRAWDatarec.so",
158 "libRAWDatabase.so",
159 "libMUONcore.so",
160 "libMUONraw.so",
161 "libMUONbase.so",
162 "libMUONgeometry.so",
163 "libMUONmapping.so",
164 "libMUONcalib.so",
165 "libMUONsim.so",
166 "libMUONtrigger.so",
167 "libMUONevaluation.so",
168 "libMUONrec.so",
169 "libHLTbase.so",
170 "libAliHLTUtil.so",
171 NULL
172 };
173
174 // First check if the library is not already loaded. If it is then we have
175 // no reason to declare it as needed, so that we do not load it again.
176 static TString result;
177 for (const char** lib = libs; *lib != NULL; lib++)
178 {
179 const char* list = gSystem->GetLibraries(*lib, "", kFALSE);
180 if (list == NULL) continue;
181 // Check if not found, i.e. result was an empty string.
182 // If so then add the library to the required list.
183 if (list[0] == '\0')
184 {
185 result += *lib;
186 result += " ";
187 }
188 }
189 return result.Data();
d1ff7c16 190}
191
192
193int AliHLTMUONAgent::CreateConfigurations(
194 AliHLTConfigurationHandler* handler,
887a669c 195 AliRawReader* rawReader,
196 AliRunLoader* runloader
d1ff7c16 197 ) const
198{
6253e09b 199 /// Register all processing configurations belonging to the dimuon HLT
200 /// library with the AliHLTConfigurationHandler.
201 /// @param handler the configuration handler
202 /// @param rawReader [in] AliRoot rawreader instance.
203 /// @param runloader AliRoot runloader
204 /// @return Zero on success and error code if failed.
205 ///
887a669c 206 /// Chains available:
207 /// dHLT-sim - standard dHLT simulation chain.
208 /// dHLT-sim-fromRaw - standard dHLT chain taking raw DDL data as input.
209 /// dHLT-sim-fromMC - dHLT chain taking Monte Carlo hit data as input.
210 /// So hit reconstruction is not checked, just the tracker.
6253e09b 211
d1ff7c16 212 if (handler == NULL) return 0;
887a669c 213
214 const char* trackerId = AliHLTMUONConstants::MansoTrackerFSMId();
215 const char* decCompId = AliHLTMUONConstants::DecisionComponentId();
216
217 if (rawReader != NULL)
218 {
219 // Implement the dHLT-sim-fromRaw dHLT simulation chain reading
220 // from raw data.
221 const char* rawPubComp = "AliRawReaderPublisher";
222 const char* cmd13 = "-minid 2572 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x001000";
223 const char* cmd14 = "-minid 2573 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x002000";
224 const char* cmd15 = "-minid 2574 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x004000";
225 const char* cmd16 = "-minid 2575 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x008000";
226 const char* cmd17 = "-minid 2576 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x010000";
227 const char* cmd18 = "-minid 2577 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x020000";
228 const char* cmd19 = "-minid 2578 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x040000";
229 const char* cmd20 = "-minid 2579 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x080000";
230 const char* cmd21 = "-minid 2816 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x100000";
231 const char* cmd22 = "-minid 2817 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x200000";
232 handler->CreateConfiguration("RawDDL13", rawPubComp, NULL, cmd13);
233 handler->CreateConfiguration("RawDDL14", rawPubComp, NULL, cmd14);
234 handler->CreateConfiguration("RawDDL15", rawPubComp, NULL, cmd15);
235 handler->CreateConfiguration("RawDDL16", rawPubComp, NULL, cmd16);
236 handler->CreateConfiguration("RawDDL17", rawPubComp, NULL, cmd17);
237 handler->CreateConfiguration("RawDDL18", rawPubComp, NULL, cmd18);
238 handler->CreateConfiguration("RawDDL19", rawPubComp, NULL, cmd19);
239 handler->CreateConfiguration("RawDDL20", rawPubComp, NULL, cmd20);
240 handler->CreateConfiguration("RawDDL21", rawPubComp, NULL, cmd21);
241 handler->CreateConfiguration("RawDDL22", rawPubComp, NULL, cmd22);
242 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
243 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
244 handler->CreateConfiguration("RecoRawDDL13", hrId, "RawDDL13", "-ddl 13 -cdb");
245 handler->CreateConfiguration("RecoRawDDL14", hrId, "RawDDL14", "-ddl 14 -cdb");
246 handler->CreateConfiguration("RecoRawDDL15", hrId, "RawDDL15", "-ddl 15 -cdb");
247 handler->CreateConfiguration("RecoRawDDL16", hrId, "RawDDL16", "-ddl 16 -cdb");
248 handler->CreateConfiguration("RecoRawDDL17", hrId, "RawDDL17", "-ddl 17 -cdb");
249 handler->CreateConfiguration("RecoRawDDL18", hrId, "RawDDL18", "-ddl 18 -cdb");
250 handler->CreateConfiguration("RecoRawDDL19", hrId, "RawDDL19", "-ddl 19 -cdb");
251 handler->CreateConfiguration("RecoRawDDL20", hrId, "RawDDL20", "-ddl 20 -cdb");
252 handler->CreateConfiguration("RecoRawDDL21", trId, "RawDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
253 handler->CreateConfiguration("RecoRawDDL22", trId, "RawDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
254
255 const char* recoSrcs = "RecoRawDDL13 RecoRawDDL14 RecoRawDDL15 RecoRawDDL16 RecoRawDDL17"
256 " RecoRawDDL18 RecoRawDDL19 RecoRawDDL20 RecoRawDDL21 RecoRawDDL22";
257 handler->CreateConfiguration("MansoTrackerForRaw", trackerId, recoSrcs, "");
258
147b1df7 259 handler->CreateConfiguration("DecisionForRaw", decCompId, "MansoTrackerForRaw", "");
260
261 TString outputSrcs = "DecisionForRaw MansoTrackerForRaw ";
262 outputSrcs += recoSrcs;
263 handler->CreateConfiguration("dHLT-sim-fromRaw", "BlockFilter", outputSrcs, "");
887a669c 264 }
265
266 if (runloader != NULL)
267 {
268 // Implement the dHLT-sim dHLT simulation chain reading from
269 // simulated digits.
270 const char* digitPub = AliHLTMUONConstants::DigitPublisherId();
271 handler->CreateConfiguration("DigitDDL13", digitPub, NULL, "-simdata -ddl 13");
272 handler->CreateConfiguration("DigitDDL14", digitPub, NULL, "-simdata -ddl 14");
273 handler->CreateConfiguration("DigitDDL15", digitPub, NULL, "-simdata -ddl 15");
274 handler->CreateConfiguration("DigitDDL16", digitPub, NULL, "-simdata -ddl 16");
275 handler->CreateConfiguration("DigitDDL17", digitPub, NULL, "-simdata -ddl 17");
276 handler->CreateConfiguration("DigitDDL18", digitPub, NULL, "-simdata -ddl 18");
277 handler->CreateConfiguration("DigitDDL19", digitPub, NULL, "-simdata -ddl 19");
278 handler->CreateConfiguration("DigitDDL20", digitPub, NULL, "-simdata -ddl 20");
279 handler->CreateConfiguration("DigitDDL21", digitPub, NULL, "-simdata -ddl 21");
280 handler->CreateConfiguration("DigitDDL22", digitPub, NULL, "-simdata -ddl 22");
281 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
282 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
283 handler->CreateConfiguration("RecoDDL13", hrId, "DigitDDL13", "-ddl 13 -cdb");
284 handler->CreateConfiguration("RecoDDL14", hrId, "DigitDDL14", "-ddl 14 -cdb");
285 handler->CreateConfiguration("RecoDDL15", hrId, "DigitDDL15", "-ddl 15 -cdb");
286 handler->CreateConfiguration("RecoDDL16", hrId, "DigitDDL16", "-ddl 16 -cdb");
287 handler->CreateConfiguration("RecoDDL17", hrId, "DigitDDL17", "-ddl 17 -cdb");
288 handler->CreateConfiguration("RecoDDL18", hrId, "DigitDDL18", "-ddl 18 -cdb");
289 handler->CreateConfiguration("RecoDDL19", hrId, "DigitDDL19", "-ddl 19 -cdb");
290 handler->CreateConfiguration("RecoDDL20", hrId, "DigitDDL20", "-ddl 20 -cdb");
291 handler->CreateConfiguration("RecoDDL21", trId, "DigitDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
292 handler->CreateConfiguration("RecoDDL22", trId, "DigitDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
293
294 const char* recoSrcs = "RecoDDL13 RecoDDL14 RecoDDL15 RecoDDL16 RecoDDL17"
295 " RecoDDL18 RecoDDL19 RecoDDL20 RecoDDL21 RecoDDL22";
296 handler->CreateConfiguration("MansoTracker", trackerId, recoSrcs, "");
297
147b1df7 298 handler->CreateConfiguration("Decision", decCompId, "MansoTracker", "");
299
300 TString outputSrcs = "Decision MansoTracker ";
301 outputSrcs += recoSrcs;
302 handler->CreateConfiguration("dHLT-sim", "BlockFilter", outputSrcs.Data(), "");
887a669c 303
304 // Implement the dHLT-sim-fromMC dHLT simulation chain reading
305 // Monte Carlo geant hits and putting those into a tracker component.
306 const char* rhsId = AliHLTMUONConstants::RecHitsSourceId();
307 const char* trsId = AliHLTMUONConstants::TriggerRecordsSourceId();
308 handler->CreateConfiguration("HitsDDL13", rhsId, NULL, "-simdata -plane left -chamber 7");
309 handler->CreateConfiguration("HitsDDL14", rhsId, NULL, "-simdata -plane right -chamber 7");
310 handler->CreateConfiguration("HitsDDL15", rhsId, NULL, "-simdata -plane left -chamber 8");
311 handler->CreateConfiguration("HitsDDL16", rhsId, NULL, "-simdata -plane right -chamber 8");
312 handler->CreateConfiguration("HitsDDL17", rhsId, NULL, "-simdata -plane left -chamber 9");
313 handler->CreateConfiguration("HitsDDL18", rhsId, NULL, "-simdata -plane right -chamber 9");
314 handler->CreateConfiguration("HitsDDL19", rhsId, NULL, "-simdata -plane left -chamber 10");
315 handler->CreateConfiguration("HitsDDL20", rhsId, NULL, "-simdata -plane right -chamber 10");
316 handler->CreateConfiguration("TrigRecsDDL21", trsId, NULL, "-hitdata -plane left");
317 handler->CreateConfiguration("TrigRecsDDL22", trsId, NULL, "-hitdata -plane right");
318
319 const char* dataSrcs = "HitsDDL13 HitsDDL14 HitsDDL15 HitsDDL16 HitsDDL17"
320 " HitsDDL18 HitsDDL19 HitsDDL20 TrigRecsDDL21 TrigRecsDDL22";
321 handler->CreateConfiguration("MansoTrackerForMC", trackerId, dataSrcs, "");
322
147b1df7 323 handler->CreateConfiguration("DecisionForMC", decCompId, "MansoTrackerForMC", "");
324
325 outputSrcs = "DecisionForMC MansoTrackerForMC ";
326 outputSrcs += dataSrcs;
327 handler->CreateConfiguration("dHLT-sim-fromMC", "BlockFilter", outputSrcs.Data(), "");
887a669c 328 }
329
94135365 330 // Create a chain for generating AliESDEvent objects from dHLT raw reconstructed data.
331 handler->CreateConfiguration("HLTOUTPubTrigRecs", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRECS' 'MUON'");
332 handler->CreateConfiguration("HLTOUTPubMansoTracks", "AliHLTOUTPublisher", NULL, "-datatype 'MANTRACK' 'MUON'");
333 handler->CreateConfiguration(
334 "dHLT-make-esd",
335 AliHLTMUONConstants::ESDMakerId(),
336 "HLTOUTPubTrigRecs HLTOUTPubMansoTracks",
337 "-make_minimal_esd"
338 );
339
340 // Create a chain for rootifying the raw dHLT data and dumping to file.
341 // This is used during AliRoot reconstruction.
342 handler->CreateConfiguration("HLTOUTPubTrigDbg", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRDBG' 'MUON'");
343 handler->CreateConfiguration("HLTOUTPubHits", "AliHLTOUTPublisher", NULL, "-datatype 'RECHITS ' 'MUON'");
344 handler->CreateConfiguration("HLTOUTPubClusters", "AliHLTOUTPublisher", NULL, "-datatype 'CLUSTERS' 'MUON'");
345 handler->CreateConfiguration("HLTOUTPubChannels", "AliHLTOUTPublisher", NULL, "-datatype 'CHANNELS' 'MUON'");
346 handler->CreateConfiguration("HLTOUTPubCandidates", "AliHLTOUTPublisher", NULL, "-datatype 'MNCANDID' 'MUON'");
347 handler->CreateConfiguration("HLTOUTPubSingles", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDSIN' 'MUON'");
348 handler->CreateConfiguration("HLTOUTPubPairs", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDPAR' 'MUON'");
349 handler->CreateConfiguration(
350 "HLTOUTConverter",
351 AliHLTMUONConstants::RootifierComponentId(),
352 "HLTOUTPubTrigRecs HLTOUTPubTrigDbg HLTOUTPubHits HLTOUTPubClusters"
353 " HLTOUTPubChannels HLTOUTPubMansoTracks HLTOUTPubCandidates"
354 " HLTOUTPubSingles HLTOUTPubPairs",
355 ""
356 );
357 handler->CreateConfiguration(
358 "dHLT-rootify-and-dump",
359 "ROOTFileWriter",
360 "HLTOUTConverter",
361 "-concatenate-events -datafile dHLTRawData.root -specfmt"
362 );
363
d1ff7c16 364 return 0;
365}
6253e09b 366
367
368int AliHLTMUONAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
369{
370 ///
371 /// Registers all available components of this module.
372 /// @param pHandler [in] instance of the component handler.
373 ///
374
375 if (pHandler == NULL) return -EINVAL;
376 pHandler->AddComponent(new AliHLTMUONRecHitsSource);
377 pHandler->AddComponent(new AliHLTMUONTriggerRecordsSource);
887a669c 378 pHandler->AddComponent(new AliHLTMUONDigitPublisherComponent);
6253e09b 379 pHandler->AddComponent(new AliHLTMUONRootifierComponent);
380 pHandler->AddComponent(new AliHLTMUONHitReconstructorComponent);
381 pHandler->AddComponent(new AliHLTMUONTriggerReconstructorComponent);
382 pHandler->AddComponent(new AliHLTMUONMansoTrackerFSMComponent);
c9537879 383 pHandler->AddComponent(new AliHLTMUONDecisionComponent);
649ab027 384 pHandler->AddComponent(new AliHLTMUONESDMaker);
0528e93a 385 pHandler->AddComponent(new AliHLTMUONEmptyEventFilterComponent);
dba14d7d 386 pHandler->AddComponent(new AliHLTMUONDataCheckerComponent);
17d68f2a 387 pHandler->AddComponent(new AliHLTMUONClusterFinderComponent);
6253e09b 388 return 0;
389}
390
94135365 391
392int AliHLTMUONAgent::GetHandlerDescription(
393 AliHLTComponentDataType dt,
394#ifdef __DEBUG
395 AliHLTUInt32_t spec,
396#else
397 AliHLTUInt32_t /*spec*/,
398#endif
399 AliHLTOUTHandlerDesc& desc
400 ) const
401{
402 /// Get handler decription for MUON data in the HLTOUT data stream.
403
404 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
405 dt == AliHLTMUONConstants::MansoTracksBlockDataType()
406 )
407 {
408 HLTDebug("Indicating we can handle data type = %s and specification"
409 " = 0x%8.8X with dHLT-make-esd chain",
410 AliHLTComponent::DataType2Text(dt).c_str(),
411 spec
412 );
413 desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-make-esd");
414 return 1;
415 }
416
417 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
418 dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
419 dt == AliHLTMUONConstants::RecHitsBlockDataType() or
420 dt == AliHLTMUONConstants::ClusterBlockDataType() or
421 dt == AliHLTMUONConstants::ChannelBlockDataType() or
422 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
423 dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
424 dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
425 dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
426 )
427 {
428 HLTDebug("Indicating we can handle data type = %s and specification"
429 " = 0x%8.8X with dHLT-rootify-and-dump chain",
430 AliHLTComponent::DataType2Text(dt).c_str(),
431 spec
432 );
433 desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-rootify-and-dump");
434 return 1;
435 }
436
437 return 0;
438}
439
440
441AliHLTOUTHandler* AliHLTMUONAgent::GetOutputHandler(
442 AliHLTComponentDataType dt,
443#ifdef __DEBUG
444 AliHLTUInt32_t spec
445#else
446 AliHLTUInt32_t /*spec*/
447#endif
448 )
449{
450 /// Get specific handler for MUON data in the HLTOUT data stream.
451
452 HLTDebug("Trying to create HLTOUT handler for data type = %s and"
453 " specification = 0x%8.8X",
454 AliHLTComponent::DataType2Text(dt).c_str(),
455 spec
456 );
457
458 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
459 dt == AliHLTMUONConstants::MansoTracksBlockDataType()
460 )
461 {
462 return &fgkESDMakerChain;
463 }
464
465 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
466 dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
467 dt == AliHLTMUONConstants::RecHitsBlockDataType() or
468 dt == AliHLTMUONConstants::ClusterBlockDataType() or
469 dt == AliHLTMUONConstants::ChannelBlockDataType() or
470 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
471 dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
472 dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
473 dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
474 )
475 {
476 return &fgkRootifyDumpChain;
477 }
478
479 return NULL;
480}
481
482
483int AliHLTMUONAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
484{
485 /// Deletes the HLTOUT handlers. In this case since the handlers are
486 /// allocated statically, we just check that the right pointer was
487 /// given and exit.
488
489 HLTDebug("Trying to delete HLTOUT handler: %p", pInstance);
490
491 if (pInstance != &fgkESDMakerChain or pInstance != &fgkRootifyDumpChain)
492 return -EINVAL;
493
494 return 0;
495}