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