AliPhysics  5364b50 (5364b50)
MyTrain.C
Go to the documentation of this file.
1 #ifndef __CINT__
2 # include <AliAnalysisManager.h>
3 #else
5 #endif
6 #include "TrainSetup.C"
7 #include "ParUtilities.C"
8 
9 class MyTrain : public TrainSetup
10 {
11 public:
12  MyTrain(const char* name="myTest") : TrainSetup(name)
13  {
14  fOptions.Set("type", "ESD");
15  }
17  {
19  "MyAnalysis.C",
20  "STEERBase,ESD,AOD,ANALYSIS,"
21  "OADB,ANALYSISalice", fRailway))
22  Fatal("CreateTasks", "Failed to create PAR file");
23  fRailway->LoadLibrary("MyAnalysis");
24 
25  Long_t r = gROOT->ProcessLine("new MyAnalysis(\"test\")");
26  AliAnalysisTaskSE* t = reinterpret_cast<AliAnalysisTaskSE*>(r);
27  if (!t) Fatal("CreateTasks", "Failed to make task");
28  mgr->AddTask(t);
29 
30  AliAnalysisDataContainer* sums =
31  mgr->CreateContainer("Sums", TList::Class(),
32  AliAnalysisManager::kOutputContainer,
33  AliAnalysisManager::GetCommonFileName());
34  AliAnalysisDataContainer* results = // Needed for output from Terminate
35  mgr->CreateContainer("Results", TList::Class(),
36  AliAnalysisManager::kParamContainer, // Important!
37  AliAnalysisManager::GetCommonFileName());
38 
39  mgr->ConnectOutput(t, 1, sums);
40  mgr->ConnectOutput(t, 2, results);
41  mgr->ConnectInput(t, 0, mgr->GetCommonInputContainer());
42  }
44  AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
45  const char* ClassName() const { return "MyTrain"; }
46 };
47 //
48 // EOF
49 //
Railway * fRailway
Definition: TrainSetup.C:1674
static Bool_t MakeScriptPAR(Bool_t isLocal, const TString &script, const TString &deps, Railway *helper)
Definition: ParUtilities.C:202
const char * ClassName() const
Definition: MyTrain.C:45
AliVEventHandler * CreateOutputHandler(UShort_t)
Definition: MyTrain.C:44
virtual UShort_t Mode() const =0
MyTrain(const char *name="myTest")
Definition: MyTrain.C:12
void CreateTasks(AliAnalysisManager *mgr)
Definition: MyTrain.C:16
void Set(const TString &name, const TString &value)
Definition: Option.C:736
Base classs for train specifications.
PAR file utilities.
OptionList fOptions
Definition: TrainSetup.C:1673
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
void CreateCentralitySelection(Bool_t, AliAnalysisManager *)
Definition: MyTrain.C:43
Definition: MyTrain.C:9
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0