3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 /** @file AliHLTGlobalAgent.cxx
20 @author Matthias Richter
22 @brief Agent of the libAliHLTGlobal library
26 #include "AliHLTGlobalAgent.h"
27 #include "AliHLTConfigurationHandler.h"
28 #include "TObjString.h"
29 #include "TObjArray.h"
31 // header files of library components
32 #include "AliHLTGlobalTrackMergerComponent.h"
33 #include "AliHLTGlobalEsdConverterComponent.h"
34 #include "AliHLTGlobalVertexerComponent.h"
35 #include "AliHLTGlobalOfflineVertexerComponent.h"
36 #include "AliHLTV0HistoComponent.h"
37 #include "AliHLTdNdPtAnalysisComponent.h"
38 #include "AliHLTdNdPtAnalysisMergerComponent.h"
39 #include "AliHLTGlobalVertexerHistoComponent.h"
40 #include "AliHLTGlobalHistoComponent.h"
41 #include "AliHLTGlobalHistoCollector.h"
42 #include "AliHLTGlobalDCSPublisherComponent.h"
43 #include "AliHLTMultiplicityCorrelationsComponent.h"
44 #include "AliHLTPrimaryVertexFinderComponent.h"
45 #include "AliHLTV0FinderComponent.h"
47 /** global instance for agent registration */
48 AliHLTGlobalAgent gAliHLTGlobalAgent;
50 /** ROOT macro for the implementation of ROOT specific class methods */
51 ClassImp(AliHLTGlobalAgent)
53 AliHLTGlobalAgent::AliHLTGlobalAgent()
55 AliHLTModuleAgent("Global")
57 // see header file for class documentation
59 // refer to README to build package
61 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
64 AliHLTGlobalAgent::~AliHLTGlobalAgent()
66 // see header file for class documentation
69 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
71 // see header file for class documentation
73 if (!pHandler) return -EINVAL;
74 pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
75 pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
76 pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
77 pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
78 pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
79 pHandler->AddComponent(new AliHLTGlobalHistoComponent);
80 pHandler->AddComponent(new AliHLTV0HistoComponent );
81 //pHandler->AddComponent(new AliHLTdNdPtAnalysisComponent );
82 //pHandler->AddComponent(new AliHLTdNdPtAnalysisMergerComponent );
83 pHandler->AddComponent(new AliHLTMultiplicityCorrelationsComponent );
84 pHandler->AddComponent(new AliHLTPrimaryVertexFinderComponent);
85 pHandler->AddComponent(new AliHLTV0FinderComponent);
86 pHandler->AddComponent(new AliHLTGlobalHistoCollector );
87 pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
91 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
92 AliRawReader* /*rawReader*/,
93 AliRunLoader* /*runloader*/) const
95 // see header file for class documentation
96 if (!pHandler) return -EINVAL;
97 TObjArray* pTokens=NULL;
99 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 // global vertexer component
104 TString vertexerInputs="TPC-globalmerger ITS-tracker";
106 // check for the availibility
107 pTokens=vertexerInputs.Tokenize(" ");
110 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
111 TString module=((TObjString*)pTokens->At(n))->GetString();
112 if (pHandler->FindConfiguration(module.Data())) {
113 vertexerInputs+=module;
120 if (!vertexerInputs.IsNull()) {
121 HLTInfo("Configuring inputs to global HLT Vertexer: %s", vertexerInputs.Data());
122 pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
124 HLTWarning("No inputs to global HLT Vertexer found");
127 /////////////////////////////////////////////////////////////////////////////////////
129 // assembly of the global ESD
131 // define the inputs to the global ESD
132 TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker GLOBAL-vertexer TPC-dEdx VZERO-RECO";
134 // check for the availibility
135 pTokens=esdInputs.Tokenize(" ");
138 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
139 TString module=((TObjString*)pTokens->At(n))->GetString();
140 if (pHandler->FindConfiguration(module.Data())) {
149 if (esdInputs.Length()>0) {
150 HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
152 HLTWarning("No inputs to global HLT ESD found");
155 pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
157 ///////////////////////////////////////////////////////////////////////////////////////////////////
161 TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
163 // check for the availibility
164 pTokens=vertexhistoInput.Tokenize(" ");
167 for (int n=0; n<pTokens->GetEntriesFast(); n++) {
168 TString module=((TObjString*)pTokens->At(n))->GetString();
169 if (pHandler->FindConfiguration(module.Data())) {
170 vertexhistoInput+=module;
171 vertexhistoInput+=" ";
178 if (!vertexhistoInput.IsNull()) {
179 HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
180 pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
182 HLTWarning("No inputs to global HLT Vertex histogram component found");
185 //pHandler->CreateConfiguration("GLOBAL-dNdPtAnalysis", "dNdPtAnalysis", "GLOBAL-esd-converter", "");
187 pHandler->CreateConfiguration("GLOBAL-MultCorr", "MultiplicityCorrelations", "GLOBAL-esd-converter", "");
192 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
193 AliRunLoader* runloader) const
195 // see header file for class documentation
197 // reconstruction chains for AliRoot simulation
198 // Note: run loader is only available while running embedded into
199 // AliRoot simulation
200 return "GLOBAL-esd-converter";
205 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
207 // see header file for class documentation
212 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
213 AliHLTUInt32_t /*spec*/,
214 AliHLTOUTHandlerDesc& /*desc*/) const
216 // see header file for class documentation
221 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
222 AliHLTUInt32_t /*spec*/)
224 // see header file for class documentation
229 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
231 // see header file for class documentation
232 if (pInstance==NULL) return -EINVAL;