]>
Commit | Line | Data |
---|---|---|
d321c9a1 | 1 | AliAnalysisTaskPi0Flow* AddTaskPHOSPi0pPb (const char* name = "PHOSPi0pPb", |
e8fb5673 | 2 | const char* options = "LHC13", |
3 | const 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, | |
fffbd965 | 11 | const Int_t centEdge5 = 100) |
d321c9a1 | 12 | { |
13 | //Add a task AliAnalysisTaskPi0Flow to the analysis train, for LHC13 PbP data | |
14 | //Author: Paul Baetzing | |
15 | /* $Id$ */ | |
16 | ||
17 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
18 | if (!mgr) { | |
19 | ::Error("AddTaskPHOSPi0pPb", "No analysis manager to connect to"); | |
20 | return NULL; | |
21 | } | |
22 | ||
23 | if (!mgr->GetInputEventHandler()) { | |
24 | ::Error("AddTaskPHOSPi0pPb", "This task requires an input event handler"); | |
25 | return NULL; | |
26 | } | |
27 | ||
28 | AliAnalysisTaskPi0Flow* task = new AliAnalysisTaskPi0Flow(Form("%sTask", name)); | |
29 | ||
30 | // MB or PHOS Trigger: | |
31 | if( AliVEvent::kINT7 == offlineTriggerMask || AliVEvent::kPHI7 == offlineTriggerMask ) { | |
e8fb5673 | 32 | if (nCentBins<1) { |
33 | ::Error("AddTaskPHOSPi0pPb", Form("Invalid number of centrality bins: %d",nCentBins)); | |
34 | return NULL; | |
35 | } | |
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); | |
44 | ||
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 | ||
d321c9a1 | 49 | task->SetCentralityBinning(tbin, tNMixed); |
50 | } | |
90d2ba9f | 51 | if( TString(options).Contains("LHC13") ) |
52 | task->SetPeriod( AliAnalysisTaskPi0Flow::kLHC13 ); | |
53 | ||
e8fb5673 | 54 | task->SetCentralityEstimator(centrality); |
d321c9a1 | 55 | |
56 | task->SetEventMixingRPBinning(1); | |
57 | task->SelectCollisionCandidates(offlineTriggerMask); | |
f43d2298 | 58 | task->SetEnablePHOSModule(2, kFALSE); |
2d463e18 | 59 | task->EnableTOFCut(true, 100.e-9, true); |
d321c9a1 | 60 | |
61 | mgr->AddTask(task); | |
62 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() ); | |
63 | ||
64 | TString cname(Form("%sCoutput1", name)); | |
65 | TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name)); | |
66 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data()); | |
67 | mgr->ConnectOutput(task, 1, coutput1); | |
68 | ||
69 | return task; | |
70 | } |