AliPhysics  a5cd6b6 (a5cd6b6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventTimeTrain.C
Go to the documentation of this file.
1 // EventTimeTrain.C
2 #ifndef __CINT__
3 #include <AliAnalysisManager.h>
4 #include <fstream>
5 #else
7 #endif
8 #include "TrainSetup.C"
9 #include "ParUtilities.C"
10 
16 class EventTimeTrain : public TrainSetup
17 {
18 public:
24  EventTimeTrain(const char* name="eventTime") : TrainSetup(name)
25  {
26  fOptions.Set("type", "ESD");
27  }
33  {
35  "EventTimeTask.C",
36  // Gui because of CDB
37  // XMLParser because of CDB
38  // CDB because look-up of trigger config
39  "Gui,XMLParser,"
40  "STEERBase,CDB,ESD,AOD,ANALYSIS,OADB,"
41  "ANALYSISalice",
42  fRailway))
43  Fatal("","Failed to make PAR");
44  fRailway->LoadLibrary("EventTimeTask");
45  gROOT->ProcessLine("EventTimeTask::Create()");
46  }
58  AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
64  const char* ClassName() const { return "EventTimeTrain"; }
71  void SaveSetup(Bool_t asShellScript)
72  {
73  TrainSetup::SaveSetup(asShellScript);
74 
75  SaveSort();
76  }
77  void SaveSort()
78  {
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"
85  << "{\n"
86  << " gSystem->AddIncludePath(\"-DNO_TASK -I$ALICE_PHYSICS/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"
93  << "}\n"
94  << std::endl;
95  o.close();
96  }
97  void PostShellCode(std::ostream& f)
98  {
99  f << " echo \"=== Sort results ...\"\n"
100  << " aliroot -l -b -q ${prefix}Sort.C\\(\\\"${prefix}\\\"\\)\n"
101  << std::endl;
102  }
103 };
104 // EOF
void CreateTasks(AliAnalysisManager *)
const char * ClassName() const
Railway * fRailway
Definition: TrainSetup.C:1667
static Bool_t MakeScriptPAR(Bool_t isLocal, const TString &script, const TString &deps, Railway *helper)
Definition: ParUtilities.C:202
virtual UShort_t Mode() const =0
void Set(const TString &name, const TString &value)
Definition: Option.C:736
void PostShellCode(std::ostream &f)
void SaveSetup(Bool_t asShellScript)
Base classs for train specifications.
PAR file utilities.
virtual void SaveSetup(Bool_t asShellScript)
Definition: TrainSetup.C:1472
OptionList fOptions
Definition: TrainSetup.C:1666
EventTimeTrain(const char *name="eventTime")
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
AliVEventHandler * CreateOutputHandler(UShort_t)
void CreateCentralitySelection(Bool_t *)
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0
void CreatePhysicsSelection(Bool_t, AliAnalysisManager *)