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"
31 // header files of library components
32 #include "AliHLTGlobalTrackMergerComponent.h"
33 #include "AliHLTGlobalEsdConverterComponent.h"
34 #include "AliHLTGlobalVertexerComponent.h"
35 #include "AliHLTGlobalOfflineVertexerComponent.h"
36 #include "AliHLTV0HistoComponent.h"
37 #include "AliHLTdNdPtAnalysisComponent.h"
38 #include "AliHLTdNdPtAnalysisMergerComponent.h"
39 #include "AliHLTGlobalVertexerHistoComponent.h"
40 #include "AliHLTGlobalHistoComponent.h"
41 #include "AliHLTGlobalHistoCollector.h"
42 #include "AliHLTGlobalDCSPublisherComponent.h"
43 #include "AliHLTMultiplicityCorrelationsComponent.h"
45 /** global instance for agent registration */
46 AliHLTGlobalAgent gAliHLTGlobalAgent;
48 /** ROOT macro for the implementation of ROOT specific class methods */
49 ClassImp(AliHLTGlobalAgent)
51 AliHLTGlobalAgent::AliHLTGlobalAgent()
53 AliHLTModuleAgent("Global")
55 // see header file for class documentation
57 // refer to README to build package
59 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
62 AliHLTGlobalAgent::~AliHLTGlobalAgent()
64 // see header file for class documentation
67 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
69 // see header file for class documentation
71 if (!pHandler) return -EINVAL;
72 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
73 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
74 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
75 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
76 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
77 pHandler->AddComponent(new AliHLTGlobalHistoComponent);
78 pHandler->AddComponent(new AliHLTV0HistoComponent );
79 //pHandler->AddComponent(new AliHLTdNdPtAnalysisComponent );
80 //pHandler->AddComponent(new AliHLTdNdPtAnalysisMergerComponent );
81 pHandler->AddComponent(new AliHLTMultiplicityCorrelationsComponent );
82 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
83 pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
87 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
88 AliRawReader* /*rawReader*/,
89 AliRunLoader* /*runloader*/) const
91 // see header file for class documentation
92 if (!pHandler) return -EINVAL;
93 TObjArray* pTokens=NULL;
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
97 // global vertexer component
100 TString vertexerInputs="TPC-globalmerger ITS-tracker";
102 // check for the availibility
103 pTokens=vertexerInputs.Tokenize(" ");
106 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
107 TString module=((TObjString*)pTokens->At(n))->GetString();
108 if (pHandler->FindConfiguration(module.Data())) {
109 vertexerInputs+=module;
116 if (!vertexerInputs.IsNull()) {
117 HLTInfo("Configuring inputs to global HLT Vertexer: %s", vertexerInputs.Data());
118 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
120 HLTWarning("No inputs to global HLT Vertexer found");
123 /////////////////////////////////////////////////////////////////////////////////////
125 // assembly of the global ESD
127 // define the inputs to the global ESD
128 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker GLOBAL-vertexer TPC-dEdx VZERO-RECO";
130 // check for the availibility
131 pTokens=esdInputs.Tokenize(" ");
134 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
135 TString module=((TObjString*)pTokens->At(n))->GetString();
136 if (pHandler->FindConfiguration(module.Data())) {
145 if (esdInputs.Length()>0) {
146 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
148 HLTWarning("No inputs to global HLT ESD found");
151 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
153 ///////////////////////////////////////////////////////////////////////////////////////////////////
157 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
159 // check for the availibility
160 pTokens=vertexhistoInput.Tokenize(" ");
163 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
164 TString module=((TObjString*)pTokens->At(n))->GetString();
165 if (pHandler->FindConfiguration(module.Data())) {
166 vertexhistoInput+=module;
167 vertexhistoInput+=" ";
174 if (!vertexhistoInput.IsNull()) {
175 HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
176 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
178 HLTWarning("No inputs to global HLT Vertex histogram component found");
181 //pHandler->CreateConfiguration("GLOBAL-dNdPtAnalysis", "dNdPtAnalysis", "GLOBAL-esd-converter", "");
183 pHandler->CreateConfiguration("GLOBAL-MultCorr", "MultiplicityCorrelations", "GLOBAL-esd-converter", "");
188 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
189 AliRunLoader* runloader) const
191 // see header file for class documentation
193 // reconstruction chains for AliRoot simulation
194 // Note: run loader is only available while running embedded into
195 // AliRoot simulation
196 return "GLOBAL-esd-converter";
201 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
203 // see header file for class documentation
208 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
209 AliHLTUInt32_t /*spec*/,
210 AliHLTOUTHandlerDesc& /*desc*/) const
212 // see header file for class documentation
217 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
218 AliHLTUInt32_t /*spec*/)
220 // see header file for class documentation
225 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
227 // see header file for class documentation
228 if (pInstance==NULL) return -EINVAL;