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