]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalAgent.cxx
Add output of VZERO reco directly to multCorr
[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 "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
45 /** global instance for agent registration */
46 AliHLTGlobalAgent gAliHLTGlobalAgent;
47
48 /** ROOT macro for the implementation of ROOT specific class methods */
49 ClassImp(AliHLTGlobalAgent)
50
51 AliHLTGlobalAgent::AliHLTGlobalAgent()
52   :
53   AliHLTModuleAgent("Global")
54 {
55   // see header file for class documentation
56   // or
57   // refer to README to build package
58   // or
59   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
60 }
61
62 AliHLTGlobalAgent::~AliHLTGlobalAgent()
63 {
64   // see header file for class documentation
65 }
66
67 int AliHLTGlobalAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
68 {
69   // see header file for class documentation
70   assert(pHandler);
71   if (!pHandler) return -EINVAL;
72   pHandler->AddComponent(new AliHLTGlobalTrackMergerComponent);
73   pHandler->AddComponent(new AliHLTGlobalEsdConverterComponent);
74   pHandler->AddComponent(new AliHLTGlobalVertexerComponent);
75   pHandler->AddComponent(new AliHLTGlobalOfflineVertexerComponent);
76   pHandler->AddComponent(new AliHLTGlobalVertexerHistoComponent);
77   pHandler->AddComponent(new AliHLTGlobalHistoComponent);
78   pHandler->AddComponent(new AliHLTV0HistoComponent );
79   //pHandler->AddComponent(new AliHLTdNdPtAnalysisComponent );
80   //pHandler->AddComponent(new AliHLTdNdPtAnalysisMergerComponent );
81   pHandler->AddComponent(new AliHLTMultiplicityCorrelationsComponent );
82   pHandler->AddComponent(new AliHLTGlobalHistoCollector );
83   pHandler->AddComponent(new AliHLTGlobalDCSPublisherComponent );
84   return 0;
85 }
86
87 int AliHLTGlobalAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
88                                             AliRawReader* /*rawReader*/,
89                                             AliRunLoader* /*runloader*/) const
90 {
91   // see header file for class documentation
92   if (!pHandler) return -EINVAL;
93   TObjArray* pTokens=NULL;
94
95   ///////////////////////////////////////////////////////////////////////////////////////////////////
96   //
97   // global vertexer component
98   //
99   // define the inputs 
100   TString vertexerInputs="TPC-globalmerger ITS-tracker";
101
102   // check for the availibility
103   pTokens=vertexerInputs.Tokenize(" ");
104   vertexerInputs="";
105   if (pTokens) {
106     for (int n=0; n<pTokens->GetEntriesFast(); n++) {
107       TString module=((TObjString*)pTokens->At(n))->GetString();
108       if (pHandler->FindConfiguration(module.Data())) {
109         vertexerInputs+=module;
110         vertexerInputs+=" ";
111       }
112     }
113     delete pTokens;
114     pTokens=NULL;
115   }
116   if (!vertexerInputs.IsNull()) {
117     HLTInfo("Configuring inputs to global HLT Vertexer: %s", vertexerInputs.Data());
118     pHandler->CreateConfiguration("GLOBAL-vertexer","GlobalVertexer",vertexerInputs,"");
119   } else {
120     HLTWarning("No inputs to global HLT Vertexer found");
121   }
122
123   /////////////////////////////////////////////////////////////////////////////////////
124   //
125   // assembly of the global ESD
126
127   // define the inputs to the global ESD
128   TString esdInputs="TPC-globalmerger TPC-mcTrackMarker ITS-tracker GLOBAL-vertexer TPC-dEdx VZERO-RECO";
129
130   // check for the availibility
131   pTokens=esdInputs.Tokenize(" ");
132   esdInputs="";
133   if (pTokens) {
134     for (int n=0; n<pTokens->GetEntriesFast(); n++) {
135       TString module=((TObjString*)pTokens->At(n))->GetString();
136       if (pHandler->FindConfiguration(module.Data())) {
137         esdInputs+=module;
138         esdInputs+=" ";
139       }
140     }
141     delete pTokens;
142     pTokens=NULL;
143   }
144
145   if (esdInputs.Length()>0) {
146     HLTInfo("Configuring inputs to global HLT ESD: %s", esdInputs.Data());
147   } else {
148     HLTWarning("No inputs to global HLT ESD found");
149   }
150
151   pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "");
152
153   ///////////////////////////////////////////////////////////////////////////////////////////////////
154   //
155   // global histograms
156   //
157   TString vertexhistoInput="GLOBAL-vertexer ITS-SPD-vertexer";
158
159   // check for the availibility
160   pTokens=vertexhistoInput.Tokenize(" ");
161   vertexhistoInput="";
162   if (pTokens) {
163     for (int n=0; n<pTokens->GetEntriesFast(); n++) {
164       TString module=((TObjString*)pTokens->At(n))->GetString();
165       if (pHandler->FindConfiguration(module.Data())) {
166         vertexhistoInput+=module;
167         vertexhistoInput+=" ";
168       }
169     }
170     delete pTokens;
171     pTokens=NULL;
172   }
173
174   if (!vertexhistoInput.IsNull()) {
175     HLTInfo("Configuring inputs to global HLT Vertex histogram component: %s", vertexhistoInput.Data());
176     pHandler->CreateConfiguration("GLOBAL-vertexhisto","GlobalVertexerHisto", vertexhistoInput.Data(),"");
177   } else {
178     HLTWarning("No inputs to global HLT Vertex histogram component found");
179   }
180   
181   //pHandler->CreateConfiguration("GLOBAL-dNdPtAnalysis", "dNdPtAnalysis", "GLOBAL-esd-converter", "");
182  
183   pHandler->CreateConfiguration("GLOBAL-MultCorr", "MultiplicityCorrelations", "GLOBAL-esd-converter", "");
184
185   return 0;
186 }
187
188 const char* AliHLTGlobalAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
189                                                     AliRunLoader* runloader) const
190 {
191   // see header file for class documentation
192   if (runloader) {
193     // reconstruction chains for AliRoot simulation
194     // Note: run loader is only available while running embedded into
195     // AliRoot simulation
196     return "GLOBAL-esd-converter";    
197   }
198   return NULL;
199 }
200
201 const char* AliHLTGlobalAgent::GetRequiredComponentLibraries() const
202 {
203   // see header file for class documentation
204
205   return "";
206 }
207
208 int AliHLTGlobalAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
209                                              AliHLTUInt32_t /*spec*/,
210                                              AliHLTOUTHandlerDesc& /*desc*/) const
211 {
212   // see header file for class documentation
213
214   return 0;
215 }
216
217 AliHLTOUTHandler* AliHLTGlobalAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
218                                                       AliHLTUInt32_t /*spec*/)
219 {
220   // see header file for class documentation
221
222   return NULL;
223 }
224
225 int AliHLTGlobalAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
226 {
227   // see header file for class documentation
228   if (pInstance==NULL) return -EINVAL;
229
230   return 0;
231 }