]>
Commit | Line | Data |
---|---|---|
fa5e8413 | 1 | /** |
2 | * @file ESDMCEventPublisher.C | |
3 | * @brief Macro for testing AliESDEvent and AliMCEvent publishing and writing | |
4 | * | |
5 | * This macro is a testing/example macro of how to use the ESDMCEventPublisher | |
6 | * (AliHLTESDMCEventPublisherComponent) 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 datapath has to be changed with an actual one. It must contain | |
12 | * the files: <br> | |
13 | * - AliESDs.root<br> | |
14 | * - Kinematics.root<br> | |
15 | * - galice.root<br> | |
16 | * - TrackRefs.root<br> | |
17 | * | |
18 | * Entry type can be one, all or some of :<br> | |
19 | * - ESD<br> | |
20 | * - HLTESD<br> | |
21 | * - MC<br> | |
22 | * | |
23 | * For more descriptions, especially the used datatypes and specification: | |
24 | * @see AliHLTESDMCEventPublisherComponent | |
25 | * | |
26 | * @author thaeder@kip.uni-heidelberg.de | |
27 | * @ingroup alihlt_tutorial | |
28 | */ | |
29 | ||
30 | /** ESDMCEventPublisher test macro | |
31 | * @param nEvents Number of events which should be processed | |
32 | */ | |
33 | void ESDMCEventPublisher(Int_t nEvents=1) { | |
34 | ||
35 | TString writerInput; | |
36 | TString arg; | |
37 | ||
38 | AliHLTSystem gHLT; | |
39 | gHLT.LoadComponentLibraries("libAliHLTUtil.so"); | |
40 | ||
41 | // -- Root publisher configuration | |
42 | // !!! myDataPath has to be exchanged with an existing one. | |
43 | arg.Form("-entrytype ESD -entrytype HLTESD -entrytype MC -dataspec 0x0000001F -datapath /opt/HLT/analysis/HLT-HEAD_2008-09-24/exa -datapath /home/jthaeder/jet/data/test"); | |
44 | // arg.Form("-entrytype ESD -entrytype HLTESD -entrytype MC -dataspec 0x0000001F -datapath mydatapath0 -datapath mydatapath1"); | |
45 | ||
46 | // -- The AliHLTESDMCEventPublisher (Id 'ESDMCEventPublisher') is a data source. | |
47 | // It provides AliESDEvents and AliMCEvents out of the given datapaths to | |
48 | // the subsequent components in the chain. | |
49 | // see AliHLTESDMCEventPublisherComponent for more options | |
50 | AliHLTConfiguration ESDMCEventPublisher("ESDMCEventPublisher", "ESDMCEventPublisher", NULL, arg.Data() ); | |
51 | if (!writerInput.IsNull()) writerInput+=" "; | |
52 | writerInput+="ESDMCEventPublisher"; | |
53 | ||
54 | // - | |
55 | // -- Processing Components can be put in here | |
56 | // - | |
57 | ||
58 | // -- The AliHLTRootFileWriter (Id 'ROOTFileWriter') is a data sink. It writes | |
59 | // all incoming data blocks to files. Several options available. | |
60 | AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter", writerInput.Data(),"-datafile event"); | |
61 | ||
62 | // -- Here you specify the top most configuration of the chain. The | |
63 | // configuration depends on all the parents. The task lisy is build | |
64 | // according to that. | |
65 | gHLT.BuildTaskList("RootWriter"); | |
66 | gHLT.Run(nEvents); | |
67 | } |