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