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