]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/exa/rootfilepublisher.C
- removed obsolete argument for the HLTOUT publisher
[u/mrichter/AliRoot.git] / HLT / exa / rootfilepublisher.C
CommitLineData
992ea13b 1/**
85ac9c28 2 * @file rootfilepublisher.C
992ea13b 3 * @brief Macro for testing ROOT-file publishing and writing
4 *
5 * This macro is a testing/example macro of how to use the RootFilePublisher
6 * (AliHLTRootFilePublisher) and RootFileWriter (AliHLTRootFileWriter).
7 * It defines only two component in the chain, the publisher, which
8 * publishes the content of the root files according to the selection.
9 * Be aware there can be several root objects in one root file.
10 *
11 * The file myRootFile.root has to be changed with the actual file.
12 * In this example, an ESD file is used, which contains a "esdTree" and
13 * a "HLTesdTree" object. Only the "HLTesdTree" object is selected. The
14 * data blocks, which will are published here, have the data type of
15 * {ROOTTOBJ,"***"} and specification of 0x00000000. They also have to
16 * been adopted to the actual content of the root file.
17 *
18 * @author thaeder@kip.uni-heidelberg.de
19 * @ingroup alihlt_tutorial
20 */
21
22/** RootFilePublisher test macro
23 * @param nEvents Number of events which should be processed
24 */
25void rootfilepublisher(Int_t nEvents=1) {
26
27 TString writerInput;
28 TString arg;
29
30 AliHLTSystem gHLT;
31 gHLT.LoadComponentLibraries("libAliHLTUtil.so");
32
33 // -- Root publisher configuration
34 // !!! myRootFile.root has to be exchanged with an existing one.
35 arg.Form("-objectname HLTesdTree -datatype 'ESD_TREE' 'TPC '-dataspec 0x00000000 -datafile myRootFile.root");
36
fa5e8413 37 // -- The AliHLTRootFilePublisher (Id 'ROOTFilePublisher') is a data source.
38 // It provides the given files to the subsequent components in the chain.
39 // see AliHLTRootFilePublisher for more options
40 AliHLTConfiguration RootPublisher("RootPublisher", "ROOTFilePublisher", NULL, arg.Data() );
41 if (!writerInput.IsNull()) writerInput+=" ";
42 writerInput+="RootPublisher";
992ea13b 43
44 // -
45 // -- Processing Components can be put in here
46 // -
47
48 // -- The AliHLTRootFileWriter (Id 'ROOTFileWriter') is a data sink. It writes
49 // all incoming data blocks to files. Several options available.
fa5e8413 50 AliHLTConfiguration RootWriter("RootWriter", "ROOTFileWriter", writerInput.Data(),"-datafile event");
992ea13b 51
52 // -- Here you specify the top most configuration of the chain. The
53 // configuration depends on all the parents. The task lisy is build
54 // according to that.
55 gHLT.BuildTaskList("RootWriter");
56 gHLT.Run(nEvents);
57}