QASym task runs separately for TPC tracks and global tracks, additional histograms
[u/mrichter/AliRoot.git] / prod / acrcaf / qa_pp / AddTaskQAsym.C
index ba3d30b09a5b9535b8e71feb4f8e51dc59384b63..d8eb3d3f3facbed40c82fc1781f50471d8f82e71 100644 (file)
@@ -1,4 +1,5 @@
-void AddTaskQAsym(Int_t runNumber)\r
+AliAnalysisTaskQASym * AddTaskQAsym(Int_t runNumber)\r
+\r
 {\r
   // Creates a QA task exploiting simple symmetries phi, eta +/-, charge ...\r
   \r
@@ -22,25 +23,72 @@ void AddTaskQAsym(Int_t runNumber)
    //===========================================================================\r
    \r
  \r
\r
-   AliAnalysisTaskQASym *task = new AliAnalysisTaskQASym("AliAnalysisTaskQASym");\r
-   AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts","Standard");\r
-   esdTrackCutsL->SetMinNClustersTPC(50);\r
-   esdTrackCutsL->SetRequireTPCRefit(kTRUE);\r
-   esdTrackCutsL->SetMaxDCAToVertexXY(3.);\r
-   esdTrackCutsL->SetMaxDCAToVertexZ(3.);\r
-   esdTrackCutsL->SetAcceptKinkDaughters(kFALSE);\r
+   //Task for global tracks\r
+   AliAnalysisTaskQASym *task0 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_Global");\r
+   task0->SetTrackType(0);\r
+   task0->SelectCollisionCandidates();\r
+   //Task for TPC tracks \r
+   AliAnalysisTaskQASym *task1 = new AliAnalysisTaskQASym("AliAnalysisTaskQASym_TPC");\r
+   task1->SetTrackType(1);\r
+   task1->SelectCollisionCandidates();\r
+\r
+   //cuts for global tracks\r
+   AliESDtrackCuts* esdTrackCutsL0 = new AliESDtrackCuts("AliESDtrackCuts0","Global");\r
+   esdTrackCutsL0->SetMinNClustersTPC(70);\r
+   esdTrackCutsL0->SetRequireTPCRefit(kTRUE);\r
+   esdTrackCutsL0->SetMaxDCAToVertexXY(3.);\r
+   esdTrackCutsL0->SetMaxDCAToVertexZ(3.);\r
+   esdTrackCutsL0->SetAcceptKinkDaughters(kFALSE);\r
    \r
-   task->SetCuts(esdTrackCutsL);\r
+   //cuts for TPC tracks\r
+   AliESDtrackCuts* esdTrackCutsL1 = new AliESDtrackCuts("AliESDtrackCuts1","TPC");\r
+   esdTrackCutsL1->SetRequireTPCRefit(kFALSE);\r
+   esdTrackCutsL1->SetAcceptKinkDaughters(kFALSE);\r
+   //jacek's cuts:\r
+   esdTrackCutsL1->SetMinNClustersTPC(70);\r
+   // cut on max ncl=160 in Task\r
+   esdTrackCutsL1->SetMaxDCAToVertexXY(3.);\r
+   esdTrackCutsL1->SetMaxDCAToVertexZ(3.);\r
+   esdTrackCutsL1->SetMaxChi2PerClusterTPC(3.999);\r
+   //cut minChi=0 in task\r
+   //esdTrackCutsL1->SetPRange(0.15,16); // not needed for QA\r
+   //esdTrackCutsL1->SetEtaRange(-0.8, 0.7999); // not needed for QA\r
+  \r
+\r
+   task0->SetCuts(esdTrackCutsL0);\r
+   task1->SetCuts(esdTrackCutsL1);\r
 \r
-   mgr->AddTask(task);\r
+   mgr->AddTask(task0);\r
+   mgr->AddTask(task1);\r
   \r
-   AliAnalysisDataContainer *cout  = mgr->CreateContainer("QAsymHists",TList::Class(),\r
-                                                       AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
+   AliAnalysisDataContainer *cout0  = 0;\r
+   AliAnalysisDataContainer *cout1  = 0;\r
+   \r
+   if(runNumber>0){ \r
+    cout0 =  mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
+                                 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
+    cout1 =  mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
+                                 AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));\r
+   }\r
+   \r
+   else{\r
+      cout0 = mgr->CreateContainer("QAsymHists_Global",TList::Class(),\r
+                                AliAnalysisManager::kOutputContainer, \r
+                                Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
+      cout1 = mgr->CreateContainer("QAsymHists_TPC",TList::Class(),\r
+                                  AliAnalysisManager::kOutputContainer, \r
+                                Form("%s:PWG1_QAsymHists",AliAnalysisManager::GetCommonFileName()));\r
+\r
+   }\r
 \r
-   mgr->ConnectInput  (task, 0, mgr->GetCommonInputContainer());\r
-   mgr->ConnectOutput (task, 1, cout);\r
+\r
+   mgr->ConnectInput  (task0, 0, mgr->GetCommonInputContainer());\r
+   mgr->ConnectInput  (task1, 0, mgr->GetCommonInputContainer());\r
+   mgr->ConnectOutput (task0, 1, cout0);\r
+   mgr->ConnectOutput (task1, 1, cout1);\r
   \r
+   return task1;\r
+\r
 }\r
 \r
 \r