]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliHLTGlobalAgent.cxx
adding TSystem header, needed for the component to be ported to v4-17-Release
[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"
ec6160d5 30
31// header files of library components
18ada816 32#include "AliHLTGlobalTrackMergerComponent.h"
6595fdc6 33#include "AliHLTGlobalEsdConverterComponent.h"
4d5ee3db 34#include "AliHLTGlobalVertexerComponent.h"
8125805f 35#include "AliHLTV0HistoComponent.h"
de0257eb 36#include "AliHLTGlobalVertexerHistoComponent.h"
e419c1ae 37#include "AliHLTGlobalHistoCollector.h"
ec6160d5 38
39/** global instance for agent registration */
40AliHLTGlobalAgent gAliHLTGlobalAgent;
41
42/** ROOT macro for the implementation of ROOT specific class methods */
43ClassImp(AliHLTGlobalAgent)
44
45AliHLTGlobalAgent::AliHLTGlobalAgent()
46 :
47 AliHLTModuleAgent("Global")
48{
49 // see header file for class documentation
50 // or
51 // refer to README to build package
52 // or
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
54}
55
56AliHLTGlobalAgent::~AliHLTGlobalAgent()
57{
58 // see header file for class documentation
59}
60
61int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
62{
63 // see header file for class documentation
64 assert(pHandler);
65 if (!pHandler) return -EINVAL;
18ada816 66 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
6595fdc6 67 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
4d5ee3db 68 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
de0257eb 69 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
8125805f 70 pHandler->AddComponent(new AliHLTV0HistoComponent );
e419c1ae 71 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
ec6160d5 72 return 0;
73}
74
6595fdc6 75int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
76 AliRawReader* /*rawReader*/,
77 AliRunLoader* /*runloader*/) const
ec6160d5 78{
79 // see header file for class documentation
6595fdc6 80 if (!pHandler) return -EINVAL;
81
82 /////////////////////////////////////////////////////////////////////////////////////
83 //
84 // assembly of the global ESD
85
86 // define the inputs to the global ESD
a1ac3d83 87 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
6595fdc6 88
89 // check for the availibility
90 TObjArray* pTokens=esdInputs.Tokenize(" ");
91 esdInputs="";
92 if (pTokens) {
93 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
94 TString module=((TObjString*)pTokens->At(n))->GetString();
95 if (pHandler->FindConfiguration(module.Data())) {
96 esdInputs+=module;
97 esdInputs+=" ";
98 }
99 }
100 delete pTokens;
101 }
ec6160d5 102
6595fdc6 103 if (esdInputs.Length()>0) {
104 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
105 } else {
106 HLTWarning("No inputs to global HLT ESD found");
ec6160d5 107 }
108
6595fdc6 109 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
96bad4f8 110
111 ///////////////////////////////////////////////////////////////////////////////////////////////////
112 //
113 // global vertexer component
114 //
115 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer","GLOBAL-esd-converter","");
116
117 ///////////////////////////////////////////////////////////////////////////////////////////////////
118 //
119 // global histograms
120 //
121 TString vertexhistoInput="GLOBAL-vertexer";
122 if (pHandler->FindConfiguration("ITS-SPD-vertexer")) {
123 vertexhistoInput+=" ITS-SPD-vertexer";
124 }
125 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
6595fdc6 126
ec6160d5 127 return 0;
128}
129
6595fdc6 130const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
131 AliRunLoader* runloader) const
ec6160d5 132{
133 // see header file for class documentation
6595fdc6 134 if (runloader) {
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";
ec6160d5 139 }
6595fdc6 140 return NULL;
141}
142
143const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
144{
145 // see header file for class documentation
146
147 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
148}
149
150int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
151 AliHLTUInt32_t /*spec*/,
152 AliHLTOUTHandlerDesc& /*desc*/) const
153{
154 // see header file for class documentation
155
156 return 0;
157}
158
159AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
160 AliHLTUInt32_t /*spec*/)
161{
162 // see header file for class documentation
ec6160d5 163
164 return NULL;
165}
166
167int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
168{
169 // see header file for class documentation
170 if (pInstance==NULL) return -EINVAL;
171
172 return 0;
173}