3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 /** @file AliHLTGlobalAgent.cxx
20 @author Matthias Richter
22 @brief Agent of the libAliHLTGlobal library
26 #include "AliHLTGlobalAgent.h"
27 #include "AliHLTConfigurationHandler.h"
28 #include "TObjString.h"
29 #include "TObjArray.h"
30 #include "AliHLTGlobalFlatEsdTestComponent.h"
32 // header files of library components
33 #include "AliHLTGlobalTrackMergerComponent.h"
34 #include "AliHLTGlobalCompareFlatComponent.h"
35 #include "AliHLTGlobalEsdToFlatConverterComponent.h"
36 #include "AliHLTGlobalFlatEsdConverterComponent.h"
37 #include "AliHLTGlobalEsdConverterComponent.h"
38 #include "AliHLTGlobalVertexerComponent.h"
39 #include "AliHLTGlobalOfflineVertexerComponent.h"
40 #include "AliHLTV0HistoComponent.h"
41 #include "AliHLTdNdPtAnalysisComponent.h"
42 #include "AliHLTdNdPtAnalysisMergerComponent.h"
43 #include "AliHLTGlobalVertexerHistoComponent.h"
44 #include "AliHLTGlobalHistoComponent.h"
45 #include "AliHLTGlobalHistoCollector.h"
46 #include "AliHLTGlobalDCSPublisherComponent.h"
47 #include "AliHLTMultiplicityCorrelationsComponent.h"
48 #include "AliHLTPrimaryVertexFinderComponent.h"
49 #include "AliHLTV0FinderComponent.h"
50 #include "AliHLTAnaManagerComponent.h"
51 #include "AliHLTFlatAnaManagerComponent.h"
53 // header file for preprocessor plugin
54 #include "AliHLTGlobalPreprocessor.h"
56 /** global instance for agent registration */
57 AliHLTGlobalAgent gAliHLTGlobalAgent;
59 /** ROOT macro for the implementation of ROOT specific class methods */
60 ClassImp(AliHLTGlobalAgent)
62 AliHLTGlobalAgent::AliHLTGlobalAgent()
64 AliHLTModuleAgent("Global")
66 // see header file for class documentation
68 // refer to README to build package
70 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
73 AliHLTGlobalAgent::~AliHLTGlobalAgent()
75 // see header file for class documentation
78 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
80 // see header file for class documentation
82 if (!pHandler) return -EINVAL;
83 pHandler->AddComponent(new AliHLTGlobalEsdToFlatConverterComponent);
84 pHandler->AddComponent(new AliHLTGlobalCompareFlatComponent);
85 pHandler->AddComponent(new AliHLTGlobalFlatEsdTestComponent);
86 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
87 pHandler->AddComponent(new AliHLTGlobalFlatEsdConverterComponent);
88 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
89 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
90 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
91 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
92 pHandler->AddComponent(new AliHLTGlobalHistoComponent);
93 pHandler->AddComponent(new AliHLTV0HistoComponent );
94 //pHandler->AddComponent(new AliHLTdNdPtAnalysisComponent );
95 //pHandler->AddComponent(new AliHLTdNdPtAnalysisMergerComponent );
96 pHandler->AddComponent(new AliHLTMultiplicityCorrelationsComponent );
97 pHandler->AddComponent(new AliHLTPrimaryVertexFinderComponent);
98 pHandler->AddComponent(new AliHLTV0FinderComponent);
99 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
100 pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
101 pHandler->AddComponent(new AliHLTAnaManagerComponent);
102 pHandler->AddComponent(new AliHLTFlatAnaManagerComponent);
106 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
107 AliRawReader* /*rawReader*/,
108 AliRunLoader* /*runloader*/) const
110 // see header file for class documentation
111 if (!pHandler) return -EINVAL;
112 TObjArray* pTokens=NULL;
114 ///////////////////////////////////////////////////////////////////////////////////////////////////
116 // global vertexer component
119 TString vertexerInputs="TPC-globalmerger ITS-tracker";
121 // check for the availibility
122 pTokens=vertexerInputs.Tokenize(" ");
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;
135 cout<<endl<<"\n\nConfiguring inputs to global HLT Vertexer: %s\n\n"<<vertexerInputs.Data()<<endl<<endl;
136 if (!vertexerInputs.IsNull()) {
137 HLTInfo("\n\nConfiguring inputs to global HLT Vertexer: %s\n\n", vertexerInputs.Data());
138 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
140 HLTWarning("\n\nNo inputs to global HLT Vertexer found\n\n");
143 /////////////////////////////////////////////////////////////////////////////////////
145 // assembly of the global ESD
147 // define the inputs to the global ESD
148 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker TPC-ClusterTransformation GLOBAL-vertexer ITS-SPD-vertexer TPC-dEdx VZERO-RECO ITS-SAPtracker";
150 // check for the availibility
151 pTokens=esdInputs.Tokenize(" ");
154 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
155 TString module=((TObjString*)pTokens->At(n))->GetString();
156 if (pHandler->FindConfiguration(module.Data())) {
165 if (esdInputs.Length()>0) {
166 esdInputs+=" TPC-ClusterTransformation";
167 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
169 HLTWarning("No inputs to global HLT ESD found");
172 pHandler->CreateConfiguration("GLOBAL-flat-esd-converter", "GlobalFlatEsdConverter", esdInputs.Data(), "");
173 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
174 pHandler->CreateConfiguration("GLOBAL-flat-esd-test", "GlobalFlatEsdTest", "GLOBAL-esd-converter GLOBAL-flat-esd-converter", "");
175 pHandler->CreateConfiguration("esd-to-flat-conversion", "GlobalEsdToFlatConverter", "GLOBAL-esd-converter", "");
176 pHandler->CreateConfiguration("compare-flat", "GlobalCompareFlat", "GLOBAL-flat-esd-converter esd-to-flat-conversion", "");
177 //pHandler->CreateConfiguration("compare-flat", "GlobalCompareFlat", "GLOBAL-flat-esd-converter", "");
179 ///////////////////////////////////////////////////////////////////////////////////////////////////
183 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
185 // check for the availibility
186 pTokens=vertexhistoInput.Tokenize(" ");
189 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
190 TString module=((TObjString*)pTokens->At(n))->GetString();
191 if (pHandler->FindConfiguration(module.Data())) {
192 vertexhistoInput+=module;
193 vertexhistoInput+=" ";
200 if (!vertexhistoInput.IsNull()) {
201 HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
202 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
204 HLTWarning("No inputs to global HLT Vertex histogram component found");
207 //pHandler->CreateConfiguration("GLOBAL-dNdPtAnalysis", "dNdPtAnalysis", "GLOBAL-esd-converter", "");
209 pHandler->CreateConfiguration("GLOBAL-MultCorr", "MultiplicityCorrelations", "GLOBAL-esd-converter", "");
214 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
215 AliRunLoader* runloader) const
217 // see header file for class documentation
219 // reconstruction chains for AliRoot simulation
220 // Note: run loader is only available while running embedded into
221 // AliRoot simulation
222 return "GLOBAL-esd-converter";
227 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
229 // see header file for class documentation
234 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
235 AliHLTUInt32_t /*spec*/,
236 AliHLTOUTHandlerDesc& /*desc*/) const
238 // see header file for class documentation
243 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
244 AliHLTUInt32_t /*spec*/)
246 // see header file for class documentation
251 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
253 // see header file for class documentation
254 if (pInstance==NULL) return -EINVAL;
259 AliHLTModulePreprocessor* AliHLTGlobalAgent::GetPreprocessor()
261 // create the preprocessor plugin
262 return new AliHLTGlobalPreprocessor;