]>
Commit | Line | Data |
---|---|---|
992ea13b | 1 | |
2 | /** | |
3 | * @file rootfilepublisher-sample.C | |
4 | * @brief Macro for testing ROOT-file publishing and writing | |
5 | * | |
6 | * This macro is a testing/example macro of how to use the RootFilePublisher | |
7 | * (AliHLTRootFilePublisher) and RootFileWriter (AliHLTRootFileWriter). | |
8 | * It defines only two component in the chain, the publisher, which | |
9 | * publishes the content of the root files according to the selection. | |
10 | * Be aware there can be several root objects in one root file. | |
11 | * | |
12 | * The file myRootFile.root has to be changed with the actual file. | |
13 | * In this example, an ESD file is used, which contains a "esdTree" and | |
14 | * a "HLTesdTree" object. Only the "HLTesdTree" object is selected. The | |
15 | * data blocks, which will are published here, have the data type of | |
16 | * {ROOTTOBJ,"***"} and specification of 0x00000000. They also have to | |
17 | * been adopted to the actual content of the root file. | |
18 | * | |
19 | * @author thaeder@kip.uni-heidelberg.de | |
20 | * @ingroup alihlt_tutorial | |
21 | */ | |
22 | ||
23 | /** RootFilePublisher test macro | |
24 | * @param nEvents Number of events which should be processed | |
25 | */ | |
26 | void rootfilepublisher(Int_t nEvents=1) { | |
27 | ||
28 | TString writerInput; | |
29 | TString arg; | |
30 | ||
31 | AliHLTSystem gHLT; | |
32 | gHLT.LoadComponentLibraries("libAliHLTUtil.so"); | |
33 | ||
34 | // -- Root publisher configuration | |
35 | // !!! myRootFile.root has to be exchanged with an existing one. | |
36 | arg.Form("-objectname HLTesdTree -datatype 'ESD_TREE' 'TPC '-dataspec 0x00000000 -datafile myRootFile.root"); | |
37 | ||
38 | // -- The AliHLTRootFilePublisher (component Id \em 'ROOTFilePublisher' provides | |
39 | // the given file (see AliHLTRootFilePublisher for more options) to the | |
40 | // subsequent components in the chain. | |
41 | AliHLTConfiguration rootPublisher("RootPublisher", "ROOTFilePublisher", NULL, arg.Data() ); | |
42 | ||
43 | // - | |
44 | // -- Processing Components can be put in here | |
45 | // - | |
46 | ||
47 | // -- The AliHLTRootFileWriter (Id 'ROOTFileWriter') is a data sink. It writes | |
48 | // all incoming data blocks to files. Several options available. | |
49 | // AliHLTConfiguration sink1("sink1", "FileWriter", "ESDPublisher", NULL); | |
50 | AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter", "RootPublisher","-datafile event"); | |
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 | } |