3 #include <AliAnalysisManager.h>
6 class AliAnalysisManager;
8 #include "TrainSetup.C"
9 #include "ParUtilities.C"
12 * Train to record time of each event
14 * @ingroup pwglf_forward_eventtime
16 class EventTimeTrain : public TrainSetup
22 * @param name The name
24 EventTimeTrain(const char* name="eventTime") : TrainSetup(name)
26 fOptions.Set("type", "ESD");
32 void CreateTasks(AliAnalysisManager*)
34 if (!ParUtilities::MakeScriptPAR(fRailway->Mode() == Railway::kLocal,
37 // XMLParser because of CDB
38 // CDB because look-up of trigger config
40 "STEERBase,CDB,ESD,AOD,ANALYSIS,OADB,"
43 Fatal("","Failed to make PAR");
44 fRailway->LoadLibrary("EventTimeTask");
45 gROOT->ProcessLine("EventTimeTask::Create()");
48 * Do not create a physics selection
50 void CreatePhysicsSelection(Bool_t, AliAnalysisManager*) {}
52 * Do not create a centrality selection
54 void CreateCentralitySelection(Bool_t*) {}
56 * Do not create an output handler
58 AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
60 * The train class name
62 * @return Train class name
64 const char* ClassName() const { return "EventTimeTrain"; }
66 * Overloaded to create new dNdeta.C and dndeta.sh in the output
69 * @param asShellScript
71 void SaveSetup(Bool_t asShellScript)
73 TrainSetup::SaveSetup(asShellScript);
79 std::ofstream o("Sort.C");
80 o << "// Written by " << ClassName() << "\n"
81 << "void Sort(const char* prefix=\"\",\n"
82 << " const char* fileName=\"time.root\",\n"
83 << " const char* outName=\"map.root\",\n"
84 << " const char* treeName=\"T\")\n"
86 << " gSystem->AddIncludePath(\"-DNO_TASK -I$ALICE_ROOT/include\");\n"
87 << " TString mac(\"EventTimeTask/EventTimeTask.C+g\");\n"
88 << " if (prefix && prefix[0] != '\\0') mac.Prepend(prefix);\n"
89 << " gROOT->LoadMacro(mac);\n"
90 << " EventTimeSorter s;\n"
91 << " if (!s.Run(fileName,outName,treeName)) return;\n"
92 << " s.Test(fileName,outName,treeName);\n"
97 void PostShellCode(std::ostream& f)
99 f << " echo \"=== Sort results ...\"\n"
100 << " aliroot -l -b -q ${prefix}Sort.C\\(\\\"${prefix}\\\"\\)\n"