Added same task for ITS standalone tracks
[u/mrichter/AliRoot.git] / prod / acrcaf / qa_pp / AddTaskQAsym.C
CommitLineData
b3f5a7b0 1AliAnalysisTaskQASym * AddTaskQAsym(Int_t runNumber)\r
2\r
08cff48a 3{\r
4 // Creates a QA task exploiting simple symmetries phi, eta +/-, charge ...\r
5 \r
6 // Get the pointer to the existing analysis manager via the static access method.\r
7 //==============================================================================\r
8 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
9 if (!mgr) {\r
10 ::Error("AddTaskQAsym", "No analysis manager to connect to.");\r
11 return NULL;\r
12 } \r
13 \r
14 // Check the analysis type using the event handlers connected to the analysis manager.\r
15 //==============================================================================\r
16 if (!mgr->GetInputEventHandler()) {\r
17 ::Error("AddTasQAsym", "This task requires an input event handler");\r
18 return NULL;\r
19 }\r
20 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"\r
21 \r
22 // Configure analysis\r
23 //===========================================================================\r
24 \r
25 \r
b3f5a7b0 26 //Task for global tracks\r
27 AliAnalysisTaskQASym *task0 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_Global");\r
28 task0->SetTrackType(0);\r
29 task0->SelectCollisionCandidates();\r
532dd8d8 30 //Task for ITS tracks \r
31 AliAnalysisTaskQASym *task1 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_ITS");\r
b3f5a7b0 32 task1->SetTrackType(1);\r
33 task1->SelectCollisionCandidates();\r
532dd8d8 34 //Task for TPC tracks \r
35 AliAnalysisTaskQASym *task2 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_TPC");\r
36 task2->SetTrackType(2);\r
37 task2->SelectCollisionCandidates();\r
b3f5a7b0 38\r
39 //cuts for global tracks\r
40 AliESDtrackCuts* esdTrackCutsL0 = new AliESDtrackCuts("AliESDtrackCuts0","Global");\r
41 esdTrackCutsL0->SetMinNClustersTPC(70);\r
42 esdTrackCutsL0->SetRequireTPCRefit(kTRUE);\r
43 esdTrackCutsL0->SetMaxDCAToVertexXY(3.);\r
44 esdTrackCutsL0->SetMaxDCAToVertexZ(3.);\r
45 esdTrackCutsL0->SetAcceptKinkDaughters(kFALSE);\r
532dd8d8 46\r
47 AliESDtrackCuts* esdTrackCutsL1 = new AliESDtrackCuts("AliESDtrackCuts1","ITS");\r
48 esdTrackCutsL1->SetMaxDCAToVertexXY(3.);\r
49 esdTrackCutsL1->SetMaxDCAToVertexZ(3.);\r
50 esdTrackCutsL1->SetAcceptKinkDaughters(kFALSE);\r
51 esdTrackCutsL1->SetRequireITSRefit(kTRUE);\r
52 esdTrackCutsL1->SetRequireITSStandAlone(kTRUE);\r
08cff48a 53 \r
b3f5a7b0 54 //cuts for TPC tracks\r
532dd8d8 55 AliESDtrackCuts* esdTrackCutsL2 = new AliESDtrackCuts("AliESDtrackCuts2","TPC");\r
56 esdTrackCutsL2->SetRequireTPCRefit(kFALSE);\r
57 esdTrackCutsL2->SetAcceptKinkDaughters(kFALSE);\r
b3f5a7b0 58 //jacek's cuts:\r
532dd8d8 59 esdTrackCutsL2->SetMinNClustersTPC(70);\r
b3f5a7b0 60 // cut on max ncl=160 in Task\r
532dd8d8 61 esdTrackCutsL2->SetMaxDCAToVertexXY(3.);\r
62 esdTrackCutsL2->SetMaxDCAToVertexZ(3.);\r
63 esdTrackCutsL2->SetMaxChi2PerClusterTPC(3.999);\r
b3f5a7b0 64 //cut minChi=0 in task\r
532dd8d8 65 //esdTrackCutsL2->SetPRange(0.15,16); // not needed for QA\r
66 //esdTrackCutsL2->SetEtaRange(-0.8, 0.7999); // not needed for QA\r
b3f5a7b0 67 \r
68\r
69 task0->SetCuts(esdTrackCutsL0);\r
70 task1->SetCuts(esdTrackCutsL1);\r
532dd8d8 71 task2->SetCuts(esdTrackCutsL2);\r
08cff48a 72\r
b3f5a7b0 73 mgr->AddTask(task0);\r
74 mgr->AddTask(task1);\r
532dd8d8 75 mgr->AddTask(task2);\r
08cff48a 76 \r
b3f5a7b0 77 AliAnalysisDataContainer *cout0 = 0;\r
78 AliAnalysisDataContainer *cout1 = 0;\r
532dd8d8 79 AliAnalysisDataContainer *cout2 = 0;\r
b3f5a7b0 80 \r
81 if(runNumber>0){ \r
82 cout0 = mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
83 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
532dd8d8 84 cout1 = mgr->CreateContainer("QAsymHists_ITS",TList::Class(),\r
85 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
86 cout2 = mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
b3f5a7b0 87 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
88 }\r
89 \r
90 else{\r
91 cout0 = mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
92 AliAnalysisManager::kOutputContainer, \r
93 Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
532dd8d8 94 cout1 = mgr->CreateContainer("QAsymHists_ITS",TList::Class(),\r
95 AliAnalysisManager::kOutputContainer, \r
96 Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
97 cout2 = mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
b3f5a7b0 98 AliAnalysisManager::kOutputContainer, \r
99 Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
b3f5a7b0 100 }\r
08cff48a 101\r
b3f5a7b0 102\r
103 mgr->ConnectInput (task0, 0, mgr->GetCommonInputContainer());\r
104 mgr->ConnectInput (task1, 0, mgr->GetCommonInputContainer());\r
532dd8d8 105 mgr->ConnectInput (task2, 0, mgr->GetCommonInputContainer());\r
b3f5a7b0 106 mgr->ConnectOutput (task0, 1, cout0);\r
107 mgr->ConnectOutput (task1, 1, cout1);\r
532dd8d8 108 mgr->ConnectOutput (task2, 1, cout2);\r
08cff48a 109 \r
532dd8d8 110 return task0;\r
b3f5a7b0 111\r
08cff48a 112}\r
113\r
114\r