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