]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalAgent.cxx
changed max matching distance to 40cm in globaltrackmatcher
[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 #include "AliHLTGlobalHistoCollector.h"
38
39 /** global instance for agent registration */
40 AliHLTGlobalAgent gAliHLTGlobalAgent;
41
42 /** ROOT macro for the implementation of ROOT specific class methods */
43 ClassImp(AliHLTGlobalAgent)
44
45 AliHLTGlobalAgent::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
56 AliHLTGlobalAgent::~AliHLTGlobalAgent()
57 {
58   // see header file for class documentation
59 }
60
61 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
62 {
63   // see header file for class documentation
64   assert(pHandler);
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 );
72   return 0;
73 }
74
75 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
76                                             AliRawReader* /*rawReader*/,
77                                             AliRunLoader* /*runloader*/) const
78 {
79   // see header file for class documentation
80   if (!pHandler) return -EINVAL;
81
82   /////////////////////////////////////////////////////////////////////////////////////
83   //
84   // assembly of the global ESD
85
86   // define the inputs to the global ESD
87   TString esdInputs="TPC-globalmerger TPC-mcTrackMarker";
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   }
102
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");
107   }
108
109   pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
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(),"");
126   
127   return 0;
128 }
129
130 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
131                                                     AliRunLoader* runloader) const
132 {
133   // see header file for class documentation
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";
139   }
140   return NULL;
141 }
142
143 const 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
150 int 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
159 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
160                                                       AliHLTUInt32_t /*spec*/)
161 {
162   // see header file for class documentation
163
164   return NULL;
165 }
166
167 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
168 {
169   // see header file for class documentation
170   if (pInstance==NULL) return -EINVAL;
171
172   return 0;
173 }