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