]>
Commit | Line | Data |
---|---|---|
1cb2a06e | 1 | AliAnalysisTaskEffContBF *AddTaskBalanceEffCont( TString centralityEstimator="V0M", |
2 | Double_t centrMin=0., | |
90bec8c5 | 3 | Double_t centrMax=80., |
1cb2a06e | 4 | Double_t vertexZ=10., |
5 | Int_t AODfilterBit = 128, | |
6 | TString fileNameBase="AnalysisResults" | |
7 | ) { | |
8 | ||
9 | // Creates a balance function analysis task and adds it to the analysis manager. | |
10 | // Get the pointer to the existing analysis manager via the static access method. | |
11 | TString centralityName(""); | |
12 | ||
fe5628e1 | 13 | centralityName+=Form("%.0f-%.0f_%.0f",centrMin,centrMax,vertexZ); |
1cb2a06e | 14 | TString outputFileName(fileNameBase); |
15 | outputFileName.Append(".root"); | |
16 | ||
17 | //=========================================================================== | |
18 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
19 | if (!mgr) { | |
20 | ::Error("AddTaskTriggeredBF", "No analysis manager to connect to."); | |
21 | return NULL; | |
22 | } | |
23 | ||
24 | // Check the analysis type using the event handlers connected to the analysis manager. | |
25 | //=========================================================================== | |
26 | if (!mgr->GetInputEventHandler()) { | |
27 | ::Error("AddTaskTriggeredBF", "This task requires an input event handler"); | |
28 | return NULL; | |
29 | } | |
30 | TString analysisType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
31 | if(dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())) analysisType = "MC"; | |
32 | ||
33 | ||
34 | // Create the task, add it to manager and configure it. | |
35 | //=========================================================================== | |
36 | ||
37 | ||
38 | AliAnalysisTaskEffContBF *taskEffContBF = new AliAnalysisTaskEffContBF("TaskEffContBF"); | |
39 | ||
40 | // analysis mode | |
41 | taskEffContBF->SetAnalysisMode("TPC"); | |
42 | ||
43 | // centrality | |
fe5628e1 | 44 | if(centralityEstimator) { |
45 | taskEffContBF->SetCentralityEstimator(centralityEstimator); | |
46 | taskEffContBF->SetCentralityPercentileRange(centrMin,centrMax); | |
47 | } | |
1cb2a06e | 48 | taskEffContBF->SelectCollisionCandidates(AliVEvent::kMB); |
49 | ||
50 | // vertex | |
51 | taskEffContBF->SetVertexDiamond(.3,.3,vertexZ); | |
52 | ||
53 | //analysis kinematic cuts | |
54 | taskEffContBF->SetMinPt(0.0); | |
55 | taskEffContBF->SetMaxPt(20.0); //5.0 | |
56 | //taskEffContBF->SetEtaRange(-0.8,0.8,100,0.0,1.6, 64); //acceptance cuts | |
57 | //taskEffContBF->SetPtRange(0.1, 20.0, 100); //acceptance cuts //5.0,49 | |
58 | taskEffContBF->SetEtaRange(-0.8,0.8,100,0.0,1.6, 64); //acceptance cuts | |
59 | taskEffContBF->SetPtRange(0.0, 20.0, 100); //acceptance cuts //5.0,49 | |
1cb2a06e | 60 | |
61 | //AODs | |
62 | taskEffContBF->SetAODtrackCutBit(AODfilterBit); | |
63 | mgr->AddTask(taskEffContBF); | |
64 | ||
65 | // Create ONLY the output containers for the data produced by the task. | |
66 | // Get and connect other common input/output containers via the manager as below | |
67 | //============================================================================== | |
68 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
69 | outputFileName += ":PWGCFEbyE.outputBalanceFunctionEffContAnalysis"; | |
70 | AliAnalysisDataContainer *coutQA = mgr->CreateContainer(Form("listQA_%s",centralityName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data()); | |
71 | AliAnalysisDataContainer *coutEffContBF = mgr->CreateContainer(Form("listEffContBF_%s",centralityName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data()); | |
72 | ||
73 | mgr->ConnectInput(taskEffContBF, 0, mgr->GetCommonInputContainer()); | |
74 | mgr->ConnectOutput(taskEffContBF, 1, coutQA); | |
75 | mgr->ConnectOutput(taskEffContBF, 2, coutEffContBF); | |
76 | ||
77 | return taskEffContBF; | |
78 | } |