2 * @file MCGeneratorPublisher.C
3 * @brief Macro for testing of the generation and publishing of AliHLTMCEvent
5 * This macro is a testing/example macro of how to use the MCGenerator
6 * (AliHLTMCGeneratorComponent) 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.
11 * For more descriptions, especially the used datatypes and specification:
12 * @see AliHLTMCGeneratorComponent
14 * @author thaeder@kip.uni-heidelberg.de
15 * @ingroup alihlt_tutorial
18 // ----------------------------------------------------------------------------
19 // -- Pythia Parameter
20 // ----------------------------------------------------------------------------
23 kPythia6Jets20_24, kPythia6Jets24_29, kPythia6Jets29_35,
24 kPythia6Jets35_42, kPythia6Jets42_50, kPythia6Jets50_60,
25 kPythia6Jets60_72, kPythia6Jets72_86, kPythia6Jets86_104,
26 kPythia6Jets104_125, kPythia6Jets125_150, kPythia6Jets150_180,
27 kPyJetJet, kPyGammaJetPHOS, kRunMax
30 const Char_t* pprRunName[] = {
31 "kPythia6Jets20_24", "kPythia6Jets24_29", "kPythia6Jets29_35",
32 "kPythia6Jets35_42", "kPythia6Jets42_50", "kPythia6Jets50_60",
33 "kPythia6Jets60_72", "kPythia6Jets72_86", "kPythia6Jets86_104",
34 "kPythia6Jets104_125", "kPythia6Jets125_150", "kPythia6Jets150_180",
35 "kPyJetJet", "kPyGammaJetPHOS"
39 /** ESDMCEventPublisher test macro
40 * @param nEvents Number of events which should be processed
42 void MCGeneratorPublisher(Int_t nEvents=10, PprRun_t runType = kPythia6Jets104_125) {
47 // -------------------
48 AliLog::SetGlobalLogLevel( AliLog::kError );
53 // -------------------
55 gHLT.SetGlobalLoggingLevel(0x7D);
57 gHLT.LoadComponentLibraries("libAliHLTUtil.so");
59 gHLT.LoadComponentLibraries("liblhapdf.so");
60 gHLT.LoadComponentLibraries("libEGPythia6.so");
61 gHLT.LoadComponentLibraries("libpythia6.so");
62 gHLT.LoadComponentLibraries("libAliPythia6.so");
64 // ----------------------------//
66 // -- Parameters -- //
68 // ----------------------------//
70 Float_t coneRadius = 0.7;
71 Float_t cutPtSeed = 4.0;
72 Float_t cutEtJet = 7.0;
76 // ----------------------------//
78 // -- Publisher Components -- //
80 // ----------------------------//
82 TString generatorId( Form("MCGenerator_%s", pprRunName[runType]) );
84 TString generatorArg( Form("-seed %d -nevents %d -runtype %d -coneRadius %.1f -jetCutMinEt %.1f",
85 seed, nEvents, runType, coneRadius, cutEtJet));
87 AliHLTConfiguration mcGenerator(generatorId.Data(), "MCGenerator", NULL, generatorArg.Data() );
89 if (!writerInput.IsNull()) writerInput+=" ";
90 writerInput += generatorId;
92 // ----------------------------//
94 // -- Sink Components -- //
96 // ----------------------------//
98 TString writerArg( Form("-directory analysis -datafile analyze_%d_%s -write-all-events", nEvents, pprRunName[runType] ));
100 // -- The RootFileWriter
101 AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter",
102 writerInput.Data(), writerArg.Data() );
104 // --------------------------- //
108 // --------------------------- //
110 gHLT.BuildTaskList("RootWriter");