adding more default configurations
[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"
ec6160d5 37
38/** global instance for agent registration */
39AliHLTGlobalAgent gAliHLTGlobalAgent;
40
41/** ROOT macro for the implementation of ROOT specific class methods */
42ClassImp(AliHLTGlobalAgent)
43
44AliHLTGlobalAgent::AliHLTGlobalAgent()
45 :
46 AliHLTModuleAgent("Global")
47{
48 // see header file for class documentation
49 // or
50 // refer to README to build package
51 // or
52 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
53}
54
55AliHLTGlobalAgent::~AliHLTGlobalAgent()
56{
57 // see header file for class documentation
58}
59
60int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
61{
62 // see header file for class documentation
63 assert(pHandler);
64 if (!pHandler) return -EINVAL;
18ada816 65 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
6595fdc6 66 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
4d5ee3db 67 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
de0257eb 68 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
8125805f 69 pHandler->AddComponent(new AliHLTV0HistoComponent );
ec6160d5 70 return 0;
71}
72
6595fdc6 73int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
74 AliRawReader* /*rawReader*/,
75 AliRunLoader* /*runloader*/) const
ec6160d5 76{
77 // see header file for class documentation
6595fdc6 78 if (!pHandler) return -EINVAL;
79
80 /////////////////////////////////////////////////////////////////////////////////////
81 //
82 // assembly of the global ESD
83
84 // define the inputs to the global ESD
85 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
86
87 // check for the availibility
88 TObjArray* pTokens=esdInputs.Tokenize(" ");
89 esdInputs="";
90 if (pTokens) {
91 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
92 TString module=((TObjString*)pTokens->At(n))->GetString();
93 if (pHandler->FindConfiguration(module.Data())) {
94 esdInputs+=module;
95 esdInputs+=" ";
96 }
97 }
98 delete pTokens;
99 }
ec6160d5 100
6595fdc6 101 if (esdInputs.Length()>0) {
102 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
103 } else {
104 HLTWarning("No inputs to global HLT ESD found");
ec6160d5 105 }
106
6595fdc6 107 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
108
ec6160d5 109 return 0;
110}
111
6595fdc6 112const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
113 AliRunLoader* runloader) const
ec6160d5 114{
115 // see header file for class documentation
6595fdc6 116 if (runloader) {
117 // reconstruction chains for AliRoot simulation
118 // Note: run loader is only available while running embedded into
119 // AliRoot simulation
120 return "GLOBAL-esd-converter";
ec6160d5 121 }
6595fdc6 122 return NULL;
123}
124
125const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
126{
127 // see header file for class documentation
128
129 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
130}
131
132int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
133 AliHLTUInt32_t /*spec*/,
134 AliHLTOUTHandlerDesc& /*desc*/) const
135{
136 // see header file for class documentation
137
138 return 0;
139}
140
141AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
142 AliHLTUInt32_t /*spec*/)
143{
144 // see header file for class documentation
ec6160d5 145
146 return NULL;
147}
148
149int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
150{
151 // see header file for class documentation
152 if (pInstance==NULL) return -EINVAL;
153
154 return 0;
155}