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