]>
Commit | Line | Data |
---|---|---|
d96d58a7 | 1 | AliAnalysisTaskSEPHOSpPbPi0* AddTaskPHOSpPbPi0(UInt_t triggerTag = 0, Bool_t isMCtruth=kFALSE, Bool_t useTOFCut=kFALSE, Double_t width = 0.) |
a01cd2c9 | 2 | { |
0f8c33c1 | 3 | // Creates a task to analysis pi0 in p-Pb collisions with PHOS |
d96d58a7 | 4 | // Author: H. Zhu - 09/16/2014 |
0f8c33c1 | 5 | |
a01cd2c9 | 6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
7 | if (!mgr) { | |
8 | ::Error("AddTaskPHOSpPbPi0", "No analysis manager to connect to."); | |
9 | return NULL; | |
10 | } | |
11 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
12 | if (!type.Contains("ESD") && !type.Contains("AOD")) { | |
13 | ::Error("AddTaskPHOSpPbPi0", "PHOSpPbPi0 task needs the manager to have an ESD or AOD input handler."); | |
14 | return NULL; | |
15 | } | |
16 | if (isMCtruth && type.Contains("ESD")) { | |
17 | AliMCEventHandler *mcH = mgr->GetMCtruthEventHandler(); | |
18 | if (!mcH) { | |
19 | ::Error("AddTaskPHOSpPbPi0", "PHOSpPbPi0 task needs the manager to have an MC evnet handler."); | |
20 | return NULL; | |
21 | } | |
22 | } | |
23 | ||
24 | const Int_t nBins = 6; | |
0f8c33c1 | 25 | Float_t cBin[nBins+1] = {0., 20., 40., 60., 80., 90., 100.}; TArrayF tCent(nBins+1, cBin); |
e824e25b | 26 | Int_t buffer[nBins] = { 40, 80, 80, 100, 100, 100 }; TArrayI tBuffer(nBins, buffer); |
27 | ||
bf6afad1 YK |
28 | Double_t cutsEvent[3] = { 10., // 0, max of VtxZ |
29 | 0., // 1, min of Centrality | |
30 | 100. }; // 2, max of Centrality | |
e824e25b | 31 | |
32 | Double_t cutsCaloCl[5] = { 0.3, // 0, min of cluster Energy | |
33 | 2., // 1, min of NCells | |
34 | 0.2, // 2, min of M02 | |
35 | 2.5, // 3, min of DistToBad | |
bf6afad1 | 36 | 1e-7 }; // 4, max of TOF |
a01cd2c9 | 37 | |
38 | AliAnalysisTaskSEPHOSpPbPi0 *task = new AliAnalysisTaskSEPHOSpPbPi0("TaskPHOSpPbPi0"); | |
39 | task->SetUseMC(isMCtruth); | |
40 | task->SetXBins(tCent, tBuffer); | |
e824e25b | 41 | task->SetEventCuts(cutsEvent); |
42 | task->SetCaloClCuts(cutsCaloCl); | |
d96d58a7 | 43 | task->SetDecaliWidth(width); // for decalibration |
bf6afad1 YK |
44 | task->SetRemovePileup(kTRUE); // remove pileup events |
45 | task->SetUseFiducialCut(kTRUE); // use fiducial cut | |
46 | task->SetUseTOFCut(kTRUE); // use TOF cut | |
a01cd2c9 | 47 | task->SetDebugLevel(-1); |
48 | ||
0f8c33c1 | 49 | if (triggerTag==0) task->SelectCollisionCandidates(AliVEvent::kINT7); |
bf6afad1 YK |
50 | else if (triggerTag==1) task->SelectCollisionCandidates(AliVEvent::kPHI7); |
51 | else if (triggerTag==2) task->SelectCollisionCandidates(AliVEvent::kMB); | |
a01cd2c9 | 52 | |
a01cd2c9 | 53 | mgr->AddTask(task); |
54 | ||
55 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
56 | ||
d96d58a7 | 57 | AliAnalysisDataContainer *output1 = mgr->CreateContainer(Form("histosQA_TOF%i", useTOFCut), TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root"); |
0f8c33c1 | 58 | mgr->ConnectOutput(task, 1, output1); |
d96d58a7 | 59 | AliAnalysisDataContainer *output2 = mgr->CreateContainer(Form("histosRD_TOF%i", useTOFCut), TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root"); |
0f8c33c1 | 60 | mgr->ConnectOutput(task, 2, output2); |
e824e25b | 61 | |
0f8c33c1 | 62 | if (isMCtruth) { |
d96d58a7 | 63 | AliAnalysisDataContainer *output3 = mgr->CreateContainer(Form("histosMC_TOF%i", useTOFCut), TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root"); |
e824e25b | 64 | mgr->ConnectOutput(task, 3, output3); |
0f8c33c1 | 65 | } |
a01cd2c9 | 66 | |
67 | return task; | |
68 | } |