]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliHLTGlobalAgent.cxx
- start DIS serving added to server loop
[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"
4d5ee3db 34#include "AliHLTGlobalVertexerComponent.h"
e09e5bba 35#include "AliHLTGlobalOfflineVertexerComponent.h"
8125805f 36#include "AliHLTV0HistoComponent.h"
de0257eb 37#include "AliHLTGlobalVertexerHistoComponent.h"
e419c1ae 38#include "AliHLTGlobalHistoCollector.h"
ec6160d5 39
40/** global instance for agent registration */
41AliHLTGlobalAgent gAliHLTGlobalAgent;
42
43/** ROOT macro for the implementation of ROOT specific class methods */
44ClassImp(AliHLTGlobalAgent)
45
46AliHLTGlobalAgent::AliHLTGlobalAgent()
47 :
48 AliHLTModuleAgent("Global")
49{
50 // see header file for class documentation
51 // or
52 // refer to README to build package
53 // or
54 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
55}
56
57AliHLTGlobalAgent::~AliHLTGlobalAgent()
58{
59 // see header file for class documentation
60}
61
62int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
63{
64 // see header file for class documentation
65 assert(pHandler);
66 if (!pHandler) return -EINVAL;
18ada816 67 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
6595fdc6 68 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
4d5ee3db 69 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
e09e5bba 70 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
de0257eb 71 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
8125805f 72 pHandler->AddComponent(new AliHLTV0HistoComponent );
e419c1ae 73 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
ec6160d5 74 return 0;
75}
76
6595fdc6 77int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
78 AliRawReader* /*rawReader*/,
79 AliRunLoader* /*runloader*/) const
ec6160d5 80{
81 // see header file for class documentation
6595fdc6 82 if (!pHandler) return -EINVAL;
ff242c62 83 TObjArray* pTokens=NULL;
84
85 ///////////////////////////////////////////////////////////////////////////////////////////////////
86 //
87 // global vertexer component
88 //
89 // define the inputs
90 TString vertexerInputs="TPC-globalmerger ITS-tracker";
91
92 // check for the availibility
93 pTokens=vertexerInputs.Tokenize(" ");
94 vertexerInputs="";
95 if (pTokens) {
96 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
97 TString module=((TObjString*)pTokens->At(n))->GetString();
98 if (pHandler->FindConfiguration(module.Data())) {
99 vertexerInputs+=module;
100 vertexerInputs+=" ";
101 }
102 }
103 delete pTokens;
104 pTokens=NULL;
105 }
106 if (!vertexerInputs.IsNull()) {
107 HLTInfo("Configuring inputs to global HLT Vertexer: %s", vertexerInputs.Data());
108 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
109 } else {
110 HLTWarning("No inputs to global HLT Vertexer found");
111 }
6595fdc6 112
113 /////////////////////////////////////////////////////////////////////////////////////
114 //
115 // assembly of the global ESD
116
117 // define the inputs to the global ESD
ff242c62 118 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker GLOBAL-vertexer";
6595fdc6 119
120 // check for the availibility
ff242c62 121 pTokens=esdInputs.Tokenize(" ");
6595fdc6 122 esdInputs="";
123 if (pTokens) {
124 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
125 TString module=((TObjString*)pTokens->At(n))->GetString();
126 if (pHandler->FindConfiguration(module.Data())) {
127 esdInputs+=module;
128 esdInputs+=" ";
129 }
130 }
131 delete pTokens;
ff242c62 132 pTokens=NULL;
6595fdc6 133 }
ec6160d5 134
6595fdc6 135 if (esdInputs.Length()>0) {
136 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
137 } else {
138 HLTWarning("No inputs to global HLT ESD found");
ec6160d5 139 }
140
6595fdc6 141 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
96bad4f8 142
96bad4f8 143 ///////////////////////////////////////////////////////////////////////////////////////////////////
144 //
145 // global histograms
146 //
ff242c62 147 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
148
149 // check for the availibility
150 pTokens=vertexhistoInput.Tokenize(" ");
151 vertexhistoInput="";
152 if (pTokens) {
153 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
154 TString module=((TObjString*)pTokens->At(n))->GetString();
155 if (pHandler->FindConfiguration(module.Data())) {
156 vertexhistoInput+=module;
157 vertexhistoInput+=" ";
158 }
159 }
160 delete pTokens;
161 pTokens=NULL;
162 }
163
164 if (!vertexhistoInput.IsNull()) {
165 HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
166 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
167 } else {
168 HLTWarning("No inputs to global HLT Vertex histogram component found");
96bad4f8 169 }
6595fdc6 170
ec6160d5 171 return 0;
172}
173
6595fdc6 174const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
175 AliRunLoader* runloader) const
ec6160d5 176{
177 // see header file for class documentation
6595fdc6 178 if (runloader) {
179 // reconstruction chains for AliRoot simulation
180 // Note: run loader is only available while running embedded into
181 // AliRoot simulation
182 return "GLOBAL-esd-converter";
ec6160d5 183 }
6595fdc6 184 return NULL;
185}
186
187const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
188{
189 // see header file for class documentation
190
191 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
192}
193
194int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
195 AliHLTUInt32_t /*spec*/,
196 AliHLTOUTHandlerDesc& /*desc*/) const
197{
198 // see header file for class documentation
199
200 return 0;
201}
202
203AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
204 AliHLTUInt32_t /*spec*/)
205{
206 // see header file for class documentation
ec6160d5 207
208 return NULL;
209}
210
211int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
212{
213 // see header file for class documentation
214 if (pInstance==NULL) return -EINVAL;
215
216 return 0;
217}