]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliHLTGlobalAgent.cxx
New method PrepareToRead to be able of using the container without the runloader
[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
a1ac3d83 85 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
6595fdc6 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(), "");
96bad4f8 108
109 ///////////////////////////////////////////////////////////////////////////////////////////////////
110 //
111 // global vertexer component
112 //
113 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer","GLOBAL-esd-converter","");
114
115 ///////////////////////////////////////////////////////////////////////////////////////////////////
116 //
117 // global histograms
118 //
119 TString vertexhistoInput="GLOBAL-vertexer";
120 if (pHandler->FindConfiguration("ITS-SPD-vertexer")) {
121 vertexhistoInput+=" ITS-SPD-vertexer";
122 }
123 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
6595fdc6 124
ec6160d5 125 return 0;
126}
127
6595fdc6 128const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
129 AliRunLoader* runloader) const
ec6160d5 130{
131 // see header file for class documentation
6595fdc6 132 if (runloader) {
133 // reconstruction chains for AliRoot simulation
134 // Note: run loader is only available while running embedded into
135 // AliRoot simulation
136 return "GLOBAL-esd-converter";
ec6160d5 137 }
6595fdc6 138 return NULL;
139}
140
141const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
142{
143 // see header file for class documentation
144
145 return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so";
146}
147
148int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
149 AliHLTUInt32_t /*spec*/,
150 AliHLTOUTHandlerDesc& /*desc*/) const
151{
152 // see header file for class documentation
153
154 return 0;
155}
156
157AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
158 AliHLTUInt32_t /*spec*/)
159{
160 // see header file for class documentation
ec6160d5 161
162 return NULL;
163}
164
165int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
166{
167 // see header file for class documentation
168 if (pInstance==NULL) return -EINVAL;
169
170 return 0;
171}