QASym task runs separately for TPC tracks and global tracks, additional histograms
[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
30 //Task for TPC tracks \r
31 AliAnalysisTaskQASym *task1 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_TPC");\r
32 task1->SetTrackType(1);\r
33 task1->SelectCollisionCandidates();\r
34\r
35 //cuts for global tracks\r
36 AliESDtrackCuts* esdTrackCutsL0 = new AliESDtrackCuts("AliESDtrackCuts0","Global");\r
37 esdTrackCutsL0->SetMinNClustersTPC(70);\r
38 esdTrackCutsL0->SetRequireTPCRefit(kTRUE);\r
39 esdTrackCutsL0->SetMaxDCAToVertexXY(3.);\r
40 esdTrackCutsL0->SetMaxDCAToVertexZ(3.);\r
41 esdTrackCutsL0->SetAcceptKinkDaughters(kFALSE);\r
08cff48a 42 \r
b3f5a7b0 43 //cuts for TPC tracks\r
44 AliESDtrackCuts* esdTrackCutsL1 = new AliESDtrackCuts("AliESDtrackCuts1","TPC");\r
45 esdTrackCutsL1->SetRequireTPCRefit(kFALSE);\r
46 esdTrackCutsL1->SetAcceptKinkDaughters(kFALSE);\r
47 //jacek's cuts:\r
48 esdTrackCutsL1->SetMinNClustersTPC(70);\r
49 // cut on max ncl=160 in Task\r
50 esdTrackCutsL1->SetMaxDCAToVertexXY(3.);\r
51 esdTrackCutsL1->SetMaxDCAToVertexZ(3.);\r
52 esdTrackCutsL1->SetMaxChi2PerClusterTPC(3.999);\r
53 //cut minChi=0 in task\r
54 //esdTrackCutsL1->SetPRange(0.15,16); // not needed for QA\r
55 //esdTrackCutsL1->SetEtaRange(-0.8, 0.7999); // not needed for QA\r
56 \r
57\r
58 task0->SetCuts(esdTrackCutsL0);\r
59 task1->SetCuts(esdTrackCutsL1);\r
08cff48a 60\r
b3f5a7b0 61 mgr->AddTask(task0);\r
62 mgr->AddTask(task1);\r
08cff48a 63 \r
b3f5a7b0 64 AliAnalysisDataContainer *cout0 = 0;\r
65 AliAnalysisDataContainer *cout1 = 0;\r
66 \r
67 if(runNumber>0){ \r
68 cout0 = mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
69 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
70 cout1 = mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
71 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
72 }\r
73 \r
74 else{\r
75 cout0 = mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
76 AliAnalysisManager::kOutputContainer, \r
77 Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
78 cout1 = mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
79 AliAnalysisManager::kOutputContainer, \r
80 Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
81\r
82 }\r
08cff48a 83\r
b3f5a7b0 84\r
85 mgr->ConnectInput (task0, 0, mgr->GetCommonInputContainer());\r
86 mgr->ConnectInput (task1, 0, mgr->GetCommonInputContainer());\r
87 mgr->ConnectOutput (task0, 1, cout0);\r
88 mgr->ConnectOutput (task1, 1, cout1);\r
08cff48a 89 \r
b3f5a7b0 90 return task1;\r
91\r
08cff48a 92}\r
93\r
94\r