]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/JET/macros/HLTJetReconstruction.C
jet macros
[u/mrichter/AliRoot.git] / HLT / JET / macros / HLTJetReconstruction.C
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
13 // ---------------------------------------------------------------------------- 
14 // -- Pythia Parameter 
15 // ---------------------------------------------------------------------------- 
16
17 enum 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
25 const 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
33 // ---------------------------------------------------------------------------- 
34
35
36 /** HLTJetReconstruction test macro
37  *  @param nEvents Number of events which should be processed
38  */
39 void HLTJetReconstruction(Int_t nEvents=1, Int_t idx=0, Bool_t generate=kFALSE, PprRun_t runType = kPythia6Jets104_125 ) {
40
41   TString writerInput;
42   TString analysisInput;
43   TString jetInput;
44
45   // -- Switch Logging
46   // -------------------
47   AliLog::SetGlobalLogLevel( AliLog::kError );
48   AliHLTLogging log;
49   log.SwitchAliLog(0);
50
51   // -- Initialize HLT
52   // -------------------
53   AliHLTSystem gHLT;
54   gHLT.SetGlobalLoggingLevel(0x7D);
55
56   gHLT.LoadComponentLibraries("libCGAL.so");
57   gHLT.LoadComponentLibraries("libfastjet.so");
58
59   gHLT.LoadComponentLibraries("libESD.so");  
60   gHLT.LoadComponentLibraries("libSTEER.so");  
61   gHLT.LoadComponentLibraries("libSTEERBase.so");  
62   gHLT.LoadComponentLibraries("libAOD.so");  
63   gHLT.LoadComponentLibraries("libANALYSIS.so");  
64   gHLT.LoadComponentLibraries("libANALYSISalice.so");  
65   gHLT.LoadComponentLibraries("libJETAN.so");  
66
67   gHLT.LoadComponentLibraries("libAliHLTUtil.so");
68   gHLT.LoadComponentLibraries("libAliHLTJET.so");  
69
70   gHLT.LoadComponentLibraries("liblhapdf.so");  
71   gHLT.LoadComponentLibraries("libEGPythia6.so");   
72   gHLT.LoadComponentLibraries("libpythia6.so");  
73   gHLT.LoadComponentLibraries("libAliPythia6.so");  
74
75   // ----------------------------//
76   // -                         - //
77   // -- Parameters            -- //
78   // -                         - //
79   // ----------------------------//
80
81   Float_t aConeRadius[] = { 0.4, 0.7 };
82   Float_t aCutPtSeed[]  = { 4.0, 7.0, 10.0 };
83   Float_t aCutEtJet[]   = { 4.0, 7.0, 10.0, 15.0 };
84
85   Float_t coneRadius = 0.7;
86   Float_t cutPtSeed  = 4.0;
87   Float_t cutEtJet   = 7.0;
88
89   Int_t seed = 12345;
90
91   // ----------------------------//
92   // -                         - //
93   // -- Publisher  Components -- //
94   // -                         - //
95   // ----------------------------//
96
97   // ------------------------------------------
98   // -- The ESDMCEventPublisher   
99   // ------------------------------------------
100   if ( ! generate ) {
101
102     TString publisherId("ESDMCEventPublisher");
103
104     TString publisherArg( Form("-entrytype MCFAST -dataspec 0x0000001F -datapath /home/jthaeder/jet/data/HEAD_2009-03-17/FastGen/kPythia6Jets104_125_14TeV/JET-ETA=-0.2,0.2_JET-ET=50,1000_R=0.4_10ev") );
105     
106     AliHLTConfiguration ESDMCEventPublisher(publisherId.Data(), "ESDMCEventPublisher", NULL, publisherArg.Data() );
107
108     if (!analysisInput.IsNull()) analysisInput+=" ";
109     analysisInput += publisherId;
110
111     if (!jetInput.IsNull()) jetInput+=" ";
112     jetInput += publisherId;
113   }
114
115   // ------------------------------------------
116   // -- The MCGenerator
117   // ------------------------------------------
118   else {
119     
120     TString generatorId( Form("MCGenerator_%s", pprRunName[runType]) );
121
122     TString generatorArg( Form("-seed %d -nevents %d -runtype %d -coneRadius %.1f -jetCutMinEt %.1f", 
123                                seed, nEvents, runType, coneRadius, cutEtJet));
124     
125     AliHLTConfiguration mcGenerator(generatorId.Data(), "MCGenerator", NULL, generatorArg.Data() );
126
127     if (!analysisInput.IsNull()) analysisInput+=" ";
128     analysisInput += generatorId;
129
130     if (!jetInput.IsNull()) jetInput+=" ";
131     jetInput += generatorId;
132   }
133
134   // ----------------------------//
135   // -                         - //
136   // -- Processing Components -- //
137   // -                         - //
138   // ----------------------------//
139 #if 1
140   // ------------------------------------------
141   // -- ConeJetFinder
142   // ------------------------------------------
143
144   TString jetId("JETConeJet");
145
146   TString jetArg( Form("-coneRadius %.1f -trackCutMinPt 0.0 -seedCutMinPt %.1f -jetCutMinEt %.1f",
147                        coneRadius, cutPtSeed, cutEtJet) );
148   
149   AliHLTConfiguration jetCone(jetId.Data(), "JETConeJetFinder", jetInput.Data(), jetArg.Data()); 
150   
151   if (!analysisInput.IsNull()) analysisInput+=" ";
152   analysisInput += jetId;
153   
154 #else
155   // ------------------------------------------
156   // -- FastJetFinder
157   // ------------------------------------------
158
159   AliHLTConfiguration jetFinder("JETFastJet_Kt", "JETFastJetFinder",
160                                 jetInput.Data(),"-finderType kt");
161     
162   if (!writerInput.IsNull()) writerInput+=" ";
163   writerInput+="JETFastJet_Kt";
164   
165   
166   AliHLTConfiguration jetFinder("JETFastJet_AntiKt", "JETFastJetFinder",
167                                 jetInput.Data(),"-finderType antikt");
168   
169   if (!writerInput.IsNull()) writerInput+=" ";
170   writerInput+="JETFastJet_AntiKt";
171 #endif
172   
173   // ------------------------------------------
174   // -- Jet Analysis 
175   // ------------------------------------------
176
177   TString analysisId("JETAnalysis");
178   TString analysisArg("");
179   
180   AliHLTConfiguration jetAnalysis(analysisId.Data(), "JETAnalysis", analysisInput.Data(), analysisArg.Data() );
181
182   if (!writerInput.IsNull()) writerInput+=" ";
183   writerInput += analysisId;
184   
185   // ----------------------------//
186   // -                         - //
187   // --    Sink Components    -- //
188   // -                         - //
189   // ----------------------------//
190   
191   TString writerArg( Form("-directory analysis -datafile analyze_%d_%s -write-all-events", nEvents, pprRunName[runType] ));
192
193   // -- The RootFileWriter 
194   AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter", 
195                                  writerInput.Data(), writerArg.Data() );
196   
197   // --------------------------- //
198   // -                         - //
199   // --         Run           -- //
200   // -                         - //
201   // --------------------------- //
202
203   gHLT.BuildTaskList("RootWriter");
204   gHLT.Run(nEvents);
205
206   return;
207 }