]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/trigger/macros/HLTTriggerTest.C
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / trigger / macros / HLTTriggerTest.C
CommitLineData
b6b716f5 1/**
2 * @file HLTTriggerTest.C
3 * @brief Macro for testing HLT Triggers
4 *
5 * This macro uses the ESDMCEventPublisher to publish AliESDEvents.
6 *
7 * Results are written to disk by a rootfile writer
8 *
9 * @author Jochen Thaeder <jochen@thaeder.de>
10 * @ingroup alihlt_trigger
11 */
12
13
14// ----------------------------------------------------------------------------
15
16
17/** HLTTriggerTest test macro
18 * @param nEvents Number of events which should be processed
19 */
20void HLTTriggerTest(Int_t nEvents=1,
21 const Char_t* triggername="H-Barrel_pT_Single-V0001.001",
22 const Char_t* esdpath="./") {
23
24 // -- Set the CDB storage location
25 // ---------------------------------
26 AliCDBManager * man = AliCDBManager::Instance();
27 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
28 man->SetRun(120000);
29
30 TString writerInput;
31 TString globalInput;
32 TString triggerInput;
33
34 // -- Switch Logging
35 // -------------------
36 AliLog::SetGlobalLogLevel( AliLog::kError );
37 AliHLTLogging log;
38 log.SwitchAliLog(0);
39
40 // -- Initialize HLT
41 // -------------------
42 AliHLTSystem gHLT;
43 gHLT.SetGlobalLoggingLevel(0x7D);
44
45 gHLT.LoadComponentLibraries("libESD.so");
46 gHLT.LoadComponentLibraries("libSTEER.so");
47 gHLT.LoadComponentLibraries("libSTEERBase.so");
48 gHLT.LoadComponentLibraries("libAOD.so");
49 gHLT.LoadComponentLibraries("libANALYSIS.so");
50 gHLT.LoadComponentLibraries("libANALYSISalice.so");
51
52 gHLT.LoadComponentLibraries("libHLTbase.so");
53 gHLT.LoadComponentLibraries("libAliHLTUtil.so");
54
55 gHLT.LoadComponentLibraries("libAliHLTMUON.so");
56 gHLT.LoadComponentLibraries("libAliHLTTPC.so");
57 gHLT.LoadComponentLibraries("libAliHLTTRD.so");
58
59 gHLT.LoadComponentLibraries("libAliHLTTrigger.so");
60
61 // ----------------------------//
62 // - - //
63 // -- Parameters -- //
64 // - - //
65 // ----------------------------//
66
67 TString triggerName(triggername);
68 TString esdPath(esdpath);
69
70 // ----------------------------//
71 // - - //
72 // -- Publisher Components -- //
73 // - - //
74 // ----------------------------//
75
76 // ------------------------------------------
77 // -- The ESDMCEventPublisher
78 // ------------------------------------------
79 TString publisherId("ESDMCEventPublisher");
80 // ------------------------------------------
81 TString publisherArg(Form("-entrytype HLTESD -datapath %s", esdPath.Data()));
82
83 AliHLTConfiguration ESDMCEventPublisher(publisherId.Data(), publisherId.Data(), NULL, publisherArg.Data() );
84
85 if (!triggerInput.IsNull()) triggerInput+=" ";
86 triggerInput += publisherId;
87
88 // ----------------------------//
89 // - - //
90 // -- Processing Components -- //
91 // - - //
92 // ----------------------------//
93
94 // ------------------------------------------
95 // -- Trigger
96 // ------------------------------------------
97 TString triggerId(triggerName);
98 // ------------------------------------------
99
100 TString triggerArg(Form("-triggername %s", triggerName.Data()));
101
102 AliHLTConfiguration trigger(triggerId.Data(), "BarrelMultiplicityTrigger",
103 triggerInput.Data(), triggerArg.Data());
104
105 if (!globalInput.IsNull()) globalInput+=" ";
106 globalInput += triggerId;
107
108 if (!writerInput.IsNull()) writerInput+=" ";
109 writerInput += triggerId;
110
111 // ------------------------------------------
112 // -- Global Trigger
113 // ------------------------------------------
114 TString globalId("GlobalTrigger");
115 // ------------------------------------------
116
117 TString triggerArg(Form("-triggername %s", triggerName.Data()));
118
119 AliHLTConfiguration global(globalId.Data(), "HLTGlobalTrigger", globalInput.Data(), "");
120
121 if (!writerInput.IsNull()) writerInput+=" ";
122 writerInput += globalId;
123
124 // ----------------------------//
125 // - - //
126 // -- Sink Components -- //
127 // - - //
128 // ----------------------------//
129
130 TString writerArg(Form("-directory analysis -datafile trigger_%d_%s.root", nEvents, triggerName.Data() ));
131
132 // -- The RootFileWriter
133 AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter", writerInput.Data(), writerArg.Data() );
134
135 // --------------------------- //
136 // - - //
137 // -- Run -- //
138 // - - //
139 // --------------------------- //
140
141 gHLT.BuildTaskList("RootWriter");
142 gHLT.Run(nEvents);
143
144 return;
145}