1 //____________________________________________
2 AliPerformanceTask* AddTaskPerformanceITSTPCMatch(Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, const char *triggerClass=0)
5 // Add AliPerformanceTask with TPC performance components
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 Error("AddTaskPerformanceTPC","AliAnalysisManager not set!");
13 TString type = mgr->GetInputEventHandler()->GetDataType();
14 if (!type.Contains("ESD")) {
15 Error("AddTaskPerformanceTPC", "ESD input handler needed!");
19 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
20 if (!mcH && bUseMCInfo) {
21 Error("AddTaskPerformanceTPC", "MC input handler needed!");
28 AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance");
30 Error("AddTaskPerformanceTPC", "TPC performance task cannot be created!");
33 task->SetUseMCInfo(bUseMCInfo);
34 task->SetUseESDfriend(bUseESDfriend);
35 task->SelectCollisionCandidates();
38 // Add task to analysis manager
44 // Create TPC-ESD track reconstruction cuts
47 AliRecInfoCuts *pRecInfoCutsMATCH = new AliRecInfoCuts();
48 if(pRecInfoCutsMATCH) {
49 pRecInfoCutsMATCH->SetMaxDCAToVertexXY(3.0);
50 pRecInfoCutsMATCH->SetMaxDCAToVertexZ(3..0);
51 pRecInfoCutsMATCH->SetRequireSigmaToVertex(kFALSE);
52 pRecInfoCutsMATCH->SetRequireTPCRefit(kFALSE);
53 pRecInfoCutsMATCH->SetAcceptKinkDaughters(kTRUE);
54 pRecInfoCutsMATCH->SetMinNClustersTPC(70);
55 pRecInfoCutsMATCH->SetMaxChi2PerClusterTPC(1000000.);
56 pRecInfoCutsMATCH->SetDCAToVertex2D(kFALSE);
57 pRecInfoCutsMATCH->SetTPCITSMatchingRadius(70);
58 pRecInfoCutsMATCH->SetTPCTRDMatchingRadius(260);
59 pRecInfoCutsMATCH->SetMinNClustersITS(3);
61 pRecInfoCutsMATCH->SetHistogramsOn(kFALSE);
64 Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!");
69 // Create TPC-MC track reconstruction cuts
71 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
73 pMCInfoCuts->SetMinTrackLength(70);
76 Error("AddTaskPerformanceTPC", "AliMCInfoCuts cannot be created!");
81 // Create performance objects for TPC and set cuts
83 // TPC+ITS matching performance
85 AliPerformanceMatch *pCompMatch0 = new AliPerformanceMatch("AliPerformanceMatchTPCITS","AliPerformanceMatchTPCITS",0,kFALSE);
87 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCITS");
89 pCompMatch0->SetAliRecInfoCuts(pRecInfoCutsMATCH);
90 pCompMatch0->SetAliMCInfoCuts(pMCInfoCuts);
92 // TPC+TRD matching performance
94 AliPerformanceMatch *pCompMatch1 = new AliPerformanceMatch("AliPerformanceMatchTPCTRD","AliPerformanceMatchTPCTRD",1,kFALSE);
96 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCTRD");
98 pCompMatch1->SetAliRecInfoCuts(pRecInfoCutsMATCH);
99 pCompMatch1->SetAliMCInfoCuts(pMCInfoCuts);
101 AliPerformanceMatch *pCompMatch2 = new AliPerformanceMatch("AliPerformanceMatchTPCEFF","AliPerformanceMatchTPCEFF",2,kFALSE);
103 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCEFF");
105 pCompMatch2->SetAliRecInfoCuts(pRecInfoCutsMATCH);
106 pCompMatch2->SetAliMCInfoCuts(pMCInfoCuts);
109 // Add components to the performance task
111 task->AddPerformanceObject( pCompMatch0 );
112 //task->AddPerformanceObject( pCompMatch1 );
113 task->AddPerformanceObject( pCompMatch2 );
116 if(!bUseMCInfo && triggerClass) {
117 pCompDEdx3->SetTriggerClass(triggerClass);
118 pCompDCA0->SetTriggerClass(triggerClass);
119 pCompTPC0->SetTriggerClass(triggerClass);
120 pCompMatch0->SetTriggerClass(triggerClass);
121 pCompMatch1->SetTriggerClass(triggerClass);
122 pCompMatch2->SetTriggerClass(triggerClass);
126 // Create containers for input
128 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
131 // Create containers for output
133 AliAnalysisDataContainer *coutput_tpc = mgr->CreateContainer("ITSTPCMatch", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPC.%sDet.root", task->GetName()));
134 mgr->ConnectOutput(task, 1, coutput_tpc);
136 AliAnalysisDataContainer *coutput2_tpc = mgr->CreateContainer("TPCTPCMatchSummary", TTree::Class(), AliAnalysisManager::kParamContainer, "trending.root:SummaryTPCQA");
137 mgr->ConnectOutput(task, 2, coutput2_tpc);