]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/benchmark/macros/bench-hlt-hierarchy.C
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / HLT / benchmark / macros / bench-hlt-hierarchy.C
CommitLineData
fce51f62 1// $Id$
2/**
3 * Benchmark macro for transportation of fake data blocks through an HLT
4 * hierarchy.
5 *
6 * Usage:
7 * <pre>
8 * aliroot -b -q bench-hlt-hierarchy.C | tee bench-hlt-hierarchy.log
9 * </pre>
10 * Options:
11 * <pre>
12 * aliroot -b -q bench-hlt-hierarchy.C'(2, "root raw")'
13 * </pre>
14 * First argument allows to specifiy the number of events, the second one
15 * is a string defining the output, "root" for a statistics in a root file
16 * and "raw" for just the raw data block. Can be combined. Default is "root".
17 *
18 * @ingroup alihlt_benchmark
19 * @author Matthias.Richter@ift.uib.no
20 */
21void bench_hlt_hierarchy(int events=100, const char* option="root")
22{
23 TString options=option;
24 AliHLTSystem gHLT(0x7c);
25 gHLT.LoadComponentLibraries("libAliHLTUtil.so");
26
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 //
29 // define the analysis chain to be run
30 //
31 const int iNofLevel0=6;
32 const int iNofLevel1=18;
33 const int iNofLevel2=2;
34 TString level3Input;
35 TString arg, component;
36 for (int level2=0; level2<iNofLevel2; level2++) {
37 TString level2Input;
38 for (int level1=0; level1<iNofLevel1; level1++) {
39 TString level1Input;
40 for (int level0=0; level0<iNofLevel0; level0++) {
41 // level0 publisher component
42 arg.Form("-datatype DUMMYDAT FAKE -size 10000 -range 1000 -modulo 10 -decrement 1000");
43 component.Form("L0_%d_%02d_%d", level2, level1, level0);
44 AliHLTConfiguration l0conf(component.Data(), "DataGenerator", NULL , arg.Data());
45
46 if (level1Input.Length()>0) level1Input+=" ";
47 level1Input+=component;
48 }
49
50 // level 1 components
51 arg.Form("-datatype DUMMYDAT FAKE -multiplier 0.2");
52 component.Form("L1_%d_%02d", level2, level1);
53 AliHLTConfiguration l1conf(component.Data(), "DataGenerator", level1Input.Data(), arg.Data());
54 if (level2Input.Length()>0) level2Input+=" ";
55 level2Input+=component;
56 }
57
58 // level 2 components
59 arg.Form("-datatype DUMMYDAT FAKE -multiplier 1.0");
60 component.Form("L2_%d", level2);
61 AliHLTConfiguration l2conf(component.Data(),"DataGenerator",level2Input.Data(), arg.Data());
62 if (level3Input.Length()>0) level3Input+=" ";
63 level3Input+=component;
64 }
65
66 arg.Form("-datatype DUMMYDAT FAKE -multiplier 1.0");
67 AliHLTConfiguration l3conf("L3","DataGenerator",level3Input.Data(),arg.Data());
68 AliHLTConfiguration statroot("statroot", "StatisticsCollector" , "L3", "-file HLT.statistics.root -publish 0");
69 AliHLTConfiguration statraw("statraw", "FileWriter" , "L3", "-datafile HLT.statistics.raw -concatenate-events -concatenate-blocks -datatype COMPSTAT PRIV");
70
71 if (options.Contains("root"))
72 gHLT.BuildTaskList("statroot");
73 if (options.Contains("raw"))
74 gHLT.BuildTaskList("statraw");
75 gHLT.Run(events);
76}