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