Added ignores
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / trains / MyTrain.C
1 #ifndef __CINT__
2 # include <AliAnalysisManager.h>
3 #else 
4 class AliAnalysisManager;
5 #endif
6 #include "TrainSetup.C"
7 class MyTrain : public TrainSetup
8 {
9 public:
10   MyTrain(const char* name="myTest") : TrainSetup(name) 
11   { 
12     fOptions.Set("type", "ESD");
13   }
14   void CreateTasks(AliAnalysisManager* mgr)
15   {
16     if (!ParUtilities::MakeScriptPAR(fHelper::Mode() != Helper::kLocal, 
17                                      "MyAnalysis.C", 
18                                      "STEERBase,ESD,AOD,ANALYSIS,"
19                                      "OADB,ANALYSISalice"))
20       Fatal("CreateTasks", "Failed to create PAR file");
21     LoadLibrary("MyAnalysis");
22     
23     Long_t             r = gROOT->ProcessLine("new MyAnalysis(\"test\")");
24     AliAnalysisTaskSE* t = reinterpret_cast<AliAnalysisTaskSE*>(r);
25     if (!t) Fatal("CreateTasks", "Failed to make task");
26     mgr->AddTask(t);
27     
28     AliAnalysisDataContainer* sums = 
29       mgr->CreateContainer("Sums", TList::Class(), 
30                            AliAnalysisManager::kOutputContainer,
31                            AliAnalysisManager::GetCommonFileName());
32     AliAnalysisDataContainer* results = // Needed for output from Terminate
33       mgr->CreateContainer("Results", TList::Class(), 
34                            AliAnalysisManager::kParamContainer, // Important!
35                            AliAnalysisManager::GetCommonFileName());
36     
37     mgr->ConnectOutput(t, 1, sums);
38     mgr->ConnectOutput(t, 2, results);
39     mgr->ConnectInput(t, 0, mgr->GetCommonInputContainer());
40   }
41   void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
42   AliVEventHandler* CreateOutputHandler(UShort_t type) { return 0; }
43   const char* ClassName() const { return "MyTrain"; }
44 };
45 //
46 // EOF
47 //