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