]>
Commit | Line | Data |
---|---|---|
3e81ec34 | 1 | AliAnalysisTaskPi0FlowMCAOD* AddTaskPHOSPi0pPbMCAOD (const char* name = "PHOSPi0pPbMCAOD", |
051096d1 | 2 | const char* options = "", |
3 | UInt_t offlineTriggerMask = AliVEvent::kINT7, | |
4 | const char* centrality = "V0M", | |
5 | const Int_t nCentBins = 5, | |
6 | const Int_t centEdge0 = 0, | |
7 | const Int_t centEdge1 = 20, | |
8 | const Int_t centEdge2 = 40, | |
9 | const Int_t centEdge3 = 60, | |
10 | const Int_t centEdge4 = 80, | |
11 | const Int_t centEdge5 = 100) | |
a0e28f76 | 12 | { |
051096d1 | 13 | //Add a task AliAnalysisTaskPi0FlowMCAOD to the analysis train, for LHC13 pbP MC productions |
14 | //Author: Paul Baetzing | |
15 | /* $Id$ */ | |
16 | ||
17 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
18 | if (!mgr) { | |
19 | ::Error("AddTaskPHOSPi0pPbMCAOD", "No analysis manager to connect to"); | |
20 | return NULL; | |
21 | } | |
22 | ||
23 | if (!mgr->GetInputEventHandler()) { | |
24 | ::Error("AddTaskPHOSPi0pPbMCAOD", "This task requires an input event handler"); | |
25 | return NULL; | |
26 | } | |
27 | ||
28 | AliAnalysisTaskPi0FlowMCAOD* task = new AliAnalysisTaskPi0FlowMCAOD(Form("%sTask", name)); | |
29 | ||
30 | ||
a0e28f76 | 31 | if (nCentBins<1) { |
051096d1 | 32 | ::Error("AddTaskPHOSPi0pPbMCAOD", Form("Invalid number of centrality bins: %d",nCentBins)); |
33 | return NULL; | |
a0e28f76 | 34 | } |
051096d1 | 35 | |
a0e28f76 | 36 | Double_t *cbin = new Double_t[nCentBins+1]; |
37 | cbin[0] = centEdge0; | |
38 | cbin[1] = centEdge1; | |
39 | if (nCentBins > 1) cbin[2] = centEdge2; | |
40 | if (nCentBins > 2) cbin[3] = centEdge3; | |
41 | if (nCentBins > 3) cbin[4] = centEdge4; | |
42 | if (nCentBins > 4) cbin[5] = centEdge5; | |
43 | TArrayD tbin(nCentBins+1, cbin); | |
051096d1 | 44 | |
a0e28f76 | 45 | Int_t *nMixed = new Int_t[nCentBins]; |
46 | for (Int_t ibin=0; ibin<nCentBins; ibin++) nMixed[ibin] = 20; | |
47 | TArrayI tNMixed(nCentBins, nMixed); | |
48 | task->SetCentralityBinning(tbin, tNMixed); | |
051096d1 | 49 | |
50 | ||
51 | task->SetCentralityEstimator(centrality); | |
52 | ||
53 | ||
54 | //task->SetEventMixingRPBinning(9); | |
55 | //task->SetMixingArraysLength(10); | |
56 | task->SelectCollisionCandidates(offlineTriggerMask); | |
57 | ||
58 | task->SetEnablePHOSModule(2, kFALSE); | |
59 | ||
60 | mgr->AddTask(task); | |
61 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() ); | |
62 | ||
63 | TString cname(Form("%sCoutput1", name)); | |
64 | TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name)); | |
65 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data()); | |
66 | mgr->ConnectOutput(task, 1, coutput1); | |
67 | ||
68 | return task; | |
a0e28f76 | 69 | } |