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 "AliHLTGlobalEsdToFlatConverterComponent.h"
35 #include "AliHLTGlobalFlatEsdConverterComponent.h"
36 #include "AliHLTGlobalEsdConverterComponent.h"
37 #include "AliHLTGlobalVertexerComponent.h"
38 #include "AliHLTGlobalOfflineVertexerComponent.h"
39 #include "AliHLTV0HistoComponent.h"
40 #include "AliHLTdNdPtAnalysisComponent.h"
41 #include "AliHLTdNdPtAnalysisMergerComponent.h"
42 #include "AliHLTGlobalVertexerHistoComponent.h"
43 #include "AliHLTGlobalHistoComponent.h"
44 #include "AliHLTGlobalHistoCollector.h"
45 #include "AliHLTGlobalDCSPublisherComponent.h"
46 #include "AliHLTMultiplicityCorrelationsComponent.h"
47 #include "AliHLTPrimaryVertexFinderComponent.h"
48 #include "AliHLTV0FinderComponent.h"
49 #include "AliHLTAnaManagerComponent.h"
50 #include "AliHLTFlatAnaManagerComponent.h"
52 // header file for preprocessor plugin
53 #include "AliHLTGlobalPreprocessor.h"
55 /** global instance for agent registration */
56 AliHLTGlobalAgent gAliHLTGlobalAgent;
58 /** ROOT macro for the implementation of ROOT specific class methods */
59 ClassImp(AliHLTGlobalAgent)
61 AliHLTGlobalAgent::AliHLTGlobalAgent()
63 AliHLTModuleAgent("Global")
65 // see header file for class documentation
67 // refer to README to build package
69 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
72 AliHLTGlobalAgent::~AliHLTGlobalAgent()
74 // see header file for class documentation
77 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
79 // see header file for class documentation
81 if (!pHandler) return -EINVAL;
82 //pHandler->AddComponent(new AliHLTGlobalEsdToFlatConverterComponent);
83 pHandler->AddComponent(new AliHLTGlobalFlatEsdTestComponent);
84 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
85 pHandler->AddComponent(new AliHLTGlobalFlatEsdConverterComponent);
86 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
87 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
88 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
89 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
90 pHandler->AddComponent(new AliHLTGlobalHistoComponent);
91 pHandler->AddComponent(new AliHLTV0HistoComponent );
92 //pHandler->AddComponent(new AliHLTdNdPtAnalysisComponent );
93 //pHandler->AddComponent(new AliHLTdNdPtAnalysisMergerComponent );
94 pHandler->AddComponent(new AliHLTMultiplicityCorrelationsComponent );
95 pHandler->AddComponent(new AliHLTPrimaryVertexFinderComponent);
96 pHandler->AddComponent(new AliHLTV0FinderComponent);
97 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
98 pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
99 pHandler->AddComponent(new AliHLTAnaManagerComponent);
100 pHandler->AddComponent(new AliHLTFlatAnaManagerComponent);
104 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
105 AliRawReader* /*rawReader*/,
106 AliRunLoader* /*runloader*/) const
108 // see header file for class documentation
109 if (!pHandler) return -EINVAL;
110 TObjArray* pTokens=NULL;
112 ///////////////////////////////////////////////////////////////////////////////////////////////////
114 // global vertexer component
117 TString vertexerInputs="TPC-globalmerger ITS-tracker";
119 // check for the availibility
120 pTokens=vertexerInputs.Tokenize(" ");
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;
133 cout<<endl<<"\n\nConfiguring inputs to global HLT Vertexer: %s\n\n"<<vertexerInputs.Data()<<endl<<endl;
134 if (!vertexerInputs.IsNull()) {
135 HLTInfo("\n\nConfiguring inputs to global HLT Vertexer: %s\n\n", vertexerInputs.Data());
136 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
138 HLTWarning("\n\nNo inputs to global HLT Vertexer found\n\n");
141 /////////////////////////////////////////////////////////////////////////////////////
143 // assembly of the global ESD
145 // define the inputs to the global ESD
146 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker TPC-ClusterTransformation GLOBAL-vertexer ITS-SPD-vertexer TPC-dEdx VZERO-RECO";
148 // check for the availibility
149 pTokens=esdInputs.Tokenize(" ");
152 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
153 TString module=((TObjString*)pTokens->At(n))->GetString();
154 if (pHandler->FindConfiguration(module.Data())) {
163 if (esdInputs.Length()>0) {
164 esdInputs+=" TPC-ClusterTransformation";
165 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
167 HLTWarning("No inputs to global HLT ESD found");
170 pHandler->CreateConfiguration("GLOBAL-flat-esd-converter", "GlobalFlatEsdConverter", esdInputs.Data(), "");
171 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
172 pHandler->CreateConfiguration("GLOBAL-flat-esd-test", "GlobalFlatEsdTest", "GLOBAL-esd-converter GLOBAL-flat-esd-converter", "");
173 //pHandler->CreateConfiguration("esd-to-flat-conversion", "GlobalEsdToFlatConverter", "GLOBAL-esd-converter", "");
175 ///////////////////////////////////////////////////////////////////////////////////////////////////
179 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
181 // check for the availibility
182 pTokens=vertexhistoInput.Tokenize(" ");
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+=" ";
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(),"");
200 HLTWarning("No inputs to global HLT Vertex histogram component found");
203 //pHandler->CreateConfiguration("GLOBAL-dNdPtAnalysis", "dNdPtAnalysis", "GLOBAL-esd-converter", "");
205 pHandler->CreateConfiguration("GLOBAL-MultCorr", "MultiplicityCorrelations", "GLOBAL-esd-converter", "");
210 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
211 AliRunLoader* runloader) const
213 // see header file for class documentation
215 // reconstruction chains for AliRoot simulation
216 // Note: run loader is only available while running embedded into
217 // AliRoot simulation
218 return "GLOBAL-esd-converter";
223 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
225 // see header file for class documentation
230 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
231 AliHLTUInt32_t /*spec*/,
232 AliHLTOUTHandlerDesc& /*desc*/) const
234 // see header file for class documentation
239 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
240 AliHLTUInt32_t /*spec*/)
242 // see header file for class documentation
247 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
249 // see header file for class documentation
250 if (pInstance==NULL) return -EINVAL;
255 AliHLTModulePreprocessor* AliHLTGlobalAgent::GetPreprocessor()
257 // create the preprocessor plugin
258 return new AliHLTGlobalPreprocessor;