]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliHLTGlobalAgent.cxx
Using common HLT track data format for TRD tracks (Theodor)
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalAgent.cxx
CommitLineData
ec6160d5 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 AliHLTGlobalAgent.cxx
20 @author Matthias Richter
21 @date
22 @brief Agent of the libAliHLTGlobal library
23*/
24
25#include <cassert>
26#include "AliHLTGlobalAgent.h"
6595fdc6 27#include "AliHLTConfigurationHandler.h"
28#include "TObjString.h"
29#include "TObjArray.h"
ec6160d5 30
31// header files of library components
18ada816 32#include "AliHLTGlobalTrackMergerComponent.h"
6595fdc6 33#include "AliHLTGlobalEsdConverterComponent.h"
ec6160d5 34
35/** global instance for agent registration */
36AliHLTGlobalAgent gAliHLTGlobalAgent;
37
38/** ROOT macro for the implementation of ROOT specific class methods */
39ClassImp(AliHLTGlobalAgent)
40
41AliHLTGlobalAgent::AliHLTGlobalAgent()
42 :
43 AliHLTModuleAgent("Global")
44{
45 // see header file for class documentation
46 // or
47 // refer to README to build package
48 // or
49 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
50}
51
52AliHLTGlobalAgent::~AliHLTGlobalAgent()
53{
54 // see header file for class documentation
55}
56
57int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
58{
59 // see header file for class documentation
60 assert(pHandler);
61 if (!pHandler) return -EINVAL;
18ada816 62 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
6595fdc6 63 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
ec6160d5 64 return 0;
65}
66
6595fdc6 67int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
68 AliRawReader* /*rawReader*/,
69 AliRunLoader* /*runloader*/) const
ec6160d5 70{
71 // see header file for class documentation
6595fdc6 72 if (!pHandler) return -EINVAL;
73
74 /////////////////////////////////////////////////////////////////////////////////////
75 //
76 // assembly of the global ESD
77
78 // define the inputs to the global ESD
79 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
80
81 // check for the availibility
82 TObjArray* pTokens=esdInputs.Tokenize(" ");
83 esdInputs="";
84 if (pTokens) {
85 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
86 TString module=((TObjString*)pTokens->At(n))->GetString();
87 if (pHandler->FindConfiguration(module.Data())) {
88 esdInputs+=module;
89 esdInputs+=" ";
90 }
91 }
92 delete pTokens;
93 }
ec6160d5 94
6595fdc6 95 if (esdInputs.Length()>0) {
96 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
97 } else {
98 HLTWarning("No inputs to global HLT ESD found");
ec6160d5 99 }
100
6595fdc6 101 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
102
ec6160d5 103 return 0;
104}
105
6595fdc6 106const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
107 AliRunLoader* runloader) const
ec6160d5 108{
109 // see header file for class documentation
6595fdc6 110 if (runloader) {
111 // reconstruction chains for AliRoot simulation
112 // Note: run loader is only available while running embedded into
113 // AliRoot simulation
114 return "GLOBAL-esd-converter";
ec6160d5 115 }
6595fdc6 116 return NULL;
117}
118
119const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
120{
121 // see header file for class documentation
122
123 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
124}
125
126int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
127 AliHLTUInt32_t /*spec*/,
128 AliHLTOUTHandlerDesc& /*desc*/) const
129{
130 // see header file for class documentation
131
132 return 0;
133}
134
135AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
136 AliHLTUInt32_t /*spec*/)
137{
138 // see header file for class documentation
ec6160d5 139
140 return NULL;
141}
142
143int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
144{
145 // see header file for class documentation
146 if (pInstance==NULL) return -EINVAL;
147
148 return 0;
149}