]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/JET/macros/HLTJetReconstruction.C
* Added fast interface to fastjet
[u/mrichter/AliRoot.git] / HLT / JET / macros / HLTJetReconstruction.C
CommitLineData
33daad3d 1/**
2 * @file HLTJetReconstruction.C
3 * @brief Macro for testing HLT Jet Reconstruction
4 *
5 * This macro uses the ESDMCEventPublisher to publish AliMCEvents and AliESDEvents.
6 * The processing is done be JetFinder's
7 * Results are written to disk by a rootfile writer
8 *
9 * @author thaeder@kip.uni-heidelberg.de
10 * @ingroup alihlt_jet
11 */
12
e6ae4f1e 13// ----------------------------------------------------------------------------
14// -- Pythia Parameter
15// ----------------------------------------------------------------------------
16
17enum PprRun_t {
18 kPythia6Jets20_24, kPythia6Jets24_29, kPythia6Jets29_35,
19 kPythia6Jets35_42, kPythia6Jets42_50, kPythia6Jets50_60,
20 kPythia6Jets60_72, kPythia6Jets72_86, kPythia6Jets86_104,
21 kPythia6Jets104_125, kPythia6Jets125_150, kPythia6Jets150_180,
22 kPyJetJet, kPyGammaJetPHOS, kRunMax
23};
24
25const Char_t* pprRunName[] = {
26 "kPythia6Jets20_24", "kPythia6Jets24_29", "kPythia6Jets29_35",
27 "kPythia6Jets35_42", "kPythia6Jets42_50", "kPythia6Jets50_60",
28 "kPythia6Jets60_72", "kPythia6Jets72_86", "kPythia6Jets86_104",
29 "kPythia6Jets104_125", "kPythia6Jets125_150", "kPythia6Jets150_180",
30 "kPyJetJet", "kPyGammaJetPHOS"
31};
32
1f9fec4a 33// ----------------------------------------------------------------------------
34// -- Jet Parameter
35// ----------------------------------------------------------------------------
36
37Float_t aConeRadius[] = { 0.4, 0.7 };
38Float_t aCutPtSeed[] = { 4.0, 7.0, 10.0 };
39Float_t aCutEtJet[] = { 4.0, 7.0, 10.0, 15.0 };
40
e6ae4f1e 41// ----------------------------------------------------------------------------
42
43
33daad3d 44/** HLTJetReconstruction test macro
45 * @param nEvents Number of events which should be processed
46 */
1f9fec4a 47void HLTJetReconstruction(Int_t nEvents=1, Bool_t generate=kFALSE, PprRun_t runType = kPythia6Jets104_125 ) {
33daad3d 48
49 TString writerInput;
e6ae4f1e 50 TString analysisInput;
51 TString jetInput;
33daad3d 52
e6ae4f1e 53 // -- Switch Logging
54 // -------------------
55 AliLog::SetGlobalLogLevel( AliLog::kError );
33daad3d 56 AliHLTLogging log;
e6ae4f1e 57 log.SwitchAliLog(0);
33daad3d 58
e6ae4f1e 59 // -- Initialize HLT
60 // -------------------
33daad3d 61 AliHLTSystem gHLT;
e6ae4f1e 62 gHLT.SetGlobalLoggingLevel(0x7D);
5ffba596 63
64 if ( getenv("FASTJET") ) {
65 gHLT.LoadComponentLibraries("libCGAL.so");
66 gHLT.LoadComponentLibraries("libfastjet.so");
67 gHLT.LoadComponentLibraries("libSISConePlugin.so");
68 }
33daad3d 69
e0677301 70 gHLT.LoadComponentLibraries("libESD.so");
71 gHLT.LoadComponentLibraries("libSTEER.so");
72 gHLT.LoadComponentLibraries("libSTEERBase.so");
73 gHLT.LoadComponentLibraries("libAOD.so");
74 gHLT.LoadComponentLibraries("libANALYSIS.so");
75 gHLT.LoadComponentLibraries("libANALYSISalice.so");
76 gHLT.LoadComponentLibraries("libJETAN.so");
0734d112 77
78 gHLT.LoadComponentLibraries("libAliHLTUtil.so");
79 gHLT.LoadComponentLibraries("libAliHLTJET.so");
e0677301 80
e6ae4f1e 81 gHLT.LoadComponentLibraries("liblhapdf.so");
82 gHLT.LoadComponentLibraries("libEGPythia6.so");
83 gHLT.LoadComponentLibraries("libpythia6.so");
84 gHLT.LoadComponentLibraries("libAliPythia6.so");
85
86 // ----------------------------//
87 // - - //
88 // -- Parameters -- //
89 // - - //
90 // ----------------------------//
91
1f9fec4a 92 Float_t coneRadius = aConeRadius[0];
93 Float_t cutPtSeed = aCutPtSeed[0];
94 Float_t cutEtJet = aCutEtJet[1];
e6ae4f1e 95
96 Int_t seed = 12345;
97
e0677301 98 // ----------------------------//
33daad3d 99 // - - //
100 // -- Publisher Components -- //
101 // - - //
e0677301 102 // ----------------------------//
33daad3d 103
e6ae4f1e 104 if ( ! generate ) {
1f9fec4a 105 // ------------------------------------------
106 // -- The ESDMCEventPublisher
107 // ------------------------------------------
e6ae4f1e 108 TString publisherId("ESDMCEventPublisher");
1f9fec4a 109 // ------------------------------------------
33daad3d 110
1f9fec4a 111 TString publisherArg( Form("-entrytype MCFAST -dataspec 0x0000001F -datapath /home/jthaeder/jet/data/HEAD_2009-10-26/FastGen/kPythia6Jets125_150_14TeV/JET-ETA=-0.2,0.2_JET-ET=50,1000_R=0.4_200ev") );
e6ae4f1e 112 AliHLTConfiguration ESDMCEventPublisher(publisherId.Data(), "ESDMCEventPublisher", NULL, publisherArg.Data() );
113
114 if (!analysisInput.IsNull()) analysisInput+=" ";
115 analysisInput += publisherId;
116
117 if (!jetInput.IsNull()) jetInput+=" ";
118 jetInput += publisherId;
119 }
120
e6ae4f1e 121 else {
1f9fec4a 122 // ------------------------------------------
123 // -- The MCGenerator
124 // ------------------------------------------
e6ae4f1e 125 TString generatorId( Form("MCGenerator_%s", pprRunName[runType]) );
1f9fec4a 126 // ------------------------------------------
e6ae4f1e 127
128 TString generatorArg( Form("-seed %d -nevents %d -runtype %d -coneRadius %.1f -jetCutMinEt %.1f",
129 seed, nEvents, runType, coneRadius, cutEtJet));
130
131 AliHLTConfiguration mcGenerator(generatorId.Data(), "MCGenerator", NULL, generatorArg.Data() );
132
133 if (!analysisInput.IsNull()) analysisInput+=" ";
134 analysisInput += generatorId;
135
136 if (!jetInput.IsNull()) jetInput+=" ";
137 jetInput += generatorId;
138 }
e0677301 139
140 // ----------------------------//
33daad3d 141 // - - //
142 // -- Processing Components -- //
143 // - - //
e0677301 144 // ----------------------------//
e6ae4f1e 145#if 1
146 // ------------------------------------------
e0677301 147 // -- ConeJetFinder
e6ae4f1e 148 // ------------------------------------------
e6ae4f1e 149 TString jetId("JETConeJet");
1f9fec4a 150 // ------------------------------------------
e6ae4f1e 151
1f9fec4a 152 TString jetArg( Form("-algorithm FSCSquareCell -leading 1 -coneRadius %.1f -trackCutMinPt 0.0 -seedCutMinPt %.1f -jetCutMinEt %.1f",
e6ae4f1e 153 coneRadius, cutPtSeed, cutEtJet) );
9b744e18 154
e6ae4f1e 155 AliHLTConfiguration jetCone(jetId.Data(), "JETConeJetFinder", jetInput.Data(), jetArg.Data());
9b744e18 156
e6ae4f1e 157 if (!analysisInput.IsNull()) analysisInput+=" ";
158 analysisInput += jetId;
6ce099ba 159
e6ae4f1e 160#else
161 // ------------------------------------------
9b744e18 162 // -- FastJetFinder
e6ae4f1e 163 // ------------------------------------------
164
165 AliHLTConfiguration jetFinder("JETFastJet_Kt", "JETFastJetFinder",
166 jetInput.Data(),"-finderType kt");
0734d112 167
e6ae4f1e 168 if (!writerInput.IsNull()) writerInput+=" ";
169 writerInput+="JETFastJet_Kt";
170
171
172 AliHLTConfiguration jetFinder("JETFastJet_AntiKt", "JETFastJetFinder",
173 jetInput.Data(),"-finderType antikt");
174
175 if (!writerInput.IsNull()) writerInput+=" ";
176 writerInput+="JETFastJet_AntiKt";
177#endif
178
179 // ------------------------------------------
180 // -- Jet Analysis
181 // ------------------------------------------
e6ae4f1e 182 TString analysisId("JETAnalysis");
1f9fec4a 183 // ------------------------------------------
184
e6ae4f1e 185 TString analysisArg("");
186
187 AliHLTConfiguration jetAnalysis(analysisId.Data(), "JETAnalysis", analysisInput.Data(), analysisArg.Data() );
188
189 if (!writerInput.IsNull()) writerInput+=" ";
190 writerInput += analysisId;
6ce099ba 191
e0677301 192 // ----------------------------//
33daad3d 193 // - - //
194 // -- Sink Components -- //
195 // - - //
e0677301 196 // ----------------------------//
e6ae4f1e 197
198 TString writerArg( Form("-directory analysis -datafile analyze_%d_%s -write-all-events", nEvents, pprRunName[runType] ));
33daad3d 199
200 // -- The RootFileWriter
201 AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter",
e6ae4f1e 202 writerInput.Data(), writerArg.Data() );
203
204 // --------------------------- //
33daad3d 205 // - - //
206 // -- Run -- //
207 // - - //
e6ae4f1e 208 // --------------------------- //
33daad3d 209
210 gHLT.BuildTaskList("RootWriter");
211 gHLT.Run(nEvents);
212
e6ae4f1e 213 return;
33daad3d 214}