3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 /** @file AliHLTGlobalAgent.cxx
20 @author Matthias Richter
22 @brief Agent of the libAliHLTGlobal library
26 #include "AliHLTGlobalAgent.h"
27 #include "AliHLTConfigurationHandler.h"
28 #include "TObjString.h"
29 #include "TObjArray.h"
31 // header files of library components
32 #include "AliHLTGlobalTrackMergerComponent.h"
33 #include "AliHLTGlobalEsdConverterComponent.h"
34 #include "AliHLTGlobalVertexerComponent.h"
35 #include "AliHLTGlobalOfflineVertexerComponent.h"
36 #include "AliHLTV0HistoComponent.h"
37 #include "AliHLTGlobalVertexerHistoComponent.h"
38 #include "AliHLTGlobalHistoComponent.h"
39 #include "AliHLTGlobalHistoCollector.h"
40 #include "AliHLTGlobalDCSPublisherComponent.h"
42 /** global instance for agent registration */
43 AliHLTGlobalAgent gAliHLTGlobalAgent;
45 /** ROOT macro for the implementation of ROOT specific class methods */
46 ClassImp(AliHLTGlobalAgent)
48 AliHLTGlobalAgent::AliHLTGlobalAgent()
50 AliHLTModuleAgent("Global")
52 // see header file for class documentation
54 // refer to README to build package
56 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
59 AliHLTGlobalAgent::~AliHLTGlobalAgent()
61 // see header file for class documentation
64 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
66 // see header file for class documentation
68 if (!pHandler) return -EINVAL;
69 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
70 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
71 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
72 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
73 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
74 pHandler->AddComponent(new AliHLTGlobalHistoComponent);
75 pHandler->AddComponent(new AliHLTV0HistoComponent );
76 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
77 pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
81 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
82 AliRawReader* /*rawReader*/,
83 AliRunLoader* /*runloader*/) const
85 // see header file for class documentation
86 if (!pHandler) return -EINVAL;
87 TObjArray* pTokens=NULL;
89 ///////////////////////////////////////////////////////////////////////////////////////////////////
91 // global vertexer component
94 TString vertexerInputs="TPC-globalmerger ITS-tracker";
96 // check for the availibility
97 pTokens=vertexerInputs.Tokenize(" ");
100 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
101 TString module=((TObjString*)pTokens->At(n))->GetString();
102 if (pHandler->FindConfiguration(module.Data())) {
103 vertexerInputs+=module;
110 if (!vertexerInputs.IsNull()) {
111 HLTInfo("Configuring inputs to global HLT Vertexer: %s", vertexerInputs.Data());
112 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
114 HLTWarning("No inputs to global HLT Vertexer found");
117 /////////////////////////////////////////////////////////////////////////////////////
119 // assembly of the global ESD
121 // define the inputs to the global ESD
122 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker GLOBAL-vertexer TPC-dEdx VZERO-RECO";
124 // check for the availibility
125 pTokens=esdInputs.Tokenize(" ");
128 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
129 TString module=((TObjString*)pTokens->At(n))->GetString();
130 if (pHandler->FindConfiguration(module.Data())) {
139 if (esdInputs.Length()>0) {
140 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
142 HLTWarning("No inputs to global HLT ESD found");
145 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
147 ///////////////////////////////////////////////////////////////////////////////////////////////////
151 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
153 // check for the availibility
154 pTokens=vertexhistoInput.Tokenize(" ");
157 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
158 TString module=((TObjString*)pTokens->At(n))->GetString();
159 if (pHandler->FindConfiguration(module.Data())) {
160 vertexhistoInput+=module;
161 vertexhistoInput+=" ";
168 if (!vertexhistoInput.IsNull()) {
169 HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
170 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
172 HLTWarning("No inputs to global HLT Vertex histogram component found");
178 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
179 AliRunLoader* runloader) const
181 // see header file for class documentation
183 // reconstruction chains for AliRoot simulation
184 // Note: run loader is only available while running embedded into
185 // AliRoot simulation
186 return "GLOBAL-esd-converter";
191 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
193 // see header file for class documentation
198 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
199 AliHLTUInt32_t /*spec*/,
200 AliHLTOUTHandlerDesc& /*desc*/) const
202 // see header file for class documentation
207 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
208 AliHLTUInt32_t /*spec*/)
210 // see header file for class documentation
215 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
217 // see header file for class documentation
218 if (pInstance==NULL) return -EINVAL;