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