]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalAgent.cxx
Hack to get it running with current setup
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalAgent.cxx
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"
27 #include "AliHLTConfigurationHandler.h"
28 #include "TObjString.h"
29 #include "TObjArray.h"
30
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
38 /** global instance for agent registration */
39 AliHLTGlobalAgent gAliHLTGlobalAgent;
40
41 /** ROOT macro for the implementation of ROOT specific class methods */
42 ClassImp(AliHLTGlobalAgent)
43
44 AliHLTGlobalAgent::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
55 AliHLTGlobalAgent::~AliHLTGlobalAgent()
56 {
57   // see header file for class documentation
58 }
59
60 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
61 {
62   // see header file for class documentation
63   assert(pHandler);
64   if (!pHandler) return -EINVAL;
65   pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
66   pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
67   pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
68   pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
69   pHandler->AddComponent(new AliHLTV0HistoComponent );
70   return 0;
71 }
72
73 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
74                                             AliRawReader* /*rawReader*/,
75                                             AliRunLoader* /*runloader*/) const
76 {
77   // see header file for class documentation
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   }
100
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");
105   }
106
107   pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
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(),"");
124   
125   return 0;
126 }
127
128 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
129                                                     AliRunLoader* runloader) const
130 {
131   // see header file for class documentation
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";
137   }
138   return NULL;
139 }
140
141 const 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
148 int 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
157 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
158                                                       AliHLTUInt32_t /*spec*/)
159 {
160   // see header file for class documentation
161
162   return NULL;
163 }
164
165 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
166 {
167   // see header file for class documentation
168   if (pInstance==NULL) return -EINVAL;
169
170   return 0;
171 }