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