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 "AliHLTV0HistoComponent.h"
36 #include "AliHLTGlobalVertexerHistoComponent.h"
37 #include "AliHLTGlobalHistoCollector.h"
39 /** global instance for agent registration */
40 AliHLTGlobalAgent gAliHLTGlobalAgent;
42 /** ROOT macro for the implementation of ROOT specific class methods */
43 ClassImp(AliHLTGlobalAgent)
45 AliHLTGlobalAgent::AliHLTGlobalAgent()
47 AliHLTModuleAgent("Global")
49 // see header file for class documentation
51 // refer to README to build package
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 AliHLTGlobalAgent::~AliHLTGlobalAgent()
58 // see header file for class documentation
61 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
63 // see header file for class documentation
65 if (!pHandler) return -EINVAL;
66 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
67 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
68 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
69 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
70 pHandler->AddComponent(new AliHLTV0HistoComponent );
71 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
75 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
76 AliRawReader* /*rawReader*/,
77 AliRunLoader* /*runloader*/) const
79 // see header file for class documentation
80 if (!pHandler) return -EINVAL;
82 /////////////////////////////////////////////////////////////////////////////////////
84 // assembly of the global ESD
86 // define the inputs to the global ESD
87 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
89 // check for the availibility
90 TObjArray* pTokens=esdInputs.Tokenize(" ");
93 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
94 TString module=((TObjString*)pTokens->At(n))->GetString();
95 if (pHandler->FindConfiguration(module.Data())) {
103 if (esdInputs.Length()>0) {
104 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
106 HLTWarning("No inputs to global HLT ESD found");
109 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
111 ///////////////////////////////////////////////////////////////////////////////////////////////////
113 // global vertexer component
115 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer","GLOBAL-esd-converter","");
117 ///////////////////////////////////////////////////////////////////////////////////////////////////
121 TString vertexhistoInput="GLOBAL-vertexer";
122 if (pHandler->FindConfiguration("ITS-SPD-vertexer")) {
123 vertexhistoInput+=" ITS-SPD-vertexer";
125 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
130 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
131 AliRunLoader* runloader) const
133 // see header file for class documentation
135 // reconstruction chains for AliRoot simulation
136 // Note: run loader is only available while running embedded into
137 // AliRoot simulation
138 return "GLOBAL-esd-converter";
143 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
145 // see header file for class documentation
147 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
150 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
151 AliHLTUInt32_t /*spec*/,
152 AliHLTOUTHandlerDesc& /*desc*/) const
154 // see header file for class documentation
159 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
160 AliHLTUInt32_t /*spec*/)
162 // see header file for class documentation
167 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
169 // see header file for class documentation
170 if (pInstance==NULL) return -EINVAL;