]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/OfflineInterface/AliHLTMUONAgent.cxx
New dependancy introduced into libAliHLTUtil.so
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONAgent.cxx
CommitLineData
d1ff7c16 1/**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
1d8ae082 16// $Id$
d1ff7c16 17
6253e09b 18///
19/// @file AliHLTMUONAgent.cxx
20/// @author Artur Szostak <artursz@iafrica.com>
887a669c 21/// @date 28 May 2007
6253e09b 22/// @brief Implementation of the AliHLTMUONAgent class.
23///
d1ff7c16 24
25#include "AliHLTMUONAgent.h"
887a669c 26#include "AliHLTMUONConstants.h"
6253e09b 27#include "AliHLTMUONRecHitsSource.h"
28#include "AliHLTMUONTriggerRecordsSource.h"
887a669c 29#include "AliHLTMUONDigitPublisherComponent.h"
6253e09b 30#include "AliHLTMUONRootifierComponent.h"
31#include "AliHLTMUONHitReconstructorComponent.h"
32#include "AliHLTMUONTriggerReconstructorComponent.h"
33#include "AliHLTMUONMansoTrackerFSMComponent.h"
52c6d8aa 34#include "AliHLTMUONFullTrackerComponent.h"
c9537879 35#include "AliHLTMUONDecisionComponent.h"
649ab027 36#include "AliHLTMUONESDMaker.h"
0528e93a 37#include "AliHLTMUONEmptyEventFilterComponent.h"
dba14d7d 38#include "AliHLTMUONDataCheckerComponent.h"
17d68f2a 39#include "AliHLTMUONClusterFinderComponent.h"
a63da6d6 40#include "AliHLTMUONRawDataHistoComponent.h"
f064ef44 41#include "AliHLTMUONClusterHistoComponent.h"
94135365 42#include "AliHLTOUTHandlerChain.h"
352670bf 43#include "AliRawReader.h"
d1ff7c16 44#include "AliRunLoader.h"
a252a44b 45#include "AliRun.h"
46#include "AliMUON.h"
887a669c 47#include "TSystem.h"
a252a44b 48#include "TObjArray.h"
887a669c 49#include "TString.h"
d1ff7c16 50
6253e09b 51// The single global instance of the dimuon HLT agent.
52AliHLTMUONAgent AliHLTMUONAgent::fgkInstance;
d1ff7c16 53
94135365 54AliHLTOUTHandlerChain AliHLTMUONAgent::fgkESDMakerChain("libAliHLTMUON.so chains=dHLT-make-esd");
55AliHLTOUTHandlerChain AliHLTMUONAgent::fgkRootifyDumpChain("libAliHLTMUON.so chains=dHLT-rootify-and-dump");
a252a44b 56Int_t AliHLTMUONAgent::fgMuonModuleLoaded = 0;
0d716b5f 57bool AliHLTMUONAgent::fgRunRootifyChain = false;
94135365 58
59
d1ff7c16 60ClassImp(AliHLTMUONAgent);
61
62
a252a44b 63bool AliHLTMUONAgent::IsMuonModuleLoaded()
64{
59d9bb69 65 /// Checks to see if the MUON module is loaded or not.
a252a44b 66
67 // If the check was already done then use the cached value.
68 if (fgMuonModuleLoaded > 0) return true;
69 if (fgMuonModuleLoaded < 0) return false;
70
a252a44b 71 if (gAlice != NULL)
72 {
73 // Search for a module in gAlice deriving from AliMUON.
74 TIter next(gAlice->Modules());
75 TObject* mod = NULL;
76 while ((mod = next()) != NULL)
77 {
42d1b43c 78 if (mod->InheritsFrom(AliMUON::Class()))
a252a44b 79 {
80 fgMuonModuleLoaded = 1;
81 return true;
82 }
83 }
84 }
59d9bb69 85
86 fgMuonModuleLoaded = -1;
87 return false;
a252a44b 88}
89
90
626bfcc1 91AliHLTMUONAgent::AliHLTMUONAgent() : AliHLTModuleAgent("MUON")
d1ff7c16 92{
6253e09b 93 ///
94 /// Default constructor.
95 ///
d1ff7c16 96}
97
98AliHLTMUONAgent::~AliHLTMUONAgent()
99{
6253e09b 100 ///
101 /// Default destructor.
102 ///
d1ff7c16 103}
104
887a669c 105const char* AliHLTMUONAgent::GetReconstructionChains(AliRawReader* rawReader,
106 AliRunLoader* runloader
d1ff7c16 107 ) const
108{
6253e09b 109 ///
110 /// Inherited from AliHLTModuleAgent.
111 /// Returns the top processing chain configurations for local event
112 /// reconstruction.
113 /// @param rawReader [in] AliRoot rawreader instance.
114 /// @param runloader [in] AliRoot runloader
115 /// @return string containing the top configurations separated by blanks.
116 ///
887a669c 117 /// If rawReader is not NULL then the standard dHLT chain is run taking
118 /// data from raw DDL data. Otherwise runloader is checked and if it is
119 /// not NULL then a dHLT chain is run with input data from digits.
6253e09b 120
887a669c 121 if (rawReader != NULL)
122 {
352670bf 123 // Check if there is any data from the tracker and trigger.
124 bool dataFromTracker = false;
125 bool dataFromTrigger = false;
126 rawReader->Select("MUONTRK", 0, 19);
127 for (Int_t i = 0; i < 20; i++)
128 {
129 if (rawReader->ReadHeader()) dataFromTracker = true;
130 }
131 rawReader->Select("MUONTRG", 0, 1);
132 for (Int_t i = 0; i < 2; i++)
133 {
134 if (rawReader->ReadHeader()) dataFromTrigger = true;
135 }
a1dcf777 136 rawReader->Reset();
352670bf 137
138 // If raw data was found for our detector then select the
139 // appropriate chain.
140 if (dataFromTracker and dataFromTrigger)
141 return "dHLT-sim-fromRaw";
887a669c 142 }
352670bf 143
144 if (runloader != NULL)
887a669c 145 {
a252a44b 146 // IsMuonModuleLoaded() is used to check if the muon module was loaded
147 // If there is no AliMUON module in the simulation then do not run the
148 // MUON HLT chain.
149 if (IsMuonModuleLoaded() and runloader->GetLoader("MUONLoader") != NULL)
352670bf 150 return "dHLT-sim";
887a669c 151 }
352670bf 152
153 return "";
d1ff7c16 154}
155
156const char* AliHLTMUONAgent::GetRequiredComponentLibraries() const
157{
6253e09b 158 ///
159 /// Inherited from AliHLTModuleAgent.
160 /// Returns a list of libraries which the configurations registered by
161 /// this module agent depend on.
162 /// @return list of component libraries as a blank-separated string.
163 ///
164
887a669c 165 // List of libraries that we depend on.
166 static const char* libs[] =
167 {
168 "libCore.so",
169 "libCint.so",
170 "libGraf.so",
171 "libRIO.so",
172 "libNet.so",
173 "libHist.so",
174 "libMatrix.so",
175 "libMathCore.so",
176 "libMinuit.so",
177 "libTree.so",
178 "libGraf3d.so",
179 "libGpad.so",
180 "libPhysics.so",
181 "libGui.so",
182 "libProofPlayer.so",
183 "libProof.so",
184 "libThread.so",
185 "libGeom.so",
887a669c 186 "libEG.so",
187 "libTreePlayer.so",
188 "libXMLIO.so",
189 "libVMC.so",
190 "libESD.so",
191 "libCDB.so",
192 "libSTEERBase.so",
193 "libSTEER.so",
194 "libGui.so",
195 "libRAWDatasim.so",
196 "libRAWDatarec.so",
197 "libRAWDatabase.so",
198 "libMUONcore.so",
199 "libMUONraw.so",
200 "libMUONbase.so",
201 "libMUONgeometry.so",
202 "libMUONmapping.so",
203 "libMUONcalib.so",
204 "libMUONsim.so",
205 "libMUONtrigger.so",
206 "libMUONevaluation.so",
207 "libMUONrec.so",
4811617e 208 "libANALYSIS.so",
209 "libANALYSISalice.so",
887a669c 210 "libHLTbase.so",
211 "libAliHLTUtil.so",
212 NULL
213 };
214
215 // First check if the library is not already loaded. If it is then we have
216 // no reason to declare it as needed, so that we do not load it again.
217 static TString result;
218 for (const char** lib = libs; *lib != NULL; lib++)
219 {
220 const char* list = gSystem->GetLibraries(*lib, "", kFALSE);
221 if (list == NULL) continue;
222 // Check if not found, i.e. result was an empty string.
223 // If so then add the library to the required list.
224 if (list[0] == '\0')
225 {
226 result += *lib;
227 result += " ";
228 }
229 }
230 return result.Data();
d1ff7c16 231}
232
233
234int AliHLTMUONAgent::CreateConfigurations(
235 AliHLTConfigurationHandler* handler,
887a669c 236 AliRawReader* rawReader,
237 AliRunLoader* runloader
d1ff7c16 238 ) const
239{
6253e09b 240 /// Register all processing configurations belonging to the dimuon HLT
241 /// library with the AliHLTConfigurationHandler.
242 /// @param handler the configuration handler
243 /// @param rawReader [in] AliRoot rawreader instance.
244 /// @param runloader AliRoot runloader
245 /// @return Zero on success and error code if failed.
246 ///
887a669c 247 /// Chains available:
248 /// dHLT-sim - standard dHLT simulation chain.
249 /// dHLT-sim-fromRaw - standard dHLT chain taking raw DDL data as input.
250 /// dHLT-sim-fromMC - dHLT chain taking Monte Carlo hit data as input.
251 /// So hit reconstruction is not checked, just the tracker.
6253e09b 252
d1ff7c16 253 if (handler == NULL) return 0;
887a669c 254
255 const char* trackerId = AliHLTMUONConstants::MansoTrackerFSMId();
52c6d8aa 256 const char* fullTrackerId = AliHLTMUONConstants::FullTrackerId();
887a669c 257 const char* decCompId = AliHLTMUONConstants::DecisionComponentId();
258
259 if (rawReader != NULL)
260 {
261 // Implement the dHLT-sim-fromRaw dHLT simulation chain reading
262 // from raw data.
263 const char* rawPubComp = "AliRawReaderPublisher";
52c6d8aa 264 const char* cmd1 = "-minid 2560 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000001";
265 const char* cmd2 = "-minid 2561 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000002";
266 const char* cmd3 = "-minid 2562 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000004";
267 const char* cmd4 = "-minid 2563 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000008";
268 const char* cmd5 = "-minid 2564 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000010";
269 const char* cmd6 = "-minid 2565 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000020";
270 const char* cmd7 = "-minid 2566 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000040";
271 const char* cmd8 = "-minid 2567 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000080";
272 const char* cmd9 = "-minid 2568 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000100";
273 const char* cmd10 = "-minid 2569 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000200";
274 const char* cmd11 = "-minid 2570 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000400";
275 const char* cmd12 = "-minid 2571 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000800";
887a669c 276 const char* cmd13 = "-minid 2572 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x001000";
277 const char* cmd14 = "-minid 2573 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x002000";
278 const char* cmd15 = "-minid 2574 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x004000";
279 const char* cmd16 = "-minid 2575 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x008000";
280 const char* cmd17 = "-minid 2576 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x010000";
281 const char* cmd18 = "-minid 2577 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x020000";
282 const char* cmd19 = "-minid 2578 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x040000";
283 const char* cmd20 = "-minid 2579 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x080000";
284 const char* cmd21 = "-minid 2816 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x100000";
285 const char* cmd22 = "-minid 2817 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x200000";
52c6d8aa 286 handler->CreateConfiguration("RawDDL1", rawPubComp, NULL, cmd1);
287 handler->CreateConfiguration("RawDDL2", rawPubComp, NULL, cmd2);
288 handler->CreateConfiguration("RawDDL3", rawPubComp, NULL, cmd3);
289 handler->CreateConfiguration("RawDDL4", rawPubComp, NULL, cmd4);
290 handler->CreateConfiguration("RawDDL5", rawPubComp, NULL, cmd5);
291 handler->CreateConfiguration("RawDDL6", rawPubComp, NULL, cmd6);
292 handler->CreateConfiguration("RawDDL7", rawPubComp, NULL, cmd7);
293 handler->CreateConfiguration("RawDDL8", rawPubComp, NULL, cmd8);
294 handler->CreateConfiguration("RawDDL9", rawPubComp, NULL, cmd9);
295 handler->CreateConfiguration("RawDDL10", rawPubComp, NULL, cmd10);
296 handler->CreateConfiguration("RawDDL11", rawPubComp, NULL, cmd11);
297 handler->CreateConfiguration("RawDDL12", rawPubComp, NULL, cmd12);
887a669c 298 handler->CreateConfiguration("RawDDL13", rawPubComp, NULL, cmd13);
299 handler->CreateConfiguration("RawDDL14", rawPubComp, NULL, cmd14);
300 handler->CreateConfiguration("RawDDL15", rawPubComp, NULL, cmd15);
301 handler->CreateConfiguration("RawDDL16", rawPubComp, NULL, cmd16);
302 handler->CreateConfiguration("RawDDL17", rawPubComp, NULL, cmd17);
303 handler->CreateConfiguration("RawDDL18", rawPubComp, NULL, cmd18);
304 handler->CreateConfiguration("RawDDL19", rawPubComp, NULL, cmd19);
305 handler->CreateConfiguration("RawDDL20", rawPubComp, NULL, cmd20);
306 handler->CreateConfiguration("RawDDL21", rawPubComp, NULL, cmd21);
307 handler->CreateConfiguration("RawDDL22", rawPubComp, NULL, cmd22);
308 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
309 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
52c6d8aa 310 handler->CreateConfiguration("RecoRawDDL1", hrId, "RawDDL1", "-ddl 1 -cdb");
311 handler->CreateConfiguration("RecoRawDDL2", hrId, "RawDDL2", "-ddl 2 -cdb");
312 handler->CreateConfiguration("RecoRawDDL3", hrId, "RawDDL3", "-ddl 3 -cdb");
313 handler->CreateConfiguration("RecoRawDDL4", hrId, "RawDDL4", "-ddl 4 -cdb");
314 handler->CreateConfiguration("RecoRawDDL5", hrId, "RawDDL5", "-ddl 5 -cdb");
315 handler->CreateConfiguration("RecoRawDDL6", hrId, "RawDDL6", "-ddl 6 -cdb");
316 handler->CreateConfiguration("RecoRawDDL7", hrId, "RawDDL7", "-ddl 7 -cdb");
317 handler->CreateConfiguration("RecoRawDDL8", hrId, "RawDDL8", "-ddl 8 -cdb");
318 handler->CreateConfiguration("RecoRawDDL9", hrId, "RawDDL9", "-ddl 9 -cdb");
319 handler->CreateConfiguration("RecoRawDDL10", hrId, "RawDDL10", "-ddl 10 -cdb");
320 handler->CreateConfiguration("RecoRawDDL11", hrId, "RawDDL11", "-ddl 11 -cdb");
321 handler->CreateConfiguration("RecoRawDDL12", hrId, "RawDDL12", "-ddl 12 -cdb");
887a669c 322 handler->CreateConfiguration("RecoRawDDL13", hrId, "RawDDL13", "-ddl 13 -cdb");
323 handler->CreateConfiguration("RecoRawDDL14", hrId, "RawDDL14", "-ddl 14 -cdb");
324 handler->CreateConfiguration("RecoRawDDL15", hrId, "RawDDL15", "-ddl 15 -cdb");
325 handler->CreateConfiguration("RecoRawDDL16", hrId, "RawDDL16", "-ddl 16 -cdb");
326 handler->CreateConfiguration("RecoRawDDL17", hrId, "RawDDL17", "-ddl 17 -cdb");
327 handler->CreateConfiguration("RecoRawDDL18", hrId, "RawDDL18", "-ddl 18 -cdb");
328 handler->CreateConfiguration("RecoRawDDL19", hrId, "RawDDL19", "-ddl 19 -cdb");
329 handler->CreateConfiguration("RecoRawDDL20", hrId, "RawDDL20", "-ddl 20 -cdb");
330 handler->CreateConfiguration("RecoRawDDL21", trId, "RawDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
331 handler->CreateConfiguration("RecoRawDDL22", trId, "RawDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
332
333 const char* recoSrcs = "RecoRawDDL13 RecoRawDDL14 RecoRawDDL15 RecoRawDDL16 RecoRawDDL17"
334 " RecoRawDDL18 RecoRawDDL19 RecoRawDDL20 RecoRawDDL21 RecoRawDDL22";
335 handler->CreateConfiguration("MansoTrackerForRaw", trackerId, recoSrcs, "");
336
147b1df7 337 handler->CreateConfiguration("DecisionForRaw", decCompId, "MansoTrackerForRaw", "");
338
339 TString outputSrcs = "DecisionForRaw MansoTrackerForRaw ";
340 outputSrcs += recoSrcs;
341 handler->CreateConfiguration("dHLT-sim-fromRaw", "BlockFilter", outputSrcs, "");
52c6d8aa 342
343 // For reconstruction using full tracker.
344 const char* recoSrcsFull = " RecoRawDDL1 RecoRawDDL2 RecoRawDDL3 RecoRawDDL4 RecoRawDDL5 RecoRawDDL6 "
345 " RecoRawDDL7 RecoRawDDL8 RecoRawDDL9 RecoRawDDL10 RecoRawDDL11 RecoRawDDL12 "
346 " RecoRawDDL13 RecoRawDDL14 RecoRawDDL15 RecoRawDDL16 RecoRawDDL17 "
347 " RecoRawDDL18 RecoRawDDL19 RecoRawDDL20 RecoRawDDL21 RecoRawDDL22 ";
fd5b812e 348 handler->CreateConfiguration("FullTrackerForRaw", fullTrackerId, recoSrcsFull, "-cdb");
52c6d8aa 349
350 handler->CreateConfiguration("DecisionForRawFullTrk", decCompId, "FullTrackerForRaw", "");
351
fd5b812e 352 TString outputSrcsFull = "DecisionForRawFullTrk FullTrackerForRaw ";
52c6d8aa 353 outputSrcsFull += recoSrcsFull;
354 handler->CreateConfiguration("dHLT-sim-fromRaw-fullTracker", "BlockFilter", outputSrcsFull, "");
887a669c 355 }
356
a252a44b 357 if (IsMuonModuleLoaded() and runloader != NULL)
887a669c 358 {
359 // Implement the dHLT-sim dHLT simulation chain reading from
360 // simulated digits.
361 const char* digitPub = AliHLTMUONConstants::DigitPublisherId();
362 handler->CreateConfiguration("DigitDDL13", digitPub, NULL, "-simdata -ddl 13");
363 handler->CreateConfiguration("DigitDDL14", digitPub, NULL, "-simdata -ddl 14");
364 handler->CreateConfiguration("DigitDDL15", digitPub, NULL, "-simdata -ddl 15");
365 handler->CreateConfiguration("DigitDDL16", digitPub, NULL, "-simdata -ddl 16");
366 handler->CreateConfiguration("DigitDDL17", digitPub, NULL, "-simdata -ddl 17");
367 handler->CreateConfiguration("DigitDDL18", digitPub, NULL, "-simdata -ddl 18");
368 handler->CreateConfiguration("DigitDDL19", digitPub, NULL, "-simdata -ddl 19");
369 handler->CreateConfiguration("DigitDDL20", digitPub, NULL, "-simdata -ddl 20");
370 handler->CreateConfiguration("DigitDDL21", digitPub, NULL, "-simdata -ddl 21");
371 handler->CreateConfiguration("DigitDDL22", digitPub, NULL, "-simdata -ddl 22");
372 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
373 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
374 handler->CreateConfiguration("RecoDDL13", hrId, "DigitDDL13", "-ddl 13 -cdb");
375 handler->CreateConfiguration("RecoDDL14", hrId, "DigitDDL14", "-ddl 14 -cdb");
376 handler->CreateConfiguration("RecoDDL15", hrId, "DigitDDL15", "-ddl 15 -cdb");
377 handler->CreateConfiguration("RecoDDL16", hrId, "DigitDDL16", "-ddl 16 -cdb");
378 handler->CreateConfiguration("RecoDDL17", hrId, "DigitDDL17", "-ddl 17 -cdb");
379 handler->CreateConfiguration("RecoDDL18", hrId, "DigitDDL18", "-ddl 18 -cdb");
380 handler->CreateConfiguration("RecoDDL19", hrId, "DigitDDL19", "-ddl 19 -cdb");
381 handler->CreateConfiguration("RecoDDL20", hrId, "DigitDDL20", "-ddl 20 -cdb");
382 handler->CreateConfiguration("RecoDDL21", trId, "DigitDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
383 handler->CreateConfiguration("RecoDDL22", trId, "DigitDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
384
385 const char* recoSrcs = "RecoDDL13 RecoDDL14 RecoDDL15 RecoDDL16 RecoDDL17"
386 " RecoDDL18 RecoDDL19 RecoDDL20 RecoDDL21 RecoDDL22";
387 handler->CreateConfiguration("MansoTracker", trackerId, recoSrcs, "");
388
147b1df7 389 handler->CreateConfiguration("Decision", decCompId, "MansoTracker", "");
390
391 TString outputSrcs = "Decision MansoTracker ";
392 outputSrcs += recoSrcs;
393 handler->CreateConfiguration("dHLT-sim", "BlockFilter", outputSrcs.Data(), "");
887a669c 394
395 // Implement the dHLT-sim-fromMC dHLT simulation chain reading
396 // Monte Carlo geant hits and putting those into a tracker component.
397 const char* rhsId = AliHLTMUONConstants::RecHitsSourceId();
398 const char* trsId = AliHLTMUONConstants::TriggerRecordsSourceId();
399 handler->CreateConfiguration("HitsDDL13", rhsId, NULL, "-simdata -plane left -chamber 7");
400 handler->CreateConfiguration("HitsDDL14", rhsId, NULL, "-simdata -plane right -chamber 7");
401 handler->CreateConfiguration("HitsDDL15", rhsId, NULL, "-simdata -plane left -chamber 8");
402 handler->CreateConfiguration("HitsDDL16", rhsId, NULL, "-simdata -plane right -chamber 8");
403 handler->CreateConfiguration("HitsDDL17", rhsId, NULL, "-simdata -plane left -chamber 9");
404 handler->CreateConfiguration("HitsDDL18", rhsId, NULL, "-simdata -plane right -chamber 9");
405 handler->CreateConfiguration("HitsDDL19", rhsId, NULL, "-simdata -plane left -chamber 10");
406 handler->CreateConfiguration("HitsDDL20", rhsId, NULL, "-simdata -plane right -chamber 10");
407 handler->CreateConfiguration("TrigRecsDDL21", trsId, NULL, "-hitdata -plane left");
408 handler->CreateConfiguration("TrigRecsDDL22", trsId, NULL, "-hitdata -plane right");
409
410 const char* dataSrcs = "HitsDDL13 HitsDDL14 HitsDDL15 HitsDDL16 HitsDDL17"
411 " HitsDDL18 HitsDDL19 HitsDDL20 TrigRecsDDL21 TrigRecsDDL22";
412 handler->CreateConfiguration("MansoTrackerForMC", trackerId, dataSrcs, "");
413
147b1df7 414 handler->CreateConfiguration("DecisionForMC", decCompId, "MansoTrackerForMC", "");
415
416 outputSrcs = "DecisionForMC MansoTrackerForMC ";
417 outputSrcs += dataSrcs;
418 handler->CreateConfiguration("dHLT-sim-fromMC", "BlockFilter", outputSrcs.Data(), "");
887a669c 419 }
420
94135365 421 // Create a chain for generating AliESDEvent objects from dHLT raw reconstructed data.
422 handler->CreateConfiguration("HLTOUTPubTrigRecs", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRECS' 'MUON'");
423 handler->CreateConfiguration("HLTOUTPubMansoTracks", "AliHLTOUTPublisher", NULL, "-datatype 'MANTRACK' 'MUON'");
d24a4636 424 handler->CreateConfiguration("HLTOUTPubTracks", "AliHLTOUTPublisher", NULL, "-datatype 'TRACKS ' 'MUON'");
94135365 425 handler->CreateConfiguration(
426 "dHLT-make-esd",
427 AliHLTMUONConstants::ESDMakerId(),
d24a4636 428 "HLTOUTPubTrigRecs HLTOUTPubMansoTracks HLTOUTPubTracks",
94135365 429 "-make_minimal_esd"
430 );
431
432 // Create a chain for rootifying the raw dHLT data and dumping to file.
433 // This is used during AliRoot reconstruction.
434 handler->CreateConfiguration("HLTOUTPubTrigDbg", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRDBG' 'MUON'");
435 handler->CreateConfiguration("HLTOUTPubHits", "AliHLTOUTPublisher", NULL, "-datatype 'RECHITS ' 'MUON'");
436 handler->CreateConfiguration("HLTOUTPubClusters", "AliHLTOUTPublisher", NULL, "-datatype 'CLUSTERS' 'MUON'");
437 handler->CreateConfiguration("HLTOUTPubChannels", "AliHLTOUTPublisher", NULL, "-datatype 'CHANNELS' 'MUON'");
438 handler->CreateConfiguration("HLTOUTPubCandidates", "AliHLTOUTPublisher", NULL, "-datatype 'MNCANDID' 'MUON'");
439 handler->CreateConfiguration("HLTOUTPubSingles", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDSIN' 'MUON'");
440 handler->CreateConfiguration("HLTOUTPubPairs", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDPAR' 'MUON'");
441 handler->CreateConfiguration(
442 "HLTOUTConverter",
443 AliHLTMUONConstants::RootifierComponentId(),
444 "HLTOUTPubTrigRecs HLTOUTPubTrigDbg HLTOUTPubHits HLTOUTPubClusters"
445 " HLTOUTPubChannels HLTOUTPubMansoTracks HLTOUTPubCandidates"
d24a4636 446 " HLTOUTPubTracks HLTOUTPubSingles HLTOUTPubPairs",
94135365 447 ""
448 );
449 handler->CreateConfiguration(
450 "dHLT-rootify-and-dump",
451 "ROOTFileWriter",
452 "HLTOUTConverter",
453 "-concatenate-events -datafile dHLTRawData.root -specfmt"
454 );
455
d1ff7c16 456 return 0;
457}
6253e09b 458
459
460int AliHLTMUONAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
461{
462 ///
463 /// Registers all available components of this module.
464 /// @param pHandler [in] instance of the component handler.
465 ///
466
467 if (pHandler == NULL) return -EINVAL;
468 pHandler->AddComponent(new AliHLTMUONRecHitsSource);
469 pHandler->AddComponent(new AliHLTMUONTriggerRecordsSource);
887a669c 470 pHandler->AddComponent(new AliHLTMUONDigitPublisherComponent);
6253e09b 471 pHandler->AddComponent(new AliHLTMUONRootifierComponent);
472 pHandler->AddComponent(new AliHLTMUONHitReconstructorComponent);
473 pHandler->AddComponent(new AliHLTMUONTriggerReconstructorComponent);
474 pHandler->AddComponent(new AliHLTMUONMansoTrackerFSMComponent);
52c6d8aa 475 pHandler->AddComponent(new AliHLTMUONFullTrackerComponent);
c9537879 476 pHandler->AddComponent(new AliHLTMUONDecisionComponent);
649ab027 477 pHandler->AddComponent(new AliHLTMUONESDMaker);
0528e93a 478 pHandler->AddComponent(new AliHLTMUONEmptyEventFilterComponent);
dba14d7d 479 pHandler->AddComponent(new AliHLTMUONDataCheckerComponent);
17d68f2a 480 pHandler->AddComponent(new AliHLTMUONClusterFinderComponent);
a63da6d6 481 pHandler->AddComponent(new AliHLTMUONRawDataHistoComponent);
f064ef44 482 pHandler->AddComponent(new AliHLTMUONClusterHistoComponent);
6253e09b 483 return 0;
484}
485
94135365 486
487int AliHLTMUONAgent::GetHandlerDescription(
488 AliHLTComponentDataType dt,
489#ifdef __DEBUG
490 AliHLTUInt32_t spec,
491#else
492 AliHLTUInt32_t /*spec*/,
493#endif
494 AliHLTOUTHandlerDesc& desc
495 ) const
496{
497 /// Get handler decription for MUON data in the HLTOUT data stream.
498
499 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
d24a4636 500 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
501 dt == AliHLTMUONConstants::TracksBlockDataType()
94135365 502 )
503 {
504 HLTDebug("Indicating we can handle data type = %s and specification"
505 " = 0x%8.8X with dHLT-make-esd chain",
506 AliHLTComponent::DataType2Text(dt).c_str(),
507 spec
508 );
509 desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-make-esd");
510 return 1;
511 }
512
0d716b5f 513 if (fgRunRootifyChain and
514 (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
515 dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
516 dt == AliHLTMUONConstants::RecHitsBlockDataType() or
517 dt == AliHLTMUONConstants::ClusterBlockDataType() or
518 dt == AliHLTMUONConstants::ChannelBlockDataType() or
519 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
520 dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
521 dt == AliHLTMUONConstants::TracksBlockDataType() or
522 dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
523 dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
524 ))
94135365 525 {
526 HLTDebug("Indicating we can handle data type = %s and specification"
527 " = 0x%8.8X with dHLT-rootify-and-dump chain",
528 AliHLTComponent::DataType2Text(dt).c_str(),
529 spec
530 );
531 desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-rootify-and-dump");
532 return 1;
533 }
534
535 return 0;
536}
537
538
539AliHLTOUTHandler* AliHLTMUONAgent::GetOutputHandler(
540 AliHLTComponentDataType dt,
541#ifdef __DEBUG
542 AliHLTUInt32_t spec
543#else
544 AliHLTUInt32_t /*spec*/
545#endif
546 )
547{
548 /// Get specific handler for MUON data in the HLTOUT data stream.
549
550 HLTDebug("Trying to create HLTOUT handler for data type = %s and"
551 " specification = 0x%8.8X",
552 AliHLTComponent::DataType2Text(dt).c_str(),
553 spec
554 );
555
556 if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
d24a4636 557 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
558 dt == AliHLTMUONConstants::TracksBlockDataType()
94135365 559 )
560 {
561 return &fgkESDMakerChain;
562 }
d24a4636 563
0d716b5f 564 if (fgRunRootifyChain and
565 (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
566 dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
567 dt == AliHLTMUONConstants::RecHitsBlockDataType() or
568 dt == AliHLTMUONConstants::ClusterBlockDataType() or
569 dt == AliHLTMUONConstants::ChannelBlockDataType() or
570 dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
571 dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
572 dt == AliHLTMUONConstants::TracksBlockDataType() or
573 dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
574 dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
575 ))
94135365 576 {
577 return &fgkRootifyDumpChain;
578 }
579
580 return NULL;
581}
582
583
584int AliHLTMUONAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
585{
586 /// Deletes the HLTOUT handlers. In this case since the handlers are
587 /// allocated statically, we just check that the right pointer was
588 /// given and exit.
589
590 HLTDebug("Trying to delete HLTOUT handler: %p", pInstance);
591
592 if (pInstance != &fgkESDMakerChain or pInstance != &fgkRootifyDumpChain)
593 return -EINVAL;
594
595 return 0;
596}