Added Pi0FlowMC
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_PbPb / AddTaskPHOSPi0FlowMC.C
CommitLineData
444647ad 1AliAnalysisTaskPi0FlowMC* AddTaskPHOSPi0FlowMC (const char* name = "PHOSPi0FlowMC",
2 const char* options = ""
3 // , UInt_t offlineTriggerMask = AliVEvent::kCentral
4 )
5{
6 //Add a task AliAnalysisTaskPi0FlowMC to the analysis train
7 //Author: Henrik Qvigstad
8 /* $Id$ */
9
10 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11 if (!mgr) {
12 ::Error("AddTaskPHOSPi0FlowMC", "No analysis manager to connect to");
13 return NULL;
14 }
15
16 if (!mgr->GetInputEventHandler()) {
17 ::Error("AddTaskPHOSPi0FlowMC", "This task requires an input event handler");
18 return NULL;
19 }
20
21 AliAnalysisTaskPi0FlowMC* task = new AliAnalysisTaskPi0FlowMC(Form("%sTask", name));
22
23 // Binning
24 // const int nbins = 8;
25 // Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
26 // TArrayD tbin(nbins+1, cbin);
27 // Int_t nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
28 // TArrayI tNMixed(nbins, nMixed);
29 // task->SetCentralityBinning(tbin, tNMixed);
30
31 // Binning
32 const int nbins = 5;
33 Double_t cbin[nbins+1] = {0., 10., 20., 40., 60., 80.};
34 TArrayD tbin(nbins+1, cbin);
35 Int_t nMixed[nbins] = {6, 40, 40, 40, 80};
36 TArrayI tNMixed(nbins, nMixed);
37 task->SetCentralityBinning(tbin, tNMixed);
38
39 //task->SetEventMixingRPBinning(9);
40 //task->SetMixingArraysLength(10);
41 //task->SelectCollisionCandidates(offlineTriggerMask);
42
43
44 mgr->AddTask(task);
45 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
46
47 TString cname(Form("%sCoutput1", name));
48 TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name));
49 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
50 mgr->ConnectOutput(task, 1, coutput1);
51
52 return task;
53}