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 **************************************************************************/
19 #if !defined(__CINT__) || defined(__MAKECINT__)
20 #include "AliHLTPluginBase.h"
21 #include "AliHLTConfiguration.h"
22 #include "AliReconstruction.h"
29 * @file HLToutputTodHLTRootObjects.C
30 * @brief Macro for converting dHLT output in HLTOUT into ROOT objects or dumping to file.
32 * This macro converts dHLT output data blocks in HLTOUT to dHLT ROOT
33 * objects which can be used for dHLT specific analysis or debugging.
34 * Alternatively the dHLT data blocks are dumped to file in raw binary format.
36 * @note The macro must be run in the directory with the raw0, raw1 etc
37 * directories. Also no reconstructed ROOT files should be in this directory
38 * either. Backup any reconstructed AliESDs.root files if you want, and then
39 * delete all root files in the directory where you will run this macro.
41 * @param dataSource Indicates where to find the raw data. If this is a path
42 * then the raw data is expected to be in DDL file format stored in directories
43 * called raw0, raw1 and so on.
44 * If a file name is given instead then it is assumed to be a DATE file unless
45 * it ends in ".root", in which case it is assumed to be rootified raw data.
46 * @param dumpBinary Indicates if the data should be dumped in raw binary format
47 * to files with the file name prefix "output-". If set to false then the
48 * output is rootified and written to a ROOT file "output.root".
50 * @author Artur Szostak <artursz@iafrica.com>
51 * @ingroup alihlt_dimuon_macros
53 void HLToutputTodHLTRootObjects(const char* dataSource = "./", bool dumpBinary = false)
55 // setup of the HLT system
56 gSystem->Load("libHLTrec.so");
57 AliHLTSystem* sys = AliHLTPluginBase::GetInstance();
60 cerr << "FATAL ERROR: Cannot get HLT system instance." << endl;
64 // Configure the chain.
65 AliHLTConfiguration pub("Pub", "AliHLTOUTPublisher" , NULL, "-origin 'MUON'");
66 TString sources = "Pub";
69 AliHLTConfiguration sink("dhlt-output-dump", "FileWriter", sources, "-datafile output.dat -specfmt");
73 AliHLTConfiguration convert("convert", "MUONRootifier", sources, "");
74 AliHLTConfiguration sink("dhlt-output-dump", "ROOTFileWriter", "convert", "-concatenate-events -datafile output.root -specfmt");
77 // Setup the reconstruction and run.
78 AliReconstruction rec;
79 rec.SetInput(dataSource);
80 rec.SetLoadAlignData("");
81 rec.SetRunLocalReconstruction("HLT");
82 rec.SetRunTracking("");
85 rec.SetFillTriggerESD(kFALSE);
86 rec.SetRunVertexFinder(kFALSE);
87 rec.SetOption("HLT", "libAliHLTMUON.so loglevel=0x78 chains=dhlt-output-dump");