1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Artur Szostak <artursz@iafrica.com> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
22 * \brief Macro for running the dHLT chain in a standalone mode.
24 * This macro is used to run the dHLT component chain within the AliHLTSystem
25 * framework, which is a simulation of the dHLT online system's output.
26 * To run this macro you must be in the same directory as the galice.root
27 * files or in the directory containing the rawXX/ directories produced from
28 * AliRoot simulations.
29 * Also make sure you specify CDB as for the lutDir (lookup table directory)
30 * or that the appropriate LUTs are in the same directory as your working
31 * directory, or you can specify the directory with the lutDir parameter option.
33 * The simplest way to run this macro with defaults is to copy "rootlogon.C" from
34 * $ALICE_ROOT/HLT/MUON/macros into your current working directory, then from
35 * the shell command prompt run the following command:
37 * > aliroot -b -q -l $ALICE_ROOT/HLT/MUON/macros/RunChain.C+
40 * \author Artur Szostak <artursz@iafrica.com>
43 #if !defined(__CINT__) || defined(__MAKECINT__)
44 #include "AliRawReader.h"
45 #include "AliHLTOfflineInterface.h"
46 #include "AliCDBStorage.h"
47 #include "AliCDBManager.h"
48 #include "AliHLTSystem.h"
49 #include "AliHLTConfiguration.h"
58 * Used to run the dimuon HLT (dHLT) chain in various configuration in a standalone
59 * configuration. This is normally used for debugging, testing and can also be used
60 * as an example of how to build chains for dHLT by hand.
62 * @param chainType Specifies the type of chain to run. This can be one of the
64 * "full" - Run the full dHLT chain. (default)
65 * "ddlreco" - Run only the reconstruction of the DDL raw data up to hits
66 * and trigger records.
67 * "tracker" - Run the tracker only using hits and trigger records from
68 * AliRoot simulation or offline reconstruction.
69 * @param firstEvent The event number of the first event to process. (default = 0)
70 * @param lastEvent The event number of the last event to process. If this is
71 * less than firstEvent then it is set to firstEvent automatically. (default = -1)
72 * @param output Specifies the kind of output to generate. The options can be one
74 * "bin" - Generates all possible output and dumps it to binary files
75 * using the FileWriter component.
76 * "root" - Generates all possible output and writes it to a ROOT file
77 * using the ROOTFileWriter component.
78 * "tracks_bin" - Generates only track data and dumps it to binary files
79 * using the FileWriter component. This option is equivalent to
80 * 'bin' if the chain type is 'ddlreco'.
81 * "tracks_root" - Generates only track data and writes it to a ROOT file
82 * using the ROOTFileWriter component. This option is equivalent
83 * to 'bin' if the chain type is 'ddlreco'.
84 * @param dataSource This is the data source from which to use hits and trigger
85 * records when we are running the tracker only chain and the DDL raw data
86 * reading method when running the 'full' or 'ddlreco' chain. If the
87 * chainType = "full" or "ddlreco", then the possible options are:
88 * "file" - Reads the raw data directly from the DDL files. (default)
89 * "rawreader" - Reads the raw data using the AliRawReader interface from
90 * the current working directory.
91 * If the chainType = "tracker", then the possible options are:
92 * "sim" - Take data from GEANT hits. (default)
93 * "rec" - Take data from offline reconstructed hits and local trigger
95 * @param logLevel Specifies the amount of logging messages produced by the HLT
96 * system. The possible options are:
97 * "normal" - Shows warnings, errors and information.
98 * "debug" - Shows all messages up to the debug level only for HLT and the
99 * same as normal for all other modules.
100 * "max" - Shows everything including debug messages if they were compiled in.
101 * "min" - Shows only error messages.
102 * @param lutDir This is the directory in which the LUTs can be found.
103 * If it is set to "CDB" (case sensitive) then the LUTs will be loaded from
104 * CDB instead. The default behaviour is to read from the local CDB store.
105 * @param checkData A flag for indicating if the event data should be checked
106 * for consistency with the AliHLTMUONDataCheckerComponent.
107 * @param rawDataPath The path of the raw data (i.e. path to the rawXX directories)
108 * or can be the file name if using the "rawreader" option for dataSource.
109 * @param runNumber Specifies the run number to use. If it is set to -1 then the
110 * run number is not set if the CDB manager already has a run number set,
111 * otherwise a default run number of 0 is used. The default value is -1.
112 * @param cdbPath This gives the CDB path to use. If it is set to NULL then
113 * the CDB path is not set if the CDB manager already has a default storage
114 * CDB path set, otherwise a default value of "local://$ALICE_ROOT/OCDB" is used.
115 * The default value is NULL.
116 * @param tryrecover If this is true then the "-tryrecover" flag is set in the
117 * raw data reconstruction components. This is useful if when running RunChain
118 * log messages appear indicating that there was a problem decoding the raw data.
119 * The "-tryrecover" flag will turn on recovery logic in the raw data decoders
120 * to try and overcome errors in the data.
123 const char* chainType = "full",
124 Int_t firstEvent = 0,
125 Int_t lastEvent = -1,
126 const char* output = "bin",
127 const char* dataSource = "file",
128 const char* logLevel = "normal",
129 const char* lutDir = "CDB",
130 bool checkData = false,
131 const char* rawDataPath = "./",
132 Int_t runNumber = -1,
133 const char* cdbPath = NULL,
134 bool tryrecover = false
137 // Setup the CDB default storage and run number if nothing was set.
138 AliCDBManager* cdbManager = AliCDBManager::Instance();
139 if (cdbManager == NULL)
141 cerr << "ERROR: Global CDB manager object does not exist." << endl;
146 cdbManager->SetRun(runNumber);
148 else if (cdbManager->GetRun() == -1)
150 cdbManager->SetRun(0);
154 cdbManager->SetDefaultStorage(cdbPath);
156 else if (cdbManager->GetDefaultStorage() == NULL)
158 cdbManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
161 if (cdbManager->GetDefaultStorage() == NULL)
163 cerr << "ERROR: There is no value for the default CDB storage, cannot continue." << endl;
167 // Make sure that the lastEvent is greater than firstEvent.
168 if (lastEvent < firstEvent)
169 lastEvent = firstEvent;
170 int eventCount = lastEvent - firstEvent + 1;
172 bool buildDDLFilePubs = false;
173 bool buildRawReaderPubs = false;
174 bool buildDDLRecoComps = false;
175 bool buildSimDataPubs = false;
176 bool buildRecDataPubs = false;
177 bool buildTrackerComp = false;
178 bool maxLogging = false;
179 bool debugLogging = false;
180 bool minLogging = false;
181 bool useRootWriter = false;
182 bool makeTracksOnly = false;
183 bool buildDecisionComp = true;
185 // Parse the chainType, output, dataSource and logLevel option strings:
186 TString outOpt = output;
187 if (outOpt.CompareTo("bin", TString::kIgnoreCase) == 0)
189 useRootWriter = false;
191 else if (outOpt.CompareTo("root", TString::kIgnoreCase) == 0)
193 useRootWriter = true;
195 else if (outOpt.CompareTo("tracks_bin", TString::kIgnoreCase) == 0)
197 useRootWriter = false;
198 makeTracksOnly = true;
200 else if (outOpt.CompareTo("tracks_root", TString::kIgnoreCase) == 0)
202 useRootWriter = true;
203 makeTracksOnly = true;
207 cerr << "ERROR: Unknown option for output: '" << output << "'" << endl;
211 TString chainOpt = chainType;
212 if (chainOpt.CompareTo("full", TString::kIgnoreCase) == 0)
214 buildDDLRecoComps = true;
215 buildTrackerComp = true;
217 TString dataOpt = dataSource;
218 if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
220 buildDDLFilePubs = true;
222 else if (dataOpt.CompareTo("rawreader", TString::kIgnoreCase) == 0)
224 buildRawReaderPubs = true;
228 cerr << "ERROR: Unknown option for dataSource: '" << dataSource
229 << "'. Valid options are: 'file' or 'rawreader'" << endl;
233 else if (chainOpt.CompareTo("ddlreco", TString::kIgnoreCase) == 0)
235 buildDDLRecoComps = true;
236 buildDecisionComp = false;
238 TString dataOpt = dataSource;
239 if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
241 buildDDLFilePubs = true;
243 else if (dataOpt.CompareTo("rawreader", TString::kIgnoreCase) == 0)
245 buildRawReaderPubs = true;
249 cerr << "ERROR: Unknown option for dataSource: '" << dataSource
250 << "'. Valid options are: 'file' or 'rawreader'" << endl;
254 else if (chainOpt.CompareTo("tracker", TString::kIgnoreCase) == 0)
256 buildTrackerComp = true;
258 TString dataOpt = dataSource;
259 if (dataOpt.CompareTo("sim", TString::kIgnoreCase) == 0)
261 buildSimDataPubs = true;
263 else if (dataOpt.CompareTo("rec", TString::kIgnoreCase) == 0)
265 buildRecDataPubs = true;
269 cerr << "ERROR: Unknown option for dataSource: '" << dataSource
270 << "'. Valid options are: 'sim' or 'rec'" << endl;
276 cerr << "ERROR: Unknown option for chainType: '" << chainType << "'" << endl;
280 TString logOpt = logLevel;
281 if (logOpt.CompareTo("normal", TString::kIgnoreCase) == 0)
285 else if (logOpt.CompareTo("debug", TString::kIgnoreCase) == 0)
289 else if (logOpt.CompareTo("max", TString::kIgnoreCase) == 0)
293 else if (logOpt.CompareTo("min", TString::kIgnoreCase) == 0)
299 cerr << "ERROR: Unknown option for logLevel: '" << logLevel << "'" << endl;
303 // If we are supposed to make tracks only but are in a ddlreco chain
304 // then we clearly can only generate the DDL reconstructed data, so do that.
305 if (makeTracksOnly && ! buildTrackerComp)
307 makeTracksOnly = false;
310 // Now we can initialise the AliHLTSystem...
313 // Start by setting up the logging.
316 AliLog::SetGlobalLogLevel(AliLog::kMaxType);
317 sys.SetGlobalLoggingLevel(kHLTLogAll);
321 AliLog::SetModuleDebugLevel("HLT", AliLog::kMaxType);
322 sys.SetGlobalLoggingLevel(kHLTLogAll);
326 sys.SetGlobalLoggingLevel(AliHLTComponentLogSeverity(
327 kHLTLogFatal | kHLTLogError
331 sys.LoadComponentLibraries("libAliHLTUtil.so");
332 sys.LoadComponentLibraries("libAliHLTMUON.so");
334 // The DDL file publishers are only needed if we create the ddlreco or
335 // full chains. The filename lists are built assuming the aliroot rawXX/
336 // directory structure.
337 if (buildDDLFilePubs)
339 string cmd13 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x001000";
340 string cmd14 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x002000";
341 string cmd15 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x004000";
342 string cmd16 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x008000";
343 string cmd17 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x010000";
344 string cmd18 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x020000";
345 string cmd19 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x040000";
346 string cmd20 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x080000";
347 string cmd21 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x100000";
348 string cmd22 = "-datatype 'DDL_RAW ' 'MUON' -dataspec 0x200000";
349 for (int i = firstEvent; i < lastEvent+1; i++)
353 cmd13 += " -nextevent";
354 cmd14 += " -nextevent";
355 cmd15 += " -nextevent";
356 cmd16 += " -nextevent";
357 cmd17 += " -nextevent";
358 cmd18 += " -nextevent";
359 cmd19 += " -nextevent";
360 cmd20 += " -nextevent";
361 cmd21 += " -nextevent";
362 cmd22 += " -nextevent";
365 sprintf(buf, "%d", i);
366 cmd13 += " -datafile "; cmd13 += rawDataPath; cmd13 += "raw"; cmd13 += buf; cmd13 += "/MUONTRK_2572.ddl";
367 cmd14 += " -datafile "; cmd14 += rawDataPath; cmd14 += "raw"; cmd14 += buf; cmd14 += "/MUONTRK_2573.ddl";
368 cmd15 += " -datafile "; cmd15 += rawDataPath; cmd15 += "raw"; cmd15 += buf; cmd15 += "/MUONTRK_2574.ddl";
369 cmd16 += " -datafile "; cmd16 += rawDataPath; cmd16 += "raw"; cmd16 += buf; cmd16 += "/MUONTRK_2575.ddl";
370 cmd17 += " -datafile "; cmd17 += rawDataPath; cmd17 += "raw"; cmd17 += buf; cmd17 += "/MUONTRK_2576.ddl";
371 cmd18 += " -datafile "; cmd18 += rawDataPath; cmd18 += "raw"; cmd18 += buf; cmd18 += "/MUONTRK_2577.ddl";
372 cmd19 += " -datafile "; cmd19 += rawDataPath; cmd19 += "raw"; cmd19 += buf; cmd19 += "/MUONTRK_2578.ddl";
373 cmd20 += " -datafile "; cmd20 += rawDataPath; cmd20 += "raw"; cmd20 += buf; cmd20 += "/MUONTRK_2579.ddl";
374 cmd21 += " -datafile "; cmd21 += rawDataPath; cmd21 += "raw"; cmd21 += buf; cmd21 += "/MUONTRG_2816.ddl";
375 cmd22 += " -datafile "; cmd22 += rawDataPath; cmd22 += "raw"; cmd22 += buf; cmd22 += "/MUONTRG_2817.ddl";
378 AliHLTConfiguration pubDDL13("pubDDL13", "FilePublisher", NULL, cmd13.c_str());
379 AliHLTConfiguration pubDDL14("pubDDL14", "FilePublisher", NULL, cmd14.c_str());
380 AliHLTConfiguration pubDDL15("pubDDL15", "FilePublisher", NULL, cmd15.c_str());
381 AliHLTConfiguration pubDDL16("pubDDL16", "FilePublisher", NULL, cmd16.c_str());
382 AliHLTConfiguration pubDDL17("pubDDL17", "FilePublisher", NULL, cmd17.c_str());
383 AliHLTConfiguration pubDDL18("pubDDL18", "FilePublisher", NULL, cmd18.c_str());
384 AliHLTConfiguration pubDDL19("pubDDL19", "FilePublisher", NULL, cmd19.c_str());
385 AliHLTConfiguration pubDDL20("pubDDL20", "FilePublisher", NULL, cmd20.c_str());
386 AliHLTConfiguration pubDDL21("pubDDL21", "FilePublisher", NULL, cmd21.c_str());
387 AliHLTConfiguration pubDDL22("pubDDL22", "FilePublisher", NULL, cmd22.c_str());
390 // Build the DDL file publishers using AliRawReaderPublisher components.
391 if (buildRawReaderPubs)
393 string cmd13 = "-skipempty -minid 2572 -maxid 2572 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x001000";
394 string cmd14 = "-skipempty -minid 2573 -maxid 2573 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x002000";
395 string cmd15 = "-skipempty -minid 2574 -maxid 2574 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x004000";
396 string cmd16 = "-skipempty -minid 2575 -maxid 2575 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x008000";
397 string cmd17 = "-skipempty -minid 2576 -maxid 2576 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x010000";
398 string cmd18 = "-skipempty -minid 2577 -maxid 2577 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x020000";
399 string cmd19 = "-skipempty -minid 2578 -maxid 2578 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x040000";
400 string cmd20 = "-skipempty -minid 2579 -maxid 2579 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x080000";
401 string cmd21 = "-skipempty -minid 2816 -maxid 2816 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x100000";
402 string cmd22 = "-skipempty -minid 2817 -maxid 2817 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x200000";
404 AliHLTConfiguration pubDDL13("pubDDL13", "AliRawReaderPublisher", NULL, cmd13.c_str());
405 AliHLTConfiguration pubDDL14("pubDDL14", "AliRawReaderPublisher", NULL, cmd14.c_str());
406 AliHLTConfiguration pubDDL15("pubDDL15", "AliRawReaderPublisher", NULL, cmd15.c_str());
407 AliHLTConfiguration pubDDL16("pubDDL16", "AliRawReaderPublisher", NULL, cmd16.c_str());
408 AliHLTConfiguration pubDDL17("pubDDL17", "AliRawReaderPublisher", NULL, cmd17.c_str());
409 AliHLTConfiguration pubDDL18("pubDDL18", "AliRawReaderPublisher", NULL, cmd18.c_str());
410 AliHLTConfiguration pubDDL19("pubDDL19", "AliRawReaderPublisher", NULL, cmd19.c_str());
411 AliHLTConfiguration pubDDL20("pubDDL20", "AliRawReaderPublisher", NULL, cmd20.c_str());
412 AliHLTConfiguration pubDDL21("pubDDL21", "AliRawReaderPublisher", NULL, cmd21.c_str());
413 AliHLTConfiguration pubDDL22("pubDDL22", "AliRawReaderPublisher", NULL, cmd22.c_str());
416 // Build the DDL reconstructor components for all the DDLs 13 to 22, that
417 // is for chambers 7 to 10 and trigger stations. We only need to build
418 // these components if we are are building the ddlreco or full chains.
419 if (buildDDLRecoComps)
421 const char* recoverFlag = tryrecover ? "-tryrecover" : "";
422 for (int k = 13; k <= 22; k++)
424 string compId = Form("recDDL%d", k);
425 string name = (k <= 20) ? "MUONHitReconstructor" : "MUONTriggerReconstructor";
426 string parent = Form("pubDDL%d", k);
428 const char* extraInfoFlags = k < 21 ? "-makeclusters -makechannels" : "-makedebuginfo";
429 if (TString(lutDir) == "CDB")
431 const char* path = cdbManager->GetDefaultStorage()->GetURI().Data();
432 cmd = Form("-ddl %d -cdbpath %s -run %d %s %s",
433 k, path, cdbManager->GetRun(), recoverFlag, extraInfoFlags
438 cmd = Form("-ddl %d -lut %s/Lut%d.dat %s %s",
439 k, lutDir, k, recoverFlag, extraInfoFlags
444 cmd += " -suppress_partial_triggers -dont_use_crateid -dont_use_localid";
446 AliHLTConfiguration recDDL(compId.c_str(), name.c_str(), parent.c_str(), cmd.c_str());
450 TString startEventStr = "-firstevent ";
451 startEventStr += firstEvent;
453 // Build the data source components to take data from simulated hits if
454 // we are building the tracker only chain with the 'sim' data source.
455 if (buildSimDataPubs)
457 AliHLTConfiguration recDDL13("recDDL13", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane left -chamber 7");
458 AliHLTConfiguration recDDL14("recDDL14", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane right -chamber 7");
459 AliHLTConfiguration recDDL15("recDDL15", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane left -chamber 8");
460 AliHLTConfiguration recDDL16("recDDL16", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane right -chamber 8");
461 AliHLTConfiguration recDDL17("recDDL17", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane left -chamber 9");
462 AliHLTConfiguration recDDL18("recDDL18", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane right -chamber 9");
463 AliHLTConfiguration recDDL19("recDDL19", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane left -chamber 10");
464 AliHLTConfiguration recDDL20("recDDL20", "MUONRecHitsSource", NULL, startEventStr + " -simdata -plane right -chamber 10");
465 AliHLTConfiguration recDDL21("recDDL21", "MUONTriggerRecordsSource", NULL, startEventStr + " -hitdata -plane left");
466 AliHLTConfiguration recDDL22("recDDL22", "MUONTriggerRecordsSource", NULL, startEventStr + " -hitdata -plane right");
469 // Build the data source components to take data from offline reconstructed
470 // objects if we are building the tracker only chain with the 'rec' data source.
471 if (buildRecDataPubs)
473 AliHLTConfiguration recDDL13("recDDL13", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane left -chamber 7");
474 AliHLTConfiguration recDDL14("recDDL14", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane right -chamber 7");
475 AliHLTConfiguration recDDL15("recDDL15", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane left -chamber 8");
476 AliHLTConfiguration recDDL16("recDDL16", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane right -chamber 8");
477 AliHLTConfiguration recDDL17("recDDL17", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane left -chamber 9");
478 AliHLTConfiguration recDDL18("recDDL18", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane right -chamber 9");
479 AliHLTConfiguration recDDL19("recDDL19", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane left -chamber 10");
480 AliHLTConfiguration recDDL20("recDDL20", "MUONRecHitsSource", NULL, startEventStr + " -recdata -plane right -chamber 10");
481 AliHLTConfiguration recDDL21("recDDL21", "MUONTriggerRecordsSource", NULL, startEventStr + " -recdata -plane left");
482 AliHLTConfiguration recDDL22("recDDL22", "MUONTriggerRecordsSource", NULL, startEventStr + " -recdata -plane right");
485 // Build the tracker component if we are building the tracker only or
487 if (buildTrackerComp)
489 AliHLTConfiguration tracker(
491 "MUONMansoTrackerFSM",
492 "recDDL13 recDDL14 recDDL15 recDDL16 recDDL17 recDDL18 recDDL19 recDDL20 recDDL21 recDDL22",
497 // Build the dHLT trigger decision component if enabled.
498 if (buildDecisionComp)
500 AliHLTConfiguration decision("decision", "MUONDecisionComponent", "tracker", "");
503 // Build the data sink to subscribe only to what has been created and
504 // to the data source we actaully want.
505 TString sources = "";
508 sources += "tracker ";
512 if (buildTrackerComp)
513 sources += "tracker ";
514 sources += "recDDL13 recDDL14 recDDL15 recDDL16 recDDL17 recDDL18 recDDL19 recDDL20 recDDL21 recDDL22";
516 if (buildDecisionComp)
518 // Add the trigger decision component if it was enabled.
519 sources += " decision";
522 // Build the data checker component if so requested.
525 AliHLTConfiguration checker("checker", "MUONDataChecker", sources, "-warn_on_unexpected_block");
531 AliHLTConfiguration convert("convert", "MUONRootifier", sources, "");
532 AliHLTConfiguration sink("sink", "ROOTFileWriter", "convert", "-concatenate-events -datafile output.root -specfmt");
536 AliHLTConfiguration sink("sink", "FileWriter", sources, "-datafile output.dat -specfmt");
539 // Build and run the chain's tasks.
540 sys.BuildTaskList("sink");
541 if (buildDDLFilePubs)
547 // Setup the raw reader.
548 AliRawReader* rawReader = AliRawReader::Create(rawDataPath);
549 if (rawReader == NULL)
551 cerr << "ERROR: Could not create raw reader." << endl;
554 if (! rawReader->IsRawReaderValid())
556 cerr << "ERROR: Raw reader is not valid." << endl;
559 AliHLTOfflineInterface::SetParamsToComponents(NULL, rawReader);
560 rawReader->NextEvent(); // Need to call this once here or we will start at the wrong event.
561 // Now step through the events.
562 for (int i = 0; i < firstEvent; i++) rawReader->NextEvent();
563 for (int i = firstEvent; i <= lastEvent; i++)
565 // The "(i == lastEvent) ? 1 : 0" part is to indicate a
566 // stop run command when we hit the last event.
567 sys.Run(1, (i == lastEvent) ? 1 : 0);
568 rawReader->NextEvent();