.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGPP / EVCHAR / runCentrality.C
CommitLineData
e6f3f2fe 1void runCentrality(const char * type = "a", const char *mode="grid")
c5297977 2{
3 // Load common libraries
4070f709 4 gSystem->Load("libCore");
5 gSystem->Load("libTree");
6 gSystem->Load("libGeom");
7 gSystem->Load("libVMC");
8 gSystem->Load("libPhysics");
c5297977 9 gSystem->Load("libSTEERBase");
10 gSystem->Load("libESD");
11 gSystem->Load("libAOD");
12 gSystem->Load("libANALYSIS");
13 gSystem->Load("libANALYSISalice");
14 // Use AliRoot includes to compile our task
15 gROOT->ProcessLine(".include $ALICE_ROOT/include");
c5297977 16
17 // form filename
18 TString filenameStr = Form("%s",type);
e6f3f2fe 19 filenameStr = TString("LHC10g2")+filenameStr;
c5297977 20 const char * filename = filenameStr.Data();
21
22 // Create and configure the alien handler plugin
e6f3f2fe 23 gROOT->LoadMacro("CreateAlienHandlerAOD.C");
24 AliAnalysisGrid *alienHandler = CreateAlienHandlerAOD(filename);
c5297977 25 if(!alienHandler) return;
26
27 // Create the analysis manager
28 AliAnalysisManager *mgr = new AliAnalysisManager("AnalysisManager");
29
30 // Connect plug-in to the analysis manager
31 mgr->SetGridHandler(alienHandler);
32
33 // My task
e6f3f2fe 34 gROOT->LoadMacro("AliAnalysisTaskCentrality.cxx++g");
35 AliAnalysisTaskCentrality *task = new AliAnalysisTaskCentrality("CentralityTask");
c5297977 36 // Writing (or not) output tree
37 //task->SetTreeFilling(writeTree);
38 task->SetMCInput();
39 mgr->AddTask(task);
40
41 AliMCEventHandler* mcHandler = new AliMCEventHandler();
42 mgr->SetMCtruthEventHandler(mcHandler);
43
44 AliESDInputHandler* esdH = new AliESDInputHandler();
45 mgr->SetInputEventHandler(esdH);
46
47 // Physics selection
48 //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
49 //AliPhysicsSelectionTask *physSelTask = AddTaskPhysicsSelection(kFALSE);
50 // Selecting collision candidates
51 //task->SelectCollisionCandidates();
52
53 // Create containers for input/output
54 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
55
56 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("coutput1",TList::Class(),
57 AliAnalysisManager::kOutputContainer,
58 "cenHistos.root");
59 mgr->ConnectOutput(task, 1, coutput1);
60
e6f3f2fe 61// AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("coutput2",TTree::Class(),
62// AliAnalysisManager::kOutputContainer,
63// "cenTree.root");
64// // coutput2->SetSpecialOutput();
65// mgr->ConnectOutput(task, 2, coutput2);
c5297977 66
67 // Enable debug printouts
68 mgr->SetDebugLevel(2);
69
70 if(!mgr->InitAnalysis()) return;
71
72 mgr->PrintStatus();
73 // Start analysis in grid.
e6f3f2fe 74 mgr->StartAnalysis(mode);
c5297977 75
76};